Sha256: 33d5ca6317d83146adb186056c23fd332cb688ed58d47768d54e35f03c4f20de

Contents?: true

Size: 1.53 KB

Versions: 53

Compression:

Stored size: 1.53 KB

Contents

require 'rake/testtask'
require 'bundler/gem_tasks'
require 'bump/tasks'

begin
  require 'rspec/core/rake_task'
rescue LoadError
end

if defined?(RSpec)
  desc "Run specs"
  RSpec::Core::RakeTask.new("spec") do |t|
    t.pattern = "spec/core/**/*_spec.rb"
  end

  desc "Run server specs"
  RSpec::Core::RakeTask.new("spec:server") do |t|
    t.pattern = "spec/server/**/*_spec.rb"
  end

  desc "Run live specs"
  RSpec::Core::RakeTask.new("spec:live") do |t|
    t.pattern = "spec/live/**/*_spec.rb"
  end

  task :clean_live do
    sh "rm -rf spec/fixtures/cassettes"
  end

  if RUBY_VERSION =~ /1.9/
    desc "Find coverage"
    task "spec:coverage" do
      ENV["COVERAGE"] = "yes"
      Rake::Task["spec"].invoke
    end
  end

  desc 'Default: run specs.'
  task :default => "spec"
end

# extracted from https://github.com/grosser/project_template
rule /^version:bump:.*/ do |t|
  sh "git status | grep 'nothing to commit'" # ensure we are not dirty
  index = ['major', 'minor','patch'].index(t.name.split(':').last)
  file = 'lib/zendesk_api/version.rb'

  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

53 entries across 53 versions & 1 rubygems

Version Path
zendesk_api-1.2.10 Rakefile
zendesk_api-1.2.9 Rakefile
zendesk_api-0.3.14 Rakefile
zendesk_api-1.2.8 Rakefile
zendesk_api-1.3.5 Rakefile
zendesk_api-1.2.7 Rakefile
zendesk_api-1.3.4 Rakefile
zendesk_api-1.3.2 Rakefile
zendesk_api-1.3.1 Rakefile
zendesk_api-1.3.0 Rakefile
zendesk_api-1.3.0.rc3 Rakefile
zendesk_api-1.2.6 Rakefile
zendesk_api-1.3.0.rc2 Rakefile
zendesk_api-1.3.0.rc1 Rakefile
zendesk_api-1.2.5 Rakefile
zendesk_api-1.2.4 Rakefile
zendesk_api-1.2.3 Rakefile
zendesk_api-1.2.2 Rakefile
zendesk_api-1.2.1 Rakefile
zendesk_api-1.1.3 Rakefile