module Themes::Environments
Public Instance Methods
list()
click to toggle source
# File lib/themes/environments.rb, line 3 def list @list ||= Dir.entries(Rails.root.join('config', 'environments').to_s). select{ |f| f.match /.*\.rb/ }. map{|f| File.basename(f, '.rb').to_sym}.sort end
method_missing(method_name, *arguments, &block)
click to toggle source
Calls superclass method
# File lib/themes/environments.rb, line 9 def method_missing(method_name, *arguments, &block) if block_given? && list.include?(method_name) block.call if Rails.env.send("#{method_name}?") else super end end