Sha256: 80975afbd8720358961159a3ed4a08d0b56e1c39ecb7cd3123b891c44b3df07f

Contents?: true

Size: 679 Bytes

Versions: 17

Compression:

Stored size: 679 Bytes

Contents

module Relish
  class << self
    
    def self.setting(name, value)
      attr_writer name
      class_eval %{
        def #{name}                              # def global_options_file
          @#{name.to_s} ||=                      #   @global_options_file ||= 
            ENV['RELISH_#{name.to_s.upcase}'] || #   ENV['RELISH_GLOBAL_OPTIONS_FILE'] || 
            '#{value}'                           #   '~/.relish'
        end                                      # end
      }
    end
    
    setting :global_options_file, File.join(File.expand_path('~'), '.relish')
    setting :local_options_file,  '.relish'
    setting :default_host,        'relishapp.com'
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
relish-0.4.0 lib/relish.rb
relish-0.3.0 lib/relish.rb
relish-0.3.0.pre lib/relish.rb
relish-0.2.3 lib/relish.rb
relish-0.2.2 lib/relish.rb
relish-0.2.1 lib/relish.rb
relish-0.2.0 lib/relish.rb
relish-0.1.6 lib/relish.rb
relish-0.1.5 lib/relish.rb
relish-0.1.4 lib/relish.rb
relish-0.1.3 lib/relish.rb
relish-0.1.2 lib/relish.rb
relish-0.1.1 lib/relish.rb
relish-0.0.9 lib/relish.rb
relish-0.0.8 lib/relish.rb
relish-0.0.7 lib/relish.rb
relish-0.0.6 lib/relish.rb