Permalink
Browse files

Generate gemspec with jeweler

  • Loading branch information...
1 parent 55c7485 commit 77641a78938128adaa5f50aadd5f6c6122df1973 @mattb committed Jul 22, 2009
Showing with 113 additions and 43 deletions.
  1. +5 −0 .gitignore
  2. +56 −28 Rakefile
  3. +1 −1 VERSION
  4. +51 −13 findmyiphone.gemspec
  5. +0 −1 lib/findmyiphone.rb
View
@@ -2,3 +2,8 @@
examples/fireeagle_keys.yml
examples/iphone_credentials.yml
.*.swp
+*.sw?
+.DS_Store
+coverage
+rdoc
+pkg
View
@@ -1,31 +1,59 @@
-require File.join("lib", "findmyiphone")
-
-desc "Generate the gemspec"
-task :gemspec do
- gemspec =<<-EOF
-# this file is automatically generated
-Gem::Specification.new do |s|
-s.name = "findmyiphone"
-s.version = "#{FindMyIphone::VERSION * "."}"
-s.summary = "MobileMe utilities"
-s.description = "A toolkit for sending messages and getting location from MobileMe."
-s.authors = ["Matt Biddulph"]
-s.email = ["mb@hackdiary.com"]
-
-s.files = #{Dir.glob("**/*").select { |f| File.file?(f) }.inspect}
-s.executables = ["findmyiphone"]
-s.require_paths = ["lib"]
-
-s.add_dependency("mechanize", [">= 0.9.3"])
-s.add_dependency("json", [">= 1.1.3"])
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "findmyiphone"
+ gem.summary = "MobileMe utilities"
+ gem.description = "A toolkit for sending messages and getting location from MobileMe."
+ gem.email = "matt@hackdiary.com"
+ gem.homepage = "http://github.com/mattb/findmyiphone"
+ gem.authors = ["Matt Biddulph"]
+ gem.add_dependency("mechanize", [">= 0.9.3"])
+ gem.add_dependency("json", [">= 1.1.3"])
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+ end
+
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
+end
+
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/**/*_test.rb'
+ test.verbose = true
+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
end
-EOF
-
- open("findmyiphone.gemspec", "w") do |f|
- f << gemspec
+
+
+task :default => :test
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ if File.exist?('VERSION.yml')
+ config = YAML.load(File.read('VERSION.yml'))
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
+ else
+ version = ""
end
-
- puts "gemspec successfully created."
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "findmyiphone #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
end
-
-task :default => :gemspec
+
View
@@ -1 +1 @@
-0.0.0
+0.1.2
View
@@ -1,15 +1,53 @@
-# this file is automatically generated
+# -*- encoding: utf-8 -*-
+
Gem::Specification.new do |s|
-s.name = "findmyiphone"
-s.version = "0.1.1"
-s.summary = "MobileMe utilities"
-s.description = "A toolkit for sending messages and getting location from MobileMe."
-s.authors = ["Matt Biddulph"]
-s.email = ["mb@hackdiary.com"]
-
-s.files = ["examples/fireeagle_keys.yml.example", "examples/iphone_2_fireeagle.rb", "examples/iphone_credentials.yml.example", "lib/findmyiphone.rb", "Rakefile"]
-s.require_paths = ["lib"]
-
-s.add_dependency("mechanize", [">= 0.9.3"])
-s.add_dependency("json", [">= 1.1.3"])
+ s.name = %q{findmyiphone}
+ s.version = "0.1.2"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Matt Biddulph"]
+ s.date = %q{2009-07-23}
+ s.description = %q{A toolkit for sending messages and getting location from MobileMe.}
+ s.email = %q{matt@hackdiary.com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README"
+ ]
+ s.files = [
+ ".gitignore",
+ "LICENSE",
+ "README",
+ "Rakefile",
+ "VERSION",
+ "examples/fireeagle_keys.yml.example",
+ "examples/iphone_2_fireeagle.rb",
+ "examples/iphone_credentials.yml.example",
+ "findmyiphone.gemspec",
+ "lib/findmyiphone.rb"
+ ]
+ s.has_rdoc = true
+ s.homepage = %q{http://github.com/mattb/findmyiphone}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.1}
+ s.summary = %q{MobileMe utilities}
+ s.test_files = [
+ "examples/iphone_2_fireeagle.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 2
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<mechanize>, [">= 0.9.3"])
+ s.add_runtime_dependency(%q<json>, [">= 1.1.3"])
+ else
+ s.add_dependency(%q<mechanize>, [">= 0.9.3"])
+ s.add_dependency(%q<json>, [">= 1.1.3"])
+ end
+ else
+ s.add_dependency(%q<mechanize>, [">= 0.9.3"])
+ s.add_dependency(%q<json>, [">= 1.1.3"])
+ end
end
View
@@ -3,7 +3,6 @@
require 'json'
class FindMyIphone
- VERSION = [0, 1, 1]
def initialize(username, password)
@username = username
@password = password

0 comments on commit 77641a7

Please sign in to comment.