tableware 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 008bc899c66b79add438462dfff36b63dfe6465e
4
- data.tar.gz: 627aa77b932393e933a3b44a6cbef16cc31da48c
3
+ metadata.gz: fe2cc6c82f8fe22be2e4b99022b4940740da1004
4
+ data.tar.gz: 53f0ea321bd8189cfc871c55667cd4e345bf6534
5
5
  SHA512:
6
- metadata.gz: 1fc51b626f8e553462e713e67d75b2ead6e09171269794e704b075cc6a7a22189b1e2a9058d59772e3a0cf3f389bc348be773e9ad914fcace90802eb3ebc3ab9
7
- data.tar.gz: e6cc38365860817dc00842e318bcde7c89b2d47b0b31af1dd450e841d7a3a1a54c3d237bf942bea55f72ac0cd47751b92f553c62d01e226739890435251187ae
6
+ metadata.gz: 9a839b16f79e601270986c600dd7c65a061fb416844856169bb394ac0943a0a31ecb203b83db5c4feab041d2810a94475d462e779842ae8b753e21b095dbdd8a
7
+ data.tar.gz: e21c5a9eedc2342e7bfc23336becb26224816bb8ab806660dbd76e86ace18bb43472a8bf24510b5f3ad5b857dbce0c5e9bf3f816154cfd0b71cebfeead72f47f
data/.semver CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 2
4
- :patch: 0
4
+ :patch: 1
5
5
  :special: ''
6
6
  :metadata: ''
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
+ == v0.2.1 (06 November 2016)
2
+
3
+ * Improve examples in the README
4
+
1
5
  == v0.2.0 (06 November 2016)
2
6
 
3
- * Allow a single line to be processed by prepending it with a `>` character
7
+ * Allow a single row to be processed by prepending it with a `>` character
4
8
 
5
9
  == v0.1.3 (16 August 2016)
6
10
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tableware (0.2.0)
4
+ tableware (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -35,7 +35,9 @@ The downside is that everything is treated as a string, so you may need to do so
35
35
 
36
36
  This isn't always going to be better than defining your data in another format, but it is another option. Or perhaps you just like Cucumber scenario outlines and want something similar in rspec!
37
37
 
38
- You can also focus a single row, to help with debugging, by prepending a line with `>`.
38
+ ### Focus a single row
39
+
40
+ You can focus a single row, to help with debugging, by prepending a line with `>`.
39
41
  For example:
40
42
 
41
43
  ```ruby
@@ -47,6 +49,18 @@ Tableware.arrays(words)
47
49
  #=> [ ['Yay', 'Woo'] ]
48
50
  ```
49
51
 
52
+ ### Focus multiple rows
53
+
54
+ Running multiple rows cannot be achieved with prepending `>`. Instead, use [Enum#select](https://ruby-doc.org/core-2.3.1/Enumerable.html#method-i-select) (or `reject`) to decide which lines to process. For the the previous example, you could achieve the same result using select as follows:
55
+
56
+ ```ruby
57
+ words = ' Foo | Bar
58
+ Yay | Woo
59
+ Zip | Zap '
60
+
61
+ Tableware.arrays(words).select{ |row| row.first == 'Yay' }
62
+ #=> [ ['Yay', 'Woo'] ]
63
+ ```
50
64
 
51
65
  This gem has been created as a quick experiment to see if or how often this feature could be useful.
52
66
  If you find it useful, please like it or better yet, extend it!
@@ -1,5 +1,5 @@
1
1
  class Tableware
2
2
 
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'.freeze
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tableware
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
  - Adam Whittingham