Class: Gem::Compiler
- Inherits:
-
Object
- Object
- Gem::Compiler
- Includes:
- UserInteraction
- Defined in:
- lib/rubygems/compiler/version.rb,
lib/rubygems/compiler.rb
Defined Under Namespace
Classes: CompilerError
Constant Summary collapse
- VERSION =
"0.9.0"
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#target_dir ⇒ Object
readonly
Returns the value of attribute target_dir.
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(gemfile, _options = {}) ⇒ Compiler
constructor
A new instance of Compiler.
Constructor Details
#initialize(gemfile, _options = {}) ⇒ Compiler
Returns a new instance of Compiler.
18 19 20 21 22 |
# File 'lib/rubygems/compiler.rb', line 18 def initialize(gemfile, = {}) @gemfile = gemfile @output_dir = .delete(:output) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
16 17 18 |
# File 'lib/rubygems/compiler.rb', line 16 def @options end |
#target_dir ⇒ Object (readonly)
Returns the value of attribute target_dir.
16 17 18 |
# File 'lib/rubygems/compiler.rb', line 16 def target_dir @target_dir end |
Instance Method Details
#compile ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/rubygems/compiler.rb', line 24 def compile unpack build_extensions artifacts = collect_artifacts strip_artifacts artifacts if shared_dir = [:include_shared_dir] shared_libs = collect_shared(shared_dir) artifacts.concat shared_libs end # build a new gemspec from the original one gemspec = installer.spec.dup adjust_gemspec_files gemspec, artifacts # generate new gem and return new path to it repackage gemspec ensure cleanup end |