Permalink
Browse files

update .gemspec file

update to a more modern gemspec file
user /version.rb file for version control
update Rakefile to use bundler
  • Loading branch information...
1 parent b53eca1 commit 23d8225c7d1851272c212060aeec5901e55714d8 @arthurnn committed May 4, 2013
Showing with 50 additions and 110 deletions.
  1. +27 −48 Rakefile
  2. +19 −62 apn_sender.gemspec
  3. +4 −0 lib/apn/version.rb
View
@@ -1,56 +1,35 @@
-require 'rubygems'
-require 'rake'
-
-load 'lib/apn/tasks.rb'
-
-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@deviantech.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"
-end
+require "bundler"
+Bundler.setup
-require 'rake/testtask'
-Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
- test.pattern = 'test/**/test_*.rb'
- test.verbose = true
-end
+require "rake"
+require "rspec/core/rake_task"
-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
+$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
+require "apn/version"
+
+task :gem => :build
+task :build do
+ system "gem build apn_sender.gemspec"
end
-task :test => :check_dependencies
+task :install => :build do
+ system "gem install apn_sender-#{APN::VERSION}.gem"
+end
-task :default => :test
+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
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
+RSpec::Core::RakeTask.new("spec") do |spec|
+ spec.pattern = "spec/**/*_spec.rb"
+end
- 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
View
@@ -1,69 +1,26 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
-# -*- encoding: utf-8 -*-
+# encoding: utf-8
+lib = File.expand_path('../lib/', __FILE__)
+$:.unshift lib unless $:.include?(lib)
+
+require "apn/version"
Gem::Specification.new do |s|
s.name = %q{apn_sender}
- s.version = "1.0.5"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Kali Donovan"]
+ s.version = APN::VERSION
+ s.authors = ["Kali Donovan", "Arthur Neves"]
s.date = %q{2011-05-15}
- s.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.}
- s.email = %q{kali.donovan@gmail.com}
- s.extra_rdoc_files = [
- "LICENSE",
- "README.rdoc"
- ]
- s.files = [
- ".document",
- "LICENSE",
- "README.rdoc",
- "Rakefile",
- "VERSION",
- "apn_sender.gemspec",
- "contrib/apn_sender.monitrc",
- "generators/apn_sender_generator.rb",
- "generators/templates/script",
- "init.rb",
- "lib/apn.rb",
- "lib/apn/connection/base.rb",
- "lib/apn/feedback.rb",
- "lib/apn/notification.rb",
- "lib/apn/notification_job.rb",
- "lib/apn/queue_manager.rb",
- "lib/apn/queue_name.rb",
- "lib/apn/sender.rb",
- "lib/apn/sender_daemon.rb",
- "lib/apn/tasks.rb",
- "lib/resque/hooks/before_unregister_worker.rb",
- "rails/init.rb",
- "test/helper.rb",
- "test/test_apple_push_notification.rb"
- ]
- s.homepage = %q{http://github.com/kdonovan/apple_push_notification}
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.5.2}
- s.summary = %q{Resque-based background worker to send Apple Push Notifications over a persistent TCP socket.}
- s.test_files = [
- "test/helper.rb",
- "test/test_apple_push_notification.rb"
- ]
+ s.summary = "Resque-based background worker to send Apple Push Notifications over a persistent TCP socket."
+ s.description = "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."
+ s.email = %q{arthurnn@gmail.com}
+ s.homepage = "http://github.com/arthurnn/apn_sender"
+ s.license = "MIT"
- if s.respond_to? :specification_version then
- s.specification_version = 3
+ s.required_ruby_version = ">= 1.9"
+ s.required_rubygems_version = ">= 1.3.6"
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<resque>, [">= 0"])
- s.add_runtime_dependency(%q<resque-access_worker_from_job>, [">= 0"])
- else
- s.add_dependency(%q<resque>, [">= 0"])
- s.add_dependency(%q<resque-access_worker_from_job>, [">= 0"])
- end
- else
- s.add_dependency(%q<resque>, [">= 0"])
- s.add_dependency(%q<resque-access_worker_from_job>, [">= 0"])
- end
-end
+ s.add_dependency("resque", [">= 0"])
+ s.add_dependency("resque-access_worker_from_job", [">= 0"])
+ s.files = Dir.glob("lib/**/*") + %w(CHANGELOG LICENSE README.md Rakefile)
+ s.require_path = 'lib'
+end
View
@@ -0,0 +1,4 @@
+# encoding: utf-8
+module APN
+ VERSION = "1.0.5"
+end

0 comments on commit 23d8225

Please sign in to comment.