Class: Noodle::Noodler
- Inherits:
-
Object
- Object
- Noodle::Noodler
- Defined in:
- lib/noodle.rb
Instance Attribute Summary collapse
-
#groups ⇒ Array
An array of bundler groups that reference the required dlls.
-
#merge ⇒ Boolean
Whether to copy everything into one directory or not.
-
#outdir ⇒ String
The destination directory.
Instance Method Summary collapse
-
#initialize ⇒ Noodler
constructor
A new instance of Noodler.
- #install ⇒ Object
-
#merge! ⇒ void
Sets #merge to true.
Constructor Details
#initialize ⇒ Noodler
Returns a new instance of Noodler.
35 36 37 38 39 |
# File 'lib/noodle.rb', line 35 def initialize @groups = [] @outdir = 'lib' @merge = false end |
Instance Attribute Details
#groups ⇒ Array
An array of bundler groups that reference the required dlls. Use an empty array for all groups.
Defaults to all groups.
12 13 14 |
# File 'lib/noodle.rb', line 12 def groups @groups end |
#merge ⇒ Boolean
27 28 29 |
# File 'lib/noodle.rb', line 27 def merge @merge end |
#outdir ⇒ String
The destination directory.
Defaults to ‘lib’.
18 19 20 |
# File 'lib/noodle.rb', line 18 def outdir @outdir end |
Instance Method Details
#install ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/noodle.rb', line 41 def install specs = groups.any? ? Bundler.definition.specs_for(groups) : Bundler.environment.requested_specs specs.each do |spec| next if spec.name == 'bundler' spec.load_paths.each do |path| dest_path = dest_for(spec) FileUtils.mkdir_p dest_path FileUtils.cp_r "#{path}/.", dest_path, :verbose => true end end end |
#merge! ⇒ void
This method returns an undefined value.
Sets #merge to true.
31 32 33 |
# File 'lib/noodle.rb', line 31 def merge! @merge = true end |