singem 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -5
- data/bin/singem +1 -2
- data/lib/generators/cucumber/cucumber_generator.rb +1 -1
- data/lib/generators/cucumber/templates/Gemfile +22 -0
- data/lib/generators/cucumber/templates/LICENSE +1 -1
- data/lib/generators/cucumber/templates/README.md +6 -0
- data/lib/generators/cucumber/templates/Rakefile +27 -27
- data/lib/generators/cucumber/templates/config.ru.erb +4 -7
- data/lib/generators/cucumber/templates/features/basics.feature.erb +5 -4
- data/lib/generators/cucumber/templates/features/support/env.rb.erb +10 -4
- data/lib/generators/cucumber/templates/lib/templates.rb.erb +8 -1
- data/lib/generators/cucumber/templates/spec/spec_helper.rb.erb +10 -14
- data/lib/generators/twitter/templates/Gemfile +27 -0
- data/lib/generators/twitter/templates/README.md +6 -0
- data/lib/generators/twitter/templates/Rakefile +29 -28
- data/lib/generators/twitter/templates/config.ru.erb +4 -7
- data/lib/generators/twitter/templates/features/support/env.rb.erb +9 -1
- data/lib/generators/twitter/templates/lib/templates.rb.erb +10 -11
- data/lib/generators/twitter/templates/lib/templates/{sinatra/app.rb.erb → app.rb.erb} +1 -2
- data/lib/generators/twitter/templates/spec/helpers.rb.erb +1 -8
- data/lib/generators/twitter/templates/spec/spec_helper.rb.erb +12 -6
- data/lib/generators/twitter/twitter_generator.rb +2 -2
- metadata +12 -69
- data/lib/generators/singem/USAGE +0 -5
- data/lib/generators/singem/singem_generator.rb +0 -77
- data/lib/generators/singem/templates/LICENSE +0 -20
- data/lib/generators/singem/templates/README.md +0 -4
- data/lib/generators/singem/templates/Rakefile +0 -66
- data/lib/generators/singem/templates/TODO +0 -4
- data/lib/generators/singem/templates/config.ru.erb +0 -11
- data/lib/generators/singem/templates/lib/templates.rb.erb +0 -9
- data/lib/generators/singem/templates/lib/templates/app.rb.erb +0 -7
- data/lib/generators/singem/templates/spec/fixtures.rb.erb +0 -0
- data/lib/generators/singem/templates/spec/spec_helper.rb.erb +0 -40
- data/lib/generators/singem/templates/spec/templates_spec.rb.erb +0 -8
- data/lib/generators/twitter/templates/features/adding_items_from_the_bookmarklet.feature +0 -16
- data/lib/generators/twitter/templates/features/adding_items_to_my_wishlist.feature +0 -19
- data/lib/generators/twitter/templates/features/viewing_my_wish_list.feature +0 -14
- data/lib/generators/twitter/templates/features/viewing_the_site_for_the_first_time.feature +0 -6
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'date'
|
|
5
5
|
require 'spec/rake/spectask'
|
6
6
|
|
7
7
|
GEM = "singem"
|
8
|
-
GEM_VERSION = "0.0.
|
8
|
+
GEM_VERSION = "0.0.5"
|
9
9
|
AUTHOR = "Corey Donohoe"
|
10
10
|
EMAIL = "atmos@atmos.org"
|
11
11
|
HOMEPAGE = "http://github.com/atmos/singem"
|
@@ -24,11 +24,9 @@ spec = Gem::Specification.new do |s|
|
|
24
24
|
s.homepage = HOMEPAGE
|
25
25
|
|
26
26
|
s.add_dependency "sinatra", ">=0.9.2"
|
27
|
-
s.add_dependency "
|
28
|
-
s.add_dependency "rack-test", "~>0.3.0"
|
27
|
+
s.add_dependency "rack-test", ">=0.4.0"
|
29
28
|
s.add_dependency "webrat", "~>0.4.4"
|
30
|
-
s.add_dependency "fakeweb", "~>1.2.
|
31
|
-
s.add_dependency 'haml', "~>2.0.9"
|
29
|
+
s.add_dependency "fakeweb", "~>1.2.5"
|
32
30
|
|
33
31
|
s.bindir = "bin"
|
34
32
|
s.executables = %w( singem )
|
data/bin/singem
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'rubigen'
|
5
|
+
require 'digest/sha1'
|
5
6
|
|
6
7
|
if %w(-v --version).include? ARGV.first
|
7
8
|
require File.dirname(__FILE__) + "/../lib/newgem"
|
@@ -19,8 +20,6 @@ RubiGen::Base.prepend_sources(*[
|
|
19
20
|
|
20
21
|
if ARGV.delete "--twitter"
|
21
22
|
RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'twitter', :backtrace => true)
|
22
|
-
elsif ARGV.delete "--old-school"
|
23
|
-
RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'singem', :backtrace => true)
|
24
23
|
else
|
25
24
|
RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'cucumber', :backtrace => true)
|
26
25
|
end
|
@@ -37,7 +37,7 @@ class CucumberGenerator < RubiGen::Base
|
|
37
37
|
m.template "spec/templates_spec.rb.erb", "spec/#{name}_spec.rb"
|
38
38
|
m.template "spec/fixtures.rb.erb", "spec/fixtures.rb"
|
39
39
|
|
40
|
-
%w(LICENSE Rakefile README.md).each do |file|
|
40
|
+
%w(LICENSE Rakefile README.md Gemfile).each do |file|
|
41
41
|
m.template file, file
|
42
42
|
end
|
43
43
|
%w(TODO).each do |file|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
gem 'rack_hoptoad', '>=0.0.3'
|
2
|
+
gem 'haml', '~>2.2.0'
|
3
|
+
gem 'sinatra', '~>0.9.4'
|
4
|
+
|
5
|
+
#gem 'do_sqlite3', '>=0.9.12'
|
6
|
+
#gem 'dm-validations', '>=0.9.11'
|
7
|
+
#gem 'dm-timestamps', '>=0.9.11'
|
8
|
+
|
9
|
+
gem 'rake', :only => [:test]
|
10
|
+
gem 'rspec', :only => [:test]
|
11
|
+
gem 'rcov', :only => [:test]
|
12
|
+
gem 'bundler', '>=0.5.0', :only => [:test]
|
13
|
+
gem 'cucumber', :only => [:test]
|
14
|
+
gem 'webrat', '~>0.5.0', :only => [:test]
|
15
|
+
gem 'rack-test', '~>0.4.2', :only => [:test]
|
16
|
+
gem 'fakeweb', '>=1.2.5', :only => [:test]
|
17
|
+
gem 'ParseTree', '>=3.0.4', :only => [:test]
|
18
|
+
gem 'randexp', '>=0.1.4', :only => [:test]
|
19
|
+
|
20
|
+
disable_system_gems
|
21
|
+
|
22
|
+
# vim:ft=ruby
|
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
17
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,9 +1,29 @@
|
|
1
|
-
require '
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'vendor', 'gems', 'environment'))
|
2
2
|
require 'rake/gempackagetask'
|
3
3
|
require 'rubygems/specification'
|
4
4
|
require 'date'
|
5
|
-
require '
|
5
|
+
require 'bundler'
|
6
|
+
|
7
|
+
task :default => [:cucumber, :spec]
|
8
|
+
|
6
9
|
require 'cucumber/rake/task'
|
10
|
+
desc "Run cucumber"
|
11
|
+
Cucumber::Rake::Task.new do |t|
|
12
|
+
t.cucumber_opts = %w{--format pretty}
|
13
|
+
end
|
14
|
+
|
15
|
+
require 'spec/rake/spectask'
|
16
|
+
desc "Run specs"
|
17
|
+
Spec::Rake::SpecTask.new do |t|
|
18
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
19
|
+
t.spec_opts = %w(-fs --color)
|
20
|
+
t.spec_opts << '--loadby' << 'random'
|
21
|
+
|
22
|
+
t.rcov_opts << '--exclude' << 'spec'
|
23
|
+
t.rcov = ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true
|
24
|
+
t.rcov_opts << '--text-summary'
|
25
|
+
t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
|
26
|
+
end
|
7
27
|
|
8
28
|
GEM = "<%= name %>"
|
9
29
|
GEM_VERSION = "0.0.1"
|
@@ -24,12 +44,11 @@ spec = Gem::Specification.new do |s|
|
|
24
44
|
s.email = EMAIL
|
25
45
|
s.homepage = HOMEPAGE
|
26
46
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
s.add_dependency 'haml', "~>2.0.9"
|
47
|
+
manifest = Bundler::Environment.load(File.dirname(__FILE__) + '/Gemfile')
|
48
|
+
manifest.dependencies.each do |d|
|
49
|
+
next if d.only && d.only.include?('test')
|
50
|
+
s.add_dependency(d.name, d.version)
|
51
|
+
end
|
33
52
|
|
34
53
|
s.require_path = 'lib'
|
35
54
|
s.autorequire = GEM
|
@@ -52,22 +71,3 @@ task :make_spec do
|
|
52
71
|
end
|
53
72
|
end
|
54
73
|
|
55
|
-
task :default => :features
|
56
|
-
|
57
|
-
desc "Run cucumber"
|
58
|
-
Cucumber::Rake::Task.new do |t|
|
59
|
-
t.cucumber_opts = %w{--format pretty}
|
60
|
-
end
|
61
|
-
|
62
|
-
|
63
|
-
desc "Run specs"
|
64
|
-
Spec::Rake::SpecTask.new do |t|
|
65
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
66
|
-
t.spec_opts = %w(-fs --color)
|
67
|
-
t.spec_opts << '--loadby' << 'random'
|
68
|
-
|
69
|
-
t.rcov_opts << '--exclude' << 'spec'
|
70
|
-
t.rcov = ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true
|
71
|
-
t.rcov_opts << '--text-summary'
|
72
|
-
t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
|
73
|
-
end
|
@@ -1,11 +1,8 @@
|
|
1
|
-
require '
|
2
|
-
require '<%= name %>'
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'vendor', 'gems', 'environment'))
|
2
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'lib', '<%= name %>'))
|
3
3
|
|
4
4
|
#DataMapper.setup(:default, "mysql://atmos:fail@localhost/<%= name.capitalize %>_production")
|
5
5
|
|
6
|
-
|
7
|
-
set :public, File.expand_path(File.dirname(__FILE__), "public")
|
8
|
-
set :environment, :production
|
9
|
-
end
|
6
|
+
use Rack::Static, :urls => ["/css", "/img", "/js"], :root => "public"
|
10
7
|
|
11
|
-
run <%= name.camelize
|
8
|
+
run <%= name.camelize %>.app
|
@@ -1,6 +1,7 @@
|
|
1
1
|
Feature: Visiting the Home Page
|
2
|
-
In order to display a splash page
|
2
|
+
In order to display a splash page
|
3
3
|
As an anonymous user
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
|
5
|
+
Scenario: Seeing the splash page
|
6
|
+
When I visit the home page
|
7
|
+
Then I should be greeted
|
@@ -1,7 +1,15 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'vendor', 'gems', 'environment'))
|
2
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'lib', '<%= name %>')
|
1
3
|
require 'spec'
|
2
4
|
require 'webrat'
|
3
5
|
require 'rack/test'
|
4
|
-
require
|
6
|
+
require 'fakeweb'
|
7
|
+
|
8
|
+
Webrat.configure do |config|
|
9
|
+
config.mode = :rack
|
10
|
+
config.application_port = 4567
|
11
|
+
end
|
12
|
+
|
5
13
|
module <%= name.camelize %>::AppHelpers
|
6
14
|
begin
|
7
15
|
gem 'safariwatir', '~>0.3.3'
|
@@ -17,9 +25,7 @@ module <%= name.camelize %>::AppHelpers
|
|
17
25
|
end
|
18
26
|
|
19
27
|
def app
|
20
|
-
|
21
|
-
run <%= name.camelize %>::App
|
22
|
-
end
|
28
|
+
<%= name.camelize %>.app
|
23
29
|
end
|
24
30
|
end
|
25
31
|
|
@@ -1,9 +1,16 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'sinatra/base'
|
3
2
|
require 'haml/util'
|
4
3
|
require 'haml/engine'
|
5
4
|
|
6
5
|
module <%= name.camelize %>
|
6
|
+
def self.app
|
7
|
+
@app ||= Rack::Builder.new do
|
8
|
+
# use Rack::HoptoadNotifier 'mysecretkey'
|
9
|
+
# use Rack::Session::Cookie, :key => 'rack.session', :path => '/',
|
10
|
+
# :expire_after => 2592000, :secret => '<%= ::Digest::SHA1.hexdigest(Time.now.to_s) %>'
|
11
|
+
run <%= name.camelize %>::App
|
12
|
+
end
|
13
|
+
end
|
7
14
|
end
|
8
15
|
|
9
16
|
require File.dirname(__FILE__)+'/<%= name %>/app'
|
@@ -1,11 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require '
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', 'gems', 'environment'))
|
2
|
+
|
3
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', '<%= name %>')
|
4
|
+
|
4
5
|
require 'randexp'
|
5
|
-
require '<%= name %>'
|
6
|
-
#require 'dm-core'
|
7
6
|
require 'rack/test'
|
8
|
-
require 'webrat
|
7
|
+
require 'webrat'
|
8
|
+
#require 'dm-core'
|
9
9
|
#require 'dm-sweatshop'
|
10
10
|
require 'fakeweb'
|
11
11
|
require 'pp'
|
@@ -15,11 +15,9 @@ FakeWeb.allow_net_connect = false
|
|
15
15
|
#require File.dirname(__FILE__)+'/fixtures'
|
16
16
|
#DataMapper.setup(:default, 'sqlite3::memory:')
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
@read = true
|
22
|
-
end
|
18
|
+
Webrat.configure do |config|
|
19
|
+
config.mode = :rack
|
20
|
+
config.application_port = 4567
|
23
21
|
end
|
24
22
|
|
25
23
|
Spec::Runner.configure do |config|
|
@@ -33,8 +31,6 @@ Spec::Runner.configure do |config|
|
|
33
31
|
end
|
34
32
|
|
35
33
|
def app
|
36
|
-
|
37
|
-
run <%= name.camelize %>::App
|
38
|
-
end
|
34
|
+
<%= name.camelize %>.app
|
39
35
|
end
|
40
36
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
gem 'rack_hoptoad', '>=0.0.3'
|
2
|
+
gem 'haml', '~>2.2.0'
|
3
|
+
gem 'sinatra', '~>0.9.4'
|
4
|
+
gem 'curb', '>=0.3.7'
|
5
|
+
gem 'json', '>=1.1.6'
|
6
|
+
gem 'oauth', '=0.3.2'
|
7
|
+
|
8
|
+
gem 'do_sqlite3', '>=0.9.12'
|
9
|
+
gem 'dm-validations', '>=0.9.11'
|
10
|
+
gem 'dm-timestamps', '>=0.9.11'
|
11
|
+
|
12
|
+
|
13
|
+
gem 'rake', :only => [:test]
|
14
|
+
gem 'rspec', :only => [:test]
|
15
|
+
gem 'rcov', :only => [:test]
|
16
|
+
gem 'bundler', '>=0.5.0', :only => [:test]
|
17
|
+
gem 'cucumber', :only => [:test]
|
18
|
+
gem 'webrat', '~>0.5.0', :only => [:test]
|
19
|
+
gem 'rack-test', '~>0.4.2', :only => [:test]
|
20
|
+
gem 'fakeweb', '>=1.2.5', :only => [:test]
|
21
|
+
gem 'ParseTree', '>=3.0.4', :only => [:test]
|
22
|
+
gem 'randexp', '>=0.1.4', :only => [:test]
|
23
|
+
gem 'dm-sweatshop', '>=0.9.11', :only => [:test]
|
24
|
+
|
25
|
+
disable_system_gems
|
26
|
+
|
27
|
+
# vim:ft=ruby
|
@@ -1,7 +1,29 @@
|
|
1
|
-
require '
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'vendor', 'gems', 'environment'))
|
2
2
|
require 'rake/gempackagetask'
|
3
3
|
require 'rubygems/specification'
|
4
4
|
require 'date'
|
5
|
+
require 'bundler'
|
6
|
+
|
7
|
+
task :default => [:cucumber, :spec]
|
8
|
+
|
9
|
+
require 'cucumber/rake/task'
|
10
|
+
desc "Run cucumber"
|
11
|
+
Cucumber::Rake::Task.new do |t|
|
12
|
+
t.cucumber_opts = %w{--format pretty}
|
13
|
+
end
|
14
|
+
|
15
|
+
require 'spec/rake/spectask'
|
16
|
+
desc "Run specs"
|
17
|
+
Spec::Rake::SpecTask.new do |t|
|
18
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
19
|
+
t.spec_opts = %w(-fs --color)
|
20
|
+
t.spec_opts << '--loadby' << 'random'
|
21
|
+
|
22
|
+
t.rcov_opts << '--exclude' << 'spec'
|
23
|
+
t.rcov = ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true
|
24
|
+
t.rcov_opts << '--text-summary'
|
25
|
+
t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
|
26
|
+
end
|
5
27
|
|
6
28
|
GEM = "<%= name %>"
|
7
29
|
GEM_VERSION = "0.0.1"
|
@@ -22,16 +44,15 @@ spec = Gem::Specification.new do |s|
|
|
22
44
|
s.email = EMAIL
|
23
45
|
s.homepage = HOMEPAGE
|
24
46
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
s.add_dependency 'haml', "~>2.0.9"
|
47
|
+
manifest = Bundler::Environment.load(File.dirname(__FILE__) + '/Gemfile')
|
48
|
+
manifest.dependencies.each do |d|
|
49
|
+
next if d.only && d.only.include?('test')
|
50
|
+
s.add_dependency(d.name, d.version)
|
51
|
+
end
|
31
52
|
|
32
53
|
s.require_path = 'lib'
|
33
54
|
s.autorequire = GEM
|
34
|
-
s.files = %w(LICENSE README.md Rakefile TODO) + Dir.glob("{lib,
|
55
|
+
s.files = %w(LICENSE README.md Rakefile TODO) + Dir.glob("{lib,features}/**/*")
|
35
56
|
end
|
36
57
|
|
37
58
|
Rake::GemPackageTask.new(spec) do |pkg|
|
@@ -50,23 +71,3 @@ task :make_spec do
|
|
50
71
|
end
|
51
72
|
end
|
52
73
|
|
53
|
-
task :default => :features
|
54
|
-
|
55
|
-
require 'cucumber/rake/task'
|
56
|
-
desc "Run cucumber"
|
57
|
-
Cucumber::Rake::Task.new do |t|
|
58
|
-
t.cucumber_opts = %w{--format pretty}
|
59
|
-
end
|
60
|
-
|
61
|
-
require 'spec/rake/spectask'
|
62
|
-
desc "Run specs"
|
63
|
-
Spec::Rake::SpecTask.new do |t|
|
64
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
65
|
-
t.spec_opts = %w(-fs --color)
|
66
|
-
t.spec_opts << '--loadby' << 'random'
|
67
|
-
|
68
|
-
t.rcov_opts << '--exclude' << 'spec'
|
69
|
-
t.rcov = ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true
|
70
|
-
t.rcov_opts << '--text-summary'
|
71
|
-
t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
|
72
|
-
end
|
@@ -1,14 +1,11 @@
|
|
1
|
-
require '
|
2
|
-
require '<%= name %>'
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'vendor', 'gems', 'environment'))
|
2
|
+
require File.join(File.dirname(__FILE__), 'lib', '<%= name %>')
|
3
3
|
|
4
4
|
ENV['<%= name.upcase %>_READKEY'] = /\w{18}/.gen # this should really be what twitter gives you
|
5
5
|
ENV['<%= name.upcase %>_READSECRET'] = /\w{24}/.gen # this should really be what twitter gives you
|
6
6
|
|
7
7
|
#DataMapper.setup(:default, "mysql://atmos:fail@localhost/<%= name.capitalize %>_production")
|
8
8
|
|
9
|
-
|
10
|
-
set :public, File.expand_path(File.dirname(__FILE__), "public")
|
11
|
-
set :environment, :production
|
12
|
-
end
|
9
|
+
use Rack::Static, :urls => ["/css", "/img", "/js"], :root => "public"
|
13
10
|
|
14
|
-
run <%= name.camelize
|
11
|
+
run <%= name.camelize %>.app
|
@@ -1,13 +1,21 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'vendor', 'gems', 'environment'))
|
2
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'lib', '<%= name %>')
|
3
|
+
|
1
4
|
require 'spec'
|
2
5
|
require 'spec/mocks'
|
3
6
|
require 'webrat'
|
4
7
|
require 'rack/test'
|
5
8
|
require 'dm-sweatshop'
|
9
|
+
require 'fakeweb'
|
6
10
|
require 'pp'
|
7
11
|
|
8
|
-
require File.dirname(__FILE__)+'/../../lib/<%= name %>'
|
9
12
|
require File.dirname(__FILE__)+'/../../spec/helpers'
|
10
13
|
|
14
|
+
Webrat.configure do |config|
|
15
|
+
config.mode = :rack
|
16
|
+
config.application_port = 4567
|
17
|
+
end
|
18
|
+
|
11
19
|
World(Rack::Test::Methods)
|
12
20
|
World(Spec::Mocks::ExampleMethods)
|
13
21
|
World(Webrat::Methods)
|
@@ -1,21 +1,11 @@
|
|
1
|
-
gem 'oauth'
|
2
1
|
require 'oauth'
|
3
|
-
gem 'json'
|
4
2
|
require 'json'
|
5
|
-
gem 'haml', '~>2.0.9'
|
6
3
|
require 'haml/util'
|
7
4
|
require 'haml/engine'
|
8
|
-
gem 'curb'
|
9
5
|
require 'curb'
|
10
6
|
require 'logger'
|
11
7
|
|
12
|
-
gem 'data_objects', '~>0.9.11'
|
13
|
-
gem 'dm-core', '~>0.9.10'
|
14
|
-
gem 'dm-types', '~>0.9.10'
|
15
|
-
gem 'dm-validations', '~>0.9.10'
|
16
|
-
gem 'dm-timestamps', '~>0.9.10'
|
17
8
|
require 'dm-core'
|
18
|
-
require 'dm-types'
|
19
9
|
require 'dm-validations'
|
20
10
|
require 'dm-timestamps'
|
21
11
|
require 'sinatra/base'
|
@@ -50,7 +40,16 @@ module <%= name.camelize %>
|
|
50
40
|
end
|
51
41
|
yield
|
52
42
|
end
|
43
|
+
|
44
|
+
def self.app
|
45
|
+
@app ||= Rack::Builder.new do
|
46
|
+
# use Rack::HoptoadNotifier 'mysecretkey'
|
47
|
+
use Rack::Session::Cookie, :key => 'rack.session', :path => '/',
|
48
|
+
:expire_after => 2592000, :secret => '<%= ::Digest::SHA1.hexdigest(Time.now.to_s) %>'
|
49
|
+
run <%= name.camelize %>::App
|
50
|
+
end
|
51
|
+
end
|
53
52
|
end
|
54
53
|
|
54
|
+
require File.dirname(__FILE__)+'/<%= name %>/app'
|
55
55
|
require File.dirname(__FILE__)+'/<%= name %>/models/user'
|
56
|
-
require File.dirname(__FILE__)+'/<%= name %>/sinatra/app'
|
@@ -5,16 +5,9 @@ class Net::HTTPResponse
|
|
5
5
|
end
|
6
6
|
end
|
7
7
|
|
8
|
-
Webrat.configure do |config|
|
9
|
-
config.mode = :rack_test
|
10
|
-
config.application_port = 4567
|
11
|
-
end
|
12
|
-
|
13
8
|
module <%= name.camelize %>::AppHelpers
|
14
9
|
def app
|
15
|
-
|
16
|
-
run <%= name.camelize %>::App
|
17
|
-
end
|
10
|
+
<%= name.camelize %>.app
|
18
11
|
end
|
19
12
|
|
20
13
|
def login_quentin
|
@@ -1,12 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
require 'randexp'
|
5
|
-
require '<%= name %>'
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'vendor', 'gems', 'environment'))
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', '<%= name %>')
|
3
|
+
|
6
4
|
require 'rack/test'
|
7
5
|
require 'webrat'
|
8
6
|
require 'dm-sweatshop'
|
9
|
-
gem 'fakeweb', '~>1.2.4'
|
10
7
|
require 'fakeweb'
|
11
8
|
require 'pp'
|
12
9
|
|
@@ -17,6 +14,11 @@ ENV['<%= name.upcase %>_READSECRET'] = /\w{18}/.gen
|
|
17
14
|
require File.dirname(__FILE__)+'/fixtures'
|
18
15
|
require File.dirname(__FILE__)+'/helpers'
|
19
16
|
|
17
|
+
Webrat.configure do |config|
|
18
|
+
config.mode = :rack
|
19
|
+
config.application_port = 4567
|
20
|
+
end
|
21
|
+
|
20
22
|
DataMapper.setup(:default, 'sqlite3::memory:')
|
21
23
|
|
22
24
|
Spec::Runner.configure do |config|
|
@@ -35,4 +37,8 @@ Spec::Runner.configure do |config|
|
|
35
37
|
{:body => "", :status => ["403", "Forbidden"]},
|
36
38
|
{:body => "Bad Gateway", :status => ["502", "Bad Gateway"]} ])
|
37
39
|
end
|
40
|
+
|
41
|
+
def app
|
42
|
+
<%= name.camelize %>.app
|
43
|
+
end
|
38
44
|
end
|
@@ -28,7 +28,7 @@ class TwitterGenerator < RubiGen::Base
|
|
28
28
|
# Create stubs
|
29
29
|
m.template "config.ru.erb", "config.ru.example"
|
30
30
|
m.template "lib/templates.rb.erb", "lib/#{name}.rb"
|
31
|
-
m.template "lib/templates/
|
31
|
+
m.template "lib/templates/app.rb.erb", "lib/#{name}/app.rb"
|
32
32
|
m.template "lib/templates/models/user.rb.erb", "lib/#{name}/models/user.rb"
|
33
33
|
|
34
34
|
# cucumber stubs
|
@@ -42,7 +42,7 @@ class TwitterGenerator < RubiGen::Base
|
|
42
42
|
m.template "spec/templates_spec.rb.erb", "spec/#{name}_spec.rb"
|
43
43
|
m.template "spec/fixtures.rb.erb", "spec/fixtures.rb"
|
44
44
|
|
45
|
-
%w(LICENSE Rakefile README.md).each do |file|
|
45
|
+
%w(LICENSE Rakefile README.md Gemfile).each do |file|
|
46
46
|
m.template file, file
|
47
47
|
end
|
48
48
|
%w(TODO).each do |file|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: singem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Donohoe
|
@@ -9,7 +9,7 @@ autorequire: singem
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-17 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,25 +22,15 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 0.9.2
|
24
24
|
version:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: rubigen
|
27
|
-
type: :runtime
|
28
|
-
version_requirement:
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.5.2
|
34
|
-
version:
|
35
25
|
- !ruby/object:Gem::Dependency
|
36
26
|
name: rack-test
|
37
27
|
type: :runtime
|
38
28
|
version_requirement:
|
39
29
|
version_requirements: !ruby/object:Gem::Requirement
|
40
30
|
requirements:
|
41
|
-
- -
|
31
|
+
- - ">="
|
42
32
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
33
|
+
version: 0.4.0
|
44
34
|
version:
|
45
35
|
- !ruby/object:Gem::Dependency
|
46
36
|
name: webrat
|
@@ -60,17 +50,7 @@ dependencies:
|
|
60
50
|
requirements:
|
61
51
|
- - ~>
|
62
52
|
- !ruby/object:Gem::Version
|
63
|
-
version: 1.2.
|
64
|
-
version:
|
65
|
-
- !ruby/object:Gem::Dependency
|
66
|
-
name: haml
|
67
|
-
type: :runtime
|
68
|
-
version_requirement:
|
69
|
-
version_requirements: !ruby/object:Gem::Requirement
|
70
|
-
requirements:
|
71
|
-
- - ~>
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version: 2.0.9
|
53
|
+
version: 1.2.5
|
74
54
|
version:
|
75
55
|
description: A gem that provides generators for sinatra apps, ready to go with rack-test/webrat/randexp and others
|
76
56
|
email: atmos@atmos.org
|
@@ -86,67 +66,29 @@ files:
|
|
86
66
|
- README.md
|
87
67
|
- Rakefile
|
88
68
|
- TODO
|
89
|
-
- lib/generators
|
90
|
-
- lib/generators/cucumber
|
91
69
|
- lib/generators/cucumber/cucumber_generator.rb
|
92
|
-
- lib/generators/cucumber/templates
|
93
70
|
- lib/generators/cucumber/templates/config.ru.erb
|
94
|
-
- lib/generators/cucumber/templates/features
|
95
71
|
- lib/generators/cucumber/templates/features/basics.feature.erb
|
96
|
-
- lib/generators/cucumber/templates/features/step_definitions
|
97
72
|
- lib/generators/cucumber/templates/features/step_definitions/basics.rb.erb
|
98
|
-
- lib/generators/cucumber/templates/features/support
|
99
73
|
- lib/generators/cucumber/templates/features/support/env.rb.erb
|
100
|
-
- lib/generators/cucumber/templates/
|
101
|
-
- lib/generators/cucumber/templates/lib/templates
|
74
|
+
- lib/generators/cucumber/templates/Gemfile
|
102
75
|
- lib/generators/cucumber/templates/lib/templates/app.rb.erb
|
103
76
|
- lib/generators/cucumber/templates/lib/templates.rb.erb
|
104
77
|
- lib/generators/cucumber/templates/LICENSE
|
105
78
|
- lib/generators/cucumber/templates/Rakefile
|
106
79
|
- lib/generators/cucumber/templates/README.md
|
107
|
-
- lib/generators/cucumber/templates/spec
|
108
80
|
- lib/generators/cucumber/templates/spec/fixtures.rb.erb
|
109
81
|
- lib/generators/cucumber/templates/spec/spec_helper.rb.erb
|
110
82
|
- lib/generators/cucumber/templates/spec/templates_spec.rb.erb
|
111
83
|
- lib/generators/cucumber/templates/TODO
|
112
84
|
- lib/generators/cucumber/USAGE
|
113
|
-
- lib/generators/singem
|
114
|
-
- lib/generators/singem/singem_generator.rb
|
115
|
-
- lib/generators/singem/templates
|
116
|
-
- lib/generators/singem/templates/config.ru.erb
|
117
|
-
- lib/generators/singem/templates/lib
|
118
|
-
- lib/generators/singem/templates/lib/templates
|
119
|
-
- lib/generators/singem/templates/lib/templates/app.rb.erb
|
120
|
-
- lib/generators/singem/templates/lib/templates.rb.erb
|
121
|
-
- lib/generators/singem/templates/LICENSE
|
122
|
-
- lib/generators/singem/templates/Rakefile
|
123
|
-
- lib/generators/singem/templates/README.md
|
124
|
-
- lib/generators/singem/templates/spec
|
125
|
-
- lib/generators/singem/templates/spec/fixtures.rb.erb
|
126
|
-
- lib/generators/singem/templates/spec/spec_helper.rb.erb
|
127
|
-
- lib/generators/singem/templates/spec/templates_spec.rb.erb
|
128
|
-
- lib/generators/singem/templates/TODO
|
129
|
-
- lib/generators/singem/USAGE
|
130
|
-
- lib/generators/twitter
|
131
|
-
- lib/generators/twitter/templates
|
132
85
|
- lib/generators/twitter/templates/config.ru.erb
|
133
|
-
- lib/generators/twitter/templates/features
|
134
|
-
- lib/generators/twitter/templates/features/adding_items_from_the_bookmarklet.feature
|
135
|
-
- lib/generators/twitter/templates/features/adding_items_to_my_wishlist.feature
|
136
86
|
- lib/generators/twitter/templates/features/basics.feature.erb
|
137
|
-
- lib/generators/twitter/templates/features/step_definitions
|
138
87
|
- lib/generators/twitter/templates/features/step_definitions/basics.rb.erb
|
139
|
-
- lib/generators/twitter/templates/features/support
|
140
88
|
- lib/generators/twitter/templates/features/support/env.rb.erb
|
141
|
-
- lib/generators/twitter/templates/
|
142
|
-
- lib/generators/twitter/templates/
|
143
|
-
- lib/generators/twitter/templates/lib
|
144
|
-
- lib/generators/twitter/templates/lib/templates
|
145
|
-
- lib/generators/twitter/templates/lib/templates/models
|
89
|
+
- lib/generators/twitter/templates/Gemfile
|
90
|
+
- lib/generators/twitter/templates/lib/templates/app.rb.erb
|
146
91
|
- lib/generators/twitter/templates/lib/templates/models/user.rb.erb
|
147
|
-
- lib/generators/twitter/templates/lib/templates/sinatra
|
148
|
-
- lib/generators/twitter/templates/lib/templates/sinatra/app.rb.erb
|
149
|
-
- lib/generators/twitter/templates/lib/templates/views
|
150
92
|
- lib/generators/twitter/templates/lib/templates/views/about.haml
|
151
93
|
- lib/generators/twitter/templates/lib/templates/views/failed.haml
|
152
94
|
- lib/generators/twitter/templates/lib/templates/views/home.haml
|
@@ -154,7 +96,6 @@ files:
|
|
154
96
|
- lib/generators/twitter/templates/LICENSE
|
155
97
|
- lib/generators/twitter/templates/Rakefile
|
156
98
|
- lib/generators/twitter/templates/README.md
|
157
|
-
- lib/generators/twitter/templates/spec
|
158
99
|
- lib/generators/twitter/templates/spec/fixtures.rb.erb
|
159
100
|
- lib/generators/twitter/templates/spec/helpers.rb.erb
|
160
101
|
- lib/generators/twitter/templates/spec/spec_helper.rb.erb
|
@@ -167,6 +108,8 @@ files:
|
|
167
108
|
- spec/spec_helper.rb
|
168
109
|
has_rdoc: true
|
169
110
|
homepage: http://github.com/atmos/singem
|
111
|
+
licenses: []
|
112
|
+
|
170
113
|
post_install_message:
|
171
114
|
rdoc_options: []
|
172
115
|
|
@@ -187,9 +130,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
130
|
requirements: []
|
188
131
|
|
189
132
|
rubyforge_project:
|
190
|
-
rubygems_version: 1.3.
|
133
|
+
rubygems_version: 1.3.5
|
191
134
|
signing_key:
|
192
|
-
specification_version:
|
135
|
+
specification_version: 3
|
193
136
|
summary: A gem that provides generators for sinatra apps, ready to go with rack-test/webrat/randexp and others
|
194
137
|
test_files: []
|
195
138
|
|
@@ -1,77 +0,0 @@
|
|
1
|
-
class SingemGenerator < RubiGen::Base
|
2
|
-
DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
|
3
|
-
Config::CONFIG['ruby_install_name'])
|
4
|
-
|
5
|
-
default_options :author => nil
|
6
|
-
attr_reader :name
|
7
|
-
|
8
|
-
def initialize(runtime_args, runtime_options = {})
|
9
|
-
super
|
10
|
-
usage if args.empty?
|
11
|
-
@destination_root = File.expand_path(args.shift)
|
12
|
-
@name = base_name
|
13
|
-
extract_options
|
14
|
-
end
|
15
|
-
|
16
|
-
def manifest
|
17
|
-
record do |m|
|
18
|
-
# Ensure appropriate folder(s) exists
|
19
|
-
m.directory ''
|
20
|
-
BASEDIRS.each { |path| m.directory path }
|
21
|
-
m.directory "lib/#{name}"
|
22
|
-
|
23
|
-
# Create stubs
|
24
|
-
m.template "config.ru.erb", "config.ru.example"
|
25
|
-
m.template "lib/templates.rb.erb", "lib/#{name}.rb"
|
26
|
-
m.template "lib/templates/app.rb.erb", "lib/#{name}/app.rb"
|
27
|
-
|
28
|
-
m.template "spec/spec_helper.rb.erb", "spec/spec_helper.rb"
|
29
|
-
m.template "spec/templates_spec.rb.erb", "spec/#{name}_spec.rb"
|
30
|
-
m.template "spec/fixtures.rb.erb", "spec/fixtures.rb"
|
31
|
-
|
32
|
-
%w(LICENSE Rakefile README.md).each do |file|
|
33
|
-
m.template file, file
|
34
|
-
end
|
35
|
-
%w(TODO).each do |file|
|
36
|
-
m.file file, file
|
37
|
-
end
|
38
|
-
|
39
|
-
# m.dependency "install_rubigen_scripts", [destination_root, 'newgem_simple'],
|
40
|
-
# :shebang => options[:shebang], :collision => :force
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
protected
|
45
|
-
def banner
|
46
|
-
<<-EOS
|
47
|
-
Creates a simple RubyGems scaffold.
|
48
|
-
|
49
|
-
USAGE: #{spec.name} name --simple"
|
50
|
-
EOS
|
51
|
-
end
|
52
|
-
|
53
|
-
def add_options!(opts)
|
54
|
-
opts.separator ''
|
55
|
-
opts.separator 'Options:'
|
56
|
-
# For each option below, place the default
|
57
|
-
# at the top of the file next to "default_options"
|
58
|
-
# opts.on("-a", "--author=\"Your Name\"", String,
|
59
|
-
# "Some comment about this option",
|
60
|
-
# "Default: none") { |x| options[:author] = x }
|
61
|
-
opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
62
|
-
end
|
63
|
-
|
64
|
-
def extract_options
|
65
|
-
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
66
|
-
# Templates can access these value via the attr_reader-generated methods, but not the
|
67
|
-
# raw instance variable value.
|
68
|
-
# @author = options[:author]
|
69
|
-
end
|
70
|
-
|
71
|
-
# Installation skeleton. Intermediate directories are automatically
|
72
|
-
# created so don't sweat their absence here.
|
73
|
-
BASEDIRS = %w(
|
74
|
-
lib
|
75
|
-
spec
|
76
|
-
)
|
77
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) <%= Time.now.year %> YOUR NAME
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,66 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake/gempackagetask'
|
3
|
-
require 'rubygems/specification'
|
4
|
-
require 'date'
|
5
|
-
require 'spec/rake/spectask'
|
6
|
-
|
7
|
-
GEM = "<%= name %>"
|
8
|
-
GEM_VERSION = "0.0.1"
|
9
|
-
AUTHOR = "Your Name"
|
10
|
-
EMAIL = "Your Email"
|
11
|
-
HOMEPAGE = "http://example.com"
|
12
|
-
SUMMARY = "A sinatra app that provides..."
|
13
|
-
|
14
|
-
spec = Gem::Specification.new do |s|
|
15
|
-
s.name = GEM
|
16
|
-
s.version = GEM_VERSION
|
17
|
-
s.platform = Gem::Platform::RUBY
|
18
|
-
s.has_rdoc = true
|
19
|
-
s.extra_rdoc_files = ["LICENSE", 'TODO']
|
20
|
-
s.summary = SUMMARY
|
21
|
-
s.description = s.summary
|
22
|
-
s.author = AUTHOR
|
23
|
-
s.email = EMAIL
|
24
|
-
s.homepage = HOMEPAGE
|
25
|
-
|
26
|
-
s.add_dependency "sinatra", ">=0.9.2"
|
27
|
-
s.add_dependency "rubigen", ">= 1.5.2"
|
28
|
-
s.add_dependency "rack-test", "~>0.1.0"
|
29
|
-
s.add_dependency "webrat", "~>0.4.3"
|
30
|
-
s.add_dependency "fakeweb", "~>1.2.0"
|
31
|
-
s.add_dependency 'haml', "~>2.0.9"
|
32
|
-
|
33
|
-
s.require_path = 'lib'
|
34
|
-
s.autorequire = GEM
|
35
|
-
s.files = %w(LICENSE README.md Rakefile TODO) + Dir.glob("{lib,spec}/**/*")
|
36
|
-
end
|
37
|
-
|
38
|
-
Rake::GemPackageTask.new(spec) do |pkg|
|
39
|
-
pkg.gem_spec = spec
|
40
|
-
end
|
41
|
-
|
42
|
-
desc "install the gem locally"
|
43
|
-
task :install => [:package] do
|
44
|
-
sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
|
45
|
-
end
|
46
|
-
|
47
|
-
desc "create a gemspec file"
|
48
|
-
task :make_spec do
|
49
|
-
File.open("#{GEM}.gemspec", "w") do |file|
|
50
|
-
file.puts spec.to_ruby
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
task :default => :spec
|
55
|
-
|
56
|
-
desc "Run specs"
|
57
|
-
Spec::Rake::SpecTask.new do |t|
|
58
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
59
|
-
t.spec_opts = %w(-fs --color)
|
60
|
-
t.spec_opts << '--loadby' << 'random'
|
61
|
-
|
62
|
-
t.rcov_opts << '--exclude' << 'spec'
|
63
|
-
t.rcov = ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true
|
64
|
-
t.rcov_opts << '--text-summary'
|
65
|
-
t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
|
66
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require '<%= name %>'
|
3
|
-
|
4
|
-
#DataMapper.setup(:default, "mysql://atmos:fail@localhost/<%= name.capitalize %>_production")
|
5
|
-
|
6
|
-
class <%= name.camelize %>Site < <%= name.camelize %>::App
|
7
|
-
set :public, File.expand_path(File.dirname(__FILE__), "public")
|
8
|
-
set :environment, :production
|
9
|
-
end
|
10
|
-
|
11
|
-
run <%= name.camelize %>Site
|
File without changes
|
@@ -1,40 +0,0 @@
|
|
1
|
-
$TESTING=true
|
2
|
-
$:.push File.join(File.dirname(__FILE__), '..', 'lib')
|
3
|
-
require 'rubygems'
|
4
|
-
require 'randexp'
|
5
|
-
require '<%= name %>'
|
6
|
-
#require 'dm-core'
|
7
|
-
require 'rack/test'
|
8
|
-
require 'webrat/sinatra'
|
9
|
-
#require 'dm-sweatshop'
|
10
|
-
require 'fakeweb'
|
11
|
-
require 'pp'
|
12
|
-
|
13
|
-
FakeWeb.allow_net_connect = false
|
14
|
-
|
15
|
-
#require File.dirname(__FILE__)+'/fixtures'
|
16
|
-
#DataMapper.setup(:default, 'sqlite3::memory:')
|
17
|
-
|
18
|
-
class Net::HTTPResponse
|
19
|
-
def body=(content)
|
20
|
-
@body = content
|
21
|
-
@read = true
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
Spec::Runner.configure do |config|
|
26
|
-
config.include(Rack::Test::Methods)
|
27
|
-
config.include(Webrat::Methods)
|
28
|
-
config.include(Webrat::Matchers)
|
29
|
-
|
30
|
-
config.before(:each) do
|
31
|
-
#DataMapper.auto_migrate!
|
32
|
-
FakeWeb.clean_registry
|
33
|
-
end
|
34
|
-
|
35
|
-
def app
|
36
|
-
@app = Rack::Builder.new do
|
37
|
-
run <%= name.camelize %>::App
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
Feature: Viewing my wish list
|
2
|
-
In order to display a users' preferences
|
3
|
-
As a twitter user
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given I am logged in
|
7
|
-
And I have created a "53cm Pistas" category
|
8
|
-
And I have created a "54cm Cyclocross" category
|
9
|
-
|
10
|
-
Scenario: After Authenticating
|
11
|
-
When I visit the bookmarklet page
|
12
|
-
And I set the category to "53cm Pistas"
|
13
|
-
And the "description" is set to "Bianchi Pista Size 53cm Medium - $500 (Downtown Denver)"
|
14
|
-
And the "url" is set to "http://denver.craigslist.org/bik/1195971789.html"
|
15
|
-
When I click submit
|
16
|
-
Then I should see the window close
|
@@ -1,19 +0,0 @@
|
|
1
|
-
Feature: Viewing my wish list
|
2
|
-
In order to display a users' preferences
|
3
|
-
As a twitter user
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given I am logged in
|
7
|
-
And I have created a "53cm Pistas" category
|
8
|
-
|
9
|
-
Scenario: Posting to an existing category
|
10
|
-
When I post "Bianchi Pista Size 53cm Medium - $500 (Downtown Denver)" with a url of "http://denver.craigslist.org/bik/1195971789.html" to the "53cm Pistas" category
|
11
|
-
And I visit the "53cm Pistas" page
|
12
|
-
Then I should see the "Bianchi Pista Size 53cm Medium - $500 (Downtown Denver)" in the list
|
13
|
-
And the url should be set to "http://denver.craigslist.org/bik/1195971789.html"
|
14
|
-
|
15
|
-
Scenario: Posting to a new category
|
16
|
-
When I post "Bianchi Pista Size 54cm Medium - $500 (Downtown Denver)" with a url of "http://denver.craigslist.org/bik/1195971789.html" to the "54cm Pistas" category
|
17
|
-
And I visit the "54cm Pistas" page
|
18
|
-
Then I should see the "Bianchi Pista Size 54cm Medium - $500 (Downtown Denver)" in the list
|
19
|
-
And the url should be set to "http://denver.craigslist.org/bik/1195971789.html"
|
@@ -1,14 +0,0 @@
|
|
1
|
-
Feature: Viewing my wish list
|
2
|
-
In order to display a users' preferences
|
3
|
-
As a twitter user
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given I am logged in
|
7
|
-
And I have created a "53cm Pistas" category
|
8
|
-
|
9
|
-
Scenario: After Authenticating
|
10
|
-
When I visit the home page
|
11
|
-
Then I should see my list of categories
|
12
|
-
When I enter "Prostitutes" for a new category
|
13
|
-
And I click submit
|
14
|
-
Then I should see the "Prostitutes" list
|