Sha256: a2a720b5a4aa507d6f8d3dcc555aed666692606ed36009258eba5f8e66d95dfe

Contents?: true

Size: 990 Bytes

Versions: 21

Compression:

Stored size: 990 Bytes

Contents

#Contains helpers for getting information about the flok folders (like platforms available)

module Flok
  module Platform
    def self.list
      Dir.chdir './app/drivers' do
        #Get a list of directories, each directory is technically a platform
        dirs = Dir["*"].select{|e| File.directory?(e)}

        return dirs
      end
    end

    #Get a list of modules for a particular environment for a platform
    def self.mods platform, environment
      #Create array that looks like a javascript array with single quotes
      mods = self.config_yml(platform, environment)['mods']
    end

    #Get all config.yml information for a platform
    def self.config_yml platform, environment
      driver_config = YAML.load_file("./app/drivers/#{platform}/config.yml")
      raise "No config.yml found in your 'platform: #{platform}' driver" unless driver_config
      return driver_config[environment]
    end
  end

  #Alias
  def self.platforms
    return Platform.list
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
flok-0.0.36 lib/flok/platform.rb
flok-0.0.35 lib/flok/platform.rb
flok-0.0.34 lib/flok/platform.rb
flok-0.0.33 lib/flok/platform.rb
flok-0.0.32 lib/flok/platform.rb
flok-0.0.31 lib/flok/platform.rb
flok-0.0.30 lib/flok/platform.rb
flok-0.0.29 lib/flok/platform.rb
flok-0.0.28 lib/flok/platform.rb
flok-0.0.27 lib/flok/platform.rb
flok-0.0.26 lib/flok/platform.rb
flok-0.0.25 lib/flok/platform.rb
flok-0.0.24 lib/flok/platform.rb
flok-0.0.23 lib/flok/platform.rb
flok-0.0.21 lib/flok/platform.rb
flok-0.0.20 lib/flok/platform.rb
flok-0.0.19 lib/flok/platform.rb
flok-0.0.18 lib/flok/platform.rb
flok-0.0.17 lib/flok/platform.rb
flok-0.0.16 lib/flok/platform.rb