tresse 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/lib/tresse.rb +11 -6
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4cbe8d134d391a575fb9e6678088eada6153a647
4
- data.tar.gz: 4789741771b4071ea4e68d1e4180745e3cf9555f
3
+ metadata.gz: 75e4b902710be0f597feab968d7b8fbcfbfa221f
4
+ data.tar.gz: c0fa95c1637ab3391138bc27424bd916dd1e74d9
5
5
  SHA512:
6
- metadata.gz: 1dcd1a054d0657d58a0366bf92a103425a5c079adfd13184897e91ed6fdcc5d138378dc56fa4415cba723a41c3c9b75ef79a129be98068d017a5d4e03b28640e
7
- data.tar.gz: bfcfce0ab29d7e477a27225847a2a3a63ff3aa8263ef5ae11c41b9bc9a9e1126d62c778d123fcfccfa7e46dc005629920bb3f26eac82ec8664e6233dda4d725d
6
+ metadata.gz: 62bbacc7d76b0c80eb11401221c6e4a088c97ea40d077344b5fa05fee41e77dfb36b0a28600cc1eba1e7c2f38607b44e164358e4d9e66f1fa82d185ad516f6d0
7
+ data.tar.gz: 4cc9b5c16c00f742e509853d26ae7a6547650c67ba01d4b9a11da57ad55156b57d761f631b0b5b23d7c079304553cb380093479622c31f5d4003d8c633b80d9d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ## tresse 1.1.2 released 2019-09-17
6
+
7
+ * Let Tresse::Group#flatten accept non-arrays
8
+
9
+
5
10
  ## tresse 1.1.1 released 2019-09-17
6
11
 
7
12
  * Refine Tresse::Group#source_each
data/lib/tresse.rb CHANGED
@@ -4,7 +4,7 @@ require 'thread'
4
4
 
5
5
  module Tresse
6
6
 
7
- VERSION = '1.1.1'
7
+ VERSION = '1.1.2'
8
8
 
9
9
  class << self
10
10
 
@@ -144,11 +144,9 @@ module Tresse
144
144
  #
145
145
  # sourcing methods
146
146
 
147
- def source(o=nil, &block)
147
+ def source(&block)
148
148
 
149
- batch = Tresse::Batch.new(self, o ? o : block)
150
-
151
- @batches << batch
149
+ @batches << Tresse::Batch.new(self, block)
152
150
 
153
151
  self
154
152
  end
@@ -190,7 +188,14 @@ module Tresse
190
188
 
191
189
  def flatten
192
190
 
193
- do_reduce([], lambda { |a, e| a.concat(e) })
191
+ do_reduce(
192
+ [],
193
+ lambda { |a, e|
194
+ if e.respond_to?(:to_a) && ! e.is_a?(Hash)
195
+ a.concat(e.to_a)
196
+ else
197
+ a.push(e)
198
+ end })
194
199
  end
195
200
  alias values flatten
196
201
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tresse
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-16 00:00:00.000000000 Z
11
+ date: 2019-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec