Class: Sparrowhawk::BundlerDefinition
- Inherits:
-
Bundler::Definition
- Object
- Bundler::Definition
- Sparrowhawk::BundlerDefinition
- Defined in:
- lib/sparrowhawk/bundler_definition.rb
Instance Method Summary collapse
- #excluded_groups ⇒ Object
-
#initialize(gemfile, lockfile) ⇒ BundlerDefinition
constructor
A new instance of BundlerDefinition.
- #production_groups ⇒ Object
-
#runtime_dependencies ⇒ Object
Filters dependencies based on what should be in the war at runtime.
Constructor Details
#initialize(gemfile, lockfile) ⇒ BundlerDefinition
Returns a new instance of BundlerDefinition.
7 8 9 |
# File 'lib/sparrowhawk/bundler_definition.rb', line 7 def initialize gemfile, lockfile super ::Bundler::Definition.build(gemfile, lockfile, nil) end |
Instance Method Details
#excluded_groups ⇒ Object
20 21 22 |
# File 'lib/sparrowhawk/bundler_definition.rb', line 20 def excluded_groups @excluded_groups ||= groups - production_groups end |
#production_groups ⇒ Object
24 25 26 |
# File 'lib/sparrowhawk/bundler_definition.rb', line 24 def production_groups [:default, :production] end |
#runtime_dependencies ⇒ Object
Filters dependencies based on what should be in the war at runtime
12 13 14 15 16 17 18 |
# File 'lib/sparrowhawk/bundler_definition.rb', line 12 def runtime_dependencies dependencies.select do |dep| dep.type.to_sym == :runtime and (dep.platforms.empty? or dep.platforms.include?(:jruby)) and !(dep.groups & production_groups).empty? end end |