pickle 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,6 +1,17 @@
1
- pkg
2
- doc/*
3
- .yardoc
4
- pickle-email*
1
+ # system crap
2
+ .DS_Store
3
+
4
+ # local ruby/gems dev stuff
5
+ .rvmrc
6
+ .bundle
7
+ Gemfile.lock
5
8
  cucumber_test_app
6
- .bundle
9
+ pickle-email*
10
+
11
+ # built docs
12
+ .yardoc
13
+ doc
14
+
15
+ # built gems
16
+ pkg
17
+ *.gem
data/Gemfile CHANGED
@@ -1,20 +1,3 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem "yard"
4
- gem "rake"
5
- gem "cucumber", ">=0.8"
6
- gem "rspec"
7
-
8
- group :test do
9
- gem "rspec-rails"
10
- gem "rails", "~>2.3"
11
- gem "cucumber-rails", ">=0.3.2"
12
- gem "factory_girl"
13
- gem "machinist"
14
- gem "jeweler"
15
- gem "rcov"
16
- gem "database_cleaner"
17
- gem "capybara"
18
- gem "webrat"
19
- gem "sqlite3-ruby"
20
- end
3
+ gemspec
@@ -0,0 +1,151 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ pickle (0.4.5)
5
+ cucumber (>= 0.8)
6
+ rake
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ abstract (1.0.0)
12
+ actionmailer (3.0.5)
13
+ actionpack (= 3.0.5)
14
+ mail (~> 2.2.15)
15
+ actionpack (3.0.5)
16
+ activemodel (= 3.0.5)
17
+ activesupport (= 3.0.5)
18
+ builder (~> 2.1.2)
19
+ erubis (~> 2.6.6)
20
+ i18n (~> 0.4)
21
+ rack (~> 1.2.1)
22
+ rack-mount (~> 0.6.13)
23
+ rack-test (~> 0.5.7)
24
+ tzinfo (~> 0.3.23)
25
+ activemodel (3.0.5)
26
+ activesupport (= 3.0.5)
27
+ builder (~> 2.1.2)
28
+ i18n (~> 0.4)
29
+ activerecord (3.0.5)
30
+ activemodel (= 3.0.5)
31
+ activesupport (= 3.0.5)
32
+ arel (~> 2.0.2)
33
+ tzinfo (~> 0.3.23)
34
+ activeresource (3.0.5)
35
+ activemodel (= 3.0.5)
36
+ activesupport (= 3.0.5)
37
+ activesupport (3.0.5)
38
+ arel (2.0.9)
39
+ builder (2.1.2)
40
+ capybara (0.4.1.2)
41
+ celerity (>= 0.7.9)
42
+ culerity (>= 0.2.4)
43
+ mime-types (>= 1.16)
44
+ nokogiri (>= 1.3.3)
45
+ rack (>= 1.0.0)
46
+ rack-test (>= 0.5.4)
47
+ selenium-webdriver (>= 0.0.27)
48
+ xpath (~> 0.1.3)
49
+ celerity (0.8.8)
50
+ childprocess (0.1.7)
51
+ ffi (~> 0.6.3)
52
+ cucumber (0.10.0)
53
+ builder (>= 2.1.2)
54
+ diff-lcs (~> 1.1.2)
55
+ gherkin (~> 2.3.2)
56
+ json (~> 1.4.6)
57
+ term-ansicolor (~> 1.0.5)
58
+ cucumber-rails (0.3.2)
59
+ cucumber (>= 0.8.0)
60
+ culerity (0.2.15)
61
+ database_cleaner (0.6.5)
62
+ diff-lcs (1.1.2)
63
+ erubis (2.6.6)
64
+ abstract (>= 1.0.0)
65
+ factory_girl (1.3.3)
66
+ ffi (0.6.3)
67
+ rake (>= 0.8.7)
68
+ gherkin (2.3.3)
69
+ json (~> 1.4.6)
70
+ git (1.2.5)
71
+ i18n (0.5.0)
72
+ json (1.4.6)
73
+ json_pure (1.5.1)
74
+ machinist (1.0.6)
75
+ mail (2.2.15)
76
+ activesupport (>= 2.3.6)
77
+ i18n (>= 0.4.0)
78
+ mime-types (~> 1.16)
79
+ treetop (~> 1.4.8)
80
+ mime-types (1.16)
81
+ nokogiri (1.4.4)
82
+ polyglot (0.3.1)
83
+ rack (1.2.1)
84
+ rack-mount (0.6.13)
85
+ rack (>= 1.0.0)
86
+ rack-test (0.5.7)
87
+ rack (>= 1.0)
88
+ rails (3.0.5)
89
+ actionmailer (= 3.0.5)
90
+ actionpack (= 3.0.5)
91
+ activerecord (= 3.0.5)
92
+ activeresource (= 3.0.5)
93
+ activesupport (= 3.0.5)
94
+ bundler (~> 1.0)
95
+ railties (= 3.0.5)
96
+ railties (3.0.5)
97
+ actionpack (= 3.0.5)
98
+ activesupport (= 3.0.5)
99
+ rake (>= 0.8.7)
100
+ thor (~> 0.14.4)
101
+ rake (0.8.7)
102
+ rcov (0.9.9)
103
+ rspec (2.5.0)
104
+ rspec-core (~> 2.5.0)
105
+ rspec-expectations (~> 2.5.0)
106
+ rspec-mocks (~> 2.5.0)
107
+ rspec-core (2.5.1)
108
+ rspec-expectations (2.5.0)
109
+ diff-lcs (~> 1.1.2)
110
+ rspec-mocks (2.5.0)
111
+ rspec-rails (2.5.0)
112
+ actionpack (~> 3.0)
113
+ activesupport (~> 3.0)
114
+ railties (~> 3.0)
115
+ rspec (~> 2.5.0)
116
+ rubyzip (0.9.4)
117
+ selenium-webdriver (0.1.3)
118
+ childprocess (~> 0.1.5)
119
+ ffi (~> 0.6.3)
120
+ json_pure
121
+ rubyzip
122
+ sqlite3 (1.3.3)
123
+ sqlite3-ruby (1.3.3)
124
+ sqlite3 (>= 1.3.3)
125
+ term-ansicolor (1.0.5)
126
+ thor (0.14.6)
127
+ treetop (1.4.9)
128
+ polyglot (>= 0.3.1)
129
+ tzinfo (0.3.24)
130
+ xpath (0.1.3)
131
+ nokogiri (~> 1.3)
132
+ yard (0.6.4)
133
+
134
+ PLATFORMS
135
+ ruby
136
+
137
+ DEPENDENCIES
138
+ bundler
139
+ capybara
140
+ cucumber-rails (>= 0.3.2)
141
+ database_cleaner
142
+ factory_girl
143
+ git
144
+ machinist
145
+ pickle!
146
+ rack (~> 1.2.1)
147
+ rails (~> 3.0.5)
148
+ rcov
149
+ rspec-rails (~> 2.5.0)
150
+ sqlite3-ruby
151
+ yard
@@ -1,3 +1,11 @@
1
+ == 0.4.5
2
+ development dependency upgrades
3
+
4
+ * 2 minor improvements
5
+ * Simplify release process, and change Gemspec handling to facilitate faster failing when a development dep becomes incompatible [Ian White]
6
+ * Upgrade development to use rspec 2, and a rails 3 application for the features [Ian White]
7
+
8
+
1
9
  == 0.4.4
2
10
  large object space fix, and allow escaped quotes as string values
3
11
 
@@ -331,16 +331,16 @@ can build up composite objects with ease
331
331
 
332
332
  == Run the tests
333
333
 
334
- To get all the dependencies required for developing pickle, do the following
334
+ To run the specs and features, you can start from the last known good set of gem dependencies in Gemfile.lock.development:
335
335
 
336
- bundle install
336
+ git clone http://github.com/ianwhite/pickle
337
+ cd pickle
338
+ cp Gemfile.lock.development Gemfile.lock
339
+ bundle
337
340
 
338
- To run the specs do:
341
+ To run the specs & features do:
339
342
 
340
343
  bundle exec rake spec
341
-
342
- To run the features (rails 2.3 only ATM):
343
-
344
344
  bundle exec rake cucumber
345
345
 
346
346
  == Contributors
@@ -7,17 +7,19 @@ end
7
7
 
8
8
  desc "setup a rails app for running cucumber"
9
9
  file "cucumber_test_app" do
10
- puts "** setting up cucumber test app ** (rails 2.3 only at present)"
10
+ puts "** setting up cucumber test app **"
11
11
  Rake::Task['cucumber:setup'].invoke
12
12
  end
13
13
 
14
14
  namespace :cucumber do
15
15
  task :setup do
16
16
  rm_rf "cucumber_test_app"
17
- sh "rails cucumber_test_app"
17
+ sh "rails new cucumber_test_app"
18
18
  cd "cucumber_test_app" do
19
- sh "script/generate rspec"
20
- sh "script/generate cucumber"
19
+ sh "echo 'gem \"cucumber-rails\"' >> Gemfile"
20
+ sh "echo 'gem \"rspec-rails\"' >> Gemfile"
21
+ sh "echo 'gem \"capybara\"' >> Gemfile"
22
+ sh "bundle install"
21
23
  end
22
24
  sh "ln -s #{File.expand_path('.')} cucumber_test_app/vendor/plugins/pickle"
23
25
  end
@@ -0,0 +1,44 @@
1
+ # tasks for building and releasing the software
2
+ require 'git'
3
+ require 'pickle/version'
4
+
5
+ task :build do
6
+ system "gem build pickle.gemspec"
7
+ end
8
+
9
+ namespace :release do
10
+ task :rubygems => :pre do
11
+ system "gem push pickle-#{Pickle::VERSION}.gem"
12
+ end
13
+
14
+ task :github => :pre do
15
+ tag = "v#{Pickle::VERSION}"
16
+ git = Git.open('.')
17
+
18
+ if (git.tag(tag) rescue nil)
19
+ raise "** repo is already tagged with: #{tag}"
20
+ end
21
+
22
+ git.add_tag(tag)
23
+ git.push('origin', tag)
24
+ end
25
+
26
+ task :pre => [:spec, :cucumber, :build] do
27
+ git = Git.open('.')
28
+
29
+ if File.exists?("Gemfile.lock") && File.read("Gemfile.lock") != File.read("Gemfile.lock.development")
30
+ cp "Gemfile.lock", "Gemfile.lock.development"
31
+ raise "** Gemfile.lock.development has been updated, please commit these changes."
32
+ end
33
+
34
+ if (git.status.changed + git.status.added + git.status.deleted).any?
35
+ raise "** repo is not clean, try committing some files"
36
+ end
37
+
38
+ if git.object('HEAD').sha != git.object('origin/master').sha
39
+ raise "** origin does not match HEAD, have you pushed?"
40
+ end
41
+ end
42
+
43
+ task :all => ['release:github', 'release:rubygems']
44
+ end
@@ -1,7 +1,3 @@
1
- require 'spec/rake/spectask'
1
+ require 'rspec/core/rake_task'
2
2
 
3
- desc "Run the specs"
4
- Spec::Rake::SpecTask.new(:spec) do |t|
5
- t.spec_files = FileList['spec/**/*_spec.rb']
6
- t.spec_opts = ["--colour"]
7
- end
3
+ RSpec::Core::RakeTask.new(:spec)
@@ -0,0 +1,9 @@
1
+ require 'autotest/bundler'
2
+
3
+ Autotest.add_hook :initialize do |autotest|
4
+ %w{.git .DS_Store ._* vendor tmp email cucumber_test_app}.each do |exception|
5
+ autotest.add_exception(exception)
6
+ end
7
+ end
8
+
9
+ Autotest.add_discovery { "rspec2" }
@@ -1,12 +1,12 @@
1
1
  # Routes
2
- ActionController::Routing::Routes.draw do |map|
3
- map.resources :spoons, :controller => 'default'
4
- map.resources :forks, :controller => 'default' do |fork|
5
- fork.resources :tines, :controller => 'default' do |tine|
6
- tine.resources :comments, :controller => 'default'
2
+ Rails.application.routes.draw do
3
+ resources :spoons, :controller => 'default'
4
+ resources :forks, :controller => 'default' do
5
+ resources :tines, :controller => 'default' do
6
+ resources :comments, :controller => 'default'
7
7
  end
8
8
  end
9
- map.resources :users, :controller => 'default'
9
+ resources :users, :controller => 'default'
10
10
  end
11
11
 
12
12
  # Migrations
@@ -98,25 +98,21 @@ end
98
98
 
99
99
  # notifiers
100
100
  class Notifier < ActionMailer::Base
101
- include ActionController::UrlWriter
101
+ include Rails.application.routes.url_helpers
102
102
 
103
103
  # BC 2.1
104
- if respond_to?(:view_paths)
105
- view_paths << "#{File.dirname(__FILE__)}/views"
106
- else
107
- self.template_root = "#{File.dirname(__FILE__)}/views"
108
- end
104
+ self.view_paths = "#{File.dirname(__FILE__)}/views"
109
105
 
110
106
  def user_email(user)
111
107
  @recipients = user.email
112
108
  @subject = 'A user email'
113
- @body[:user] = user
114
- @body[:path] = user_path(user)
109
+ @user = user
110
+ @path = user_path(user)
115
111
  end
116
112
 
117
113
  def email(to, subject, body)
118
114
  @recipients = to
119
115
  @subject = subject
120
- @body[:body] = body
116
+ @body = body
121
117
  end
122
118
  end
@@ -6,14 +6,14 @@ Feature: allow pickle to generate steps
6
6
 
7
7
  Scenario: script/generate pickle on fresh cuke install
8
8
  Given cucumber has been freshly generated
9
- When I run "script/generate pickle -f"
9
+ When I run "rails g pickle -f"
10
10
  Then the file features/support/pickle.rb should exist
11
11
  And the file features/support/pickle.rb should match /require 'pickle\/world'/
12
12
  And the file features/step_definitions/pickle_steps.rb should be identical to the local step_definitions/pickle_steps.rb
13
13
 
14
14
  Scenario: script/generate pickle path on fresh cuke install
15
15
  Given cucumber has been freshly generated
16
- When I run "script/generate pickle path -f"
16
+ When I run "rails g pickle --paths -f"
17
17
  Then the file features/support/pickle.rb should exist
18
18
  And the file features/support/pickle.rb should match /require 'pickle\/world'/
19
19
  And the file features/support/pickle.rb should match /require 'pickle\/path\/world'/
@@ -22,7 +22,7 @@ Feature: allow pickle to generate steps
22
22
 
23
23
  Scenario: script/generate pickle email on fresh cuke install
24
24
  Given cucumber has been freshly generated
25
- When I run "script/generate pickle email -f"
25
+ When I run "rails g pickle --email -f"
26
26
  Then the file features/support/pickle.rb should exist
27
27
  And the file features/support/pickle.rb should match /require 'pickle\/world'/
28
28
  And the file features/support/pickle.rb should match /require 'pickle\/email\/world'/
@@ -32,7 +32,7 @@ Feature: allow pickle to generate steps
32
32
 
33
33
  Scenario: script/generate pickle path email on fresh cuke install
34
34
  Given cucumber has been freshly generated
35
- When I run "script/generate pickle path email -f"
35
+ When I run "rails g pickle --paths --email -f"
36
36
  Then the file features/support/pickle.rb should exist
37
37
  And the file features/support/pickle.rb should be identical to the local support/pickle.rb
38
38
  And the file features/support/pickle.rb should match /require 'pickle\/world'/
@@ -46,7 +46,7 @@ Feature: allow pickle to generate steps
46
46
  Scenario: regenerating pickle
47
47
  Given cucumber has been freshly generated
48
48
  And pickle path email has been freshly generated
49
- When I run "script/generate pickle path email -f"
49
+ When I run "rails g pickle --paths --email -f"
50
50
  Then the file features/support/pickle.rb should match /require 'pickle\/world'/
51
51
  And the file features/support/pickle.rb should match /require 'pickle\/path\/world'/
52
52
  And the file features/support/pickle.rb should match /require 'pickle\/email\/world'/
@@ -1,7 +1,7 @@
1
1
  Given(/^an email "(.*?)" with body: "(.*?)" is delivered to (.+?)$/) do |subject, body, to|
2
- Notifier.deliver_email(to, subject, body)
2
+ Notifier.email(to, subject, body).deliver
3
3
  end
4
4
 
5
5
  Given(/^#{capture_model}'s email is delivered$/) do |model|
6
- Notifier.deliver_user_email(model(model))
6
+ Notifier.user_email(model!(model)).deliver
7
7
  end
@@ -8,11 +8,11 @@ After('@gen') do
8
8
  end
9
9
 
10
10
  Given(/^cucumber has been freshly generated$/) do
11
- `cd #{Rails.root}; script/generate cucumber -f --webrat`
11
+ `cd #{Rails.root}; rails g cucumber:install -f --capybara`
12
12
  end
13
13
 
14
14
  Given(/^pickle path email has been freshly generated$/) do
15
- `cd #{Rails.root}; script/generate -f pickle paths email`
15
+ `cd #{Rails.root}; rails g pickle paths email -f`
16
16
  end
17
17
 
18
18
  Given(/^env\.rb already requires (.+)$/) do |file|
@@ -10,5 +10,5 @@ When(/^I go to (.+)$/) do |page|
10
10
  end
11
11
 
12
12
  Then(/^I should be at (.+)$/) do |page|
13
- request.path.should =~ /#{path_to(page)}/
13
+ current_url.should =~ /#{path_to(page)}/
14
14
  end