Permalink
Browse files

Should better handle auto-require for rake tasks in Rails, and DRY up…

… other rake tasks
  • Loading branch information...
1 parent ca52c4c commit d054b7306ec61b4e87fab6f906fd7426f9cae82f @deadprogram deadprogram committed Nov 14, 2012
Showing with 22 additions and 23 deletions.
  1. +11 −5 README.md
  2. +4 −17 Rakefile
  3. +1 −1 lib/gitnesse.rb
  4. +6 −0 lib/gitnesse/tasks.rb
View
@@ -25,20 +25,26 @@ the following to it:
repository_url "git@github.com:hybridgroup/gitnesse-demo.wiki"
end
-## Usage
+## Usage In Rails 3
For Rails 3 there is a rake task:
$ rake gitnesse
-Not Rails 3 ? There is available an executable that requires the path to the configuration file:
+There is an example application using Rails 3 located here: [https://github.com/hybridgroup/gitnesse-example-rails](https://github.com/hybridgroup/gitnesse-example-rails)
- $ GITNESSE_CONFIG='./gitnesse_config.rb' gitnesse
-
-## Usage
+## Usage In Sinatra
For Rails 3 there is a rake task:
+There is an example application using Sinatra located here: [https://github.com/hybridgroup/gitnesse-example-sinatra](https://github.com/hybridgroup/gitnesse-example-sinatra)
+
+## Other Usage
+
+Want to use plain old Gitnesse? There is an executable that requires the path to the configuration file:
+
+ $ GITNESSE_CONFIG='./gitnesse_config.rb' gitnesse
+
## TODO
- implement git push back to git wiki
View
@@ -2,6 +2,7 @@
require "bundler/gem_tasks"
require 'rake/testtask'
require_relative 'lib/gitnesse'
+require_relative 'lib/gitnesse/tasks'
Rake::TestTask.new do |t|
t.libs << 'lib/gitnesse'
@@ -10,21 +11,7 @@ Rake::TestTask.new do |t|
end
task :default => :test
-namespace :gitnesse do
- desc "Push local features to remote git-based wiki."
- task :push do
- Gitnesse.load_config
- Gitnesse.push
- end
-
- desc "Pull remote features from git-based wiki to local."
- task :pull do
- Gitnesse.load_config
- Gitnesse.pull
- end
-
- desc "Dump the current config info to the console."
- task :info do
- puts Gitnesse.config_to_hash.to_yaml
- end
+task :environment do
end
+
+Gitnesse::Tasks.new
View
@@ -2,7 +2,7 @@
require 'gollum'
require 'fileutils'
require 'tmpdir'
-require 'gitnesse/railtie' if defined?(Rails::Railtie)
+require 'gitnesse/railtie' if defined?(Rails)
# core module
module Gitnesse
View
@@ -22,6 +22,12 @@ def initialize
Gitnesse.load_config
Gitnesse.push
end
+
+ desc "Dump the current config info to the console."
+ task :info => :environment do
+ Gitnesse.load_config
+ puts Gitnesse.config_to_hash.to_yaml
+ end
end
end
end

0 comments on commit d054b73

Please sign in to comment.