memory_profiler 0.9.5 → 0.9.6

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: f7e1c880efe5b674c1d8281a7f8659ca224abafe
4
- data.tar.gz: 37e0a418e082d1fd1af188a0966efdc9e97c92d8
3
+ metadata.gz: e2825892e9a2cf16a0cb685f91b8f754e2d85183
4
+ data.tar.gz: 248304fe60edea15abc9e501028bae8b1021d295
5
5
  SHA512:
6
- metadata.gz: e900a6abc28f73ceffc12dae74ba7cb416c53930b5eb9703d00b25a075afda2f9137f6a4f52f6958b91b9afa057c9fc4845227517c147226a1ab99de7dc384c3
7
- data.tar.gz: 915bd319992cbfa7ba1f38a64ae8a5e83358a1bb390f67ac283dfe70cab03463e1698e869a73641f563c4a9aaa29d5b0732049e29341d46c4de1d61f042b2089
6
+ metadata.gz: 2a6c49cf4df8caac5ddc61d7fe1541e79468a522a3519f1d1965586e7195a20740a4623fee1a07130d0b37d9169ed82c85e0758a05076a0f300c02c0e0031d61
7
+ data.tar.gz: 9e9b0a6a4b5b5986d2b029fb12f6c1d3eb62613f61d25df15a3bf2888237f56ead9bb6a980c25cfe5029d8249cb8b265cd58ab427aeb115f9565c6a235e1f7e0
data/README.md CHANGED
@@ -365,6 +365,10 @@ Memory profiler also performs some String analysis to help you find strings that
365
365
 
366
366
  ## Changelog
367
367
 
368
+ ### 0.9.6
369
+ - FIX: pretty_print was failing under some conditions @vincentwoo
370
+ - FIX: if #class is somehow nil don't crash @vincentwoo
371
+
368
372
  ### 0.9.5
369
373
  - Improved stability and performance @dgynn
370
374
 
@@ -25,7 +25,7 @@ module MemoryProfiler
25
25
  end
26
26
 
27
27
  def lookup_class_name(klass)
28
- @class_name_cache[klass] ||= klass.name || '<<Unknown>>'
28
+ @class_name_cache[klass] ||= (klass && klass.name) || '<<Unknown>>'
29
29
  end
30
30
 
31
31
  end
@@ -96,7 +96,7 @@ module MemoryProfiler
96
96
 
97
97
  line = ObjectSpace.allocation_sourceline(obj)
98
98
  location = helper.lookup_location(file, line)
99
- klass = obj.class
99
+ klass = obj.class rescue nil
100
100
  class_name = helper.lookup_class_name(klass)
101
101
  gem = helper.guess_gem(file)
102
102
  string = '' << obj if klass == String
@@ -63,7 +63,7 @@ module MemoryProfiler
63
63
  # @param [Hash] options the options for output
64
64
  # @option opts [String] :to_file a path to your log file
65
65
  # @option opts [Boolean] :color_output a flag for whether to colorize output
66
- def pretty_print(io = STDOUT, options = {})
66
+ def pretty_print(io = STDOUT, **options)
67
67
  io = File.open(options[:to_file], "w") if options[:to_file]
68
68
 
69
69
  color_output = options.fetch(:color_output) { io.respond_to?(:isatty) && io.isatty }
@@ -1,3 +1,3 @@
1
1
  module MemoryProfiler
2
- VERSION = "0.9.5"
2
+ VERSION = "0.9.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memory_profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-12 00:00:00.000000000 Z
11
+ date: 2015-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler