Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 103 lines (89 sloc) 2.746 kB
34be252 @mainej fix for rack 1.0.1 and specs under ruby 1.9.2
mainej authored
1 $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
0c82589 @xian Rearrange, refactor, ruin and raze.
xian authored
2 $LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/lib")
308dcba @ragaskar Minor bundler config updates
ragaskar authored
3 require "bundler"
4 Bundler.setup
0c82589 @xian Rearrange, refactor, ruin and raze.
xian authored
5
dd2523a @xian Specify dependency on RSpec 1.x and Rails 2.x.
xian authored
6 def rspec2?
7 Gem.available? "rspec", ">= 2.0"
8 end
9
10 def rails3?
11 Gem.available? "rails", ">= 3.0"
12 end
13
14 if rspec2?
15 require 'rspec'
16 require 'rspec/core/rake_task'
17 else
18 require 'spec'
19 require 'spec/rake/spectask'
20 end
0c82589 @xian Rearrange, refactor, ruin and raze.
xian authored
21
22 desc "Run all examples"
dd2523a @xian Specify dependency on RSpec 1.x and Rails 2.x.
xian authored
23 if rspec2?
24 RSpec::Core::RakeTask.new(:spec) do |t|
25 t.pattern = 'spec/**/*.rb'
26 end
27 else
28 Spec::Rake::SpecTask.new('spec') do |t|
29 t.spec_files = FileList['spec/**/*.rb']
30 end
0c82589 @xian Rearrange, refactor, ruin and raze.
xian authored
31 end
32
33 namespace :jasmine do
e4a5d56 @xian Rearrange, start adding specs.
xian authored
34 require 'spec/jasmine_self_test_config'
0c82589 @xian Rearrange, refactor, ruin and raze.
xian authored
35 task :server do
36 puts "your tests are here:"
435a53f Bypass redirect.
John Firebaugh authored
37 puts " http://localhost:8888/"
0c82589 @xian Rearrange, refactor, ruin and raze.
xian authored
38
e4a5d56 @xian Rearrange, start adding specs.
xian authored
39 JasmineSelfTestConfig.new.start_server
0c82589 @xian Rearrange, refactor, ruin and raze.
xian authored
40 end
382a5dd copy_examples step now turned into a separate task and made a prereq …
Davis Frank & Nathan Wilmes authored
41
42 desc "Copy examples from Jasmine JS to the gem"
43 task :copy_examples_to_gem do
daed866 Really? "File.exist?", not "File.exists?"? Whatever.
Christian Williams authored
44 unless File.exist?('jasmine/lib')
382a5dd copy_examples step now turned into a separate task and made a prereq …
Davis Frank & Nathan Wilmes authored
45 raise "Jasmine submodule isn't present. Run git submodule update --init"
46 end
47
9234830 Switched copy_examples to basic ruby script
Davis Frank & Nathan Wilmes authored
48 system "ruby copy_examples.rb"
382a5dd copy_examples step now turned into a separate task and made a prereq …
Davis Frank & Nathan Wilmes authored
49 end
0c82589 @xian Rearrange, refactor, ruin and raze.
xian authored
50 end
51
52 desc "Run specs via server"
53 task :jasmine => ['jasmine:server']
54
504ba8c @ragaskar First crack at jasmine-ruby
ragaskar authored
55 namespace :jeweler do
56 begin
308dcba @ragaskar Minor bundler config updates
ragaskar authored
57 require "jeweler"
504ba8c @ragaskar First crack at jasmine-ruby
ragaskar authored
58 Jeweler::Tasks.new do |gemspec|
92e6716 @pivotalops Resolve merge conflicts
pivotalops authored
59 gemspec.name = "jasmine"
2e8d508 @xian Update web url.
xian authored
60 gemspec.summary = "Jasmine Runner for Ruby"
92e6716 @pivotalops Resolve merge conflicts
pivotalops authored
61 gemspec.description = "Javascript BDD test framework"
c437970 @xian Change gem email address.
xian authored
62 gemspec.email = "jasmine-js@googlegroups.com"
2e8d508 @xian Update web url.
xian authored
63 gemspec.homepage = "http://pivotal.github.com/jasmine"
1ebd9e3 @xian Add Davis to authors.
xian authored
64 gemspec.authors = ["Rajan Agaskar", "Christian Williams", "Davis Frank"]
d2fe23b @pivotalops Only include jasmine from bin
pivotalops authored
65 gemspec.executables = ["jasmine"]
382a5dd copy_examples step now turned into a separate task and made a prereq …
Davis Frank & Nathan Wilmes authored
66 gemspec.add_dependency('rake', '>= 0.8.7')
61dc808 updating gem dependencies and bumping version to 1.0.1.1rc2
Nate Clark & Winston Teo authored
67 gemspec.add_dependency('rspec', '>= 1.1.5')
382a5dd copy_examples step now turned into a separate task and made a prereq …
Davis Frank & Nathan Wilmes authored
68 gemspec.add_dependency('rack', '>= 1.0.0')
69 gemspec.add_dependency('selenium-rc', '>=2.1.0')
70 gemspec.add_dependency('selenium-client', '>=1.2.17')
71 gemspec.add_dependency('json_pure', '>=1.4.3')
72 end
73 Jeweler::GemcutterTasks.new
74 end
75
b6e0c27 Check for generated jasmine sources before jeweler runs.
Christian Williams authored
76 task :verify_build do
77 [
78 'jasmine/lib/jasmine.css',
79 'jasmine/lib/jasmine.js',
80 'jasmine/lib/jasmine-html.js',
81 ].each {|f| raise "Missing file #{f}" unless File.exist?(f)}
82 end
83
382a5dd copy_examples step now turned into a separate task and made a prereq …
Davis Frank & Nathan Wilmes authored
84 task :setup_filelist do
85 Rake.application.jeweler_tasks.gemspec.files = FileList.new(
6a75984 Explicitly enumerate required files in lib.
Lee Byrd & Christian Williams authored
86 'generators/**/**',
87 'lib/**/**',
88 'jasmine/lib/jasmine.css',
89 'jasmine/lib/jasmine.js',
920e918 Rails generator installs examples from Jasmine.
Lee Byrd & Christian Williams authored
90 'jasmine/lib/jasmine-html.js',
91 'jasmine/lib/json2.js', # try to get rid of this
92 'jasmine/example/**',
6a75984 Explicitly enumerate required files in lib.
Lee Byrd & Christian Williams authored
93 'tasks/**',
94 'templates/**'
95 )
504ba8c @ragaskar First crack at jasmine-ruby
ragaskar authored
96 end
97 end
382a5dd copy_examples step now turned into a separate task and made a prereq …
Davis Frank & Nathan Wilmes authored
98
b6e0c27 Check for generated jasmine sources before jeweler runs.
Christian Williams authored
99 Rake.application["jeweler:gemspec"].prerequisites.
100 unshift("jeweler:verify_build").
101 unshift("jeweler:setup_filelist").
102 unshift("jasmine:copy_examples_to_gem")
Something went wrong with that request. Please try again.