Class: Shoes::Packager
- Inherits:
-
Object
- Object
- Shoes::Packager
- Defined in:
- shoes-core/lib/shoes/packager.rb
Instance Attribute Summary collapse
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
Instance Method Summary collapse
- #configure_gems ⇒ Object
-
#initialize ⇒ Packager
constructor
A new instance of Packager.
- #options ⇒ Object
- #parse!(args) ⇒ Object
- #run(path) ⇒ Object
Constructor Details
#initialize ⇒ Packager
Returns a new instance of Packager.
7 8 9 10 11 12 |
# File 'shoes-core/lib/shoes/packager.rb', line 7 def initialize @backend = Shoes.backend_for(self) configure_gems rescue ArgumentError # Packaging unsupported by this backend end |
Instance Attribute Details
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
5 6 7 |
# File 'shoes-core/lib/shoes/packager.rb', line 5 def backend @backend end |
Instance Method Details
#configure_gems ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'shoes-core/lib/shoes/packager.rb', line 27 def configure_gems @backend.gems = [] return unless defined?(::Bundler) @backend.gems = ::Bundler.environment.specs.map(&:name) - ["shoes"] rescue Bundler::GemfileNotFound # Ok to be quiet since we didn't even have a Gemfile rescue => e Shoes.logger.error "Looking up gems for packaging failed:\n#{e.}" end |
#options ⇒ Object
14 15 16 |
# File 'shoes-core/lib/shoes/packager.rb', line 14 def @backend. end |
#parse!(args) ⇒ Object
18 19 20 |
# File 'shoes-core/lib/shoes/packager.rb', line 18 def parse!(args) .parse!(args) end |
#run(path) ⇒ Object
22 23 24 25 |
# File 'shoes-core/lib/shoes/packager.rb', line 22 def run(path) raise "Packaging unsupported by this backend" if @backend.nil? @backend.run(path) end |