Method: Gem::Micro::SpecificationEmitter#to_ruby

Defined in:
lib/microgem/specification_emitter.rb

#to_rubyObject

Returns a Ruby syntax representation of the Specification which is used to generate the gemspec files that RubyGems uses to check for gems.

TODO: We are still missing the following values, but it might not be a real problem. So we need to figure out if they are important to RubyGems and if so where it gets these values from.

  • files

  • extra_rdoc_files

  • rdoc_options

  • test_files



54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/microgem/specification_emitter.rb', line 54

def to_ruby
%{Gem::Specification.new do |s|
  s.name = "#{@gem_spec.name}"
  s.version = "#{@gem_spec.version}"

  s.specification_version = #{ ivar_get(:specification_version) || 2 } if s.respond_to? :specification_version=
  s.required_rubygems_version = Gem::Requirement.new("#{ivar_get(:required_rubygems_version) || '>= 0'}") if s.respond_to? :required_rubygems_version=

#{gem_spec_variables.map { |k,v| "  s.#{k} = #{v.inspect}" }.join("\n") }

#{@gem_spec.dependencies.map { |dep| "  s.add_dependency(\"#{dep.name}\", [\"#{dep.version_requirements.to_s}\"])" }.join("\n") }
end}
end