Sha256: 51f5382e0bfdab70b8c8e883b169a300a97d2dfeff6180b1162ec419c964a3a1

Contents?: true

Size: 875 Bytes

Versions: 2

Compression:

Stored size: 875 Bytes

Contents

module VersionInfo
  class Tasks
    def self.install(opts = nil)
      #dir = caller.find{|c| /Rakefile:/}[/^(.*?)\/Rakefile:/, 1]
      dir = File.dirname(Rake.application.rakefile_location)
      self.new(dir).install
    end
    
    attr_reader :root_path

    def initialize(root_path)
      @root_path = root_path
    end

    def install
      namespace :vinfo do
        desc "Show current version tag and create version_info.yml if missing"
        task :show do
          puts VERSION.tag
          VERSION.save unless File.exist?(VERSION.class.file_name)
        end
        
        VersionInfo.segments.each do |sgm|
          desc "Bumps version segment #{sgm.upcase}"
          task sgm.to_sym do
            VERSION.bump(sgm)
            puts "version changed to #{VERSION.tag}"
            VERSION.save
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
version_info-0.5.0 lib/version_info/tasks.rb
version_info-0.4.0 lib/version_info/tasks.rb