pickle 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,10 @@
1
+ == 0.2.10
2
+
3
+ * 2 improvements
4
+ * pickle backend is rails 3 compatible (but generators are not yet)
5
+ * modular Rakefile, devs can run only what they're interested in without having to install all gems
6
+
7
+
1
8
  == 0.2.9 - 27 Apr 2010 (the #railscamp7 release)
2
9
 
3
10
  * 5 improvements
data/Rakefile CHANGED
@@ -1,95 +1,20 @@
1
- # use pluginized rpsec if it exists
2
- rspec_base = File.expand_path(File.dirname(__FILE__) + '/../rspec/lib')
3
- $LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base) and !$LOAD_PATH.include?(rspec_base)
4
-
5
- require 'spec/rake/spectask'
6
- require 'spec/rake/verify_rcov'
7
- require 'cucumber/rake/task'
8
-
9
- $LOAD_PATH.unshift File.dirname(__FILE__) + '/lib'
10
- require 'pickle/version'
11
-
12
- PluginName = 'pickle'
13
-
14
- task :default => [:spec]
15
-
16
- desc "Run the specs for #{PluginName}"
17
- Spec::Rake::SpecTask.new(:spec) do |t|
18
- t.spec_files = FileList['spec/**/*_spec.rb']
19
- t.spec_opts = ["--colour"]
20
- end
21
-
22
- desc "Generate RCov report for #{PluginName}"
23
- Spec::Rake::SpecTask.new(:rcov) do |t|
24
- t.spec_files = FileList['spec/**/*_spec.rb']
25
- t.rcov = true
26
- t.rcov_dir = 'doc/coverage'
27
- t.rcov_opts = ['--text-report', '--exclude', "gems/,features/,/Library,spec/,rcov.rb,#{File.expand_path(File.join(File.dirname(__FILE__),'../../..'))}"]
28
- end
29
-
30
- namespace :rcov do
31
- desc "Verify RCov threshold for #{PluginName}"
32
- RCov::VerifyTask.new(:verify => :rcov) do |t|
33
- t.threshold = 98.29
34
- t.index_html = File.join(File.dirname(__FILE__), 'doc/coverage/index.html')
1
+ $:.unshift File.expand_path('lib')
2
+
3
+ # load given tasks file, reporting errors without failing
4
+ def load_tasks(tasks)
5
+ load tasks
6
+ rescue Exception => exception
7
+ $stderr << "** loading #{tasks.sub(File.expand_path('.'),'')} failed: "
8
+ case exception
9
+ when LoadError
10
+ $stderr << "to use, install the gems it requires\n"
11
+ else
12
+ $stderr << ([exception.message] + exception.backtrace[0..2]).join("\n ") << "\n\n"
35
13
  end
36
14
  end
37
15
 
38
- desc "Run features for #{PluginName} (progress)"
39
- Cucumber::Rake::Task.new(:cucumber => [:cucumber_test_app]) do |t|
40
- t.cucumber_opts = ['--format', 'pretty', '--require', 'features']
41
- end
16
+ Dir["Rakefile.d/*.rake"].sort.each {|t| load_tasks t}
42
17
 
43
- desc "setup a rails app for running cucumber"
44
- file "cucumber_test_app" do
45
- puts "** setting up cucumber test app ** (rails 2.3 only at present)"
46
- Rake::Task['cucumber:setup'].invoke
47
- end
48
-
49
- namespace :cucumber do
50
- task :setup do
51
- rm_rf "cucumber_test_app"
52
- sh "rails cucumber_test_app"
53
- cd "cucumber_test_app" do
54
- sh "script/generate rspec"
55
- sh "script/generate cucumber"
56
- end
57
- sh "ln -s #{File.expand_path('.')} cucumber_test_app/vendor/plugins/pickle"
58
- end
59
- end
18
+ task :default => :spec
60
19
 
61
20
  task :ci => ['rcov:verify', 'cucumber']
62
-
63
- begin
64
- require 'jeweler'
65
-
66
- Jeweler::Tasks.new do |s|
67
- s.name = "pickle"
68
- s.version = Pickle::Version::String
69
- s.summary = "Easy model creation and reference in your cucumber features"
70
- s.description = "Easy model creation and reference in your cucumber features"
71
- s.email = "ian.w.white@gmail.com"
72
- s.homepage = "http://github.com/ianwhite/pickle/tree"
73
- s.authors = ["Ian White"]
74
- end
75
-
76
- Jeweler::GemcutterTasks.new
77
-
78
- namespace :release do
79
- task :all => ['release', 'gemcutter:release']
80
- end
81
-
82
- rescue LoadError
83
- puts "Jeweler not available for gem tasks. Install it with: sudo gem install jeweler"
84
- end
85
-
86
- begin
87
- require 'yard'
88
-
89
- YARD::Rake::YardocTask.new(:doc) do |t|
90
- t.files = ['lib/**/*.rb', 'generators/**/*.rb']
91
- end
92
-
93
- rescue LoadError
94
- puts "YARD not available for doc tasks. Install it with: sudo gem install yard"
95
- end
@@ -0,0 +1,24 @@
1
+ require 'cucumber/rake/task'
2
+
3
+ desc "Run features"
4
+ Cucumber::Rake::Task.new(:cucumber => [:cucumber_test_app]) do |t|
5
+ t.cucumber_opts = ['--format', 'pretty', '--require', 'features']
6
+ end
7
+
8
+ desc "setup a rails app for running cucumber"
9
+ file "cucumber_test_app" do
10
+ puts "** setting up cucumber test app ** (rails 2.3 only at present)"
11
+ Rake::Task['cucumber:setup'].invoke
12
+ end
13
+
14
+ namespace :cucumber do
15
+ task :setup do
16
+ rm_rf "cucumber_test_app"
17
+ sh "rails cucumber_test_app"
18
+ cd "cucumber_test_app" do
19
+ sh "script/generate rspec"
20
+ sh "script/generate cucumber"
21
+ end
22
+ sh "ln -s #{File.expand_path('.')} cucumber_test_app/vendor/plugins/pickle"
23
+ end
24
+ end
@@ -0,0 +1,19 @@
1
+ require 'jeweler'
2
+ require 'pickle/version'
3
+
4
+ Jeweler::Tasks.new do |s|
5
+ s.name = "pickle"
6
+ s.version = Pickle::Version::String
7
+ s.summary = "Easy model creation and reference in your cucumber features"
8
+ s.description = "Easy model creation and reference in your cucumber features"
9
+ s.email = "ian.w.white@gmail.com"
10
+ s.homepage = "http://github.com/ianwhite/pickle/tree"
11
+ s.authors = ["Ian White"]
12
+ end
13
+
14
+ Jeweler::GemcutterTasks.new
15
+
16
+ namespace :release do
17
+ desc "release to github and gemcutter"
18
+ task :all => ['release', 'gemcutter:release']
19
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec/rake/spectask'
2
+ require 'spec/rake/verify_rcov'
3
+
4
+ desc "Generate RCov report"
5
+ Spec::Rake::SpecTask.new(:rcov) do |t|
6
+ t.spec_files = FileList['spec/**/*_spec.rb']
7
+ t.rcov = true
8
+ t.rcov_dir = 'doc/coverage'
9
+ t.rcov_opts = ['--text-report', '--exclude', "gems/,features/,/Library,spec/,rcov.rb"]
10
+ end
11
+
12
+ namespace :rcov do
13
+ desc "Verify RCov threshold"
14
+ RCov::VerifyTask.new(:verify => :rcov) do |t|
15
+ t.threshold = 98.12
16
+ t.index_html = 'doc/coverage/index.html'
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec/rake/spectask'
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
@@ -0,0 +1,5 @@
1
+ require 'yard'
2
+
3
+ YARD::Rake::YardocTask.new(:doc) do |t|
4
+ t.files = ['lib/**/*.rb', 'rails_generators/**/*.rb']
5
+ end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.9
1
+ 0.2.10
@@ -1,3 +1,5 @@
1
+ require 'active_support/core_ext'
2
+
1
3
  module Pickle
2
4
  # Abstract Factory adapter class, if you have a factory type setup, you
3
5
  # can easily create an adaptor to make it work with Pickle.
@@ -15,7 +17,12 @@ module Pickle
15
17
  raise NotImplementedError, "create and return an object with the given attributes"
16
18
  end
17
19
 
18
- cattr_writer :model_classes
20
+ if respond_to?(:class_attribute)
21
+ class_attribute :model_classes
22
+ else
23
+ cattr_writer :model_classes
24
+ end
25
+
19
26
  self.model_classes = nil
20
27
 
21
28
  class << self
@@ -1,6 +1,9 @@
1
1
  module Pickle
2
2
  module Version
3
- String = File.read(File.dirname(File.dirname(__FILE__)) + '/../VERSION').strip
4
- Major, Minor, Patch = String.split('.').map{|i| i.to_i}
3
+ String = File.read(File.dirname(__FILE__) + '/../../VERSION').strip
4
+ Array = String.split('.').map{|i| i.to_i}
5
+ Major = Array[0]
6
+ Minor = Array[1]
7
+ Patch = Array[2]
5
8
  end
6
9
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pickle}
8
- s.version = "0.2.9"
8
+ s.version = "0.2.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ian White"]
@@ -21,6 +21,11 @@ Gem::Specification.new do |s|
21
21
  "License.txt",
22
22
  "README.rdoc",
23
23
  "Rakefile",
24
+ "Rakefile.d/cucumber.rake",
25
+ "Rakefile.d/jeweller.rake",
26
+ "Rakefile.d/rcov.rake",
27
+ "Rakefile.d/rspec.rake",
28
+ "Rakefile.d/yard.rake",
24
29
  "Todo.txt",
25
30
  "VERSION",
26
31
  "features/app/app.rb",
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
- require 'activerecord'
3
+ require 'active_record'
4
4
  require 'factory_girl'
5
5
  require 'machinist/active_record'
6
6
 
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
3
  require 'pickle/email'
4
4
  require 'pickle/email/parser'
5
- require 'actionmailer'
5
+ require 'action_mailer'
6
6
 
7
7
  describe Pickle::Email do
8
8
  include Pickle::Session
@@ -1,6 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'spec'
3
- require 'activesupport'
3
+ require 'active_support'
4
4
 
5
5
  $:.unshift(File.dirname(__FILE__) + '/../lib')
6
6
  require 'pickle'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 9
9
- version: 0.2.9
8
+ - 10
9
+ version: 0.2.10
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ian White
@@ -32,6 +32,11 @@ files:
32
32
  - License.txt
33
33
  - README.rdoc
34
34
  - Rakefile
35
+ - Rakefile.d/cucumber.rake
36
+ - Rakefile.d/jeweller.rake
37
+ - Rakefile.d/rcov.rake
38
+ - Rakefile.d/rspec.rake
39
+ - Rakefile.d/yard.rake
35
40
  - Todo.txt
36
41
  - VERSION
37
42
  - features/app/app.rb