Sha256: 0b3eb902b4aac16dac9e4d2bed1de54ed29f1db0c5a48c5fdccc25b36a2d13a6
Contents?: true
Size: 1.18 KB
Versions: 14
Compression:
Stored size: 1.18 KB
Contents
module VersionInfo class RakeTasks include Rake::DSL def self.install(opts = {}) dir = File.dirname(Rake.application.rakefile_location) self.new(dir, opts).install end attr_reader :root_path attr_reader :target def initialize(root_path, opts) @root_path = root_path @target = opts[:target] end def install namespace :vinfo do desc "Show version file format & name" task :file do puts "#{VersionInfo.file_format.to_s} format: #{target::VERSION.file_name}" end desc "Show complete version info" task :inspect do puts target::VERSION.inspect end desc "Show tag. Create version file if none" task :show do puts target::VERSION.tag target::VERSION.save unless File.exist?(target::VERSION.file_name) end VersionInfo.segments.each do |sgm| desc "Bumps version segment #{sgm.to_s.upcase}" task sgm.to_sym do target::VERSION.bump(sgm) puts "version changed to #{target::VERSION}" target::VERSION.save end end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems