Sha256: 7580a942e70125c11a59963f46a277c14b9855d66f710c69dd344efae1b1e04d

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

module Airsprite
  module Config

    CONFIG_FILENAME="airsprite.yml"


    module ModuleMethods
      def path=(value)
        @@path = value
      end
      def path
        @@path
      end

      def scales=(value)
        @@scales = value
      end
      def scales
        @@scales
      end

      def parse_config_file
        self.path = Dir.pwd

        if File.exists?(CONFIG_FILENAME)
          YAML.load(File.read(CONFIG_FILENAME)).each {|(name, value)| send "#{name}=", value }
        else
          self.scales          = [1.0]
        end
      end
    end
    extend ModuleMethods
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
airsprite-1.0 lib/airsprite/config.rb