Sha256: eaae86e05d07d5ac009220b8a782609bd2d23beea834a12f3a81ddd39dc332db

Contents?: true

Size: 1.03 KB

Versions: 23

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require "bundler/gem_tasks"
require "rspec/core/rake_task"

APP_RAKEFILE = "spec/internal/Rakefile"
load "rails/tasks/engine.rake"

RSpec::Core::RakeTask.new

def current_version
  Semantic::Version.new(PagesCore::VERSION)
end

def write_version(version)
  puts "Updating version to #{version}..."
  File.write(File.expand_path("./VERSION", __dir__), version.to_s)
  `npm version #{version} --git-tag-version=false`
  `bundle`
end

desc "Increment to next patch version"
task "version:patch" => :environment do
  write_version(current_version.patch!)
end

desc "Increment to next minor version"
task "version:minor" => :environment do
  write_version(current_version.minor!)
end

desc "Increment to next major version"
task "version:major" => :environment do
  write_version(current_version.major!)
end

desc "Push NPM package"
task "release:npm" => :environment do
  system("npm publish --access public")
end

Rake::Task["release"].enhance do
  Rake::Task["release:npm"].invoke
end

task default: :spec
task test: :spec

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
pages_core-3.15.5 Rakefile
pages_core-3.15.4 Rakefile
pages_core-3.15.3 Rakefile
pages_core-3.15.2 Rakefile
pages_core-3.15.1 Rakefile
pages_core-3.14.0 Rakefile
pages_core-3.13.0 Rakefile
pages_core-3.12.7 Rakefile
pages_core-3.12.6 Rakefile
pages_core-3.12.5 Rakefile
pages_core-3.12.4 Rakefile
pages_core-3.12.3 Rakefile
pages_core-3.12.2 Rakefile
pages_core-3.12.1 Rakefile
pages_core-3.12.0 Rakefile
pages_core-3.11.3 Rakefile
pages_core-3.11.2 Rakefile
pages_core-3.11.1 Rakefile
pages_core-3.11.0 Rakefile
pages_core-3.10.2 Rakefile