Sha256: db0432a9981b5f505dd1bf395eadbaf8e1ff5848c36b49a24d37d3576fe16b98

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

require 'bundler/gem_tasks'

task :spec do
  sh "rspec spec"
end

task :default do # can fail when run with bundler
  ['2.3.14', '~>3.0.15', '~>3.1.6', '~>3.2.6'].each do |version|
    sh "export RAILS='#{version}' && (bundle check || bundle) && bundle exec rake spec"
  end
  sh "git checkout Gemfile.lock"
end

# extracted from https://github.com/grosser/project_template
rule /^version:bump:.*/ do |t|
  file = "lib/gettext_i18n_rails/version.rb"

  sh "git status | grep 'nothing to commit'" # ensure we are not dirty
  index = ["major", "minor", "patch"].index(t.name.split(':').last)
  version_file = File.read(file)
  old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
  version_parts[index] = version_parts[index].to_i + 1
  version_parts[2] = 0 if index < 2 # remove patch for minor
  version_parts[1] = 0 if index < 1 # remove minor for major
  new_version = version_parts * '.'

  File.open(file,"w"){|f| f.write(version_file.sub(old_version, new_version)) }
  sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gettext_i18n_rails-0.7.1 Rakefile
gettext_i18n_rails-0.7.0 Rakefile