vignette 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/vignette.rb +1 -1
- data/lib/vignette/version.rb +1 -1
- data/spec/lib/vignette_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9db895564914a5387c5822faf6a42c591f96d76
|
4
|
+
data.tar.gz: dcb11d3ae9e4f9584db8f69ff262661a1108511d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16e6a8f1850a236814373aab8433b9b7a286e2d818f878c1d0df29c0b5af6401e72e1f972a3be59ed7f0228b15bbc6c663e75c2646e6cd69df3293ef7f142315
|
7
|
+
data.tar.gz: bccdef2544d9f9f3e17b43372b4924b8b5f3e226b4e2bf6974ccc485dd8db226de72d87bc119e7a5a31b45dccb198e9ee27c095e1652bfd7fa68994ebb6d0d3e
|
data/README.md
CHANGED
@@ -62,9 +62,9 @@ Vignette `tests` are identified by a checksum of the Array, and thus, changing t
|
|
62
62
|
Test <strong>two</strong>
|
63
63
|
Test #{three}
|
64
64
|
|
65
|
-
The choices for these tests are exposed through the `Vignette.
|
65
|
+
The choices for these tests are exposed through the `Vignette.tests` method:
|
66
66
|
|
67
|
-
Vignette.
|
67
|
+
Vignette.tests -> { '(app/views/users/new.html.haml:35)' => 'Test one' } # First choice was select for new.html.haml test line 35
|
68
68
|
|
69
69
|
You may store these values as properties in your analytics system.
|
70
70
|
|
data/lib/vignette.rb
CHANGED
@@ -98,7 +98,7 @@ module Vignette
|
|
98
98
|
|
99
99
|
name_values = vig.values.map { |v| [ v['n'], [ v['t'], v['v'] ] ] }.group_by { |el| el[0] }
|
100
100
|
|
101
|
-
arr = name_values.map { |k,v| [ k.to_sym, v.sort { |a,b| b[1][0] <=> a[1][0] }.first[1][1] ] }
|
101
|
+
arr = name_values.map { |k,v| [ k.to_s.to_sym, v.sort { |a,b| b[1][0] <=> a[1][0] }.first[1][1] ] }
|
102
102
|
|
103
103
|
Hash[arr]
|
104
104
|
end
|
data/lib/vignette/version.rb
CHANGED
data/spec/lib/vignette_spec.rb
CHANGED
@@ -28,6 +28,11 @@ describe Vignette do
|
|
28
28
|
expect(array.vignette).to eq('b'); new_line = __LINE__
|
29
29
|
expect(Vignette.tests).to eq({:"(vignette_spec.rb:#{line})" => 'b'})
|
30
30
|
end
|
31
|
+
|
32
|
+
it 'should handle vignettes with number as names' do
|
33
|
+
expect(%w{a a a}.vignette(0)).to eq('a')
|
34
|
+
expect(Vignette.tests).to eq(:"0" => "a")
|
35
|
+
end
|
31
36
|
end
|
32
37
|
|
33
38
|
context "for multiple runs" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vignette
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoff Hayes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|