prefab-cloud-ruby 0.0.17 → 0.0.18

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: f1152271b59ef1b001ae7da7c3d2aed5937a414e
4
- data.tar.gz: a5d6233688a739da4f98f3afbd8174486019c76f
3
+ metadata.gz: 1f4b5d7fb7e15da13eaf3e2fb5891b4aa89604db
4
+ data.tar.gz: '0779901b0789060861efafd813b28c06e1107ed4'
5
5
  SHA512:
6
- metadata.gz: 965e0d2af08fec285bd511f039019817fea9b509e3482e8e75b49d0bd8e0d653bb79ab9ddc54f6cdd37fdabaaf3acfd3e396ab45c11bf3207599e609ed5c701a
7
- data.tar.gz: 41f7f78e8df8ed1ede502df04910fdb46d7c8337e82dd391e08418f0bd155f4884d672d42adc9492681808b67fd5a9b2f370de6ee6294d0c65170c0a91070a6c
6
+ metadata.gz: '09d6907355402ffaddc9e757ac159e0172c5a227aa24793aa583326291f3590fa100f59b0bec36e4fca3605c054f47defd7da466c5244c209b28d0392a7c6283'
7
+ data.tar.gz: 7b3e1ce5ca388374a065fae0106abf52d155cbbfd1e61967ae38d28cb88cee5763226fa88c4c9fc4b60c99d212b1e69908f0c245d1131b142ec9beef9a6bd05d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.17
1
+ 0.0.18
@@ -10,18 +10,19 @@ module Prefab
10
10
  end
11
11
 
12
12
  def add(severity, message = nil, progname = nil)
13
+ loc = caller_locations(1, 1)[0]
14
+ add_internal(severity, message, progname, loc)
15
+ end
13
16
 
14
- loc = caller_locations(2, 1)[0]
17
+ def add_internal(severity, message = nil, progname = nil, loc)
15
18
  path = get_path(loc.absolute_path, loc.base_label)
16
-
17
- return log_internal(message, path, progname, severity)
19
+ log_internal(message, path, progname, severity)
18
20
  end
19
21
 
20
22
  def log_internal(message, path, progname, severity)
21
23
  level = level_of(path)
22
24
  progname = "#{path}: #{progname}"
23
25
 
24
-
25
26
  severity ||= UNKNOWN
26
27
  if @logdev.nil? or severity < level
27
28
  return true
@@ -42,6 +43,26 @@ module Prefab
42
43
  true
43
44
  end
44
45
 
46
+ def debug(progname = nil, &block)
47
+ add_internal(DEBUG, nil, progname, caller_locations(1, 1)[0], &block)
48
+ end
49
+
50
+ def info(progname = nil, &block)
51
+ add_internal(INFO, nil, progname, caller_locations(1, 1)[0], &block)
52
+ end
53
+
54
+ def warn(progname = nil, &block)
55
+ add_internal(WARN, nil, progname, caller_locations(1, 1)[0], &block)
56
+ end
57
+
58
+ def error(progname = nil, &block)
59
+ add_internal(ERROR, nil, progname, caller_locations(1, 1)[0], &block)
60
+ end
61
+
62
+ def fatal(progname = nil, &block)
63
+ add_internal(FATAL, nil, progname, caller_locations(1, 1)[0], &block)
64
+ end
65
+
45
66
  def debug?
46
67
  true;
47
68
  end
@@ -92,7 +113,10 @@ module Prefab
92
113
  path = absolute_path + ""
93
114
  path.slice! Dir.pwd
94
115
 
116
+ path.gsub!(/.*?(?=\/lib\/)/im, "")
117
+
95
118
  path = "#{path.gsub("/", SEP).gsub(".rb", "")}#{SEP}#{base_label}"
119
+ path.slice! ".lib"
96
120
  path.slice! SEP
97
121
  path
98
122
  end
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: prefab-cloud-ruby 0.0.17 ruby lib
5
+ # stub: prefab-cloud-ruby 0.0.18 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "prefab-cloud-ruby".freeze
9
- s.version = "0.0.17"
9
+ s.version = "0.0.18"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
data/test/test_logger.rb CHANGED
@@ -8,9 +8,13 @@ class TestCLogger < Minitest::Test
8
8
  end
9
9
 
10
10
  def test_get_path
11
- assert_equal "lib.test_l.foo_warn",
12
- @logger.get_path("/Users/jeffdwyer/Documents/workspace/RateLimitInc/prefab-cloud-ruby/lib/test_l.rb",
11
+ assert_equal "test_l.foo_warn",
12
+ @logger.get_path("/Users/jdwyah/Documents/workspace/RateLimitInc/prefab-cloud-ruby/lib/test_l.rb",
13
13
  "foo_warn")
14
+
15
+ assert_equal "active_support.log_subscriber.info",
16
+ @logger.get_path("/Users/jdwyah/.rvm/gems/ruby-2.3.3@forcerank/gems/activesupport-4.1.16/lib/active_support/log_subscriber.rb",
17
+ "info")
14
18
  end
15
19
 
16
20
  def test_level_of
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prefab-cloud-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dwyer