commandoes 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -11
- data/commandoes.gemspec +0 -1
- data/lib/commandoes/command.rb +0 -2
- data/lib/commandoes/version.rb +1 -1
- data/lib/commandoes.rb +0 -2
- metadata +1 -16
- data/lib/commandoes/plugins/virtus_plugin.rb +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ce4baa962b7c64576f85043b0375e3a6e7f73d3
|
4
|
+
data.tar.gz: 7c0024b52b1ea47bf827e56081a967d42f8edd0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e3a2ac346beb5b7fec187b552c71815c97efd7ba2b0033ec490ab4de8394909bea36b7c97513a515239ee6298ecd666b7a9f58d19171c19966e4d2d44d7d30b
|
7
|
+
data.tar.gz: ea294a808aa744fb458db4efcf9662d0a249a83168913ed11206917daf5a4c372b7ec62d0304f7a01247a316f284e229c738ece8358804832bda082dd5e7eb20
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# COMMANDOES
|
2
2
|
|
3
3
|
Commandoes is a project designed to help any ruby app use the command pattern to
|
4
4
|
change state.
|
@@ -7,7 +7,6 @@ change state.
|
|
7
7
|
* ruby-2.3.1
|
8
8
|
|
9
9
|
## DEPENDENCIES
|
10
|
-
* Virtus (https://github.com/solnic/virtus)
|
11
10
|
* ActiveModel::Validations
|
12
11
|
|
13
12
|
## INSTALLATION
|
@@ -15,7 +14,7 @@ change state.
|
|
15
14
|
In your Gemfile
|
16
15
|
|
17
16
|
```
|
18
|
-
gem '
|
17
|
+
gem 'commandoes'
|
19
18
|
```
|
20
19
|
|
21
20
|
## EXAMPLES
|
@@ -28,16 +27,28 @@ gem 'commando', github: 'mdelkins/commando'
|
|
28
27
|
Commandoes uses a plugin system similar to
|
29
28
|
[sequel](https://github.com/jeremyevans/sequel) or
|
30
29
|
[roda](https://github.com/jeremyevans/roda) to extend the behavior of your
|
31
|
-
command objects.
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
command objects.
|
31
|
+
|
32
|
+
### EXAMPLE OF A CUSTOM PLUGIN
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
module Commandoes
|
36
|
+
module Plugins
|
37
|
+
module ExamplePlugin
|
38
|
+
module ClassMethods
|
39
|
+
end
|
40
|
+
|
41
|
+
module InstanceMethods
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
```
|
35
47
|
|
36
|
-
|
48
|
+
Any method in the `ClassMethods` module will be injected into the `IAmACommand`
|
49
|
+
class. Any method in the `InstanceMethods` module will be injected into
|
50
|
+
instances of `IAmACommand` objects.
|
37
51
|
|
38
|
-
This plugin injects the `Virtus.value_object` behavior into
|
39
|
-
`Commandoes::IAmACommand` as well as a few helper methods for easily defining
|
40
|
-
typed attributes.
|
41
52
|
|
42
53
|
### Commandoes::Plugins::ActiveModelPlugin
|
43
54
|
|
data/commandoes.gemspec
CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_dependency "virtus", "~> 1.0"
|
24
23
|
spec.add_dependency "activemodel", "~> 5.0"
|
25
24
|
|
26
25
|
spec.add_development_dependency "bump", "~> 0.5"
|
data/lib/commandoes/command.rb
CHANGED
data/lib/commandoes/version.rb
CHANGED
data/lib/commandoes.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commandoes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Elkins
|
@@ -10,20 +10,6 @@ bindir: exe
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2017-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: virtus
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: activemodel
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -133,7 +119,6 @@ files:
|
|
133
119
|
- lib/commandoes/command.rb
|
134
120
|
- lib/commandoes/dispatcher.rb
|
135
121
|
- lib/commandoes/plugins/activemodel_plugin.rb
|
136
|
-
- lib/commandoes/plugins/virtus_plugin.rb
|
137
122
|
- lib/commandoes/registry.rb
|
138
123
|
- lib/commandoes/version.rb
|
139
124
|
homepage: https://github.com/mdelkins/commando
|
@@ -1,47 +0,0 @@
|
|
1
|
-
module Commandoes
|
2
|
-
module Plugins
|
3
|
-
module VirtusPlugin
|
4
|
-
|
5
|
-
module ClassMethods
|
6
|
-
def self.extended(object)
|
7
|
-
object.send(:include, Virtus.value_object)
|
8
|
-
end
|
9
|
-
|
10
|
-
def bool(value, options={})
|
11
|
-
attribute value, Axiom::Types::Boolean, options
|
12
|
-
end
|
13
|
-
|
14
|
-
def date(value, options={})
|
15
|
-
attribute value, Date, options
|
16
|
-
end
|
17
|
-
|
18
|
-
def datetime(value, options={})
|
19
|
-
attribute value, DateTime, options
|
20
|
-
end
|
21
|
-
|
22
|
-
def decimal(value, options={})
|
23
|
-
attribute value, BigDecimal, options
|
24
|
-
end
|
25
|
-
|
26
|
-
def float(value, options={})
|
27
|
-
attribute value, Float, options
|
28
|
-
end
|
29
|
-
|
30
|
-
def integer(value, options={})
|
31
|
-
attribute value, Integer, options
|
32
|
-
end
|
33
|
-
|
34
|
-
def string(value, options={})
|
35
|
-
attribute value, String, options
|
36
|
-
end
|
37
|
-
|
38
|
-
def time(value, options={})
|
39
|
-
attribute value, Time, options
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
module InstanceMethods
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|