Sha256: 0cd5756116ad32798677cd85e8ed8621ccac534d475bd96bb9d157c4e549dce8
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
class Gemspec def self.update gemspec_file Text.replace_in_file gemspec_file, /('\d{4}-\d{2}-\d{2}')/, "'#{Time.now.strftime('%Y-%m-%d')}'" end def self.gemfile gemspec_file spec=Gem::Specification.load(gemspec_file) return "#{spec.name}-#{spec.version}.gem" if !spec.nil? return "" end def self.version gemspec_file spec=Gem::Specification.load(gemspec_file) return spec.version.to_s end def self.published_version gemspec_file published_version='' spec=Gem::Specification.load(gemspec_file) begin published_version = `gem list -r #{spec.name}`.scan(/\((\d+.\d+.\d+)\)/)[0][0] rescue published_version='' end published_version end def self.published? gemspec_file published_version(gemspec_file)==version(gemspec_file) ? true : false end def self.normalize gemspec_file spec=Gem::Specification.load(gemspec_file) File.open(gemspec_file,'w'){|f|f.write(spec.to_ruby)} end def self.upgrade gemspec_file end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
dev_commands-0.0.56 | lib/gemspec.rb |
dev_commands-0.0.55 | lib/gemspec.rb |