hashformer 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/Rakefile +3 -0
- data/lib/hashformer/generate.rb +10 -0
- data/lib/hashformer/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2477c5b2c20be0b81ccdc1927dc3e8ef64adcd2c
|
4
|
+
data.tar.gz: a3b05c569f07c787f55507a358bae3c5e96a3216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abb82bae7bb0aa0ef61204f2d8e3b96a695852c277f612bfaabdf88e99ce87ad84f036d530b0a74da611bab6822e438703125b12126887365876b92da9e99ff1
|
7
|
+
data.tar.gz: 70e6040079778f287cd9981eb9b815e2b97895560b0f8bf17fdc60a168362ac0fefdbc85da132a8933caf7a57f7579619b4624758a8fd189571e5415ca4cbeec
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
Hashformer
|
1
|
+
Hashformer
|
2
2
|
=========
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/hashformer.svg)](http://badge.fury.io/rb/hashformer) [![Code Climate](https://codeclimate.com/github/deseretbook/hashformer.png)](https://codeclimate.com/github/deseretbook/hashformer) [![Test Coverage](https://codeclimate.com/github/deseretbook/hashformer/coverage.png)](https://codeclimate.com/github/deseretbook/hashformer) [![Codeship Status for deseretbook/hashformer](https://www.codeship.io/projects/dd988da0-dee7-0131-9e92-7e1ff0bec112/status?branch=master)](https://www.codeship.io/projects/24888)
|
3
4
|
|
4
5
|
### Transform any Ruby Hash with a declarative DSL
|
5
6
|
|
data/Rakefile
ADDED
data/lib/hashformer/generate.rb
CHANGED
@@ -23,6 +23,8 @@ module Hashformer
|
|
23
23
|
values = @block.call(*values) if @block
|
24
24
|
values
|
25
25
|
end
|
26
|
+
|
27
|
+
# TODO: Make maps chainable? Or at least add a #reduce method.
|
26
28
|
end
|
27
29
|
|
28
30
|
# Internal representation of a path to a nested key/value. Do not
|
@@ -111,8 +113,16 @@ module Hashformer
|
|
111
113
|
@calls << info
|
112
114
|
self
|
113
115
|
end
|
116
|
+
|
117
|
+
# Returns a String with the class name and a list of chained methods.
|
118
|
+
def to_s
|
119
|
+
"#{self.class.name}: #{@calls.map{|c| c[:name]}}"
|
120
|
+
end
|
121
|
+
alias inspect to_s
|
114
122
|
end
|
115
123
|
|
124
|
+
# TODO: Add a constant generator (that can be chained?)
|
125
|
+
|
116
126
|
# Generates a transformation that passes one or more values from the input
|
117
127
|
# Hash (denoted by key names or paths (see Hashformer::Generate.path) to
|
118
128
|
# the block. If the block is not given, then the values are placed in an
|
data/lib/hashformer/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hashformer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Deseret Book
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-08-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -60,6 +60,7 @@ files:
|
|
60
60
|
- Gemfile
|
61
61
|
- LICENSE
|
62
62
|
- README.md
|
63
|
+
- Rakefile
|
63
64
|
- hashformer.gemspec
|
64
65
|
- lib/hashformer.rb
|
65
66
|
- lib/hashformer/generate.rb
|