autoloaded 1.5.0 → 1.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: b6f618df722d4ed99a713dfbcf0344a03eca3493
4
- data.tar.gz: dc5dbdff9502b4c1988100f0fcf43e83cf69ee97
3
+ metadata.gz: 2047f7eef42a1cbbb9ad8e47748d3f99eaab4f32
4
+ data.tar.gz: be5523f0c2b3367d20546bb07af2b6fdef581dac
5
5
  SHA512:
6
- metadata.gz: 1d7d80da2b33e2d1eebcfdd5d80d66790d7d9fcb173104114b530fb6d42437749d097e0347f9a7197e74ba1dd2c4ef41fcf03efcede9fc89f0088fd5a3696f0d
7
- data.tar.gz: 7cccc5f5fe68de29fa48a07ceb18351e4e4b47d0a9c65fa911e8253ba7f8c6d025b544c64bf78d429c2d1bc12a3e52877624d0fdfb96de8581ea3f08061634e1
6
+ metadata.gz: c4fbb79d6f769531510d3c423b670598ae292f79ba2dd44c9c7fac2ba16f919b1a603c5b832ed3897ca5f1e994e9708361eb7f542740aa0c57856ef6169b2570
7
+ data.tar.gz: bf3585f53218dca2f703019e402dc86cf600001d8368e1d744b3217d9d1588cc0de6f83b655665b9325cfbec66a249417d33708b26d85a109da8fed54685737c
@@ -6,6 +6,7 @@ rvm:
6
6
  - 2.1
7
7
  - 2.2
8
8
  - 2.3
9
+ - 2.4
9
10
  - ruby-head
10
11
  - jruby-head
11
12
  - rbx
data/History.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Version history for the _Autoloaded_ project
2
2
 
3
+ ## <a name="v1.5.1"></a>v1.5.1, Wed 10/18/2017
4
+
5
+ * Eliminate Ruby warnings about undefined instance variables
6
+
3
7
  ## <a name="v1.5.0"></a>v1.5.0, Wed 2/22/2017
4
8
 
5
9
  * Add support for Ruby load paths (`$:`) that contain one or more
@@ -213,7 +213,10 @@ module Autoloaded
213
213
  # @see #autoload!
214
214
  # @see #host_binding
215
215
  def from(value=nil)
216
- return((@from && @from.path) || default_from) if value.nil?
216
+ if value.nil?
217
+ return (instance_variable_defined?(:@from) && @from && @from.path) ||
218
+ default_from
219
+ end
217
220
 
218
221
  # Validate value.
219
222
  @from = LoadPathedDirectory.new(value)
@@ -249,7 +252,8 @@ module Autoloaded
249
252
  end
250
253
 
251
254
  def from_load_pathed_directory
252
- @from || LoadPathedDirectory.new(default_from)
255
+ (instance_variable_defined?(:@from) && @from) ||
256
+ LoadPathedDirectory.new(default_from)
253
257
  end
254
258
 
255
259
  def host_eval(statement)
@@ -37,7 +37,9 @@ class Autoloaded::Specifications
37
37
  %i(except only with).each do |attribute_name|
38
38
  define_method attribute_name do
39
39
  variable_name = "@#{attribute_name}"
40
- (instance_variable_get(variable_name) || []).tap do |value|
40
+ ((instance_variable_defined?(variable_name) &&
41
+ instance_variable_get(variable_name)) ||
42
+ []).tap do |value|
41
43
  instance_variable_set variable_name, value
42
44
  end
43
45
  end
@@ -3,6 +3,6 @@ module Autoloaded
3
3
  # The current version of the _Autoloaded_ project.
4
4
  #
5
5
  # @since 0.0.1
6
- VERSION = '1.5.0'
6
+ VERSION = '1.5.1'
7
7
 
8
8
  end
@@ -62,7 +62,7 @@ module Autoloaded::Warning
62
62
  #
63
63
  # @see .enabled?
64
64
  def enable(enabling)
65
- previous_value = @disabled
65
+ previous_value = instance_variable_defined?(:@disabled) && @disabled
66
66
  @disabled = not!(enabling)
67
67
  if block_given?
68
68
  begin
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoloaded
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nils Jonsson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-23 00:00:00.000000000 Z
11
+ date: 2017-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.6.8
134
+ rubygems_version: 2.6.14
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Eliminates the drudgery of handcrafting a Ruby Core library `autoload` statement