Sha256: f78d5093211582e5dae68345802f99f17711e037a62538a73cacde60a9513bfb

Contents?: true

Size: 503 Bytes

Versions: 6

Compression:

Stored size: 503 Bytes

Contents

require 'yaml'
require 'pathname'

module Jarl
  class JarlFile
    attr_reader :path, :name

    def initialize(path)
      @path = Pathname.new(path).expand_path
      @name = @path.basename('.jarl')
    end

    def applications
      @applications ||= load_applications
    end

    private

    def load_applications
      YAML.load(File.read(path)).map do |app_name, params|
        Application.new(name, app_name, params, path.dirname)
      end
    end

  end # class JarlFile
end # module Jarl

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jarl-0.9.0 lib/jarl/jarl_file.rb
jarl-0.8.3 lib/jarl/jarl_file.rb
jarl-0.8.1 lib/jarl/jarl_file.rb
jarl-0.7.0 lib/jarl/jarl_file.rb
jarl-0.6.0 lib/jarl/jarl_file.rb
jarl-0.5.0 lib/jarl/jarl_file.rb