Sha256: 94042bc880892877d2423da6eda38f1b0e2634f45db853bde66128fd8cba652d

Contents?: true

Size: 702 Bytes

Versions: 1

Compression:

Stored size: 702 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,        'api.relishapp.com'
  end
end

require 'relish/version'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
relish-0.5.0 lib/relish.rb