autoloaded 2.2.0 → 2.2.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: 0b0bcd64a5dc57c864b540c419b314adc30956c8
4
- data.tar.gz: 123e9bfd7e9ce087f6567255ce58c7b0f7fd979a
3
+ metadata.gz: b0374f06d830e6f6fd9374e49328e40e5ef21752
4
+ data.tar.gz: 12f8ef7aa7f296d736bc4b5a1dcd10f23935d1c1
5
5
  SHA512:
6
- metadata.gz: 59e0246f3a164323ae7c379861488d77d943b72968ddbaee57ee9bc6f8142580ba05bddc36f330622d549eb8d863e0d73f1b9611e20a87020623dc7821ce351e
7
- data.tar.gz: 6906ecfd5c252b431422dd2d98a446ff9b1ad60a673fb0f0359b9853638e0a5ecd0503521b86c47e2d6f1c21c54feb1379b8733b69ac3a4ee5727e9e02d22e9b
6
+ metadata.gz: 9b48d6d8f4281986e1069497dca2c54cbcd6b1446fd11e6436df4a9cfd3658a449b4d099fcf42d3cfc715b0f04223ef8a21a81778f49800c611253b62d57b4f9
7
+ data.tar.gz: fcf9518c24572378c5a2cf3bbf1084b22675ef55139c431ae3cf1999aeddc23e171dd28218752846918c81642f2aeb086d6cb803f618173c33c7ae9cb4ccb939
data/.travis.yml CHANGED
@@ -7,6 +7,7 @@ rvm:
7
7
  - 2.1
8
8
  - 2.2
9
9
  - 2.3
10
+ - 2.4
10
11
  - ruby-head
11
12
  - jruby-head
12
13
  - rbx
data/History.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Version history for the _Autoloaded_ project
2
2
 
3
+ ## <a name="v2.2.1"></a>v2.2.1 and <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="v2.2.0"></a>v2.2.0 and <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
  [: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 = '2.2.0'
6
+ VERSION = '2.2.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: 2.2.0
4
+ version: 2.2.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
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 2.6.8
133
+ rubygems_version: 2.6.14
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Eliminates the drudgery of handcrafting a Ruby Core library `autoload` statement