lite-command 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +5 -4
- data/lib/lite/command/complex.rb +3 -3
- data/lib/lite/command/simple.rb +2 -2
- data/lib/lite/command/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 436bbcd8024e3203b8d1fe3a9baa4d0d634c2668f0c2a479622ee68de4becdfb
|
4
|
+
data.tar.gz: 7e1fad943b41eb36ac0a4dfbefe19ec214d2016ddde9d8456878ff7ef6870a81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56cf37475d6501782938bfcc064b07d2d2357bde6ac99654a854409ac9c422aa031cbcde908e86b9b2185faa405c750d27a4af5f27adead5350023c6638d0fe5
|
7
|
+
data.tar.gz: c9f76b43944446aeb56b5be3c4eda67af0f48e088e66e32a85623d9ba791a506819f1867f6a02047240e93c9f0f8bd61613216e9d55f08a7b4071773d00b65e2
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.0.2] - 2019-08-12
|
10
|
+
### Changed
|
11
|
+
- Renamed command method to execute
|
12
|
+
- Renamed run method to execute
|
13
|
+
|
9
14
|
## [1.0.1] - 2019-08-07
|
10
15
|
### Changed
|
11
16
|
- Pass args to command in call for Simple based commands
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -40,7 +40,7 @@ class SearchMovies < Lite::Command::Simple
|
|
40
40
|
private
|
41
41
|
|
42
42
|
# NOTE: This class method is required
|
43
|
-
def
|
43
|
+
def execute(*args)
|
44
44
|
{ generate_fingerprint => movies_by_name }
|
45
45
|
end
|
46
46
|
end
|
@@ -68,7 +68,7 @@ class SearchMovies < Lite::Command::Complex
|
|
68
68
|
end
|
69
69
|
|
70
70
|
# NOTE: This instance method is required
|
71
|
-
def
|
71
|
+
def execute
|
72
72
|
{ generate_fingerprint => movies_by_name }
|
73
73
|
end
|
74
74
|
|
@@ -102,7 +102,8 @@ command.call #=> { 'fingerprint_1' => [ 'Toy Story 1', ... ] }
|
|
102
102
|
# - or -
|
103
103
|
|
104
104
|
# Useful when you are not using the Errors mixin as its a one time access call.
|
105
|
-
|
105
|
+
# Very similar to the simple command builder.
|
106
|
+
SearchMovies.execute('Toy Story') #=> { 'fingerprint_1' => [ 'Toy Story 1', ... ] }
|
106
107
|
```
|
107
108
|
|
108
109
|
**Result**
|
@@ -144,7 +145,7 @@ class SearchMovies < Lite::Command::Complex
|
|
144
145
|
end
|
145
146
|
```
|
146
147
|
|
147
|
-
**
|
148
|
+
**Callers**
|
148
149
|
|
149
150
|
```ruby
|
150
151
|
# Useful for controllers or actions that depend on states.
|
data/lib/lite/command/complex.rb
CHANGED
@@ -12,7 +12,7 @@ module Lite
|
|
12
12
|
klass
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
15
|
+
def execute(*args)
|
16
16
|
klass = call(*args)
|
17
17
|
klass.result
|
18
18
|
end
|
@@ -26,11 +26,11 @@ module Lite
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def call
|
29
|
-
raise Lite::Command::NotImplementedError unless defined?(
|
29
|
+
raise Lite::Command::NotImplementedError unless defined?(execute)
|
30
30
|
return @result if called?
|
31
31
|
|
32
32
|
@called = true
|
33
|
-
@result =
|
33
|
+
@result = execute
|
34
34
|
end
|
35
35
|
|
36
36
|
def called?
|
data/lib/lite/command/simple.rb
CHANGED
data/lib/lite/command/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lite-command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lite-errors
|