Class: EY::Serverside::DependencyManager::Bundler

Inherits:
Base
  • Object
show all
Defined in:
lib/engineyard-serverside/dependency_manager/bundler.rb

Defined Under Namespace

Classes: Lockfile

Constant Summary collapse

DEFAULT_VERSION =
"1.3.5"

Instance Attribute Summary

Attributes inherited from Base

#config, #runner, #servers, #shell

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

detect, #initialize

Constructor Details

This class inherits a constructor from EY::Serverside::DependencyManager::Base

Class Method Details

.default_versionObject



9
10
11
# File 'lib/engineyard-serverside/dependency_manager/bundler.rb', line 9

def self.default_version
  DEFAULT_VERSION
end

Instance Method Details

#checkObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/engineyard-serverside/dependency_manager/bundler.rb', line 21

def check
  if lockfile
    shell.status "Gemfile and Gemfile.lock found"

    if config.check_database_adapter? && !lockfile.any_database_adapter?
      shell.warning "Gemfile.lock does not contain a recognized database adapter.\nA database-adapter gem such as pg, mysql2, mysql, or do_mysql was expected.\nThis can prevent applications that use PostgreSQL or MySQL from booting.\n\nTo fix, add any needed adapter to your Gemfile, bundle, commit, and redeploy.\nApplications not using PostgreSQL or MySQL can safely ignore this warning by\nadding ignore_database_adapter_warning: true to the application's ey.yml file\nunder the defaults: top level key and committing the file to the repository.\n      WARN\n    end\n  else\n    shell.warning <<-WARN\nGemfile found but Gemfile.lock is missing!\nYou can get different versions of gems in production than what you tested with.\nYou can get different versions of gems on every deployment even if your Gemfile hasn't changed.\nDeploying will take longer and some deploy options will be limited.\n\nTo fix this problem, commit your Gemfile.lock to your repository and redeploy.\n    WARN\n  end\nend\n"

#detected?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/engineyard-serverside/dependency_manager/bundler.rb', line 13

def detected?
  gemfile?
end

#gemfile?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/engineyard-serverside/dependency_manager/bundler.rb', line 17

def gemfile?
  paths.gemfile.exist?
end

#installObject



49
50
51
52
53
54
55
# File 'lib/engineyard-serverside/dependency_manager/bundler.rb', line 49

def install
  shell.status "Bundling gems..."
  clean_bundle_on_system_version_change
  install_bundler_gem
  run "#{clean_environment} && cd #{paths.active_release} && #{bundle_install_command}"
  write_system_version
end

#rails_versionObject



67
68
69
# File 'lib/engineyard-serverside/dependency_manager/bundler.rb', line 67

def rails_version
  lockfile && lockfile.rails_version
end

#show_ey_config_instructionsObject



61
62
63
64
65
# File 'lib/engineyard-serverside/dependency_manager/bundler.rb', line 61

def show_ey_config_instructions
  if lockfile && !lockfile.has_ey_config?
    shell.warning "Gemfile.lock does not contain ey_config. Add gem 'ey_config' to your Gemfile to access service configurations through EY::Config."
  end
end

#uses_sqlite3?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/engineyard-serverside/dependency_manager/bundler.rb', line 57

def uses_sqlite3?
  lockfile && lockfile.uses_sqlite3?
end