Sha256: 360bc64670edc14297db81efde48b96bce9d9b7f7a6dc2453cfb1c4d21b98f46

Contents?: true

Size: 653 Bytes

Versions: 5

Compression:

Stored size: 653 Bytes

Contents

# frozen_string_literal: true

require 'app_store_dev_api/version'
require 'semantic'

namespace :version do
  desc 'Print current version'
  task :current do
    puts AppStoreDevApi::VERSION
  end

  desc 'Increment version'
  task :increment do
    version = Semantic::Version.new(AppStoreDevApi::VERSION)
    path = File.expand_path(File.join('..', 'app_store_connect', 'version.rb'), __dir__)
    new_version = version.increment!(:minor).to_s

    File.open(path, 'r+') do |file|
      contents = file.read
      contents.gsub!(AppStoreDevApi::VERSION, new_version)

      file.rewind
      file.write(contents)

      new_version
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
app_store_dev_api-0.1.4 lib/tasks/version.rake
app_store_dev_api-0.1.3 lib/tasks/version.rake
app_store_dev_api-0.1.2 lib/tasks/version.rake
app_store_dev_api-0.1.1 lib/tasks/version.rake
app_store_dev_api-0.1.0 lib/tasks/version.rake