extensible 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/extensible.gemspec +2 -2
- data/lib/extensible/extension_kernel.rb +2 -1
- data/lib/extensible/utils.rb +25 -0
- data/lib/extensible/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a163bb5bc78d58cd5fef286bf04aabb325c1e08
|
4
|
+
data.tar.gz: 456938339ba2debb9bfa754abddb2a3d8889ab70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33b7c6c50f64503f37247a8e8c1b1871a7e7d786d75299acd9f38f022e7abbe2b9d25692017ec3a619d73d8c871f49af2fa9f1711ba8929762cd15d8c4e93317
|
7
|
+
data.tar.gz: 9941d4f942e2828e89d2ec0db63389f4ed9a49b94262dbf3738f2f5de6dfb29e617c19a1757059cf8a334578abb2cd502749a4b454ec1a1e8439911fb89ec7bd
|
data/extensible.gemspec
CHANGED
@@ -33,13 +33,13 @@ the Module#extended method directly.
|
|
33
33
|
].freeze
|
34
34
|
spec.required_ruby_version = ">= 1.9".freeze
|
35
35
|
|
36
|
-
spec.add_development_dependency "bundler".freeze, "~> 1.13.
|
36
|
+
spec.add_development_dependency "bundler".freeze, "~> 1.13.1".freeze
|
37
37
|
spec.add_development_dependency "codeclimate-test-reporter".freeze, "~> 0.6.0".freeze
|
38
38
|
spec.add_development_dependency "guard-rspec".freeze, "~> 4.7.3".freeze
|
39
39
|
spec.add_development_dependency "guard-rubocop".freeze, "~> 1.2.0".freeze
|
40
40
|
spec.add_development_dependency "io-console".freeze, "~> 0.4.6".freeze
|
41
41
|
spec.add_development_dependency "pry-byebug".freeze, "~> 3.4.0".freeze
|
42
|
-
spec.add_development_dependency "rake".freeze, "~> 11.
|
42
|
+
spec.add_development_dependency "rake".freeze, "~> 11.3.0".freeze
|
43
43
|
spec.add_development_dependency "rdoc".freeze, "~> 4.2.2".freeze
|
44
44
|
spec.add_development_dependency "ruby_gntp".freeze, "~> 0.3.4".freeze
|
45
45
|
spec.add_development_dependency "simplecov".freeze, "~> 0.12.0".freeze
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "extensible/extension_kernel_template".freeze
|
2
|
+
require "extensible/utils".freeze
|
2
3
|
|
3
4
|
module Extensible
|
4
5
|
##
|
@@ -9,7 +10,7 @@ module Extensible
|
|
9
10
|
def extended(submodule)
|
10
11
|
super
|
11
12
|
|
12
|
-
unless
|
13
|
+
unless Utils.own_const_defined?(submodule, :ExtensionKernel)
|
13
14
|
kernel = ExtensionKernelTemplate.clone
|
14
15
|
submodule.const_set(:ExtensionKernel, kernel)
|
15
16
|
submodule.extend kernel
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Extensible
|
2
|
+
##
|
3
|
+
# Utils contains utility methods whose implementation depends on the currently used Ruby version.
|
4
|
+
module Utils
|
5
|
+
class << self
|
6
|
+
if RUBY_VERSION >= "1.9".freeze
|
7
|
+
##
|
8
|
+
# call-seq:
|
9
|
+
# own_const_defined?(mod, const_name) => true or false
|
10
|
+
#
|
11
|
+
# Returns +true+ if constant +const_name+ has been defined in module +mod+ (and not in one of its ancestors).
|
12
|
+
# Returns +false+ otherwise.
|
13
|
+
def own_const_defined?(mod, const_name)
|
14
|
+
mod.const_defined?(const_name, false)
|
15
|
+
end
|
16
|
+
else
|
17
|
+
# :nocov:
|
18
|
+
def own_const_defined?(mod, const_name)
|
19
|
+
mod.const_defined?(const_name)
|
20
|
+
end
|
21
|
+
# :nocov:
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/extensible/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extensible
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel de Oliveira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.13.
|
19
|
+
version: 1.13.1
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.13.
|
26
|
+
version: 1.13.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: codeclimate-test-reporter
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 11.
|
103
|
+
version: 11.3.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 11.
|
110
|
+
version: 11.3.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rdoc
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,6 +164,7 @@ files:
|
|
164
164
|
- lib/extensible.rb
|
165
165
|
- lib/extensible/extension_kernel.rb
|
166
166
|
- lib/extensible/extension_kernel_template.rb
|
167
|
+
- lib/extensible/utils.rb
|
167
168
|
- lib/extensible/version.rb
|
168
169
|
homepage: https://github.com/gdeoliveira/extensible
|
169
170
|
licenses:
|