summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorfelix <felix@seconddrawer.com.au>2011-10-28 09:15:24 +0000
committerfelix <felix@seconddrawer.com.au>2011-10-28 09:15:24 +0000
commit874406c3fe8dbbd9f58e7ab2a2311335cce84775 (patch)
tree1963132aad75c82f298c5818b378dbf744eb86b0 /Rakefile
parent696ac343950df685a31349f6acd613acee967992 (diff)
downloadtimetrackr-master.tar.gz
timetrackr-master.tar.bz2
clean up all the gem stuffHEADmaster
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile90
1 files changed, 76 insertions, 14 deletions
diff --git a/Rakefile b/Rakefile
index 7176883..f121d33 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,18 +1,80 @@
require 'rubygems'
require 'bundler'
-begin
- Bundler.setup(:default, :development)
-rescue Bundler::BundlerError => e
- $stderr.puts e.message
- $stderr.puts "Run `bundle install` to install missing gems"
- exit e.status_code
+require "rubygems/package_task"
+require "rdoc/task"
+require "rake/testtask"
+Rake::TestTask.new do |t|
+ t.libs << "test"
+ t.test_files = FileList["test/**/*_test.rb"]
+ t.verbose = true
end
-require 'rake'
-
-require 'echoe'
-Echoe.new('timetrackr') do |g|
- g.author = 'Felix Hanley'
- g.email = 'felix@seconddrawer.com.au'
- g.summary = 'A simple time tracking utility'
- g.url = 'https://github.com/felix/timetrackr'
+
+task :default => ["test"]
+
+# This builds the actual gem. For details of what all these options
+# mean, and other ones you can add, check the documentation here:
+#
+# http://rubygems.org/read/chapter/20
+#
+spec = Gem::Specification.new do |s|
+
+ # Change these as appropriate
+ s.name = "timetrackr"
+ s.version = "0.2.0"
+ s.summary = "A simple time tracking utility"
+ s.author = "Felix Hanley"
+ s.email = "felix@seconddrawer.com.au"
+ s.homepage = "http://github.com/felix/timetrackr"
+
+ s.has_rdoc = true
+ s.extra_rdoc_files = %w(README)
+ s.rdoc_options = %w(--main README)
+
+ # Add any extra files to include in the gem
+ s.files = %w(Rakefile Gemfile Gemfile.lock LICENSE README CHANGELOG Manifest TODO) + Dir.glob("{bin,test,lib}/**/*")
+ s.executables = FileList["bin/**"].map { |f| File.basename(f) }
+ 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")
+
+ # If your tests use any gems, include them here
+ # s.add_development_dependency("mocha") # for example
+end
+
+# This task actually builds the gem. We also regenerate a static
+# .gemspec file, which is useful if something (i.e. GitHub) will
+# be automatically building a gem for this project. If you're not
+# using GitHub, edit as appropriate.
+#
+# To publish your gem online, install the 'gemcutter' gem; Read more
+# about that here: http://gemcutter.org/pages/gem_docs
+Gem::PackageTask.new(spec) do |pkg|
+ pkg.gem_spec = spec
+end
+
+desc "Build the gemspec file #{spec.name}.gemspec"
+task :gemspec do
+ file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
+ File.open(file, "w") {|f| f << spec.to_ruby }
+end
+
+# If you don't want to generate the .gemspec file, just remove this line. Reasons
+# why you might want to generate a gemspec:
+# - using bundler with a git source
+# - building the gem without rake (i.e. gem build blah.gemspec)
+# - maybe others?
+task :package => :gemspec
+
+# Generate documentation
+RDoc::Task.new do |rd|
+ rd.main = "README"
+ rd.rdoc_files.include("README", "lib/**/*.rb")
+ rd.rdoc_dir = "rdoc"
+end
+
+desc 'Clear out RDoc and generated packages'
+task :clean => [:clobber_rdoc, :clobber_package] do
+ rm "#{spec.name}.gemspec"
end