action_commander 1.0.9 → 1.0.10
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 +8 -8
- data/CHANGELOG.md +4 -0
- data/README.md +11 -6
- data/lib/action_commander/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzUyNDdkMzMyY2YxYTgyYzNjOWZkYjU1NzE3MmE0MmJmNWQ3MDFjNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTQxYTdkZTA2YTBiNzk1YjdmYWI3MTMwYzljMGVkZWY4NmNiODFjOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTkwMjYzM2ZiMWQyNWFjZmJlMmYxMDhjMWZiMmVkMjM5YmM2M2I2Y2JmNjdm
|
10
|
+
ODBmZWE2NGQ1YTQxMTcyZmM1ZWUyMTJkMDk2YjlkYzM4MWVmY2IzMjA5ZmQ3
|
11
|
+
YjFlYTkwYzAzZThkYjNjODBmMWVhM2MwY2VmNzgwNzc1OGMzMWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzRkNzFlZGYxZTY3MDI0NTA4MTg2MWUwZWJhNDI5ZDlhZmZlMzU1MmM2M2Y2
|
14
|
+
NWU1NzE5MGYzYjczNmRkZGJiNmI1N2EyYWM4N2ViNTk3MDgxODBiMzI3MTky
|
15
|
+
N2JjM2I3ZDkzYjgyOTJlMzU5OTRkMzZkZTUxZWIxNTIwOTM3Yjk=
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/action_commander)
|
4
4
|
|
5
|
-
Solution based on the [jimweirich/wyriki][jww].
|
5
|
+
Solution based on the [jimweirich/wyriki][jww].
|
6
6
|
This pattern is useful, when you need to separate an interface from a business logic.
|
7
7
|
|
8
8
|
## Installation
|
@@ -29,7 +29,7 @@ require 'action_commander/action'
|
|
29
29
|
class SomeAction < ActionCommander::Action
|
30
30
|
def run(args)
|
31
31
|
# do some things, collect params...
|
32
|
-
# you can inject some dependencies, just use `context`
|
32
|
+
# you can inject some dependencies, just use `context`
|
33
33
|
context.database_session_from_controller.do_something
|
34
34
|
# if everything is ok, pass the result to the 'success' callback
|
35
35
|
if ok
|
@@ -47,7 +47,7 @@ and then you can use it in the controller:
|
|
47
47
|
|
48
48
|
```ruby
|
49
49
|
class SomeController
|
50
|
-
|
50
|
+
|
51
51
|
attr_reader :database_session_from_controller
|
52
52
|
|
53
53
|
def initialize
|
@@ -58,7 +58,7 @@ class SomeController
|
|
58
58
|
# handle input ...
|
59
59
|
run_helper(SomeAction, imput_param1) do |on|
|
60
60
|
on.success do |param1, param2|
|
61
|
-
# ...actions when success...
|
61
|
+
# ...actions when success...
|
62
62
|
end
|
63
63
|
on.failure do |msg|
|
64
64
|
# ...display the error msg ... or something...
|
@@ -66,7 +66,7 @@ class SomeController
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
private
|
69
|
+
private
|
70
70
|
|
71
71
|
def run_helper(action_class, *args, &block)
|
72
72
|
# `self` - the context which is injected to the action
|
@@ -75,6 +75,10 @@ class SomeController
|
|
75
75
|
end
|
76
76
|
```
|
77
77
|
|
78
|
+
## Versioning
|
79
|
+
|
80
|
+
See [semver.org][semver]
|
81
|
+
|
78
82
|
## Contributing
|
79
83
|
|
80
84
|
1. Fork it
|
@@ -83,4 +87,5 @@ end
|
|
83
87
|
4. Push to the branch (`git push origin my-new-feature`)
|
84
88
|
5. Create new Pull Request
|
85
89
|
|
86
|
-
[jww]: https://github.com/jimweirich/wyriki
|
90
|
+
[jww]: https://github.com/jimweirich/wyriki
|
91
|
+
[semver]: http://semver.org/
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_commander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Szymon Kopciewski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|