simple_service 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af47217423dfde7e55b44539cb67335bf973e827
4
- data.tar.gz: 6f6955116fc1de25feb69748943bbd693f032fe1
3
+ metadata.gz: 34986961f7123b9e3d467a2886eac29975e5ca1c
4
+ data.tar.gz: 69ef5d5fd27746e2f9cd3ef1fdebf8ca1052f9b7
5
5
  SHA512:
6
- metadata.gz: a29bd75670cad144a923b95738dc20966cd2af9c5c777ee64603f7b498d16ac948e4ed0f1003cd2e15a4dc4d0d9e34c9f03a2782fdb2fb02876d973efb80a4a4
7
- data.tar.gz: 078d232dc698930fec97d656566edce4d29007e144849f03d14c263e0f0a220eb487525bd3e37f9d0822c2daa2dbe4965b46136f60dc6ccdbb044564a0c1ceae
6
+ metadata.gz: de14c40b0a186d035b1a7c1a8b43a4e9d6ac7c00209bccde3f7200661f816baeba28c2b4d94875b95c98122bc95433b9d991367c226ae5ca92f6ef7f7d778d13
7
+ data.tar.gz: 6946d0168b295ff890883a2c7fb966fc5b0214441581712fbc5f785dbb2c999387dc45db49d8e7cd9e12e3564c127012438551049e9069b2dadbd748b925f6ea
data/README.md CHANGED
@@ -7,8 +7,9 @@
7
7
  SimpleService gives you a way to organize service objects such that they adhere
8
8
  to the single responsibility principle. Instead of writing large service objects
9
9
  that perform multiple tasks, SimpleService allows you to breakdown tasks into a
10
- set a sequentially performed Command objects. When properly designed, these command
11
- objects can be reused in multiple different organizers minimizing code duplication.
10
+ set of sequentially performed "Command" objects. Commands are very small classes
11
+ that perform exactly one task. When properly designed, these command
12
+ objects can be reused in multiple organizers minimizing code duplication.
12
13
 
13
14
  When an organizer is instantiated a hash of arguments is passed in. This hash
14
15
  is referred to as the context. The context hash is carried along throughout
@@ -17,13 +18,16 @@ successful run, the entire context hash (or a specified subset) is returned.
17
18
 
18
19
  First, setup an Organizer class. An Organizer needs the following things defined:
19
20
 
20
- * expects: keys that are required to be passed into initialize when an instance
21
- of organizer is created. If not defined the organizer will accept arbitrary arguments.
22
- * returns: keys that will be returned when the organizer has executed all of its commands
23
- * commands: classes that define all the steps that the organizer will execute. The organizer
24
- will call #execute on each command in order and the context hash is passed to each of
25
- these commands. Any keys within the context that are modified will be merged back into
26
- the organizer and passed along to the next command.
21
+ * expects: keys that are required to be passed into initialize when an
22
+ instance of organizer is created. If not defined the organizer will
23
+ accept arbitrary arguments.
24
+ * returns: keys that will be returned when the organizer has executed all of
25
+ its commands
26
+ * commands: classes that define all the steps that the organizer will execute.
27
+ The organizer will call #execute on each command in order and the context
28
+ hash is passed to each of these commands. Any keys within the context that
29
+ are modified will be merged back into the organizer and passed along to the
30
+ next command.
27
31
 
28
32
  ```ruby
29
33
  class ProcessSomethingComplex < SimpleService::Organizer
@@ -102,7 +106,8 @@ not using rails, a similar structure would also be recommended.
102
106
 
103
107
  ## Inspiration and Rationale
104
108
 
105
- This gem is heavily inspired by two very nice gems: [mutations](https://github.com/cypriss/mutations) and
109
+ This gem is heavily inspired by two very nice gems:
110
+ [mutations](https://github.com/cypriss/mutations) and
106
111
  [light-service](https://github.com/adomokos/light-service).
107
112
 
108
113
  Mutations is a great gem, but lacks the concept of a top level organizer.
@@ -1,3 +1,3 @@
1
1
  module SimpleService
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarrod Spillers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-04 00:00:00.000000000 Z
11
+ date: 2015-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler