lhs 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lhs/collection.rb +2 -0
- data/lib/lhs/version.rb +1 -1
- data/spec/collection/enumerable_spec.rb +27 -0
- data/spec/data/select_spec.rb +21 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b80422557549f4c6187df6ec6068be2d4186317
|
4
|
+
data.tar.gz: ed4841db53bf4da2636c33167eea5171f6064199
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 475b1f2ba9d9082f086e3e2777b28cd19eea593ca2678484c72121e5b128667f1f324c85b1b869ba032084076a4c994565f60c0c403e6b9737fc55133a8ef17b
|
7
|
+
data.tar.gz: ee009de8735ccd8ae997b6c97530a6dee5243a34c2498fc54c7c35b6421f0831845007ae8b32ededc02a41b2db7737c6bd1ee5eb1a224d2f0f52e4ca6259e3c5
|
data/lib/lhs/collection.rb
CHANGED
data/lib/lhs/version.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
describe LHS::Collection do
|
4
|
+
|
5
|
+
let(:data) {
|
6
|
+
[1, 2, 3]
|
7
|
+
}
|
8
|
+
|
9
|
+
let(:collection){
|
10
|
+
described_class.new(LHS::Data.new(data))
|
11
|
+
}
|
12
|
+
|
13
|
+
context 'enumerable' do
|
14
|
+
|
15
|
+
it 'works with map' do
|
16
|
+
expect(
|
17
|
+
collection.map{|x| x + 1}
|
18
|
+
).to eq [2, 3, 4]
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'works with select' do
|
22
|
+
expect(
|
23
|
+
collection.select{|x| x == 2}
|
24
|
+
).to eq [2]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
describe LHS::Data do
|
4
|
+
|
5
|
+
let(:raw) do
|
6
|
+
{ labels: { de: ['cat', 'dog'] } }
|
7
|
+
end
|
8
|
+
|
9
|
+
let(:data) do
|
10
|
+
LHS::Data.new(raw)
|
11
|
+
end
|
12
|
+
|
13
|
+
context 'select' do
|
14
|
+
|
15
|
+
it 'works with select' do
|
16
|
+
expect(
|
17
|
+
data.labels.de.select{|x| x}.join()
|
18
|
+
).to eq 'catdog'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- local.ch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lhc
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- script/ci/build.sh
|
162
162
|
- spec/.DS_Store
|
163
163
|
- spec/collection/delegate_spec.rb
|
164
|
+
- spec/collection/enumerable_spec.rb
|
164
165
|
- spec/collection/meta_data_spec.rb
|
165
166
|
- spec/collection/respond_to_spec.rb
|
166
167
|
- spec/collection/without_object_items_spec.rb
|
@@ -170,6 +171,7 @@ files:
|
|
170
171
|
- spec/data/raw_spec.rb
|
171
172
|
- spec/data/respond_to_spec.rb
|
172
173
|
- spec/data/root_spec.rb
|
174
|
+
- spec/data/select_spec.rb
|
173
175
|
- spec/data/to_json_spec.rb
|
174
176
|
- spec/dummy/README.rdoc
|
175
177
|
- spec/dummy/Rakefile
|
@@ -274,6 +276,7 @@ specification_version: 4
|
|
274
276
|
summary: LocalHttpServices
|
275
277
|
test_files:
|
276
278
|
- spec/collection/delegate_spec.rb
|
279
|
+
- spec/collection/enumerable_spec.rb
|
277
280
|
- spec/collection/meta_data_spec.rb
|
278
281
|
- spec/collection/respond_to_spec.rb
|
279
282
|
- spec/collection/without_object_items_spec.rb
|
@@ -283,6 +286,7 @@ test_files:
|
|
283
286
|
- spec/data/raw_spec.rb
|
284
287
|
- spec/data/respond_to_spec.rb
|
285
288
|
- spec/data/root_spec.rb
|
289
|
+
- spec/data/select_spec.rb
|
286
290
|
- spec/data/to_json_spec.rb
|
287
291
|
- spec/dummy/README.rdoc
|
288
292
|
- spec/dummy/Rakefile
|