Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 68 lines (55 sloc) 1.667 kb
880ce0d @godfat builtin clients moved from rest-core!
godfat authored
1 # encoding: utf-8
2
3 require "#{dir = File.dirname(__FILE__)}/task/gemgem"
4 Gemgem.dir = dir
5
a357f9e @godfat Rakefile: use develop version (submodule) of rest-core to run rest-more
godfat authored
6 ($LOAD_PATH << File.expand_path("#{Gemgem.dir}/lib" ) <<
7 File.expand_path("#{Gemgem.dir}/rest-core/lib")).uniq!
880ce0d @godfat builtin clients moved from rest-core!
godfat authored
8
9 desc 'Generate gemspec'
10 task 'gem:spec' do
11 Gemgem.spec = Gemgem.create do |s|
12 require 'rest-more/version'
13 s.name = 'rest-more'
14 s.version = RestMore::VERSION
15 s.homepage = 'https://github.com/cardinalblue/rest-more'
16
17 %w[rest-core].each{ |g| s.add_runtime_dependency(g) }
18
19 s.authors = ['Cardinal Blue', 'Lin Jen-Shin (godfat)']
20 s.email = ['dev (XD) cardinalblue.com']
a73ea1c @godfat adding rest-core as a submodule for testing; exclude it from gems
godfat authored
21
22 # exclude rest-core
23 s.files.reject!{ |f| f.start_with?('rest-core/') }
880ce0d @godfat builtin clients moved from rest-core!
godfat authored
24 end
25
26 Gemgem.write
27 end
28
29 module Gemgem
30 module_function
31 def test_rails *rails
32 rails.each{ |framework|
33 opts = Rake.application.options
34 args = (opts.singleton_methods - [:rakelib, 'rakelib']).map{ |arg|
35 if arg.to_s !~ /=$/ && opts.send(arg)
36 "--#{arg}"
37 else
38 ''
39 end
40 }.join(' ')
41 Rake.sh "cd example/#{framework}; #{Gem.ruby} -S rake test #{args}"
42 }
43 end
44 end
45
46 desc 'Run example tests'
47 task 'test:example' do
48 Gemgem.test_rails('rails3', 'rails2')
49 end
50
51 desc 'Run all tests'
52 task 'test:all' => ['test', 'test:example']
53
54 desc 'Run different json test'
55 task 'test:json' do
56 %w[yajl json].each{ |json|
57 Rake.sh "#{Gem.ruby} -S rake -r #{json} test"
58 }
59 end
60
61 task 'test:travis' do
62 case ENV['RESTMORE']
63 when 'rails3'; Gemgem.test_rails('rails3')
64 when 'rails2'; Gemgem.test_rails('rails2')
65 else ; Rake::Task['test'].invoke
66 end
67 end
Something went wrong with that request. Please try again.