Class: Circus::Profiles::RubyBase
- Defined in:
- lib/circus/profiles/ruby_base.rb
Constant Summary collapse
- BUNDLER_TOOL =
File.('../../../bundler/gem_cacher.rb', __FILE__)
Instance Method Summary collapse
- #cleanup_after_deploy(logger, overlay_dir) ⇒ Object
- #extra_dirs ⇒ Object
-
#initialize(name, dir, props) ⇒ RubyBase
constructor
A new instance of RubyBase.
- #prepare_for_deploy(logger, overlay_dir) ⇒ Object
-
#prepare_for_dev(logger, run_dir) ⇒ Object
Do basic gemfile preparation for dev.
Methods inherited from Base
#mark_for_persistent_run?, #package_base_dir?, #package_for_deploy, #package_for_dev, #requirements, #supported_for_development?
Constructor Details
#initialize(name, dir, props) ⇒ RubyBase
Returns a new instance of RubyBase.
10 11 12 |
# File 'lib/circus/profiles/ruby_base.rb', line 10 def initialize(name, dir, props) super(name, dir, props) end |
Instance Method Details
#cleanup_after_deploy(logger, overlay_dir) ⇒ Object
37 38 39 |
# File 'lib/circus/profiles/ruby_base.rb', line 37 def cleanup_after_deploy(logger, ) Bundler::CircusUtil.unfix_external_paths(@dir) end |
#extra_dirs ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/circus/profiles/ruby_base.rb', line 41 def extra_dirs if has_gemfile? ["#{@dir}/.bundle"] else [] end end |
#prepare_for_deploy(logger, overlay_dir) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/circus/profiles/ruby_base.rb', line 25 def prepare_for_deploy(logger, ) # Run the gem bundler if necessary if has_gemfile? logger.info("Bundling gems") return false unless run_external(logger, 'gem installation', "cd #{@dir}; bundle install") return false unless run_external(logger, 'gem caching', "cd #{@dir}; ruby #{BUNDLER_TOOL} && rm Gemfile.lock && bundle install vendor/bundle") end true end |
#prepare_for_dev(logger, run_dir) ⇒ Object
Do basic gemfile preparation for dev. Don’t override dev_run_script_content, since it is the same as the deployment variant.
16 17 18 19 20 21 22 23 |
# File 'lib/circus/profiles/ruby_base.rb', line 16 def prepare_for_dev(logger, run_dir) if has_gemfile? # TODO: Correct behaviour if working in the presence of an existing bundler environment run_external(logger, 'gem installation', "cd #{@dir}; bundle check || bundle install") end true end |