Sha256: e43b5675b1a7de6a2a6ef9b025d4e42625bebf1ac81e4fbe34eab6a4a2c8fe30

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

require "core/constants"
module Radon
class Environments

  # The list of all supported environments and their associeted data paths
  @@all = {
          'gradle' => File.join(DATA_DIR, "gradle.zip"),
          'java'   => File.join(DATA_DIR, "java.zip"),
          'maven'  => File.join(DATA_DIR, "maven.zip"),
          'python' => File.join(DATA_DIR, "python.zip"),
          'c'      => File.join(DATA_DIR, "c.zip"),
          'ruby'   => File.join(DATA_DIR, "ruby.zip"),
          'crystal'=> File.join(DATA_DIR, "crystal_app.zip"),
          'go_s'   => File.join(DATA_DIR, "go_s.zip")
        }

  # Gets all environments as an array of strings      
  def self.getAllNames
    @@all.keys
  end

  # Gets the value (corrosponding zip) of the key
  def self.getTargetOf(key)
    @@all[key]
  end

  # Extract the zip 
  def self.extract(key, target)
    envs = self.getAllNames
    if envs.include? key
      send "extract_#{key}", target
    else
      error("#{key} is not a supported environment.\nYou can suggest it be added at https://github.com/cbrnrd/radon/issues")
    end
  end

end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
radon-0.1.6 lib/core/environments.rb
radon-0.1.5 lib/core/environments.rb