hashformer 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7f71daa79a2af9d68aaa378dca0748ab4e19157
4
- data.tar.gz: 7f17e9b9260f1ad6cbb362a7eebf435995fb2449
3
+ metadata.gz: 2477c5b2c20be0b81ccdc1927dc3e8ef64adcd2c
4
+ data.tar.gz: a3b05c569f07c787f55507a358bae3c5e96a3216
5
5
  SHA512:
6
- metadata.gz: 265374fe6b61f42539c24e3007ce6da1b36da296c92e6c5889325a58da6f4ac4a24f1361586cf42df6afc871be96bd0f740692b65b0d76b4c830e05b038343a0
7
- data.tar.gz: daa336e0a096baebb1bab6535adb24723ac56a9c8f64ddc4513975a3920fcf4b671a91d7dabf5ebfa3ef37cfe73a877c0cd4b90e57513b366f582768b1974fca
6
+ metadata.gz: abb82bae7bb0aa0ef61204f2d8e3b96a695852c277f612bfaabdf88e99ce87ad84f036d530b0a74da611bab6822e438703125b12126887365876b92da9e99ff1
7
+ data.tar.gz: 70e6040079778f287cd9981eb9b815e2b97895560b0f8bf17fdc60a168362ac0fefdbc85da132a8933caf7a57f7579619b4624758a8fd189571e5415ca4cbeec
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
- 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)
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
@@ -0,0 +1,3 @@
1
+ namespace :gem do
2
+ require 'bundler/gem_tasks'
3
+ end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Hashformer
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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-07-16 00:00:00.000000000 Z
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