Browse Source

samples: un-submoduling

dev
Andy Meneely 9 years ago
parent
commit
4bde295ace
  1. 1
      samples/build_groups
  2. 1
      samples/build_groups/.gitignore
  3. 25
      samples/build_groups/Rakefile
  4. 36
      samples/build_groups/build_groups.rb

1
samples/build_groups

@ -1 +0,0 @@
Subproject commit 943d3871f97e8d29f197d91ae306578b2e6c8c78

1
samples/build_groups/.gitignore vendored

@ -0,0 +1 @@
*.png

25
samples/build_groups/Rakefile

@ -0,0 +1,25 @@
# Example Rakefile that makes use of build groups
desc 'Build black-and-white by default'
task default: [:bw]
desc 'Build both bw and color'
task both: [:bw, :color]
desc 'Build black-and-white only'
task :bw do
ENV['SQUIB_BUILD'] = 'print_n_play'
load 'build_groups.rb'
end
desc 'Build the color version only'
task :color do
ENV['SQUIB_BUILD'] = 'color'
load 'build_groups.rb'
end
desc 'Build a test card'
task :color do
ENV['SQUIB_BUILD'] = 'test'
load 'build_groups.rb'
end

36
samples/build_groups/build_groups.rb

@ -0,0 +1,36 @@
require 'squib'
Squib::Deck.new(width: 75, height: 75, cards: 2) do
# puts "Groups enabled by environment: #{groups.to_a}"
text str: ['A', 'B']
build :print_n_play do
rect
save_sheet dir: '.', prefix: 'build_groups_bw_'
end
build :color do
rect stroke_color: :red, dash: '5 5'
save_png dir: '.', prefix: 'build_groups_color_'
end
build :test do
save_png range: 0, dir: '.', prefix: 'build_groups_'
end
end
# Here's how you can run this on the command line:
#
# --- OSX/Linux (bash or similar shells) ---
# $ ruby build_groups.rb
# $ SQUIB_BUILD=color ruby build_groups.rb
# $ SQUIB_BUILD=print_n_play,test ruby build_groups.rb
#
# --- Windows CMD ---
# $ ruby build_groups.rb
# $ set SQUIB_BUILD=color && ruby build_groups.rb
# $ set SQUIB_BUILD=print_n_play,test && ruby build_groups.rb
#
# Or, better yet... use a Rakefile like the one provided in this gist!
Loading…
Cancel
Save