class Schaltroom::Repository

features class for Schaltroom

Public Instance Methods

add_feature(name, type, value) click to toggle source
# File lib/schaltroom/repository.rb, line 6
def add_feature(name, type, value)
  sym = name.is_a?(Symbol) ? name : name.to_s.to_sym
  if type == :boolean
    self[sym] = { type: :boolean, value: value }
  elsif type == :version
    self[sym] = { type: :version, value: value }
  else
    raise Exception, "unknown type: #{type.to_sym}"
  end
end
add_gem(gem) click to toggle source
# File lib/schaltroom/repository.rb, line 17
def add_gem(gem)
  add_feature(gem.to_s.to_sym, :version, gem::VERSION::STRING)
end