vignette 0.0.4pre1 → 0.0.4pre2

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.
@@ -3,9 +3,13 @@ module ObjectExtensions
3
3
  # Extensions to the Array object
4
4
  module ArrayExtensions
5
5
 
6
+ def crc
7
+ Zlib.crc32(self.join)
8
+ end
9
+
6
10
  # Test will select a random object from the Array
7
11
  def vignette(name=nil)
8
- key = "vignette_#{name || hash.abs.to_s(16)}"
12
+ key = "vignette_#{name || crc.abs.to_s(16)}"
9
13
  test_name = nil
10
14
 
11
15
  if name.blank?
@@ -13,7 +17,7 @@ module ObjectExtensions
13
17
  # E.g /Users/hayesgm/animals/shadow/app/views/landing/family.html.haml:11:in `_app_views_landing_family_html_haml__3008026497873467685_70232967999960'
14
18
  # -> app/views/landing/family.html.haml:313c7f3a472883ba
15
19
  filename = caller[1].split(':')[0].gsub(Rails.root.to_s+'/','') # Take the view name
16
- test_name = "#{filename}:#{hash.abs.to_s(16)}"
20
+ test_name = "#{filename}:#{crc.abs.to_s(16)}"
17
21
  else
18
22
  # E.g /Users/hayesgm/animals/shadow/app/controllers/home_controller.rb:27:in `home'
19
23
  # -> app/controllers/home_controller:home:313c7f3a472883ba
@@ -22,7 +26,7 @@ module ObjectExtensions
22
26
  m = /(?<filename>[\w.\/]+):(?<line>\d+):in `(?<function>\w+)'/.match(line)
23
27
 
24
28
  if m && !m[:filename].blank? && !m[:function].blank?
25
- test_name = "#{m[:filename]}:#{m[:function]}:#{hash.abs.to_s(16)}"
29
+ test_name = "#{m[:filename]}:#{m[:function]}:#{crc.abs.to_s(16)}"
26
30
  else # Fallback
27
31
  test_name = key
28
32
  end
@@ -1,3 +1,3 @@
1
1
  module Vignette
2
- VERSION = "0.0.4pre1"
2
+ VERSION = "0.0.4pre2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vignette
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4pre1
4
+ version: 0.0.4pre2
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors: