Class: Rubypack::Builder
- Inherits:
-
Object
- Object
- Rubypack::Builder
- Defined in:
- lib/rubypack/builder.rb
Instance Method Summary collapse
- #build! ⇒ Object
-
#initialize(options) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(options) ⇒ Builder
Returns a new instance of Builder.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rubypack/builder.rb', line 5 def initialize() @options = @output = if [:verbose] VerboseOutput.new elsif [:quiet] QuietOutput.new else DefaultOutput.new end @overwrite = ![:no_overwrite] @output_directory = [:output_directory] end |
Instance Method Details
#build! ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rubypack/builder.rb', line 18 def build! pack = read_rubypack_file return false unless pack download_success = download_gems(pack) return false unless download_success files = generate_list_of_files(pack) return false unless files Dir.mktmpdir do |output_directory| copy_files(pack, files, output_directory) create_package(pack, output_directory) end true rescue => exception @output.error(exception.) verbose(exception.backtrace.join("\n")) false end |