Class: PDK::Util::Bundler::BundleHelper
- Inherits:
-
Object
- Object
- PDK::Util::Bundler::BundleHelper
- Defined in:
- lib/pdk/util/bundler.rb,
lib/pdk/util/bundler.rb
Instance Method Summary collapse
- #binstubs!(gems) ⇒ Object
- #gemfile ⇒ Object
- #gemfile? ⇒ Boolean
- #install! ⇒ Object
- #installed? ⇒ Boolean
- #lock! ⇒ Object
- #locked? ⇒ Boolean
Instance Method Details
#binstubs!(gems) ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/pdk/util/bundler.rb', line 106 def binstubs!(gems) # FIXME: wrap in progress indicator result = invoke('binstubs', gems.join(' '), '--force') unless result[:exit_code].zero? $stderr.puts result[:stdout] $stderr.puts result[:stderr] end result[:exit_code].zero? end |
#gemfile ⇒ Object
118 119 120 |
# File 'lib/pdk/util/bundler.rb', line 118 def gemfile @gemfile ||= PDK::Util.find_upwards('Gemfile') end |
#gemfile? ⇒ Boolean
56 57 58 |
# File 'lib/pdk/util/bundler.rb', line 56 def gemfile? !gemfile.nil? end |
#install! ⇒ Object
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/pdk/util/bundler.rb', line 90 def install! output_start(_('Installing missing Gemfile dependencies')) result = invoke('install', "--gemfile=#{gemfile}", "--path=#{bundle_cachedir}") if result[:exit_code].zero? output_end(:success) else output_end(:failure) $stderr.puts result[:stdout] $stderr.puts result[:stderr] end result[:exit_code].zero? end |
#installed? ⇒ Boolean
64 65 66 67 68 69 70 71 72 |
# File 'lib/pdk/util/bundler.rb', line 64 def installed? output_start(_('Checking for missing Gemfile dependencies')) result = invoke('check', "--gemfile=#{gemfile}", "--path=#{bundle_cachedir}") output_end(:success) result[:exit_code].zero? end |
#lock! ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/pdk/util/bundler.rb', line 74 def lock! output_start(_('Resolving Gemfile dependencies')) result = invoke('lock') if result[:exit_code].zero? output_end(:success) else output_end(:failure) $stderr.puts result[:stdout] $stderr.puts result[:stderr] end result[:exit_code].zero? end |
#locked? ⇒ Boolean
60 61 62 |
# File 'lib/pdk/util/bundler.rb', line 60 def locked? !gemfile_lock.nil? end |