Rakefile in transistor-0.1.0 vs Rakefile in transistor-0.1.1
- old
+ new
@@ -10,10 +10,15 @@
task.include_pattern = "lib/transistor/*.js"
task.browser = true # predefine Browser globals
end
+
+ desc 'Build min and src version of transistor'
+ task :build do
+ system "rm -fr build/* && jake && cp build/src/*.js lib/assets/javascripts/ && git add build lib/assets/javascripts"
+ end
end
begin
require 'jasmine'
load 'jasmine/tasks/jasmine.rake'
@@ -26,17 +31,11 @@
require "rubygems"
require "rubygems/package_task"
require "rdoc/task"
-require "rspec"
-require "rspec/core/rake_task"
-RSpec::Core::RakeTask.new do |t|
- t.rspec_opts = %w(--format documentation --colour)
-end
-
task :default => ["spec"]
# This builds the actual gem. For details of what all these options
# mean, and other ones you can add, check the documentation here:
#
@@ -44,22 +43,22 @@
#
spec = Gem::Specification.new do |s|
# Change these as appropriate
s.name = "transistor"
- s.version = "0.1.0"
+ s.version = "0.1.1"
s.summary = "Client for the radiotower.io service"
s.author = "Jakob Holderbaum"
s.email = "jakob@featurefabrik.de"
s.homepage = "http://featurefabrik.com"
s.has_rdoc = true
s.extra_rdoc_files = %w(README.md)
s.rdoc_options = %w(--main README.md)
# Add any extra files to include in the gem
- s.files = %w(Gemfile.lock index.html Rakefile Gemfile faye-browser.js README.md jake.yml) + Dir.glob("{spec,lib}/**/*")
+ s.files = %w(Gemfile.lock Rakefile Gemfile README.md jake.yml) + Dir.glob("{spec,lib,build}/**/*")
s.require_paths = ["lib"]
# If you want to depend on other gems, add them here, along with any
# relevant versions
# s.add_dependency("some_other_gem", "~> 0.1.0")
@@ -105,5 +104,28 @@
desc 'Clear out RDoc and generated packages'
task :clean => [:clobber_rdoc, :clobber_package] do
rm "#{spec.name}.gemspec"
end
+
+desc 'Tag the repository in git with gem version number'
+task :tag => [:gemspec, :build] do
+ if `git diff --cached`.empty?
+ if `git tag`.split("\n").include?("v#{spec.version}")
+ raise "Version #{spec.version} has already been released"
+ end
+ `git add #{File.expand_path("../#{spec.name}.gemspec", __FILE__)}`
+ `git commit -m "Released version #{spec.version}"`
+ `git tag v#{spec.version}`
+ `git push --tags`
+ `git push`
+ else
+ raise "Unstaged changes still waiting to be committed"
+ end
+end
+
+desc "Tag and publish the gem to rubygems.org"
+task :publish => :tag do
+ `gem push pkg/#{spec.name}-#{spec.version}.gem`
+end
+
+task :build => ['js:build', :package]