class2 0.5.0 → 0.5.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: 495d09d37f08a9426e07e7dc11aeb89e98e91898
4
- data.tar.gz: d045a532d5807ff0683165696e39db4b139fc92d
3
+ metadata.gz: 61dc3c545f0d85bb351f739def887860fa1ae4b4
4
+ data.tar.gz: 60ccf0018c8d307435c061921ecd75ebb9fed97b
5
5
  SHA512:
6
- metadata.gz: 7a8a8369c8ab850c2d9233a8951facf0163d1e404a4fff3919099d3d7f6c84160cae2112a2ae15dc7f91ff18f3bc0463f71732f4d230d5074d56e69a98032fca
7
- data.tar.gz: ea2223eb9048584675754f2c240a79055f654f897117a5219913874ab0872994e87dbf76e073c8317af3a4ffd0a91685e074b5fe4a74d6b470732e42792bc648
6
+ metadata.gz: eb86ad32514cb49fbfb5e094d9ca3a5f71c2713183439093c6b44cbc2e98c81ebed982a687a050bbdae6a55f85fdd845ee0477b9752d2df8bd4dc9320978afc9
7
+ data.tar.gz: ea05449a79eb2f1e0c42469c34a72ab660303b740386128295f020c9ed9a31708dccf09ca89c687ebf416c5aca15f338d824827fc82102ce93a7cf94f6cc7c4c
data/Changes CHANGED
@@ -1,3 +1,7 @@
1
+ 2018-06-26 v0.5.1
2
+ --------------------
3
+ * Bug fix: autoload backtrace search "improvemnts"
4
+
1
5
  2018-06-07 v0.5.0
2
6
  --------------------
3
7
  * Add support for autoloading class definitions from JSON in a DATA section
@@ -61,9 +61,11 @@ class Class2
61
61
  def autoload(namespace = Object) # :nodoc:
62
62
  failure = lambda { |message| abort "class2: cannot autoload class definitions: #{message}" }
63
63
  failure["cannot find the right caller"] unless caller.find do |line|
64
- line.index("/kernel_require.rb:").nil? && line =~ /(.+):\d+:in\s+`\w/
64
+ # Ignore our autoload file and require()
65
+ line.index("/class2/autoload.rb:").nil? && line.index("/kernel_require.rb:").nil? && line =~ /(.+):\d+:in\s+`\S/
65
66
  end
66
67
 
68
+ # Give this precedence over global DATA constant
67
69
  data = String.new
68
70
  File.open($1) do |io|
69
71
  while line = io.gets
@@ -73,6 +75,7 @@ class Class2
73
75
  end
74
76
  end
75
77
 
78
+ # Fallback to global constant if nothing found
76
79
  data = ::DATA.read if data.empty? && defined?(::DATA)
77
80
  failure["no data section found"] if data.empty?
78
81
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Class2
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: class2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Skye Shaw
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-07 00:00:00.000000000 Z
11
+ date: 2018-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport