supa 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/supa/builder.rb +1 -2
- data/lib/supa/command.rb +2 -3
- data/lib/supa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6b7efd9667abba76f2e38690529fc1d48d65785
|
4
|
+
data.tar.gz: 9deff2741c116d12ca1f7eb064043bfe3ca5e9f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5454644b39f98f31051e061922a3df2b68c1fe01c531dbf109dc48436054d5769af063f2b7efb9ce94cb0727bc814bf246b204adc9a3f2a58eec8b008ab6fad
|
7
|
+
data.tar.gz: 072f2b3885875c593637df845b4b9499580cf339f2064f1db781de673bfd18aa10e0a6311b5de8001ea618556901250ff612445ad3c9beb278c1aeeebe5e9e0e
|
data/lib/supa/builder.rb
CHANGED
@@ -12,12 +12,11 @@ module Supa
|
|
12
12
|
COMMANDS.each do |command|
|
13
13
|
klass = Supa::Commands.const_get(command.capitalize)
|
14
14
|
|
15
|
-
define_method command do |name,
|
15
|
+
define_method command do |name, options = {}, &block|
|
16
16
|
klass.new(representer: representer,
|
17
17
|
context: context,
|
18
18
|
tree: tree,
|
19
19
|
name: name,
|
20
|
-
getter: getter,
|
21
20
|
options: options,
|
22
21
|
&block).represent
|
23
22
|
end
|
data/lib/supa/command.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
module Supa
|
2
2
|
class Command
|
3
|
-
def initialize(representer:, context:, tree:, name:,
|
3
|
+
def initialize(representer:, context:, tree:, name:, options: {}, &block)
|
4
4
|
@representer = representer
|
5
5
|
@context = context
|
6
6
|
@tree = tree
|
7
7
|
@name = name
|
8
|
-
@getter = getter
|
9
8
|
@options = options
|
10
9
|
@block = block
|
11
10
|
end
|
@@ -58,7 +57,7 @@ module Supa
|
|
58
57
|
end
|
59
58
|
|
60
59
|
def getter
|
61
|
-
|
60
|
+
options[:getter] || @name
|
62
61
|
end
|
63
62
|
end
|
64
63
|
end
|
data/lib/supa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: supa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Das
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|