Class: Bubing::Bundler

Inherits:
Object
  • Object
show all
Defined in:
lib/bubing/bundler.rb

Direct Known Subclasses

ExecutableBundler, SharedObjectBundler

Constant Summary collapse

PATH_RE =
/=> (.+?(?=\())/

Instance Method Summary collapse

Constructor Details

#initialize(binary, directory, **options) ⇒ Bundler

Returns a new instance of Bundler.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/bubing/bundler.rb', line 13

def initialize(binary, directory, **options)
  @binary = binary
  @directory = directory
  @interpreter = options[:interpreter]
  @plugins = options[:plugins] || []
  @plugin_dirs = options[:plugin_dirs]  || []
  @files = options[:files]  || []
  @file_dirs = options[:file_dirs]  || []
  @ld_paths = options[:ld_paths] || []
  @verbose = options[:verbose]

  @lib_dir = File.join(directory, 'lib')
  @copied = []
end

Instance Method Details

#bundle!Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/bubing/bundler.rb', line 28

def bundle!
  prepare_dir
  log("Interpreter is #{@interpreter}")
  copy_deps(@binary)
  log('Copying plugins...')
  log("Plugins to bundle #{@plugins.count}")
  copy_plugins(@plugins)
  log("Plugin dirs to bundle #{@plugin_dirs.count}")
  copy_plugin_dirs
  log('Copying files...')
  log("Files to bundle #{@files.count}")
  copy_files(@files)
  log("File dirs to bundle #{@file_dirs.count}")
  copy_files(@file_dirs)
rescue Bubing::DependencyNotFoundError => e
  puts "#{e.message} not found!"
  raise Bubing::BundlingError
end