Class: Sparrowhawk::BundlerDefinition

Inherits:
Bundler::Definition
  • Object
show all
Defined in:
lib/sparrowhawk/bundler_definition.rb

Instance Method Summary collapse

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_groupsObject


20
21
22
# File 'lib/sparrowhawk/bundler_definition.rb', line 20

def excluded_groups
  @excluded_groups ||= groups - production_groups
end

#production_groupsObject


24
25
26
# File 'lib/sparrowhawk/bundler_definition.rb', line 24

def production_groups
  [:default, :production]
end

#runtime_dependenciesObject

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