pathological 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -162,9 +162,15 @@ module Pathological
162
162
  # @return [String] name of file requiring pathological, or the currently executing file.
163
163
  def self.requiring_filename
164
164
  requiring_file = Kernel.caller.find do |stack_line|
165
- stack_line.include?("top (required)") && !stack_line.include?("pathological.rb")
165
+ if RUBY_VERSION.start_with?("1.9")
166
+ # In Ruby 1.9, top-level files will have the string "top (required)" included in the stack listing.
167
+ stack_line.include?("top (required)") && !stack_line.include?("pathological.rb")
168
+ else
169
+ # In Ruby 1.8, top-level files are listed with their relative path and without a line number.
170
+ !stack_line.match(/:\d+:in/) && !stack_line.include?("pathological.rb")
171
+ end
166
172
  end
167
- requiring_file ? requiring_file.match(/(.+):\d+:in/)[1] : $0 rescue $0
173
+ requiring_file ? requiring_file.match(/(.+):\d+/)[1] : $0 rescue $0
168
174
  end
169
175
 
170
176
  private_class_method :debug, :real_path, :parse_pathfile
@@ -1,3 +1,3 @@
1
1
  module Pathological
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pathological
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-09-28 00:00:00.000000000Z
13
+ date: 2011-09-29 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rr
17
- requirement: &2165564740 !ruby/object:Gem::Requirement
17
+ requirement: &2153778480 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 1.0.3
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *2165564740
25
+ version_requirements: *2153778480
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: scope
28
- requirement: &2165564280 !ruby/object:Gem::Requirement
28
+ requirement: &2153778020 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 0.2.3
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2165564280
36
+ version_requirements: *2153778020
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: fakefs
39
- requirement: &2165563900 !ruby/object:Gem::Requirement
39
+ requirement: &2153777640 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2165563900
47
+ version_requirements: *2153777640
48
48
  description: ! " Pathological provides a way to manage a project's require paths
49
49
  by using a small config file that\n indicates all directories to include in the
50
50
  load path.\n"