orientea 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +56 -47
- data/README.md +6 -2
- data/VERSION +1 -1
- data/lib/orientea/command.rb +0 -1
- data/orientea.gemspec +5 -4
- data/spec/changing_command_spec.rb +3 -3
- data/spec/creating_command_spec.rb +1 -1
- metadata +25 -25
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb65b6b7fe16e7e00f236555307a819997877a13
|
|
4
|
+
data.tar.gz: 3744b953bb78a95fdd112c5ac49e3e47e1de84b3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f212d38f20c541eaa375c1ffe0cec0a3d92cd745fcf25ca7ebe8443a077503fb05c1fbf24d78b3d6626b62fea8059ae922dcca28b7f54860e87e75ab37ff59d2
|
|
7
|
+
data.tar.gz: 5e9ca3c569fc657e7d90744ac2f4a93a53a6bfc98e10cb09f7fbf9ad346c6b05101c8978995cb5aa221c7950787018ab291ba34e2578beab5d40bb57f93e93b0
|
data/Gemfile.lock
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
GEM
|
|
2
2
|
remote: http://rubygems.org/
|
|
3
3
|
specs:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
activemodel (4.1.1)
|
|
5
|
+
activesupport (= 4.1.1)
|
|
6
|
+
builder (~> 3.1)
|
|
7
|
+
activerecord (4.1.1)
|
|
8
|
+
activemodel (= 4.1.1)
|
|
9
|
+
activesupport (= 4.1.1)
|
|
10
|
+
arel (~> 5.0.0)
|
|
11
|
+
activesupport (4.1.1)
|
|
12
|
+
i18n (~> 0.6, >= 0.6.9)
|
|
13
|
+
json (~> 1.7, >= 1.7.7)
|
|
14
|
+
minitest (~> 5.1)
|
|
9
15
|
thread_safe (~> 0.1)
|
|
10
|
-
tzinfo (~>
|
|
11
|
-
addressable (2.3.
|
|
12
|
-
|
|
13
|
-
awesome_print (1.
|
|
16
|
+
tzinfo (~> 1.1)
|
|
17
|
+
addressable (2.3.6)
|
|
18
|
+
arel (5.0.1.20140414130214)
|
|
19
|
+
awesome_print (1.2.0)
|
|
14
20
|
builder (3.2.2)
|
|
15
|
-
diff-lcs (1.2.
|
|
16
|
-
|
|
21
|
+
diff-lcs (1.2.5)
|
|
22
|
+
docile (1.1.3)
|
|
23
|
+
faraday (0.8.9)
|
|
17
24
|
multipart-post (~> 1.2.0)
|
|
18
|
-
git (1.2.
|
|
25
|
+
git (1.2.7)
|
|
19
26
|
github_api (0.10.1)
|
|
20
27
|
addressable
|
|
21
28
|
faraday (~> 0.8.1)
|
|
@@ -23,11 +30,10 @@ GEM
|
|
|
23
30
|
multi_json (~> 1.4)
|
|
24
31
|
nokogiri (~> 1.5.2)
|
|
25
32
|
oauth2
|
|
26
|
-
hashie (
|
|
27
|
-
highline (1.6.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
jeweler (1.8.6)
|
|
33
|
+
hashie (3.0.0)
|
|
34
|
+
highline (1.6.21)
|
|
35
|
+
i18n (0.6.9)
|
|
36
|
+
jeweler (1.8.8)
|
|
31
37
|
builder
|
|
32
38
|
bundler (~> 1.0)
|
|
33
39
|
git (>= 1.2.5)
|
|
@@ -36,47 +42,50 @@ GEM
|
|
|
36
42
|
nokogiri (= 1.5.10)
|
|
37
43
|
rake
|
|
38
44
|
rdoc
|
|
39
|
-
json (1.8.
|
|
40
|
-
jwt (0.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
multi_xml (0.5.4)
|
|
45
|
+
json (1.8.1)
|
|
46
|
+
jwt (1.0.0)
|
|
47
|
+
minitest (5.3.4)
|
|
48
|
+
multi_json (1.10.1)
|
|
49
|
+
multi_xml (0.5.5)
|
|
45
50
|
multipart-post (1.2.0)
|
|
46
51
|
nokogiri (1.5.10)
|
|
47
|
-
oauth2 (0.9.
|
|
48
|
-
faraday (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
multi_json (~> 1.0)
|
|
52
|
+
oauth2 (0.9.4)
|
|
53
|
+
faraday (>= 0.8, < 0.10)
|
|
54
|
+
jwt (~> 1.0)
|
|
55
|
+
multi_json (~> 1.3)
|
|
52
56
|
multi_xml (~> 0.5)
|
|
53
57
|
rack (~> 1.2)
|
|
54
|
-
pg (0.
|
|
58
|
+
pg (0.17.1)
|
|
55
59
|
rack (1.5.2)
|
|
56
|
-
rake (10.
|
|
60
|
+
rake (10.3.2)
|
|
57
61
|
rdoc (3.12.2)
|
|
58
62
|
json (~> 1.4)
|
|
59
|
-
rspec (
|
|
60
|
-
rspec-core (~>
|
|
61
|
-
rspec-expectations (~>
|
|
62
|
-
rspec-mocks (~>
|
|
63
|
-
rspec-core (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
rspec (3.0.0)
|
|
64
|
+
rspec-core (~> 3.0.0)
|
|
65
|
+
rspec-expectations (~> 3.0.0)
|
|
66
|
+
rspec-mocks (~> 3.0.0)
|
|
67
|
+
rspec-core (3.0.0)
|
|
68
|
+
rspec-support (~> 3.0.0)
|
|
69
|
+
rspec-expectations (3.0.0)
|
|
70
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
71
|
+
rspec-support (~> 3.0.0)
|
|
72
|
+
rspec-mocks (3.0.1)
|
|
73
|
+
rspec-support (~> 3.0.0)
|
|
74
|
+
rspec-support (3.0.0)
|
|
67
75
|
shoulda (3.5.0)
|
|
68
76
|
shoulda-context (~> 1.0, >= 1.0.1)
|
|
69
77
|
shoulda-matchers (>= 1.4.1, < 3.0)
|
|
70
|
-
shoulda-context (1.1
|
|
71
|
-
shoulda-matchers (2.
|
|
78
|
+
shoulda-context (1.2.1)
|
|
79
|
+
shoulda-matchers (2.6.1)
|
|
72
80
|
activesupport (>= 3.0.0)
|
|
73
|
-
simplecov (0.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
tzinfo (
|
|
81
|
+
simplecov (0.8.2)
|
|
82
|
+
docile (~> 1.1.0)
|
|
83
|
+
multi_json
|
|
84
|
+
simplecov-html (~> 0.8.0)
|
|
85
|
+
simplecov-html (0.8.0)
|
|
86
|
+
thread_safe (0.3.4)
|
|
87
|
+
tzinfo (1.2.1)
|
|
88
|
+
thread_safe (~> 0.1)
|
|
80
89
|
|
|
81
90
|
PLATFORMS
|
|
82
91
|
ruby
|
data/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
orientea: command pattern for active record.
|
|
2
|
+
|
|
2
3
|
========
|
|
3
4
|
|
|
4
5
|
#### This is one command pattern implementation for ruby. Designed to use with rails (ActiveRecord).
|
|
5
|
-
|
|
6
|
+
Current support Rails 4.
|
|
7
|
+
You can store the command object , perform it by action method , or undo it by undo method. Useful for auditing and undo users' modification on model.########
|
|
6
8
|
|
|
7
9
|
Note: this gem use postgresql with hstore extension.
|
|
8
10
|
|
|
@@ -25,7 +27,9 @@ Note: this gem use postgresql with hstore extension.
|
|
|
25
27
|
@record = Record.new
|
|
26
28
|
reate_command = Orientea::CreatingCommand.build(@record) # would build and save the command
|
|
27
29
|
record.name = "changed name"
|
|
28
|
-
hange_command = Orientea::ChangingCommand.build(@record)
|
|
30
|
+
hange_command = Orientea::ChangingCommand.build(@record)
|
|
31
|
+
hange_command.your_any_customized_attributes = .....
|
|
32
|
+
hange_command.save # will save the command object
|
|
29
33
|
hange_command.action # would apply the changes
|
|
30
34
|
hange_command.undo # would discard the changes
|
|
31
35
|
```
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.4
|
data/lib/orientea/command.rb
CHANGED
data/orientea.gemspec
CHANGED
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
|
+
# stub: orientea 0.2.4 ruby lib
|
|
5
6
|
|
|
6
7
|
Gem::Specification.new do |s|
|
|
7
8
|
s.name = "orientea"
|
|
8
|
-
s.version = "0.2.
|
|
9
|
+
s.version = "0.2.4"
|
|
9
10
|
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
12
|
+
s.require_paths = ["lib"]
|
|
11
13
|
s.authors = ["Vincent Zhu"]
|
|
12
|
-
s.date = "
|
|
14
|
+
s.date = "2014-06-10"
|
|
13
15
|
s.description = "Command Pattern Implementation for easy use with rails"
|
|
14
16
|
s.email = "zhu1230@gmail.com"
|
|
15
17
|
s.extra_rdoc_files = [
|
|
@@ -45,8 +47,7 @@ Gem::Specification.new do |s|
|
|
|
45
47
|
]
|
|
46
48
|
s.homepage = "http://github.com/vincent/orientea"
|
|
47
49
|
s.licenses = ["MIT"]
|
|
48
|
-
s.
|
|
49
|
-
s.rubygems_version = "2.0.3"
|
|
50
|
+
s.rubygems_version = "2.2.2"
|
|
50
51
|
s.summary = "Command Pattern Implementation for easy use with rails"
|
|
51
52
|
|
|
52
53
|
if s.respond_to? :specification_version then
|
|
@@ -9,15 +9,15 @@ describe Orientea::ChangingCommand do
|
|
|
9
9
|
it "should work correctly with action" do
|
|
10
10
|
@customer.attr_name = 'Derek'
|
|
11
11
|
command = Orientea::ChangingCommand.build(@customer)
|
|
12
|
-
expect(command.done).to
|
|
12
|
+
expect(command.done).to be_falsey
|
|
13
13
|
expect{
|
|
14
14
|
command.action
|
|
15
15
|
}.to change{Customer.first.attr_name}.from('vincent').to('Derek')
|
|
16
|
-
expect(command.done).to
|
|
16
|
+
expect(command.done).to be_truthy
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
it "should save the command object" do
|
|
20
|
-
expect{Orientea::ChangingCommand.build(@customer)}.to change{Orientea::ChangingCommand.count}.by(1)
|
|
20
|
+
expect{Orientea::ChangingCommand.build(@customer).save}.to change{Orientea::ChangingCommand.count}.by(1)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
it "should work correctly with undo" do
|
|
@@ -18,7 +18,7 @@ describe Orientea::CreatingCommand do
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
it "should save the command object" do
|
|
21
|
-
expect{Orientea::CreatingCommand.build(@customer)}.to change{Orientea::CreatingCommand.count}.by(1)
|
|
21
|
+
expect{Orientea::CreatingCommand.build(@customer).save}.to change{Orientea::CreatingCommand.count}.by(1)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
it "undo should work correctly" do
|
metadata
CHANGED
|
@@ -1,139 +1,139 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: orientea
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vincent Zhu
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2014-06-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '0'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- -
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: pg
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '0'
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: awesome_print
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- -
|
|
45
|
+
- - ">="
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: '0'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- -
|
|
52
|
+
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '0'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: shoulda
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- -
|
|
59
|
+
- - ">="
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
61
|
version: '0'
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- -
|
|
66
|
+
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: rdoc
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- - ~>
|
|
73
|
+
- - "~>"
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
75
|
version: '3.12'
|
|
76
76
|
type: :development
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- - ~>
|
|
80
|
+
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '3.12'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: bundler
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- -
|
|
87
|
+
- - ">="
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
89
|
version: 1.3.5
|
|
90
90
|
type: :development
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
|
-
- -
|
|
94
|
+
- - ">="
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: 1.3.5
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
98
|
name: jeweler
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
|
-
- - ~>
|
|
101
|
+
- - "~>"
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
103
|
version: 1.8.4
|
|
104
104
|
type: :development
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
|
-
- - ~>
|
|
108
|
+
- - "~>"
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: 1.8.4
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
112
|
name: simplecov
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
|
-
- -
|
|
115
|
+
- - ">="
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
117
|
version: '0'
|
|
118
118
|
type: :development
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
|
-
- -
|
|
122
|
+
- - ">="
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
124
|
version: '0'
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
126
|
name: rspec
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
|
128
128
|
requirements:
|
|
129
|
-
- -
|
|
129
|
+
- - ">="
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
131
|
version: '0'
|
|
132
132
|
type: :development
|
|
133
133
|
prerelease: false
|
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
|
136
|
-
- -
|
|
136
|
+
- - ">="
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
138
|
version: '0'
|
|
139
139
|
description: Command Pattern Implementation for easy use with rails
|
|
@@ -144,8 +144,8 @@ extra_rdoc_files:
|
|
|
144
144
|
- LICENSE.txt
|
|
145
145
|
- README.md
|
|
146
146
|
files:
|
|
147
|
-
- .document
|
|
148
|
-
- .rspec
|
|
147
|
+
- ".document"
|
|
148
|
+
- ".rspec"
|
|
149
149
|
- Gemfile
|
|
150
150
|
- Gemfile.lock
|
|
151
151
|
- LICENSE.txt
|
|
@@ -179,17 +179,17 @@ require_paths:
|
|
|
179
179
|
- lib
|
|
180
180
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
181
|
requirements:
|
|
182
|
-
- -
|
|
182
|
+
- - ">="
|
|
183
183
|
- !ruby/object:Gem::Version
|
|
184
184
|
version: '0'
|
|
185
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
186
|
requirements:
|
|
187
|
-
- -
|
|
187
|
+
- - ">="
|
|
188
188
|
- !ruby/object:Gem::Version
|
|
189
189
|
version: '0'
|
|
190
190
|
requirements: []
|
|
191
191
|
rubyforge_project:
|
|
192
|
-
rubygems_version: 2.
|
|
192
|
+
rubygems_version: 2.2.2
|
|
193
193
|
signing_key:
|
|
194
194
|
specification_version: 4
|
|
195
195
|
summary: Command Pattern Implementation for easy use with rails
|