Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

load jasmine.rake using a Railtie if available (Rails >= 3.0) instead…

… of copying it into the project
  • Loading branch information...
commit 600068ee9ee509bcd7e47cd8d4e4dbf2548c2ee7 1 parent 16aee04
Nate Clark heythisisnate authored
Showing with 49 additions and 90 deletions.
  1. +24 −76 Gemfile.lock
  2. +15 −14 generators/jasmine/jasmine_generator.rb
  3. +10 −0 lib/jasmine.rb
100 Gemfile.lock
View
@@ -9,82 +9,33 @@ PATH
GEM
remote: http://rubygems.org/
specs:
- abstract (1.0.0)
- actionmailer (3.0.3)
- actionpack (= 3.0.3)
- mail (~> 2.2.9)
- actionpack (3.0.3)
- activemodel (= 3.0.3)
- activesupport (= 3.0.3)
- builder (~> 2.1.2)
- erubis (~> 2.6.6)
- i18n (~> 0.4)
- rack (~> 1.2.1)
- rack-mount (~> 0.6.13)
- rack-test (~> 0.5.6)
- tzinfo (~> 0.3.23)
- activemodel (3.0.3)
- activesupport (= 3.0.3)
- builder (~> 2.1.2)
- i18n (~> 0.4)
- activerecord (3.0.3)
- activemodel (= 3.0.3)
- activesupport (= 3.0.3)
- arel (~> 2.0.2)
- tzinfo (~> 0.3.23)
- activeresource (3.0.3)
- activemodel (= 3.0.3)
- activesupport (= 3.0.3)
- activesupport (3.0.3)
- arel (2.0.6)
- builder (2.1.2)
- diff-lcs (1.1.2)
- erubis (2.6.6)
- abstract (>= 1.0.0)
- gem-release (0.0.15)
- i18n (0.5.0)
+ actionmailer (2.3.10)
+ actionpack (= 2.3.10)
+ actionpack (2.3.10)
+ activesupport (= 2.3.10)
+ rack (~> 1.1.0)
+ activerecord (2.3.10)
+ activesupport (= 2.3.10)
+ activeresource (2.3.10)
+ activesupport (= 2.3.10)
+ activesupport (2.3.10)
+ gem-release (0.0.16)
json_pure (1.4.6)
- mail (2.2.12)
- activesupport (>= 2.3.6)
- i18n (>= 0.4.0)
- mime-types (~> 1.16)
- treetop (~> 1.4.8)
- mime-types (1.16)
- polyglot (0.3.1)
- rack (1.2.1)
- rack-mount (0.6.13)
- rack (>= 1.0.0)
- rack-test (0.5.6)
+ rack (1.1.0)
+ rack-test (0.5.7)
rack (>= 1.0)
- rails (3.0.3)
- actionmailer (= 3.0.3)
- actionpack (= 3.0.3)
- activerecord (= 3.0.3)
- activeresource (= 3.0.3)
- activesupport (= 3.0.3)
- bundler (~> 1.0)
- railties (= 3.0.3)
- railties (3.0.3)
- actionpack (= 3.0.3)
- activesupport (= 3.0.3)
- rake (>= 0.8.7)
- thor (~> 0.14.4)
+ rails (2.3.10)
+ actionmailer (= 2.3.10)
+ actionpack (= 2.3.10)
+ activerecord (= 2.3.10)
+ activeresource (= 2.3.10)
+ activesupport (= 2.3.10)
+ rake (>= 0.8.3)
rake (0.8.7)
- rspec (2.2.0)
- rspec-core (~> 2.2)
- rspec-expectations (~> 2.2)
- rspec-mocks (~> 2.2)
- rspec-core (2.2.1)
- rspec-expectations (2.2.0)
- diff-lcs (~> 1.1.2)
- rspec-mocks (2.2.0)
+ rspec (1.3.1)
selenium-client (1.2.18)
selenium-rc (2.2.4)
selenium-client (>= 1.2.18)
- thor (0.14.6)
- treetop (1.4.9)
- polyglot (>= 0.3.1)
- tzinfo (0.3.23)
PLATFORMS
ruby
@@ -92,10 +43,7 @@ PLATFORMS
DEPENDENCIES
gem-release
jasmine!
- json_pure (~> 1.4.3)
- rack (>= 1.2.1)
+ rack (= 1.1)
rack-test
- rails (> 3.0.2)
- rspec (>= 2.0)
- selenium-client (>= 1.2.18)
- selenium-rc (>= 2.2.1)
+ rails (= 2.3.10)
+ rspec (= 1.3.1)
29 generators/jasmine/jasmine_generator.rb
View
@@ -1,27 +1,28 @@
class JasmineGenerator < Rails::Generator::Base
def manifest
- record do |m|
+ m = Rails::Generator::Manifest.new
- m.directory "public/javascripts"
- m.file "jasmine-example/src/Player.js", "public/javascripts/Player.js"
- m.file "jasmine-example/src/Song.js", "public/javascripts/Song.js"
+ m.directory "public/javascripts"
+ m.file "jasmine-example/src/Player.js", "public/javascripts/Player.js"
+ m.file "jasmine-example/src/Song.js", "public/javascripts/Song.js"
- m.directory "spec/javascripts"
- m.file "jasmine-example/spec/PlayerSpec.js", "spec/javascripts/PlayerSpec.js"
+ m.directory "spec/javascripts"
+ m.file "jasmine-example/spec/PlayerSpec.js", "spec/javascripts/PlayerSpec.js"
- m.directory "spec/javascripts/helpers"
- m.file "jasmine-example/spec/SpecHelper.js", "spec/javascripts/helpers/SpecHelper.js"
+ m.directory "spec/javascripts/helpers"
+ m.file "jasmine-example/spec/SpecHelper.js", "spec/javascripts/helpers/SpecHelper.js"
- m.directory "spec/javascripts/support"
- m.file "spec/javascripts/support/jasmine_runner.rb", "spec/javascripts/support/jasmine_runner.rb"
- m.file "spec/javascripts/support/jasmine_config.rb", "spec/javascripts/support/jasmine_config.rb"
- m.file "spec/javascripts/support/jasmine-rails.yml", "spec/javascripts/support/jasmine.yml"
+ m.directory "spec/javascripts/support"
+ m.file "spec/javascripts/support/jasmine_runner.rb", "spec/javascripts/support/jasmine_runner.rb"
+ m.file "spec/javascripts/support/jasmine_config.rb", "spec/javascripts/support/jasmine_config.rb"
+ m.file "spec/javascripts/support/jasmine-rails.yml", "spec/javascripts/support/jasmine.yml"
+ m.readme "INSTALL"
+ unless Gem.available?('rails', '>= 3.0')
m.directory "lib/tasks"
m.file "lib/tasks/jasmine.rake", "lib/tasks/jasmine.rake"
-
- m.readme "INSTALL"
end
+ m
end
def file_name
10 lib/jasmine.rb
View
@@ -10,3 +10,13 @@
jasmine_files.each do |file|
require File.join('jasmine', file)
end
+
+if Jasmine.rails3?
+ module Jasmine
+ class Railtie < Rails::Railtie
+ rake_tasks do
+ load "jasmine/tasks/jasmine.rake"
+ end
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.