Module: GemHelper
- Defined in:
- lib/trop/gem_tasks.rb
Overview
require ‘gem/release’
Class Method Summary collapse
- .check_lib_version_rb ⇒ Object
- .check_lib_version_rb? ⇒ Boolean
- .rewrite_gemspec ⇒ Object
- .update_version ⇒ Object
Class Method Details
.check_lib_version_rb ⇒ Object
24 25 26 27 28 |
# File 'lib/trop/gem_tasks.rb', line 24 def self.check_lib_version_rb content = Pathname.new(Trop::VERSION_FILE).read version_ok = content.scan(/VERSION.*["']+\d+\.\d+[\.\d+]+["']+/) version_ok end |
.check_lib_version_rb? ⇒ Boolean
30 31 32 33 |
# File 'lib/trop/gem_tasks.rb', line 30 def self.check_lib_version_rb? return false if ( GemHelper::check_lib_version_rb.nil? ) true end |
.rewrite_gemspec ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/trop/gem_tasks.rb', line 12 def self.rewrite_gemspec spec_path = FileUtils.getwd + '/' + Trop::GEMSPEC_NAME spec_gem = Gem::Specification::load(spec_path) spec_gem.version = GemVersion.next_version File.open(spec_path, 'w') {|f| f.write spec_gem.to_ruby } unless Trop::Sh::silent? File.open("gemspecx.gemspecx", 'w') {|f| f.write spec_gem.to_ruby } end return spec_gem.version end |
.update_version ⇒ Object
35 36 |
# File 'lib/trop/gem_tasks.rb', line 35 def self.update_version end |