qq 0.2.3 → 0.2.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/qq.rb +6 -8
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2bb271ddd001f9dee96a1584ab22c998ebf711f1
4
- data.tar.gz: 55504f0a3cba1d9e6e5a05bf069ccbed2bc9a536
3
+ metadata.gz: 0bda4efc91a9d9c2ca0c0d2bda31969e9683af93
4
+ data.tar.gz: 2ec309b3914cf24ed94c3dfbab3343142219b37b
5
5
  SHA512:
6
- metadata.gz: efac134cccd825b0b4951d91d58b9c84c98b64c5e134688561c424b1bb51128f9d1915f67b8188084526db99039e64474d883cb82b6231c623e254dca6822e8e
7
- data.tar.gz: 8aa113b8c4a9c4be24fa9d8143d9d2800d2461befa42e8830629a0234db67e0cb2b0f58ad530e752441a8a9cea884cdbdebe61e7ac45003d674a966d7a1cd6cc
6
+ metadata.gz: 2f3bbbc35a5fd088c0acb7c3ac497ef1f01d45a8000062a2ac643b51011e56308e75e7423f6c07579de7704c11cedd72cf4a35a63d911b744abf8f4e3616f5d8
7
+ data.tar.gz: 05e27d595f8986b29ec4359084e99c2f79908ac8a4c487e639de5b7c33231c17aac19b468580038a99b612409f4ad3f95174a8a062abba6cbce2f8d3c191531d
data/lib/qq.rb CHANGED
@@ -34,7 +34,7 @@ class QQ < Parser::AST::Processor
34
34
  NORMAL, YELLOW, CYAN = "\x1b[0m", "\x1b[33m", "\x1b[36m"
35
35
 
36
36
  @@mutex ||= Mutex.new
37
- @@start ||= Time.now
37
+ @@start ||= Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_second)
38
38
  @@location ||= nil
39
39
 
40
40
  # @see Kernel#qq
@@ -65,20 +65,18 @@ class QQ < Parser::AST::Processor
65
65
  end
66
66
 
67
67
  protected
68
+
68
69
  def write args
69
70
  File.open(File.join(Dir.tmpdir, 'q'), 'a') do |fh|
70
- now = Time.now
71
+ now = Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_second)
71
72
 
72
- if @@start <= now - 2 || @@location&.label != @location.label
73
- fh.write "\n%s[%s] %s\n" % [NORMAL, now.strftime('%T'), @location]
73
+ if @@start <= now - 2.0 || @@location&.label != @location.label
74
+ fh.write "\n%s[%s] %s\n" % [NORMAL, Time.now.strftime('%T'), @location]
74
75
  @@start = now
75
76
  end
76
77
 
77
78
  args.each do |arg, arg_source|
78
- if defined?(ActiveRecord) && arg.is_a?(ActiveRecord::Base) && arg.respond_to?(:attributes)
79
- arg = arg.attributes
80
- end
81
- fh.write [YELLOW, "%1.3fs " % (now - @@start), NORMAL, arg_source, ' = ', CYAN].join
79
+ fh.write [YELLOW, '%1.3fs ' % (now - @@start), NORMAL, arg_source, ' = ', CYAN].join
82
80
  PP.pp(arg, fh)
83
81
  fh.write NORMAL
84
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Hanna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-19 00:00:00.000000000 Z
11
+ date: 2017-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  version: '0'
68
68
  requirements: []
69
69
  rubyforge_project:
70
- rubygems_version: 2.5.1
70
+ rubygems_version: 2.6.10
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: Improved pp debugging.