Permalink
Browse files

Removed faulty gemspec history

  • Loading branch information...
1 parent 8e8063f commit 6e3e0b7c6b4e7579329ee2b8b9646a1092252800 Todd Blackman committed Jul 9, 2012
Showing with 274 additions and 86 deletions.
  1. +4 −0 .gitignore
  2. +12 −0 .travis.yml
  3. +3 −0 Gemfile
  4. +4 −0 Gemfile.rake-0.8.7
  5. +4 −0 Gemfile.rake-0.9.2.2
  6. +0 −54 README
  7. +78 −0 README.md
  8. +1 −0 Rakefile
  9. +30 −12 lib/rake/hooks.rb
  10. +5 −0 lib/rake/hooks/version.rb
  11. +22 −8 rake-hooks.gemspec
  12. +111 −12 test/test_rake_hooks.rb
View
@@ -0,0 +1,4 @@
+*.gem
+.bundle
+Gemfile.lock
+pkg/*
View
@@ -0,0 +1,12 @@
+language: ruby
+rvm:
+ - 1.8.7
+ - 1.9.2
+ - 1.9.3
+ - jruby-18mode # JRuby in 1.8 mode
+ - jruby-19mode # JRuby in 1.9 mode
+ - rbx-18mode
+script: rake test
+gemfile:
+ - Gemfile.rake-0.8.7
+ - Gemfile.rake-0.9.2.2
View
@@ -0,0 +1,3 @@
+source "http://rubygems.org"
+
+gemspec
View
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+gem "rake", "0.8.7"
+gemspec
View
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+gem "rake", "0.9.2.2"
+gemspec
View
54 README
@@ -1,54 +0,0 @@
-# rake-hooks
-
-Rake hooks let you add callbacks to rake:
-
-## Usage
-
-For example in your Rakefile
-
- require 'rake/hooks'
-
- task :say_hello do
- puts "Good Morning !"
- end
-
- after :say_hello do
- puts "GoodBye"
- end
-
- after :say_hello do
- puts "Now go to bed !"
- end
-
- before :say_hello do
- puts "Hi !"
- end
-
-Now run with rake
-
- $ rake say_hello
- Hi !
- Good Morning !
- GoodBye
- Now go to bed !"
-
-
-## Installation
-
-With rubygems use:
- gem install rake-hooks
-
-With other systems
- Add lib dir to load path.
-
-## Author
-
-Guillermo Álvarez <guillermo@cientifico.net>
-
-## Web
-
-http://github.com/guillermo/rake-hooks
-
-## Date of writing
-
-22 Jul 2010
View
@@ -0,0 +1,78 @@
+# rake-hooks
+
+Rake hooks let you add callbacks to rake:
+
+[![Build Status](https://secure.travis-ci.org/guillermo/rake-hooks.png)](http://travis-ci.org/guillermo/rake-hooks)
+[![endorse](http://api.coderwall.com/guillermo/endorsecount.png)](http://coderwall.com/guillermo)
+
+
+## Usage
+
+For example in your Rakefile
+
+```ruby
+require 'rake/hooks'
+
+task :say_hello do
+ puts "Good Morning !"
+end
+
+after :say_hello do
+ puts "GoodBye"
+end
+
+after :say_hello do
+ puts "Now go to bed !"
+end
+
+before :say_hello do
+ puts "Hi !"
+end
+```
+
+Now run with rake
+
+```bash
+$ rake say_hello
+Hi !
+Good Morning !
+GoodBye
+Now go to bed !
+```
+
+You can also pass more than one task and each task will be setup with the
+callback
+
+```ruby
+before :say_hello, :say_goodbye do
+ puts "Hi !"
+end
+```
+
+
+## Installation
+
+With rubygems use:
+```bash
+$ gem install rake-hooks
+```
+
+With other systems
+ Add lib dir to load path.
+
+## Dependencies
+
+* Rake
+
+## Author
+
+* [Joel Moss](mailto:joel@developwithstyle.com)
+* [Guillermo Álvarez](mailto:guillermo@cientifico.net)
+
+## Web
+
+http://github.com/guillermo/rake-hooks
+
+## Date of writing
+
+9 Sep 2011
View
@@ -1,3 +1,4 @@
+require "bundler/gem_tasks"
require 'rake/testtask'
Rake::TestTask.new do |t|
View
@@ -1,16 +1,34 @@
-def before(task_name, &new_task)
- old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s)
- task task_name do
- new_task.call
- old_task.invoke
+module Rake::Hooks
+ def before(*task_names, &new_task)
+ task_names.each do |task_name|
+ old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s)
+ desc old_task.full_comment
+ task task_name => old_task.prerequisites do
+ new_task.call
+ old_task.invoke
+ end
+ end
end
-end
-def after(task_name, &new_task)
- old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s)
-
- task task_name do
- old_task.invoke
- new_task.call
+ def after(*task_names, &new_task)
+ options = task_names.last.is_a?(Hash) ? task_names.pop : {}
+ ignore_exceptions = options.delete(:ignore_exceptions) || false
+
+ task_names.each do |task_name|
+ old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s)
+ desc old_task.full_comment
+ task task_name => old_task.prerequisites do
+ begin
+ old_task.invoke
+ rescue
+ raise unless ignore_exceptions
+ end
+
+ new_task.call
+ end
+ end
end
end
+
+Rake::DSL.send(:include, Rake::Hooks) if defined?(Rake::DSL)
+include Rake::Hooks unless self.class.included_modules.include?(Rake::Hooks)
@@ -0,0 +1,5 @@
+module Rake
+ module Hooks
+ VERSION = "1.2.3"
+ end
+end
View
@@ -1,11 +1,25 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "rake/hooks/version"
+
Gem::Specification.new do |s|
- s.name = "rake-hooks"
- s.version = "0.1"
- s.date = "2010-06-22"
- s.authors = ["Guillermo Álvarez"]
- s.email = "guillermo@cientifico.net"
- s.summary = "Add after and before hooks to rake tasks"
- s.homepage = "http://github.com/guillermo/rake-hooks"
+ s.name = "rake-hooks"
+ s.version = Rake::Hooks::VERSION
+ s.email = ["guillermo@cientifico.net", "joel@developwithstyle.com"]
+ s.authors = ["Guillermo Álvarez", "Joel Moss"]
+ s.summary = "Add after and before hooks to rake tasks"
s.description = "Add after and before hooks to rake tasks. You can use \"after :task do ... end\" and \"before :task do ... end\"."
- s.files = [ "README", "LICENSE", "Rakefile", "test/test_rake_hooks.rb", "lib/rake/hooks.rb"]
+
+ s.rubyforge_project = "rake-hooks"
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
+ s.add_runtime_dependency "rake"
+
+ s.add_development_dependency "bundler"
end
+
+
Oops, something went wrong.

0 comments on commit 6e3e0b7

Please sign in to comment.