trick_bag 0.46.0 → 0.47.0

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: 57ae02e1d4096731aaa9594252922acc1ade8cea
4
- data.tar.gz: c42a91603f217852a041a7dbaf5ee44a36c6ff29
3
+ metadata.gz: d01ca3cfe583081305fb5ab8275177ae10dae944
4
+ data.tar.gz: 53a75fcdec73d0ef74ef6c5e95d68a78661da520
5
5
  SHA512:
6
- metadata.gz: 54c102e7e407cb063106c8b387731dfb8844d69580dbc97ff6dc138fa1c40dd06f8c5faa7897fb2f408b5dea9e88437a36923b442653a96ac7bcc291f3f62785
7
- data.tar.gz: 8be1ece013e697c268106a184a1e66250b3bfa323e3557930f4a222b99eba7fd91313b2f74a5bb14c9a7b589155ba6863ee621f1ed29bbf4157fb85da93369b5
6
+ metadata.gz: 947ec282b463b2a1916ef64735bc585a1d9956c76fceebea3c0c8b0112659499a5374a7ad578837eb5d80a3c4be5f63bdf6d5cf483a189a670e10b18d93417f0
7
+ data.tar.gz: 098840c716d1ecab47b56f663640551d412e3dc9c304f7efec8f56c6a4759f33de0f189e8ece115e2b5a98060449d26929548798f193d364e2f7c5bc71889c19
data/RELEASE_NOTES.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## v0.47.0
2
+
3
+ * Remove array_as_multiline_string; it's too similar to array.join("\n").
4
+
5
+
1
6
  ## v0.46.0
2
7
 
3
8
  * Add array_diff and array_as_multiline_string to Formatters.
@@ -123,22 +123,13 @@ module Formatters
123
123
  end
124
124
 
125
125
 
126
- # Returns a string representation of the array as would be output by puts,
127
- # one line per element.
128
- def array_as_multiline_string(array)
129
- sio = StringIO.new
130
- sio.puts(array)
131
- sio.string
132
- end
133
-
134
-
135
126
  # Shows a visual diff of 2 arrays by comparing the string representations
136
127
  # of the arrays with one element per line.
137
128
  # @param format can be any valid Diffy option, e.g. :color
138
129
  # see https://github.com/samg/diffy/blob/master/lib/diffy/format.rb
139
130
  def array_diff(array1, array2, format = :text)
140
- string1 = array_as_multiline_string(array1)
141
- string2 = array_as_multiline_string(array2)
131
+ string1 = array1.join("\n") + "\n"
132
+ string2 = array2.join("\n") + "\n"
142
133
  Diffy::Diff.new(string1, string2).to_s(format)
143
134
  end
144
135
 
@@ -1,3 +1,3 @@
1
1
  module TrickBag
2
- VERSION = "0.46.0"
2
+ VERSION = "0.47.0"
3
3
  end
@@ -124,29 +124,13 @@ describe Formatters do
124
124
  end
125
125
 
126
126
 
127
- context 'array_as_multiline_string' do
128
- specify 'string representation is correct when array is NOT empty' do
129
- array = [1, 2, 3]
130
- expect(Formatters.array_as_multiline_string(array)).to eq("1\n2\n3\n")
131
- end
132
-
133
- specify 'string representation is correct when array is empty' do
134
- array = []
135
- expect(Formatters.array_as_multiline_string(array)).to eq("")
136
- end
137
- end
138
-
139
-
140
127
  context 'array_diff' do
141
128
  specify 'text is correct' do
142
129
  a1 = [1, 2, 3]
143
130
  a2 = [ 2, 3, 4]
144
- actual_text = Formatters.array_diff(a1, a2, :color)
131
+ actual_text = Formatters.array_diff(a1, a2)
145
132
  expected_text = "-1\n 2\n 3\n+4\n"
146
133
  expect(actual_text).to eq(expected_text)
147
- puts
148
- puts actual_text
149
- puts
150
134
  end
151
135
  end
152
136
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trick_bag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.46.0
4
+ version: 0.47.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Bennett