Rakefile in apn_sender-1.0.5 vs Rakefile in apn_sender-1.0.6
- old
+ new
@@ -1,56 +1,35 @@
-require 'rubygems'
-require 'rake'
+require "bundler"
+Bundler.setup
-load 'lib/apn/tasks.rb'
+require "rake"
+require "rspec/core/rake_task"
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "apn_sender"
- gem.summary = %Q{Resque-based background worker to send Apple Push Notifications over a persistent TCP socket.}
- gem.description = %Q{Resque-based background worker to send Apple Push Notifications over a persistent TCP socket. Includes Resque tweaks to allow persistent sockets between jobs, helper methods for enqueueing APN notifications, and a background daemon to send them.}
- gem.email = "kali.donovan@gmail.com"
- gem.homepage = "http://github.com/kdonovan/apple_push_notification"
- gem.authors = ["Kali Donovan"]
- gem.add_dependency 'resque'
- gem.add_dependency 'resque-access_worker_from_job'
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
+require "apn/version"
+
+task :gem => :build
+task :build do
+ system "gem build apn_sender.gemspec"
end
-require 'rake/testtask'
-Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
+task :install => :build do
+ system "gem install apn_sender-#{APN::VERSION}.gem"
end
-begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new do |test|
- test.libs << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
- end
-rescue LoadError
- task :rcov do
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
- end
+task :release => :build do
+ system "git tag -a v#{APN::VERSION} -m 'Tagging #{APN::VERSION}'"
+ system "git push --tags"
+ system "gem push apn_sender-#{APN::VERSION}.gem"
+ system "rm apn_sender-#{APN::VERSION}.gem"
end
-task :test => :check_dependencies
+RSpec::Core::RakeTask.new("spec") do |spec|
+ spec.pattern = "spec/**/*_spec.rb"
+end
-task :default => :test
-
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "apple_push_notification #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
+RSpec::Core::RakeTask.new('spec:progress') do |spec|
+ spec.rspec_opts = %w(--format progress)
+ spec.pattern = "spec/**/*_spec.rb"
end
+
+task :default => :spec