Class: Cibuildgem::CompilationTasks
- Inherits:
-
Object
- Object
- Cibuildgem::CompilationTasks
- Defined in:
- lib/cibuildgem/compilation_tasks.rb
Instance Attribute Summary collapse
-
#create_packaging_task ⇒ Object
readonly
Returns the value of attribute create_packaging_task.
-
#extension_task ⇒ Object
readonly
Returns the value of attribute extension_task.
-
#gemspec ⇒ Object
readonly
Returns the value of attribute gemspec.
-
#native ⇒ Object
readonly
Returns the value of attribute native.
Instance Method Summary collapse
-
#initialize(create_packaging_task = false, gemspec = nil) ⇒ CompilationTasks
constructor
A new instance of CompilationTasks.
- #normalized_platform ⇒ Object
- #ruby_cc_version ⇒ Object
- #setup ⇒ Object
Constructor Details
#initialize(create_packaging_task = false, gemspec = nil) ⇒ CompilationTasks
Returns a new instance of CompilationTasks.
12 13 14 15 16 17 |
# File 'lib/cibuildgem/compilation_tasks.rb', line 12 def initialize(create_packaging_task = false, gemspec = nil) @gemspec = Bundler.load_gemspec(gemspec || find_gemspec) verify_gemspec! @create_packaging_task = create_packaging_task end |
Instance Attribute Details
#create_packaging_task ⇒ Object (readonly)
Returns the value of attribute create_packaging_task.
10 11 12 |
# File 'lib/cibuildgem/compilation_tasks.rb', line 10 def create_packaging_task @create_packaging_task end |
#extension_task ⇒ Object (readonly)
Returns the value of attribute extension_task.
10 11 12 |
# File 'lib/cibuildgem/compilation_tasks.rb', line 10 def extension_task @extension_task end |
#gemspec ⇒ Object (readonly)
Returns the value of attribute gemspec.
10 11 12 |
# File 'lib/cibuildgem/compilation_tasks.rb', line 10 def gemspec @gemspec end |
#native ⇒ Object (readonly)
Returns the value of attribute native.
10 11 12 |
# File 'lib/cibuildgem/compilation_tasks.rb', line 10 def native @native end |
Instance Method Details
#normalized_platform ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/cibuildgem/compilation_tasks.rb', line 37 def normalized_platform platform = RUBY_PLATFORM if darwin? RUBY_PLATFORM.sub(/(.*-darwin)\d+/, '\1') else platform end end |
#ruby_cc_version ⇒ Object
30 31 32 33 34 35 |
# File 'lib/cibuildgem/compilation_tasks.rb', line 30 def ruby_cc_version required_ruby_version = @gemspec.required_ruby_version selected_rubies = RubySeries.versions_to_compile_against(required_ruby_version) selected_rubies.map(&:to_s).join(":") end |
#setup ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cibuildgem/compilation_tasks.rb', line 19 def setup Rake::ExtensionTask.enable! gemspec.extensions.each do |path| binary_name = parse_extconf(path) define_task(path, binary_name) end setup_packaging if create_packaging_task end |