Permalink
Browse files

use jeweler

  • Loading branch information...
1 parent c350bd0 commit f9710a6f86008df7d7f343f06ae2dcbdc6f7709d Scott Barron committed Oct 29, 2009
View
@@ -1 +1,2 @@
/rdoc/
+/pkg/
View
@@ -1,50 +1,54 @@
# Rakefile for garmin -*- ruby -*-
+require 'rubygems'
+require 'rake'
+
begin
- require "rubygems"
- require "rake/gempackagetask"
- require "rake/testtask"
- require "rake/rdoctask"
-rescue Exception
- nil
-end
+ require 'jeweler'
+ Jeweler::Tasks.new do |gemspec|
+ gemspec.name = 'garmin'
+ gemspec.summary = 'Ruby library for parsing tcx and gpx files'
+ gemspec.description = 'foo'
+ gemspec.email = 'scott@elitists.net'
+ gemspec.homepage = 'http://github.com/rubyist/garmin'
+ gemspec.authors = ['Scott Barron']
+ gemspec.add_development_dependency "thoughtbot-shoulda", ">= 0"
+ end
-if `ruby -Ilib -rgarmin -e "print Garmin.version"` =~ /([0-9.]+)$/
- CURRENT_VERSION = $1
-else
- CURRENT_VERSION = '0.0.0'
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler not available."
end
-desc 'Generate documentation for garmin'
-rd = Rake::RDocTask.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'html'
- rdoc.template = 'doc/jamis.rb'
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'garmin'
- rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README.rdoc' << '--title' << 'Magic Bus'
- rdoc.rdoc_files.include('README.rdoc', 'lib/**/*.rb', 'doc/**/*.rdoc')
+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."
+ end
+end
-desc "Run all tests"
-task :default => [:test]
+task :test => :check_dependencies
-Rake::TestTask.new(:test) do |t|
- t.test_files = FileList['test/test*.rb']
- t.warning = true
- t.verbose = false
-end
+task :default => :test
-desc "Verify gemspec for github"
-task :verify_gemspec do
- data = File.read('garmin.gemspec')
- spec = nil
- if data !~ %r{!ruby/object:Gem::Specification}
- Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
- else
- spec = YAML.load(data)
- end
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
- spec.validate
- puts spec
- puts "OK"
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "garmin #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
end
View
@@ -1 +1 @@
-0.0.0
+0.0.1
View
@@ -1,13 +1,72 @@
-spec = Gem::Specification.new do |s|
- s.name = 'garmin'
- s.version = '0.1'
- s.summary = 'Ruby library for parsing Garming tcx files'
- s.files = ["MIT-LICENSE", "Rakefile", "README.rdoc", "README.rdoc", "lib/activity.rb", "lib/db.rb", "lib/garmin.rb", "lib/gpx_parser.rb", "lib/lap.rb", "lib/tcx_parser.rb", "lib/track_point.rb"]
- s.require_path = 'lib'
- s.has_rdoc = true
- s.extra_rdoc_files = ['README.rdoc']
- s.rdoc_options = ['--line-numbers', '--inline-source', '--main', 'README.rdoc', '--title', 'garmin']
- s.author = "Scott Barron"
- s.email = "scott@elitists.net"
- s.homepage = "https://github.com/rubyist/garmin/tree"
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{garmin}
+ s.version = "0.0.1"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Scott Barron"]
+ s.date = %q{2009-10-28}
+ s.description = %q{foo}
+ s.email = %q{scott@elitists.net}
+ s.extra_rdoc_files = [
+ "README.rdoc"
+ ]
+ s.files = [
+ ".gitignore",
+ "MIT-LICENSE",
+ "README.rdoc",
+ "Rakefile",
+ "VERSION",
+ "doc/jamis.rb",
+ "garmin.gemspec",
+ "lib/garmin.rb",
+ "lib/garmin/activity.rb",
+ "lib/garmin/db.rb",
+ "lib/garmin/gpx_parser.rb",
+ "lib/garmin/lap.rb",
+ "lib/garmin/tcx_parser.rb",
+ "lib/garmin/track_point.rb",
+ "test/fixtures/example.tcx",
+ "test/helper.rb",
+ "test/test_activity.rb",
+ "test/test_db.rb",
+ "test/test_garmin.rb",
+ "test/test_gpx_parser.rb",
+ "test/test_lap.rb",
+ "test/test_tcx_parser.rb",
+ "test/test_track_point.rb"
+ ]
+ s.homepage = %q{http://github.com/rubyist/garmin}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{Ruby library for parsing tcx and gpx files}
+ s.test_files = [
+ "test/helper.rb",
+ "test/test_activity.rb",
+ "test/test_db.rb",
+ "test/test_garmin.rb",
+ "test/test_gpx_parser.rb",
+ "test/test_lap.rb",
+ "test/test_tcx_parser.rb",
+ "test/test_track_point.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
+ else
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
+ end
+ else
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
+ end
end
+
@@ -4,7 +4,9 @@
require 'flexmock'
require 'flexmock/test_unit'
-require 'lib/garmin'
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+require 'garmin'
def tcx_fixture_file
File.join(File.dirname(__FILE__), 'fixtures', 'example.tcx')
View
@@ -1,4 +1,4 @@
-require 'test/garmin_test_setup'
+require 'helper'
class TestActivity < Test::Unit::TestCase
should "have a date" do
View
@@ -1,4 +1,4 @@
-require 'test/garmin_test_setup'
+require 'helper'
class TestDb < Test::Unit::TestCase
context "exist" do
View
@@ -1,4 +1,4 @@
-require 'test/garmin_test_setup'
+require 'helper'
class TestGarmin < Test::Unit::TestCase
context "methods" do
View
@@ -1,4 +1,4 @@
-require 'test/garmin_test_setup'
+require 'helper'
class TestGpxParser < Test::Unit::TestCase
context "existence" do
View
@@ -1,4 +1,4 @@
-require 'test/garmin_test_setup'
+require 'helper'
class TestLap < Test::Unit::TestCase
should "exist" do
View
@@ -1,4 +1,4 @@
-require 'test/garmin_test_setup'
+require 'helper'
class TestTcxParser < Test::Unit::TestCase
context "existance" do
View
@@ -1,4 +1,4 @@
-require 'test/garmin_test_setup'
+require 'helper'
class TestTrackPoint < Test::Unit::TestCase
context "setup" do

0 comments on commit f9710a6

Please sign in to comment.