fedux_org-stdlib 0.7.18 → 0.7.19

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: e61674d3165d7c29ddbfb16ff957f435e945e67f
4
- data.tar.gz: 2b53ee529f9b9eac666c1624c0cc6d88876c88be
3
+ metadata.gz: 9516f8871b827a5de5b69fc4595149163da19a4d
4
+ data.tar.gz: ccfee460a2303ba9052aafc4378258d307de5c50
5
5
  SHA512:
6
- metadata.gz: 6e6a1038779d52203f2e352f616531edbdcfbb2fa255c5defe7fc6e9de04201b938a88c68b5b722d3be890172e0463e331070fb3e3b8216ec207cc82adec89b1
7
- data.tar.gz: a2d3f1d00fc557bff6221f7f2eb8d4f7f5eb6641a0f3a35f1441854a5e6adb691d74678d2b4ba4ee59b7a2694700889d2e5c8ec77cdfd66a2cd508e1f55526cd
6
+ metadata.gz: 4daaf8e7379496dea493224f12491c6898cd53aef9c6b7476dfafc263f15a4ac478ab265681244d2e5b3afa9741826f26d7e6c4aabc2845565d22675a386dec9
7
+ data.tar.gz: 4d0ce03fbe1e1a0a2b512376dc4a8e69f73b161b39bf584340b7bdacec74b67ae84eaa7e458ea7d9bf78c97ed9a1989a35a641cb8457f4419ce9d8a097affd64
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fedux_org-stdlib (0.7.17)
4
+ fedux_org-stdlib (0.7.18)
5
5
  activesupport
6
6
 
7
7
  PATH
@@ -5,7 +5,7 @@ class Array
5
5
 
6
6
  return items.join(last_separator) if items.size <= 2
7
7
 
8
- result = items.slice(1..-1).join(separator) << last_separator
8
+ result = items.slice(0..-2).join(separator) << last_separator
9
9
  result << items.last
10
10
 
11
11
  result
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  # FeduxOrgStdlib
3
3
  module FeduxOrgStdlib
4
- VERSION = '0.7.18'
4
+ VERSION = '0.7.19'
5
5
  end
@@ -5,9 +5,9 @@ require 'fedux_org_stdlib/core_ext/array/list'
5
5
  RSpec.describe Array do
6
6
  context '#to_list' do
7
7
  it 'handles single value' do
8
- input = %w{ asdf }
8
+ input = %w{ test }
9
9
 
10
- expect(input.to_list).to eq '"asdf"'
10
+ expect(input.to_list).to eq '"test"'
11
11
  end
12
12
 
13
13
  it 'handles two values' do
@@ -17,33 +17,39 @@ RSpec.describe Array do
17
17
  end
18
18
 
19
19
  it 'converts array to a list of values' do
20
- input = %w{ asdf asdf asdf}
20
+ input = %w{ test1 test2 test3 }
21
21
 
22
- expect(input.to_list).to eq '"asdf", "asdf", "asdf"'
22
+ expect(input.to_list).to eq '"test1", "test2", "test3"'
23
+ end
24
+
25
+ it 'converts array to a list of values' do
26
+ input = %w{ test1 test2 test3 test4 }
27
+
28
+ expect(input.to_list).to eq '"test1", "test2", "test3", "test4"'
23
29
  end
24
30
 
25
31
  it 'supports to change the last separator' do
26
- input = %w{ asdf asdf asdf}
32
+ input = %w{ test1 test2 test3}
27
33
 
28
- expect(input.to_list(last_separator: ' or ')).to eq '"asdf", "asdf" or "asdf"'
34
+ expect(input.to_list(last_separator: ' or ')).to eq '"test1", "test2" or "test3"'
29
35
  end
30
36
 
31
37
  it 'supports to change the separator' do
32
- input = %w{ asdf asdf asdf}
38
+ input = %w{ test1 test2 test3}
33
39
 
34
- expect(input.to_list(separator: ':')).to eq '"asdf":"asdf":"asdf"'
40
+ expect(input.to_list(separator: ':')).to eq '"test1":"test2":"test3"'
35
41
  end
36
42
 
37
43
  it 'change multiple things' do
38
- input = %w{ asdf asdf asdf}
44
+ input = %w{ test1 test2 test3}
39
45
 
40
- expect(input.to_list(around: '', separator: ':')).to eq 'asdf:asdf:asdf'
46
+ expect(input.to_list(around: '', separator: ':')).to eq 'test1:test2:test3'
41
47
  end
42
48
 
43
49
  it 'supports to change the string to surround items' do
44
- input = %w{ asdf asdf asdf}
50
+ input = %w{ test1 test2 test3}
45
51
 
46
- expect(input.to_list(around: '$')).to eq '$asdf$, $asdf$, $asdf$'
52
+ expect(input.to_list(around: '$')).to eq '$test1$, $test2$, $test3$'
47
53
  end
48
54
  end
49
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fedux_org-stdlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.18
4
+ version: 0.7.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Meyer