log_require 0.1.0 → 0.1.1

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: 4aaf2298b38e7e53984adf32fa37f47e7be09684
4
- data.tar.gz: 693dd61a3a0551afe4354a44846a44e0b7d726cf
3
+ metadata.gz: e13b00bb0405782eb8792068c9cc5cda57133477
4
+ data.tar.gz: 2517b3fcf790a86a599fe62067f2016f35c314b8
5
5
  SHA512:
6
- metadata.gz: 5edf0918b1d41ab18d2057b4a076f3caaececd4c4ac48f8e6be01d856a66ffc2632dc973dd40df98590f41ac826cdaef3c1a75801480bf4e775c18054598b46d
7
- data.tar.gz: c7b4421a7d82696c595f58ebc80392ad42208e2d47868ee3e50a1b3d97344d985c4f4b3c48dbfc94544f237deb4602473d9f2e6d177c89ad642e66204a4fbf14
6
+ metadata.gz: 71330135eae405dd1b40315323530a70d0e54d5657b2364e332493c2fe2a8af57ee93b8c81118fd95a5cbe1061eac54fe17a4b1bad54f7c94440e7485940b6ed
7
+ data.tar.gz: f50e5aaa0e3f1a8c8dfe28246ec72c94a270e15d6d9104baf35e263e532173c948ff1e41bbb02462256a2227e7e33bcdae881be981cf99ba29c9217895fb8d92
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  group :development do
4
4
  gem "yard", "~> 0.7"
data/Gemfile.lock CHANGED
@@ -13,7 +13,7 @@ GIT
13
13
  rake
14
14
 
15
15
  GEM
16
- remote: http://rubygems.org/
16
+ remote: https://rubygems.org/
17
17
  specs:
18
18
  addressable (2.3.6)
19
19
  builder (3.2.2)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/lib/log_require.rb CHANGED
@@ -1,6 +1,4 @@
1
1
 
2
- require "log_require/flat"
3
- require "log_require/graph"
4
2
  require "log_require/node"
5
3
 
6
4
  module LogRequire
@@ -13,6 +11,14 @@ module LogRequire
13
11
  !ENV["LOG_REQUIRE"].nil?
14
12
  end
15
13
 
14
+ if graph?
15
+ require "log_require/graph"
16
+ else
17
+ require "log_require/flat"
18
+ end
19
+
20
+ EPOCH = Time.new.to_f
21
+
16
22
  def self.setup
17
23
  io = if file? then
18
24
  File.open(ENV["LOG_REQUIRE"], 'w')
@@ -33,7 +39,7 @@ module LogRequire
33
39
  else
34
40
  $log_require = io
35
41
  if file? then
36
- io.puts "require name,caller,line number"
42
+ io.puts "elapsed time,require name,caller,line number"
37
43
  end
38
44
  Kernel.include(LogRequire::Flat)
39
45
  end
@@ -7,14 +7,16 @@ module LogRequire
7
7
  # cleanup the caller name (only interested in path relative to gem or lib)
8
8
  c, l = LogRequire.clean_caller(caller.first)
9
9
 
10
+ elapsed = sprintf("%7.4f", Time.new.to_f - LogRequire::EPOCH)
11
+
10
12
  if LogRequire.file? then
11
- $log_require.puts "#{name},#{c},#{l}"
13
+ $log_require.puts "#{elapsed},#{name},#{c},#{l}"
12
14
 
13
15
  else
14
16
  pad = 110-name.length
15
17
  pad = pad > 0 ? pad : 1
16
18
  pad = (" " * pad)
17
- STDERR.puts "require: #{name}#{pad}>> #{c}:#{l}"
19
+ STDERR.puts "#{elapsed} require: #{name}#{pad}>> #{c}:#{l}"
18
20
  end
19
21
 
20
22
  return require_without_log(name)
data/log_require.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: log_require 0.1.0 ruby lib
5
+ # stub: log_require 0.1.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "log_require"
9
- s.version = "0.1.0"
9
+ s.version = "0.1.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Chetan Sarva"]
14
- s.date = "2014-10-30"
14
+ s.date = "2014-11-22"
15
15
  s.description = "Small utility to help track down that stray library"
16
16
  s.email = "chetan@pixelcop.net"
17
17
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: log_require
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chetan Sarva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-30 00:00:00.000000000 Z
11
+ date: 2014-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard