has_draft 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Appraisals +14 -0
- data/Gemfile.lock +18 -16
- data/README.rdoc +11 -0
- data/Rakefile +28 -12
- data/lib/has_draft/version.rb +1 -1
- data/spec/db/test.sqlite3 +0 -0
- data/spec/has_draft_spec.rb +6 -2
- metadata +84 -112
data/Appraisals
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
appraise "rails-3.0" do
|
2
|
+
gem "rails", "~> 3.0.12"
|
3
|
+
gem "has_draft", :path => "../"
|
4
|
+
end
|
5
|
+
|
6
|
+
appraise "rails-3.1" do
|
7
|
+
gem "rails", "~> 3.1.4"
|
8
|
+
gem "has_draft", :path => "../"
|
9
|
+
end
|
10
|
+
|
11
|
+
appraise "rails-3.2" do
|
12
|
+
gem "rails", "~> 3.2.2"
|
13
|
+
gem "has_draft", :path => "../"
|
14
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,30 +1,34 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
has_draft (1.0.
|
4
|
+
has_draft (1.0.2)
|
5
5
|
activerecord (>= 3.0.0)
|
6
6
|
activesupport (>= 3.0.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (3.0.
|
12
|
-
activesupport (= 3.0.
|
11
|
+
activemodel (3.0.12)
|
12
|
+
activesupport (= 3.0.12)
|
13
13
|
builder (~> 2.1.2)
|
14
14
|
i18n (~> 0.5.0)
|
15
|
-
activerecord (3.0.
|
16
|
-
activemodel (= 3.0.
|
17
|
-
activesupport (= 3.0.
|
18
|
-
arel (~> 2.0.
|
15
|
+
activerecord (3.0.12)
|
16
|
+
activemodel (= 3.0.12)
|
17
|
+
activesupport (= 3.0.12)
|
18
|
+
arel (~> 2.0.10)
|
19
19
|
tzinfo (~> 0.3.23)
|
20
|
-
activesupport (3.0.
|
21
|
-
|
20
|
+
activesupport (3.0.12)
|
21
|
+
appraisal (0.4.1)
|
22
|
+
bundler
|
23
|
+
rake
|
24
|
+
arel (2.0.10)
|
22
25
|
builder (2.1.2)
|
23
26
|
diff-lcs (1.1.2)
|
24
27
|
factory_girl (1.3.3)
|
25
28
|
faker (0.9.5)
|
26
29
|
i18n (~> 0.4)
|
27
30
|
i18n (0.5.0)
|
31
|
+
rake (0.9.2.2)
|
28
32
|
rspec (2.5.0)
|
29
33
|
rspec-core (~> 2.5.0)
|
30
34
|
rspec-expectations (~> 2.5.0)
|
@@ -33,19 +37,17 @@ GEM
|
|
33
37
|
rspec-expectations (2.5.0)
|
34
38
|
diff-lcs (~> 1.1.2)
|
35
39
|
rspec-mocks (2.5.0)
|
36
|
-
sqlite3 (1.3.
|
37
|
-
|
38
|
-
sqlite3 (>= 1.3.3)
|
39
|
-
tzinfo (0.3.26)
|
40
|
+
sqlite3 (1.3.5)
|
41
|
+
tzinfo (0.3.32)
|
40
42
|
|
41
43
|
PLATFORMS
|
42
44
|
ruby
|
43
45
|
|
44
46
|
DEPENDENCIES
|
45
|
-
|
46
|
-
activesupport (>= 3.0.0)
|
47
|
+
appraisal (~> 0.4.0)
|
47
48
|
factory_girl (~> 1.3.1)
|
48
49
|
faker (~> 0.9.1)
|
49
50
|
has_draft!
|
51
|
+
rake
|
50
52
|
rspec (~> 2.0)
|
51
|
-
sqlite3
|
53
|
+
sqlite3 (~> 1.3.4)
|
data/README.rdoc
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
{<img src="https://secure.travis-ci.org/rubiety/has_draft.png?branch=master" alt="Build Status" />}[http://travis-ci.org/rubiety/has_draft]
|
2
|
+
|
1
3
|
== Has Draft
|
2
4
|
|
3
5
|
Allows for multiple "drafts" of a model which can be useful when developing:
|
@@ -152,3 +154,12 @@ context by passing a block to has_draft:
|
|
152
154
|
end
|
153
155
|
|
154
156
|
end
|
157
|
+
|
158
|
+
== Running Tests
|
159
|
+
|
160
|
+
# Just the gems locked in Gemfile.lock
|
161
|
+
$ bundle exec rake test
|
162
|
+
|
163
|
+
# All of the Appraisals:
|
164
|
+
$ bundle exec rake all
|
165
|
+
|
data/Rakefile
CHANGED
@@ -1,14 +1,30 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
|
4
|
+
require 'rake'
|
5
|
+
require 'rspec/core/rake_task'
|
6
|
+
require 'appraisal'
|
7
|
+
|
8
|
+
Bundler::GemHelper.install_tasks
|
9
|
+
|
10
|
+
desc 'Default: run unit tests.'
|
11
|
+
task :default => [:clean, :all]
|
12
|
+
|
13
|
+
desc "Run Specs against all Appraisals"
|
14
|
+
task :all => :spec do
|
15
|
+
Rake::Task["appraisal:install"].execute
|
16
|
+
system("bundle exec rake -s appraisal spec")
|
12
17
|
end
|
13
18
|
|
14
|
-
|
19
|
+
desc "Run Specs"
|
20
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
21
|
+
end
|
22
|
+
|
23
|
+
task :test => :spec
|
24
|
+
|
25
|
+
desc "Clean up files."
|
26
|
+
task :clean do |t|
|
27
|
+
FileUtils.rm_rf "tmp"
|
28
|
+
Dir.glob("spec/db/*.sqlite3").each {|f| FileUtils.rm f }
|
29
|
+
Dir.glob("has_draft-*.gem").each {|f| FileUtils.rm f }
|
30
|
+
end
|
data/lib/has_draft/version.rb
CHANGED
data/spec/db/test.sqlite3
CHANGED
Binary file
|
data/spec/has_draft_spec.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe HasDraft do
|
4
|
+
before(:all) do
|
5
|
+
ActiveSupport::Deprecation.silenced = true
|
6
|
+
end
|
7
|
+
|
4
8
|
context "Model with has_draft" do
|
5
9
|
it "should expose #draft_class_name as Draft" do
|
6
10
|
Article.draft_class_name.should == "Draft"
|
@@ -20,7 +24,7 @@ describe HasDraft do
|
|
20
24
|
|
21
25
|
describe "Draft Model" do
|
22
26
|
it "should be defined under the Article namespace" do
|
23
|
-
Article.constants.should include('Draft')
|
27
|
+
Article.constants.map(&:to_s).should include('Draft')
|
24
28
|
end
|
25
29
|
|
26
30
|
it "should expose #original_class as Article" do
|
@@ -76,4 +80,4 @@ describe HasDraft do
|
|
76
80
|
end
|
77
81
|
end
|
78
82
|
|
79
|
-
end
|
83
|
+
end
|
metadata
CHANGED
@@ -1,127 +1,111 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_draft
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 1.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Ben Hughes
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-04-01 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: activesupport
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70191481865360 !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 7
|
30
|
-
segments:
|
31
|
-
- 3
|
32
|
-
- 0
|
33
|
-
- 0
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 3.0.0
|
35
22
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: activerecord
|
39
23
|
prerelease: false
|
40
|
-
|
24
|
+
version_requirements: *70191481865360
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activerecord
|
27
|
+
requirement: &70191481864620 !ruby/object:Gem::Requirement
|
41
28
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 7
|
46
|
-
segments:
|
47
|
-
- 3
|
48
|
-
- 0
|
49
|
-
- 0
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
50
32
|
version: 3.0.0
|
51
33
|
type: :runtime
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: rspec
|
55
34
|
prerelease: false
|
56
|
-
|
35
|
+
version_requirements: *70191481864620
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec
|
38
|
+
requirement: &70191481863540 !ruby/object:Gem::Requirement
|
57
39
|
none: false
|
58
|
-
requirements:
|
40
|
+
requirements:
|
59
41
|
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
segments:
|
63
|
-
- 2
|
64
|
-
- 0
|
65
|
-
version: "2.0"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '2.0'
|
66
44
|
type: :development
|
67
|
-
version_requirements: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: factory_girl
|
70
45
|
prerelease: false
|
71
|
-
|
46
|
+
version_requirements: *70191481863540
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: factory_girl
|
49
|
+
requirement: &70191481862520 !ruby/object:Gem::Requirement
|
72
50
|
none: false
|
73
|
-
requirements:
|
51
|
+
requirements:
|
74
52
|
- - ~>
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
hash: 25
|
77
|
-
segments:
|
78
|
-
- 1
|
79
|
-
- 3
|
80
|
-
- 1
|
53
|
+
- !ruby/object:Gem::Version
|
81
54
|
version: 1.3.1
|
82
55
|
type: :development
|
83
|
-
version_requirements: *id004
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: faker
|
86
56
|
prerelease: false
|
87
|
-
|
57
|
+
version_requirements: *70191481862520
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: faker
|
60
|
+
requirement: &70191481861660 !ruby/object:Gem::Requirement
|
88
61
|
none: false
|
89
|
-
requirements:
|
62
|
+
requirements:
|
90
63
|
- - ~>
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
hash: 57
|
93
|
-
segments:
|
94
|
-
- 0
|
95
|
-
- 9
|
96
|
-
- 1
|
64
|
+
- !ruby/object:Gem::Version
|
97
65
|
version: 0.9.1
|
98
66
|
type: :development
|
99
|
-
version_requirements: *id005
|
100
|
-
- !ruby/object:Gem::Dependency
|
101
|
-
name: sqlite3-ruby
|
102
67
|
prerelease: false
|
103
|
-
|
68
|
+
version_requirements: *70191481861660
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sqlite3
|
71
|
+
requirement: &70191481849240 !ruby/object:Gem::Requirement
|
104
72
|
none: false
|
105
|
-
requirements:
|
73
|
+
requirements:
|
106
74
|
- - ~>
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 1.3.4
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70191481849240
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: appraisal
|
82
|
+
requirement: &70191481848520 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ~>
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: 0.4.0
|
114
88
|
type: :development
|
115
|
-
|
116
|
-
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *70191481848520
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: rake
|
93
|
+
requirement: &70191481847980 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70191481847980
|
102
|
+
description: Allows for your ActiveRecord models to have drafts which are stored in
|
103
|
+
a separate duplicate table.
|
117
104
|
email: ben@railsgarden.com
|
118
105
|
executables: []
|
119
|
-
|
120
106
|
extensions: []
|
121
|
-
|
122
107
|
extra_rdoc_files: []
|
123
|
-
|
124
|
-
files:
|
108
|
+
files:
|
125
109
|
- lib/has_draft/railtie.rb
|
126
110
|
- lib/has_draft/version.rb
|
127
111
|
- lib/has_draft.rb
|
@@ -131,47 +115,35 @@ files:
|
|
131
115
|
- spec/factories/article.rb
|
132
116
|
- spec/has_draft_spec.rb
|
133
117
|
- spec/spec_helper.rb
|
118
|
+
- Appraisals
|
134
119
|
- Gemfile
|
135
120
|
- Gemfile.lock
|
136
121
|
- LICENSE
|
137
122
|
- Rakefile
|
138
123
|
- README.rdoc
|
139
124
|
- init.rb
|
140
|
-
has_rdoc: true
|
141
125
|
homepage: http://github.com/rubiety/has_draft
|
142
126
|
licenses: []
|
143
|
-
|
144
127
|
post_install_message:
|
145
128
|
rdoc_options: []
|
146
|
-
|
147
|
-
require_paths:
|
129
|
+
require_paths:
|
148
130
|
- lib
|
149
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
150
132
|
none: false
|
151
|
-
requirements:
|
152
|
-
- -
|
153
|
-
- !ruby/object:Gem::Version
|
154
|
-
|
155
|
-
|
156
|
-
- 0
|
157
|
-
version: "0"
|
158
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - ! '>='
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0'
|
137
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
138
|
none: false
|
160
|
-
requirements:
|
161
|
-
- -
|
162
|
-
- !ruby/object:Gem::Version
|
163
|
-
hash: 19
|
164
|
-
segments:
|
165
|
-
- 1
|
166
|
-
- 3
|
167
|
-
- 4
|
139
|
+
requirements:
|
140
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
168
142
|
version: 1.3.4
|
169
143
|
requirements: []
|
170
|
-
|
171
144
|
rubyforge_project: has_draft
|
172
|
-
rubygems_version: 1.
|
145
|
+
rubygems_version: 1.8.10
|
173
146
|
signing_key:
|
174
147
|
specification_version: 3
|
175
148
|
summary: Attached draft model to your ActiveRecord models.
|
176
149
|
test_files: []
|
177
|
-
|