memento 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-version +1 -0
- data/Gemfile +3 -1
- data/lib/memento.rb +1 -1
- data/lib/memento/result.rb +2 -2
- data/lib/memento/version.rb +1 -1
- data/spec/memento/action/create_spec.rb +1 -1
- data/spec/memento/action/destroy_spec.rb +1 -1
- data/spec/memento/action_controller_methods_spec.rb +2 -2
- data/spec/memento/result_spec.rb +7 -7
- data/spec/memento/session_spec.rb +1 -1
- metadata +12 -23
- data/.rbenv-gemsets +0 -1
- data/.rbenv-version +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 76b7624faf71509088b847be6d9458cf957ded70
|
4
|
+
data.tar.gz: a5cf8246d670739ad8f35c8aa61ac083423b424b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 92328c9544701039b73f2bc6e10e573b04d9c8ac9235ad3f296f14278fecb168109141447bd7750dff6afe4adc3e05af59d2d45f304a2b805a985ff0210800e6
|
7
|
+
data.tar.gz: a02d9c4c3486015d8481084ecf50c77b0ad7f101da4214558aae8c3ae890b035844302ffe4926e292a0cb2d5538d19bc8d72146a1fb993336574cd66bd694a16
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.0-p247
|
data/Gemfile
CHANGED
data/lib/memento.rb
CHANGED
@@ -20,7 +20,7 @@ module Memento
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def start(user_or_id)
|
23
|
-
user = user_or_id.is_a?(User) ? user_or_id : User.
|
23
|
+
user = user_or_id.is_a?(User) ? user_or_id : User.where(:id => user_or_id).first
|
24
24
|
self.session = user ? Memento::Session.new({:user => user}, :without_protection => true) : nil
|
25
25
|
end
|
26
26
|
|
data/lib/memento/result.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
module Memento
|
2
2
|
class ResultArray < Array
|
3
3
|
def errors
|
4
|
-
|
4
|
+
find_all{ |result| result.failed? }
|
5
5
|
end
|
6
6
|
|
7
7
|
def failed?
|
8
|
-
|
8
|
+
any?{ |result| result.failed? }
|
9
9
|
end
|
10
10
|
|
11
11
|
def success?
|
data/lib/memento/version.rb
CHANGED
@@ -10,9 +10,9 @@ describe Memento::ActionControllerMethods do
|
|
10
10
|
setup_db
|
11
11
|
setup_data
|
12
12
|
@controller = FooController.new
|
13
|
-
@controller.stub
|
13
|
+
@controller.stub(:current_user => @user)
|
14
14
|
@headers = {}
|
15
|
-
@controller.
|
15
|
+
@controller.stub_chain(:response, :headers => @headers)
|
16
16
|
end
|
17
17
|
|
18
18
|
after do
|
data/spec/memento/result_spec.rb
CHANGED
@@ -4,8 +4,8 @@ describe Memento::Result do
|
|
4
4
|
|
5
5
|
describe "when initalized with valid object" do
|
6
6
|
before do
|
7
|
-
@object =
|
8
|
-
@state =
|
7
|
+
@object = double("object", :errors => {})
|
8
|
+
@state = double("state1")
|
9
9
|
@result = Memento::Result.new(@object, @state)
|
10
10
|
end
|
11
11
|
|
@@ -29,8 +29,8 @@ describe Memento::Result do
|
|
29
29
|
|
30
30
|
describe "when initalized with object with errors" do
|
31
31
|
before do
|
32
|
-
@object =
|
33
|
-
@result = Memento::Result.new(@object,
|
32
|
+
@object = double("object", :errors => {:memento_undo => "123"})
|
33
|
+
@result = Memento::Result.new(@object, double("state1"))
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should have an object attribute" do
|
@@ -66,9 +66,9 @@ describe Memento::ResultArray do
|
|
66
66
|
|
67
67
|
describe "when Memento::Result without errors added" do
|
68
68
|
before do
|
69
|
-
@object =
|
70
|
-
@results << Memento::Result.new(
|
71
|
-
@results << (@with_error = Memento::Result.new(@object,
|
69
|
+
@object = double("object", :errors => {:memento_undo => "123"})
|
70
|
+
@results << Memento::Result.new(double("object2", :errors => {}), double("state1"))
|
71
|
+
@results << (@with_error = Memento::Result.new(@object, double("state2")))
|
72
72
|
end
|
73
73
|
|
74
74
|
it "should have two entrys" do
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memento
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Yolk Sebastian Munz & Julia Soergel GbR
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-07-19 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: activerecord
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: actionpack
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,33 +41,29 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rspec
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: 2.4.0
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: 2.4.0
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: sqlite3
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - '>='
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: 1.3.5
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - '>='
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: 1.3.5
|
78
69
|
description: Undo for Rails/ActiveRecord - covers destroy, update and create
|
@@ -82,8 +73,7 @@ extensions: []
|
|
82
73
|
extra_rdoc_files: []
|
83
74
|
files:
|
84
75
|
- .gitignore
|
85
|
-
- .
|
86
|
-
- .rbenv-version
|
76
|
+
- .ruby-version
|
87
77
|
- CHANGES.md
|
88
78
|
- Gemfile
|
89
79
|
- LICENSE
|
@@ -117,27 +107,26 @@ files:
|
|
117
107
|
- spec/spec_helper.rb
|
118
108
|
homepage: http://github.com/yolk/memento
|
119
109
|
licenses: []
|
110
|
+
metadata: {}
|
120
111
|
post_install_message:
|
121
112
|
rdoc_options: []
|
122
113
|
require_paths:
|
123
114
|
- lib
|
124
115
|
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
-
none: false
|
126
116
|
requirements:
|
127
|
-
- -
|
117
|
+
- - '>='
|
128
118
|
- !ruby/object:Gem::Version
|
129
119
|
version: '0'
|
130
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
-
none: false
|
132
121
|
requirements:
|
133
|
-
- -
|
122
|
+
- - '>='
|
134
123
|
- !ruby/object:Gem::Version
|
135
124
|
version: '0'
|
136
125
|
requirements: []
|
137
126
|
rubyforge_project:
|
138
|
-
rubygems_version:
|
127
|
+
rubygems_version: 2.0.3
|
139
128
|
signing_key:
|
140
|
-
specification_version:
|
129
|
+
specification_version: 4
|
141
130
|
summary: Undo for Rails/ActiveRecord - covers destroy, update and create
|
142
131
|
test_files:
|
143
132
|
- spec/memento/action/create_spec.rb
|
data/.rbenv-gemsets
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
plugin
|
data/.rbenv-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.9.3-p286
|