autoloaded 1.3.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +8 -4
- data/README.md +2 -2
- data/lib/autoloaded/autoloader.rb +6 -1
- data/lib/autoloaded/deprecation.rb +2 -0
- data/lib/autoloaded/inflection.rb +2 -2
- data/lib/autoloaded/specifications.rb +12 -6
- data/lib/autoloaded/version.rb +1 -1
- data/lib/autoloaded/warning.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 002e4e92fb2d2dde6fc2e0f00ece6e13df188b1e
|
4
|
+
data.tar.gz: 0806960319493b98a01a0d8be789a32e519c2050
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4e6409a4cea035bc9e7d2102de99a97e0202106715b6873aad6ca1fd68f06e9850063037f03fe9c7c8bd569321729aa4d7092ac0fa56b8a67c00a7ea8b865dd
|
7
|
+
data.tar.gz: 2a0e5ba02e1a4ac86269c64bb5b788e3c5a29819284fef0ff258a73cabcb7a2ec01dec351d1395c8c1e223d9c2a8e42ebc359e5d5deb25a19d0cd68ab63261cb
|
data/History.md
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
# Version history for the _Autoloaded_ project
|
2
2
|
|
3
|
-
## <a name="v1.
|
3
|
+
## <a name="v1.4.1"></a>v1.4.1, Sat 1/24/2015
|
4
|
+
|
5
|
+
* Don’t warn about a _VERSION_ constant presumably loaded by a _.gemspec_
|
6
|
+
|
7
|
+
## <a name="v1.3.0"></a>v1.3.0, Fri 12/26/2014
|
4
8
|
|
5
9
|
* Add support for relative class references with a new API
|
6
10
|
|
7
|
-
## <a name="v1.2.0"></a>v1.2.0, Fri 11/28/
|
11
|
+
## <a name="v1.2.0"></a>v1.2.0, Fri 11/28/2014
|
8
12
|
|
9
13
|
* Add support for [JRuby][JRuby] (Ruby v2.x-compatible versions)
|
10
14
|
|
11
|
-
## <a name="v1.1.0"></a>v1.1.0, Tue 11/04/
|
15
|
+
## <a name="v1.1.0"></a>v1.1.0, Tue 11/04/2014
|
12
16
|
|
13
17
|
* Correct/improve autoload behavior
|
14
18
|
* Instead of returning the source **directory** path from
|
@@ -19,7 +23,7 @@
|
|
19
23
|
[_Module#constants_][Ruby-Core-Module-constants] in the [readme][readme] and
|
20
24
|
in [inline documentation][inline-documentation]
|
21
25
|
|
22
|
-
## <a name="v1.0.0"></a>v1.0.0, Wed 10/29/
|
26
|
+
## <a name="v1.0.0"></a>v1.0.0, Wed 10/29/2014
|
23
27
|
|
24
28
|
* Add support for Ruby v2.0
|
25
29
|
|
data/README.md
CHANGED
@@ -494,11 +494,11 @@ directories. This is by design.
|
|
494
494
|
Released under the [MIT License][MIT-License].
|
495
495
|
|
496
496
|
[Autoloaded graphic]: https://farm5.staticflickr.com/4134/4941065976_54737fe145.jpg
|
497
|
-
[Travis CI build status]: https://secure.travis-ci.org/njonsson/autoloaded.svg?branch=
|
497
|
+
[Travis CI build status]: https://secure.travis-ci.org/njonsson/autoloaded.svg?branch=v1.x
|
498
498
|
[Code Climate quality report]: https://codeclimate.com/github/njonsson/autoloaded/badges/gpa.svg
|
499
499
|
[Code Climate coverage report]: https://codeclimate.com/github/njonsson/autoloaded/badges/coverage.svg
|
500
500
|
[Gemnasium build status]: https://gemnasium.com/njonsson/autoloaded.svg
|
501
|
-
[Inch CI build status]: http://inch-ci.org/github/njonsson/autoloaded.svg?branch=
|
501
|
+
[Inch CI build status]: http://inch-ci.org/github/njonsson/autoloaded.svg?branch=v1.x
|
502
502
|
[RubyGems release]: https://badge.fury.io/rb/autoloaded.svg
|
503
503
|
|
504
504
|
[spider-gear-image]: https://www.flickr.com/photos/dongkwan/4941065976 "spider gear image by Ernesto Andrade"
|
@@ -7,7 +7,7 @@ module Autoloaded
|
|
7
7
|
|
8
8
|
# The source code context in which autoloading is to occur.
|
9
9
|
#
|
10
|
-
# @return [Binding]
|
10
|
+
# @return [Binding]
|
11
11
|
#
|
12
12
|
# @see #autoload!
|
13
13
|
#
|
@@ -79,6 +79,11 @@ module Autoloaded
|
|
79
79
|
constant_names.each do |const|
|
80
80
|
next unless existing_constant?(const)
|
81
81
|
|
82
|
+
# Don't warn about an existing MyAwesomeGem::VERSION constant since
|
83
|
+
# probably it was loaded by a `require 'my_awesome_gem/version'`
|
84
|
+
# statement in 'my_awesome_gem.gemspec'.
|
85
|
+
next if (const == :VERSION)
|
86
|
+
|
82
87
|
Warning.existing_constant constant_name: constant_full_name(const),
|
83
88
|
source_filename: source_filename,
|
84
89
|
host_source_location: host_source_location
|
@@ -31,6 +31,8 @@ module Autoloaded::Deprecation
|
|
31
31
|
# deprecated API
|
32
32
|
#
|
33
33
|
# @return [Module] _Deprecation_
|
34
|
+
#
|
35
|
+
# @raise [ArgumentError] one or more keywords are missing
|
34
36
|
def deprecate(deprecated_usage: raise(::ArgumentError,
|
35
37
|
'missing keyword: deprecated_usage'),
|
36
38
|
sanctioned_usage: raise(::ArgumentError,
|
@@ -8,26 +8,32 @@ module Autoloaded; end
|
|
8
8
|
class Autoloaded::Specifications
|
9
9
|
|
10
10
|
# @!method except
|
11
|
-
#
|
11
|
+
# _Specifications_ for excluding source files from being autoloaded.
|
12
12
|
#
|
13
|
-
# @return [Array of Specification]
|
13
|
+
# @return [Array of Specification]
|
14
|
+
#
|
15
|
+
# @see Specification
|
14
16
|
#
|
15
17
|
# @api private
|
16
18
|
#
|
17
19
|
# @!method only
|
18
|
-
#
|
20
|
+
# _Specifications_ for narrowing the set of source files being autoloaded as
|
19
21
|
# well as optionally renaming and/or reorganizing their corresponding
|
20
22
|
# constants.
|
21
23
|
#
|
22
|
-
# @return [Array of Specification]
|
24
|
+
# @return [Array of Specification]
|
25
|
+
#
|
26
|
+
# @see Specification
|
23
27
|
#
|
24
28
|
# @api private
|
25
29
|
#
|
26
30
|
# @!method with
|
27
|
-
#
|
31
|
+
# _Specifications_ for renaming and/or reorganizing the constants corresponding
|
28
32
|
# to source files being autoloaded.
|
29
33
|
#
|
30
|
-
# @return [Array of Specification]
|
34
|
+
# @return [Array of Specification]
|
35
|
+
#
|
36
|
+
# @see Specification
|
31
37
|
#
|
32
38
|
# @api private
|
33
39
|
%i(except only with).each do |attribute_name|
|
data/lib/autoloaded/version.rb
CHANGED
data/lib/autoloaded/warning.rb
CHANGED
@@ -33,6 +33,8 @@ module Autoloaded::Warning
|
|
33
33
|
# establishing autoloading
|
34
34
|
#
|
35
35
|
# @return [Module] _Warning_
|
36
|
+
#
|
37
|
+
# @raise [ArgumentError] one or more keywords are missing
|
36
38
|
def changing_autoload(constant_name: raise(::ArgumentError,
|
37
39
|
'missing keyword: constant_name'),
|
38
40
|
old_source_filename: raise(::ArgumentError,
|
@@ -94,6 +96,8 @@ module Autoloaded::Warning
|
|
94
96
|
# establishing autoloading
|
95
97
|
#
|
96
98
|
# @return [Module] _Warning_
|
99
|
+
#
|
100
|
+
# @raise [ArgumentError] one or more keywords are missing
|
97
101
|
def existing_constant(constant_name: raise(::ArgumentError,
|
98
102
|
'missing keyword: constant_name'),
|
99
103
|
source_filename: raise(::ArgumentError,
|
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.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nils Jonsson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|