Module: Engineyard::Local

Defined in:
lib/engineyard-local.rb,
lib/engineyard-local/ui.rb,
lib/engineyard-local/errors.rb,
lib/engineyard-local/command.rb,
lib/engineyard-local/command.rb,
lib/engineyard-local/version.rb,
lib/engineyard-local/command/up.rb,
lib/engineyard-local/middleware.rb,
lib/engineyard-local/virtualbox.rb,
lib/engineyard-local/command/base.rb,
lib/engineyard-local/command/exec.rb,
lib/engineyard-local/command/help.rb,
lib/engineyard-local/command/list.rb,
lib/engineyard-local/command/stop.rb,
lib/engineyard-local/command/group.rb,
lib/engineyard-local/command/rails.rb,
lib/engineyard-local/command/start.rb,
lib/engineyard-local/command/status.rb,
lib/engineyard-local/command/update.rb,
lib/engineyard-local/middleware/dna.rb,
lib/engineyard-local/middleware/tag.rb,
lib/engineyard-local/command/helpers.rb,
lib/engineyard-local/middleware/chef.rb,
lib/engineyard-local/middleware/exec.rb,
lib/engineyard-local/command/terminate.rb,
lib/engineyard-local/middleware/bundle.rb,
lib/engineyard-local/middleware/network.rb,
lib/engineyard-local/middleware/rails/db.rb,
lib/engineyard-local/middleware/cookbooks.rb,
lib/engineyard-local/middleware/rails/new.rb,
lib/engineyard-local/command/vagrant_action.rb,
lib/engineyard-local/middleware/helpers/rvm.rb,
lib/engineyard-local/middleware/rails/assets.rb,
lib/engineyard-local/middleware/rails/command.rb,
lib/engineyard-local/middleware/rails/install.rb,
lib/engineyard-local/middleware/helpers/network.rb,
lib/engineyard-local/middleware/helpers/executable.rb,
lib/engineyard-local/middleware/helpers/uploadable.rb,
lib/engineyard-local/middleware/default_provisioner.rb

Defined Under Namespace

Modules: Command, Errors, Middleware, UI Classes: Virtualbox

Constant Summary collapse

VERSION =
"1.0.2"

Class Method Summary collapse

Class Method Details

.configObject



62
63
64
# File 'lib/engineyard-local.rb', line 62

def self.config
  @config ||= load_config_yaml("settings.yml")
end

.cookbook_version_verifiedObject



50
51
52
# File 'lib/engineyard-local.rb', line 50

def self.cookbook_version_verified
  @cookbook_version_verification = true
end

.cookbook_version_verified?Boolean



46
47
48
# File 'lib/engineyard-local.rb', line 46

def self.cookbook_version_verified?
  @cookbook_version_verification || false
end

.load_config_yaml(config_rel_path) ⇒ Object



91
92
93
94
# File 'lib/engineyard-local.rb', line 91

def self.load_config_yaml(config_rel_path)
  yaml_file = File.expand_path("config/#{config_rel_path}", self.project_root)
  YAML.load_file(yaml_file)
end

.localesObject

default to en until something more inteligent is required NOTE all locale information is contained in a single yaml

file in anticipation of relatively minimal use


87
88
89
# File 'lib/engineyard-local.rb', line 87

def self.locales
  @locales ||= load_config_yaml("locales/en.yml")
end

.project_file(path) ⇒ Object



58
59
60
# File 'lib/engineyard-local.rb', line 58

def self.project_file(path)
  self.project_root + path
end

.project_rootObject



54
55
56
# File 'lib/engineyard-local.rb', line 54

def self.project_root
  @project_root ||= Pathname.new(File.expand_path('../../', __FILE__))
end

.tmp_dirObject



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/engineyard-local.rb', line 66

def self.tmp_dir
  unless @tmp_dir
    @tmp_dir = "/tmp"
    # Give priority to /tmp.
    unless File.exists?("/tmp")
      tmpvars = ENV.each_key.select {|k|
        ['TMPDIR','TEMP','TEMPDIR','TMP'].include?(k.upcase)
      }
      @tmp_dir = ENV[tmpvars.at(0)] if tmpvars.length > 0
      # Put the proper slash at the end so File.join works properly
      unless @tmp_dir.end_with?("\\")
        @tmp_dir += "\\" if @tmp_dir.include?("\\")
      end
    end
  end
  @tmp_dir
end