Class: Bubing::Configuration
- Inherits:
-
Object
- Object
- Bubing::Configuration
- Defined in:
- lib/bubing.rb
Instance Method Summary collapse
- #add_env(var, val) ⇒ Object
- #add_file(from, to) ⇒ Object
- #add_file_dir(from, to) ⇒ Object
- #add_ld_path(path) ⇒ Object
- #add_plugin(path) ⇒ Object
- #add_plugin_dir(path) ⇒ Object
- #binary(path) ⇒ Object
- #bundle! ⇒ Object
- #directory(path) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #run_script(name) ⇒ Object
- #verbose! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 18 19 20 21 22 23 |
# File 'lib/bubing.rb', line 15 def initialize @options = {} @options[:plugins] = [] @options[:plugin_dirs] = [] @options[:files] = {} @options[:file_dirs] = {} @options[:envs] = {} @options[:ld_paths] = [] end |
Instance Method Details
#add_env(var, val) ⇒ Object
49 50 51 |
# File 'lib/bubing.rb', line 49 def add_env(var, val) @options[:envs][var] = val end |
#add_file(from, to) ⇒ Object
41 42 43 |
# File 'lib/bubing.rb', line 41 def add_file(from, to) @options[:files][File.(from)] = to end |
#add_file_dir(from, to) ⇒ Object
45 46 47 |
# File 'lib/bubing.rb', line 45 def add_file_dir(from, to) @options[:file_dirs][File.(from)] = to end |
#add_ld_path(path) ⇒ Object
53 54 55 |
# File 'lib/bubing.rb', line 53 def add_ld_path(path) @options[:ld_paths] << File.(path) end |
#add_plugin(path) ⇒ Object
33 34 35 |
# File 'lib/bubing.rb', line 33 def add_plugin(path) @options[:plugins] << path end |
#add_plugin_dir(path) ⇒ Object
37 38 39 |
# File 'lib/bubing.rb', line 37 def add_plugin_dir(path) @options[:plugin_dirs] << path end |
#binary(path) ⇒ Object
25 26 27 |
# File 'lib/bubing.rb', line 25 def binary(path) @binary = File.absolute_path(path) end |
#bundle! ⇒ Object
65 66 67 |
# File 'lib/bubing.rb', line 65 def bundle! Bubing::BundlerFactory.new.build(@binary, @directory, **@options).bundle! end |
#directory(path) ⇒ Object
29 30 31 |
# File 'lib/bubing.rb', line 29 def directory(path) @directory = File.absolute_path(path) end |
#run_script(name) ⇒ Object
57 58 59 |
# File 'lib/bubing.rb', line 57 def run_script(name) @options[:run_script] = name end |
#verbose! ⇒ Object
61 62 63 |
# File 'lib/bubing.rb', line 61 def verbose! @options[:verbose] = true end |