command_model 1.2.0 → 1.3.0
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 +5 -5
- data/.travis.yml +5 -5
- data/README.md +16 -10
- data/command_model.gemspec +6 -6
- data/gemfiles/{4.0.gemfile → 4.2.gemfile} +1 -1
- data/gemfiles/{4.1.gemfile → 5.0.gemfile} +1 -1
- data/gemfiles/{3.2.gemfile → 5.1.gemfile} +1 -1
- data/lib/command_model/model.rb +23 -19
- data/lib/command_model/version.rb +1 -1
- data/spec/model_spec.rb +57 -36
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8af8e3bf9074e89aafc9b7e880eb7c99780a9189f822a6a030c8867a3429b0c7
|
4
|
+
data.tar.gz: 225ab899fa949b25dcbda27e9dac739227f8992d68ea0109afa99e36726f08bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d01d13237af6fda7df4e9002a71fb029558bd1bc114dc7bdfa1f54f288f80fdf76e744550f0a49292f2bd94fd9f13cf9c65870ab0be75af23f041ff148ae8a3
|
7
|
+
data.tar.gz: 43a0c62d7d985aff56a7875c84eafb862e9b92e40e0728ae67e468021590e5e4cdb3f6454d05cd27647432312e5bb197ed259d7b0c640f602715b1d0d7ff801b
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[](https://travis-ci.org/jackc/command_model)
|
2
|
+
|
1
3
|
# CommandModel
|
2
4
|
|
3
5
|
CommandModel is an ActiveModel based class that encapsulates the user
|
@@ -13,15 +15,15 @@ usually have richer behavior than can be represented with a typical
|
|
13
15
|
ActiveRecord style update_attributes.
|
14
16
|
|
15
17
|
# yuck!
|
16
|
-
account.update_attributes balance: account.balance - 50
|
17
|
-
|
18
|
+
account.update_attributes balance: account.balance - 50
|
19
|
+
|
18
20
|
# much better
|
19
21
|
account.withdraw amount: 50
|
20
|
-
|
22
|
+
|
21
23
|
But there are multiple complications with the OO approach. How do we integrate
|
22
24
|
Rails style validations? How are user-supplied strings typecast? How do we
|
23
|
-
know if the command succeeded? CommandModel solves these problems.
|
24
|
-
|
25
|
+
know if the command succeeded? CommandModel solves these problems.
|
26
|
+
|
25
27
|
## Installation
|
26
28
|
|
27
29
|
Add this line to your application's Gemfile:
|
@@ -47,7 +49,7 @@ request.
|
|
47
49
|
presence: true,
|
48
50
|
numericality: { greater_than: 0, less_than_or_equal_to: 500 }
|
49
51
|
end
|
50
|
-
|
52
|
+
|
51
53
|
Create the method to run the command. This method should instantiate and call a new command object. It must pass call
|
52
54
|
a block that actually does the work. The block will only be called if
|
53
55
|
the validations in the command object pass. The block is free to do
|
@@ -57,7 +59,7 @@ failed. Finally, the call method will return self.
|
|
57
59
|
|
58
60
|
class Account
|
59
61
|
# ...
|
60
|
-
|
62
|
+
|
61
63
|
def withdraw(args)
|
62
64
|
WithdrawCommand.new(args).call do |command|
|
63
65
|
if balance >= command.amount
|
@@ -67,14 +69,14 @@ failed. Finally, the call method will return self.
|
|
67
69
|
end
|
68
70
|
end
|
69
71
|
end
|
70
|
-
|
72
|
+
|
71
73
|
# ...
|
72
74
|
end
|
73
|
-
|
75
|
+
|
74
76
|
Use example:
|
75
77
|
|
76
78
|
response = account.withdraw amount: 50
|
77
|
-
|
79
|
+
|
78
80
|
if response.success?
|
79
81
|
puts "Success!"
|
80
82
|
else
|
@@ -128,6 +130,10 @@ integration of Rails form helpers and validations with CommandModel.
|
|
128
130
|
|
129
131
|
## Version History
|
130
132
|
|
133
|
+
* 1.3 - February 13, 2018
|
134
|
+
* Add decimal type cast
|
135
|
+
* 1.2 - October 24, 2014
|
136
|
+
* Suport Rails 4
|
131
137
|
* 1.1 - November 13, 2012
|
132
138
|
* Updated documentation and example application
|
133
139
|
* Refactored Model to support internal domain logic easier with #call and #execute.
|
data/command_model.gemspec
CHANGED
@@ -15,12 +15,12 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = CommandModel::VERSION
|
17
17
|
|
18
|
-
gem.add_dependency 'activemodel', ">
|
18
|
+
gem.add_dependency 'activemodel', "> 4.2"
|
19
19
|
|
20
|
-
gem.add_development_dependency 'rake', "~>
|
21
|
-
gem.add_development_dependency 'rspec', "~> 2.
|
22
|
-
gem.add_development_dependency 'guard', "~>
|
23
|
-
gem.add_development_dependency 'guard-rspec', "~>
|
24
|
-
gem.add_development_dependency 'rb-fsevent', '~> 0.
|
20
|
+
gem.add_development_dependency 'rake', "~> 11.3.0"
|
21
|
+
gem.add_development_dependency 'rspec', "~> 2.14.1"
|
22
|
+
gem.add_development_dependency 'guard', "~> 2.14.2"
|
23
|
+
gem.add_development_dependency 'guard-rspec', "~> 3.1.0"
|
24
|
+
gem.add_development_dependency 'rb-fsevent', '~> 0.10.2'
|
25
25
|
|
26
26
|
end
|
data/lib/command_model/model.rb
CHANGED
@@ -5,7 +5,7 @@ module CommandModel
|
|
5
5
|
extend ActiveModel::Naming
|
6
6
|
|
7
7
|
Parameter = Struct.new(:name, :typecast, :validations)
|
8
|
-
|
8
|
+
|
9
9
|
# Parameter requires one or more attributes as its first parameter(s).
|
10
10
|
# It accepts an options hash as its last parameter.
|
11
11
|
#
|
@@ -32,7 +32,7 @@ module CommandModel
|
|
32
32
|
|
33
33
|
args.each do |name|
|
34
34
|
attr_reader name
|
35
|
-
|
35
|
+
|
36
36
|
if typecast
|
37
37
|
attr_typecasting_writer name, typecast
|
38
38
|
else
|
@@ -47,10 +47,10 @@ module CommandModel
|
|
47
47
|
def self.parameters
|
48
48
|
@parameters ||= []
|
49
49
|
end
|
50
|
-
|
50
|
+
|
51
51
|
def self.attr_typecasting_writer(name, target_type) #:nodoc
|
52
52
|
eval <<-END_EVAL
|
53
|
-
def #{name}=(value)
|
53
|
+
public def #{name}=(value)
|
54
54
|
typecast_value = typecast_#{target_type}(value)
|
55
55
|
if typecast_value
|
56
56
|
@typecast_errors.delete("#{name}")
|
@@ -59,12 +59,12 @@ module CommandModel
|
|
59
59
|
@typecast_errors["#{name}"] = "#{target_type}"
|
60
60
|
@#{name} = value
|
61
61
|
end
|
62
|
-
|
62
|
+
|
63
63
|
@#{name}
|
64
64
|
end
|
65
65
|
END_EVAL
|
66
66
|
end
|
67
|
-
|
67
|
+
|
68
68
|
# Executes a block of code if the command model is valid.
|
69
69
|
#
|
70
70
|
# Accepts either a command model or a hash of attributes with which to
|
@@ -85,10 +85,10 @@ module CommandModel
|
|
85
85
|
else
|
86
86
|
new(attributes_or_command)
|
87
87
|
end
|
88
|
-
|
88
|
+
|
89
89
|
command.call &block
|
90
90
|
end
|
91
|
-
|
91
|
+
|
92
92
|
# Quickly create a successful command object. This is used when the
|
93
93
|
# command takes no parameters to want to take advantage of the success?
|
94
94
|
# and errors properties of a command object.
|
@@ -97,7 +97,7 @@ module CommandModel
|
|
97
97
|
instance.execution_attempted!
|
98
98
|
end
|
99
99
|
end
|
100
|
-
|
100
|
+
|
101
101
|
# Quickly create a failed command object. Requires one parameter with
|
102
102
|
# the description of what went wrong. This is used when the
|
103
103
|
# command takes no parameters to want to take advantage of the success?
|
@@ -108,7 +108,7 @@ module CommandModel
|
|
108
108
|
instance.errors.add(:base, error)
|
109
109
|
end
|
110
110
|
end
|
111
|
-
|
111
|
+
|
112
112
|
# Accepts a parameters hash or another of the same class. If another
|
113
113
|
# instance of the same class is passed in then the parameters are copied
|
114
114
|
# to the new object.
|
@@ -139,12 +139,12 @@ module CommandModel
|
|
139
139
|
def execution_attempted! #:nodoc:
|
140
140
|
@execution_attempted = true
|
141
141
|
end
|
142
|
-
|
142
|
+
|
143
143
|
# True if execution has been attempted on this command
|
144
144
|
def execution_attempted?
|
145
145
|
@execution_attempted
|
146
146
|
end
|
147
|
-
|
147
|
+
|
148
148
|
# Command has been executed without errors
|
149
149
|
def success?
|
150
150
|
execution_attempted? && errors.empty?
|
@@ -164,15 +164,15 @@ module CommandModel
|
|
164
164
|
send "#{k}=", v
|
165
165
|
end
|
166
166
|
end
|
167
|
-
|
167
|
+
|
168
168
|
#:nodoc:
|
169
169
|
def persisted?
|
170
170
|
false
|
171
171
|
end
|
172
|
-
|
172
|
+
|
173
173
|
private
|
174
174
|
def extract_parameters_from_hash_or_instance(hash_or_instance)
|
175
|
-
if hash_or_instance.respond_to?(:parameters)
|
175
|
+
if hash_or_instance.respond_to?(:parameters)
|
176
176
|
hash_or_instance.parameters
|
177
177
|
else
|
178
178
|
hash_or_instance
|
@@ -182,11 +182,15 @@ module CommandModel
|
|
182
182
|
def typecast_integer(value)
|
183
183
|
Integer(value) rescue nil
|
184
184
|
end
|
185
|
-
|
185
|
+
|
186
|
+
def typecast_decimal(value)
|
187
|
+
BigDecimal(value, 16) rescue nil
|
188
|
+
end
|
189
|
+
|
186
190
|
def typecast_float(value)
|
187
191
|
Float(value) rescue nil
|
188
192
|
end
|
189
|
-
|
193
|
+
|
190
194
|
def typecast_date(value)
|
191
195
|
return value if value.kind_of? Date
|
192
196
|
value = value.to_s
|
@@ -196,7 +200,7 @@ module CommandModel
|
|
196
200
|
Date.strptime(value, "%m/%d/%Y") rescue nil
|
197
201
|
end
|
198
202
|
end
|
199
|
-
|
203
|
+
|
200
204
|
def include_typecasting_errors
|
201
205
|
@typecast_errors.each do |attribute, target_type|
|
202
206
|
unless errors[attribute].present?
|
@@ -204,7 +208,7 @@ module CommandModel
|
|
204
208
|
end
|
205
209
|
end
|
206
210
|
end
|
207
|
-
|
211
|
+
|
208
212
|
# overriding this to make typecasting errors run at the end so they will
|
209
213
|
# not run if there is already an error on the column. Otherwise, when
|
210
214
|
# typecasting to an integer and using validates_numericality_of two
|
data/spec/model_spec.rb
CHANGED
@@ -8,27 +8,27 @@ end
|
|
8
8
|
describe CommandModel::Model do
|
9
9
|
let(:example_command) { ExampleCommand.new :name => "John" }
|
10
10
|
let(:invalid_example_command) { ExampleCommand.new }
|
11
|
-
|
11
|
+
|
12
12
|
describe "self.parameter" do
|
13
13
|
let(:klass) { Class.new(CommandModel::Model) }
|
14
|
-
|
14
|
+
|
15
15
|
it "creates an attribute reader" do
|
16
16
|
klass.parameter :foo
|
17
17
|
klass.new.methods.should include(:foo)
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
it "creates an attribute writer" do
|
21
21
|
klass.parameter :foo
|
22
22
|
klass.new.methods.should include(:foo=)
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
it "round trips values through writing and reading" do
|
26
26
|
klass.parameter :foo
|
27
27
|
instance = klass.new
|
28
28
|
instance.foo = 42
|
29
29
|
instance.foo.should eq(42)
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
it "accepts multiple attributes" do
|
33
33
|
klass.parameter :foo, :bar
|
34
34
|
klass.new.methods.should include(:foo)
|
@@ -36,7 +36,7 @@ describe CommandModel::Model do
|
|
36
36
|
klass.new.methods.should include(:bar)
|
37
37
|
klass.new.methods.should include(:bar=)
|
38
38
|
end
|
39
|
-
|
39
|
+
|
40
40
|
it "accepts multiple attributes with typecast" do
|
41
41
|
klass.parameter :foo, :bar, :typecast => "integer"
|
42
42
|
klass.new.methods.should include(:foo)
|
@@ -44,7 +44,7 @@ describe CommandModel::Model do
|
|
44
44
|
klass.new.methods.should include(:bar)
|
45
45
|
klass.new.methods.should include(:bar=)
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
48
|
it "accepts multiple attributes with validation" do
|
49
49
|
klass.parameter :foo, :bar, :presence => true
|
50
50
|
klass.new.methods.should include(:foo)
|
@@ -52,7 +52,7 @@ describe CommandModel::Model do
|
|
52
52
|
klass.new.methods.should include(:bar)
|
53
53
|
klass.new.methods.should include(:bar=)
|
54
54
|
end
|
55
|
-
|
55
|
+
|
56
56
|
it "creates typecasting writer" do
|
57
57
|
klass.send(:define_method, :typecast_42) { |value| 42 }
|
58
58
|
klass.parameter :answer, :typecast => "42"
|
@@ -60,12 +60,12 @@ describe CommandModel::Model do
|
|
60
60
|
instance.answer = "foo"
|
61
61
|
instance.answer.should eq(42)
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
it "creates validations" do
|
65
65
|
instance = ExampleCommand.new
|
66
66
|
instance.should_not be_valid
|
67
67
|
instance.errors[:name].should be_present
|
68
|
-
end
|
68
|
+
end
|
69
69
|
end
|
70
70
|
|
71
71
|
describe "self.parameters" do
|
@@ -87,44 +87,44 @@ describe CommandModel::Model do
|
|
87
87
|
it "accepts object of same kind and returns it" do
|
88
88
|
ExampleCommand.execute(example_command) {}.should eq(example_command)
|
89
89
|
end
|
90
|
-
|
90
|
+
|
91
91
|
it "accepts attributes, creates object, and returns it" do
|
92
92
|
c = ExampleCommand.execute(:name => "John") {}
|
93
93
|
c.should be_kind_of(ExampleCommand)
|
94
94
|
c.name.should eq("John")
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
it "calls passed block when there are no validation errors on Model" do
|
98
98
|
block_ran = false
|
99
99
|
ExampleCommand.execute(example_command) { block_ran = true }
|
100
|
-
block_ran.should eq(true)
|
100
|
+
block_ran.should eq(true)
|
101
101
|
end
|
102
|
-
|
102
|
+
|
103
103
|
it "does not call passed block when there are validation errors on Model" do
|
104
104
|
block_ran = false
|
105
105
|
ExampleCommand.execute(invalid_example_command) { block_ran = true }
|
106
106
|
block_ran.should eq(false)
|
107
107
|
end
|
108
|
-
|
108
|
+
|
109
109
|
it "records execution attempt when there not no validation errors on Model" do
|
110
110
|
ExampleCommand.execute(example_command) {}
|
111
111
|
example_command.execution_attempted?.should eq(true)
|
112
112
|
end
|
113
|
-
|
113
|
+
|
114
114
|
it "records execution attempt when there are validation errors on Model" do
|
115
115
|
ExampleCommand.execute(invalid_example_command) {}
|
116
116
|
invalid_example_command.execution_attempted?.should eq(true)
|
117
117
|
end
|
118
|
-
|
118
|
+
|
119
119
|
it "is not successful if block adds error to Model" do
|
120
120
|
ExampleCommand.execute(example_command) do |command|
|
121
121
|
command.errors.add :base, "foo"
|
122
122
|
end
|
123
|
-
|
123
|
+
|
124
124
|
example_command.should_not be_success
|
125
125
|
end
|
126
126
|
end
|
127
|
-
|
127
|
+
|
128
128
|
describe "self.success" do
|
129
129
|
it "creates a successful command model" do
|
130
130
|
response = ExampleCommand.success
|
@@ -132,7 +132,7 @@ describe CommandModel::Model do
|
|
132
132
|
response.should be_success
|
133
133
|
end
|
134
134
|
end
|
135
|
-
|
135
|
+
|
136
136
|
describe "self.failure" do
|
137
137
|
it "creates a command model with an error" do
|
138
138
|
response = ExampleCommand.failure "something broke"
|
@@ -141,7 +141,7 @@ describe CommandModel::Model do
|
|
141
141
|
response.errors[:base].should eq(["something broke"])
|
142
142
|
end
|
143
143
|
end
|
144
|
-
|
144
|
+
|
145
145
|
|
146
146
|
describe "initialize" do
|
147
147
|
it "assigns parameters from hash" do
|
@@ -190,25 +190,25 @@ describe CommandModel::Model do
|
|
190
190
|
expect(block_arg).to eq(example_command)
|
191
191
|
end
|
192
192
|
end
|
193
|
-
|
193
|
+
|
194
194
|
describe "execution_attempted!" do
|
195
195
|
it "sets execution_attempted? to true" do
|
196
196
|
example_command.execution_attempted!
|
197
197
|
example_command.execution_attempted?.should eq(true)
|
198
198
|
end
|
199
199
|
end
|
200
|
-
|
200
|
+
|
201
201
|
describe "success?" do
|
202
202
|
it "is false before execution" do
|
203
203
|
example_command.should_not be_success
|
204
204
|
end
|
205
|
-
|
205
|
+
|
206
206
|
it "is false after execution with errors" do
|
207
207
|
example_command.execution_attempted!
|
208
208
|
example_command.errors.add :base, "foo"
|
209
209
|
example_command.success?.should eq(false)
|
210
210
|
end
|
211
|
-
|
211
|
+
|
212
212
|
it "is true after execution without errors" do
|
213
213
|
example_command.execution_attempted!
|
214
214
|
example_command.success?.should eq(true)
|
@@ -240,12 +240,12 @@ describe CommandModel::Model do
|
|
240
240
|
expect(example_command.title).to eq("Boss")
|
241
241
|
end
|
242
242
|
end
|
243
|
-
|
243
|
+
|
244
244
|
describe "typecast_integer" do
|
245
245
|
it "casts to integer when valid string" do
|
246
246
|
example_command.send(:typecast_integer, "42").should eq(42)
|
247
247
|
end
|
248
|
-
|
248
|
+
|
249
249
|
it "returns nil when invalid string" do
|
250
250
|
example_command.send(:typecast_integer, "asdf").should be_nil
|
251
251
|
example_command.send(:typecast_integer, nil).should be_nil
|
@@ -253,32 +253,53 @@ describe CommandModel::Model do
|
|
253
253
|
example_command.send(:typecast_integer, "0.1").should be_nil
|
254
254
|
end
|
255
255
|
end
|
256
|
-
|
256
|
+
|
257
257
|
describe "typecast_float" do
|
258
258
|
it "casts to float when valid string" do
|
259
259
|
example_command.send(:typecast_float, "42").should eq(42.0)
|
260
260
|
example_command.send(:typecast_float, "42.5").should eq(42.5)
|
261
261
|
end
|
262
|
-
|
262
|
+
|
263
263
|
it "returns nil when invalid string" do
|
264
264
|
example_command.send(:typecast_float, "asdf").should be_nil
|
265
265
|
example_command.send(:typecast_float, nil).should be_nil
|
266
266
|
example_command.send(:typecast_float, "").should be_nil
|
267
267
|
end
|
268
268
|
end
|
269
|
-
|
269
|
+
|
270
|
+
describe "typecast_decimal" do
|
271
|
+
it "converts to BigDecimal when valid string" do
|
272
|
+
example_command.send(:typecast_decimal, "42").should eq(BigDecimal("42"))
|
273
|
+
example_command.send(:typecast_decimal, "42.5").should eq(BigDecimal("42.5"))
|
274
|
+
end
|
275
|
+
|
276
|
+
it "converts to BigDecimal when float" do
|
277
|
+
example_command.send(:typecast_decimal, 42.0).should eq(BigDecimal("42"))
|
278
|
+
end
|
279
|
+
|
280
|
+
it "converts to BigDecimal when int" do
|
281
|
+
example_command.send(:typecast_decimal, 42).should eq(BigDecimal("42"))
|
282
|
+
end
|
283
|
+
|
284
|
+
it "returns nil when invalid string" do
|
285
|
+
example_command.send(:typecast_decimal, "asdf").should be_nil
|
286
|
+
example_command.send(:typecast_decimal, nil).should be_nil
|
287
|
+
example_command.send(:typecast_decimal, "").should be_nil
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
270
291
|
describe "typecast_date" do
|
271
292
|
it "casts to date when valid string" do
|
272
293
|
example_command.send(:typecast_date, "01/01/2000").should eq(Date.civil(2000,1,1))
|
273
294
|
example_command.send(:typecast_date, "1/1/2000").should eq(Date.civil(2000,1,1))
|
274
295
|
example_command.send(:typecast_date, "2000-01-01").should eq(Date.civil(2000,1,1))
|
275
296
|
end
|
276
|
-
|
297
|
+
|
277
298
|
it "returns existing date unchanged" do
|
278
299
|
date = Date.civil(2000,1,1)
|
279
300
|
example_command.send(:typecast_date, date).should eq(date)
|
280
301
|
end
|
281
|
-
|
302
|
+
|
282
303
|
it "returns nil when invalid string" do
|
283
304
|
example_command.send(:typecast_date, "asdf").should be_nil
|
284
305
|
example_command.send(:typecast_date, nil).should be_nil
|
@@ -286,19 +307,19 @@ describe CommandModel::Model do
|
|
286
307
|
example_command.send(:typecast_date, "3/50/1290").should be_nil
|
287
308
|
end
|
288
309
|
end
|
289
|
-
|
310
|
+
|
290
311
|
it "includes typecasting errors in validations" do
|
291
312
|
example_command.instance_variable_get(:@typecast_errors)["name"] = "integer"
|
292
313
|
example_command.should_not be_valid
|
293
314
|
example_command.errors["name"].should be
|
294
315
|
end
|
295
|
-
|
316
|
+
|
296
317
|
it "does not include typecasting error in validations if the attribute already has an error" do
|
297
318
|
invalid_example_command.instance_variable_get(:@typecast_errors)["name"] = "integer"
|
298
319
|
invalid_example_command.should_not be_valid
|
299
320
|
invalid_example_command.errors["name"].should be
|
300
321
|
invalid_example_command.errors["name"].find { |e| e =~ /integer/ }.should_not be
|
301
322
|
end
|
302
|
-
|
303
|
-
|
323
|
+
|
324
|
+
|
304
325
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: command_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Christensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -16,84 +16,84 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.2'
|
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
|
-
version: '
|
26
|
+
version: '4.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 11.3.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 11.3.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.
|
47
|
+
version: 2.14.1
|
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
|
-
version: 2.
|
54
|
+
version: 2.14.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: guard
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 2.14.2
|
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
|
-
version:
|
68
|
+
version: 2.14.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: guard-rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 3.1.0
|
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
|
-
version:
|
82
|
+
version: 3.1.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rb-fsevent
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 0.10.2
|
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
|
-
version: 0.
|
96
|
+
version: 0.10.2
|
97
97
|
description: CommandModel - when update_attributes isn't enough.
|
98
98
|
email:
|
99
99
|
- jack@jackchristensen.com
|
@@ -170,9 +170,9 @@ files:
|
|
170
170
|
- examples/bank/vendor/assets/javascripts/.gitkeep
|
171
171
|
- examples/bank/vendor/assets/stylesheets/.gitkeep
|
172
172
|
- examples/bank/vendor/plugins/.gitkeep
|
173
|
-
- gemfiles/
|
174
|
-
- gemfiles/
|
175
|
-
- gemfiles/
|
173
|
+
- gemfiles/4.2.gemfile
|
174
|
+
- gemfiles/5.0.gemfile
|
175
|
+
- gemfiles/5.1.gemfile
|
176
176
|
- lib/command_model.rb
|
177
177
|
- lib/command_model/model.rb
|
178
178
|
- lib/command_model/version.rb
|
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
197
|
version: '0'
|
198
198
|
requirements: []
|
199
199
|
rubyforge_project:
|
200
|
-
rubygems_version: 2.
|
200
|
+
rubygems_version: 2.7.3
|
201
201
|
signing_key:
|
202
202
|
specification_version: 4
|
203
203
|
summary: CommandModel integrates Rails validations with command objects. This allows
|