Module: GemHelper

Defined in:
lib/trop/gem_tasks.rb

Overview

require ‘gem/release’

Class Method Summary collapse

Class Method Details

.check_lib_version_rbObject



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

Returns:



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_gemspecObject



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_versionObject



35
36
# File 'lib/trop/gem_tasks.rb', line 35

def self.update_version
end