build groups: add convenience methods

This commit is contained in:
Andy Meneely
2016-11-24 14:00:23 -05:00
parent 9aac069c76
commit e53e47dde7
8 changed files with 169 additions and 21 deletions
+14 -7
View File
@@ -2,13 +2,20 @@ require 'set'
module Squib
# An idea for later...
# def enable_group_env group
# ENV['SQUIB_BUILD'] ||= ''
# ENV['SQUIB_BUILD'] += ','
# ENV['SQUIB_BUILD'] += group
# end
# module_function :enable_group_env
# DSL method. See http://squib.readthedocs.io
def enable_build_globally group
groups = (ENV['SQUIB_BUILD'] ||= '').split(',')
ENV['SQUIB_BUILD'] = (groups << group).uniq.join(',')
end
module_function :enable_build_globally
# DSL method. See http://squib.readthedocs.io
def disable_build_globally group
groups = (ENV['SQUIB_BUILD'] ||= '').split(',')
groups.delete(group.to_s)
ENV['SQUIB_BUILD'] = groups.uniq.join(',')
end
module_function :disable_build_globally
class Deck