extensible 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/extensible.gemspec +5 -8
- data/lib/extensible/version.rb +1 -1
- data/lib/extensible.rb +7 -7
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11e889c3f8a16282c1c649689923862a79b5a049
|
4
|
+
data.tar.gz: fbb2b8205fe0c9ea40bb6bab6cfd1f9ec5946a92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8f44fd379d9f808fbbdecda8f0c19ba878cdc0a5a71bd68a6c2d2cc02effec54dd4ea5d045e38462a783e7e0fc39eff040a560867652680112708499c189bde
|
7
|
+
data.tar.gz: d2029bff28b773b95165d66365fce188704f570ced823f2a943220840a92ae94df509222314ae6f357329ed566d7bd3064b6c4fc8aa6893f88e05333c8582cb8
|
data/extensible.gemspec
CHANGED
@@ -4,19 +4,16 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require "extensible/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
+
spec.required_ruby_version = ">= 1.9"
|
7
8
|
spec.name = "extensible"
|
8
9
|
spec.version = Extensible::VERSION
|
9
10
|
spec.authors = ["Gabriel de Oliveira"]
|
10
11
|
spec.email = ["deoliveira.gab@gmail.com"]
|
11
12
|
spec.summary = "Ruby extensions made easy."
|
12
|
-
spec.description =
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
"- Your _extensible_ extensions will be automatically able to become the base of other, more" \
|
17
|
-
"specific extensions while proper initialization is maintained by simply including them.\n" \
|
18
|
-
"- Bundle several _extensible_ extensions in a single module by including them and they will all" \
|
19
|
-
"be correctly initialized when extending the bundler module."
|
13
|
+
spec.description = <<-EOS
|
14
|
+
Use Extensible on your custom extensions in order to get a set of advantages over traditional extensions that override
|
15
|
+
the Module#extended method directly.
|
16
|
+
EOS
|
20
17
|
spec.homepage = "https://github.com/gdeoliveira/extensible"
|
21
18
|
spec.license = "MIT"
|
22
19
|
spec.files = `git ls-files -z`.split("\x0")
|
data/lib/extensible/version.rb
CHANGED
data/lib/extensible.rb
CHANGED
@@ -9,21 +9,21 @@ module Extensible # rubocop:disable Style/Documentation
|
|
9
9
|
|
10
10
|
##
|
11
11
|
# call-seq:
|
12
|
-
# when_extended() {|
|
12
|
+
# when_extended() {|extended_module| ... } => module
|
13
13
|
#
|
14
14
|
# The +when_extended+ method accepts a code block that will be executed every time this module is extended in a
|
15
|
-
# manner similar to <tt>Module#extended</tt>. The code block will be passed
|
16
|
-
# that is being extended. There is no need to make explicit calls to +super+ as those will be made
|
17
|
-
# Extensible.
|
15
|
+
# manner similar to <tt>Module#extended</tt>. The code block will be passed an +extended_module+ parameter containing
|
16
|
+
# the module that is being extended. There is no need to make explicit calls to +super+ as those will be made
|
17
|
+
# internally by Extensible.
|
18
18
|
#
|
19
|
-
# Returns self
|
20
|
-
def when_extended(&
|
19
|
+
# Returns self (this module).
|
20
|
+
def when_extended(&block)
|
21
21
|
fail(ArgumentError, Error::BLOCK_NOT_GIVEN) unless block_given?
|
22
22
|
|
23
23
|
self::ExtensionKernel.module_eval do
|
24
24
|
define_method :extended do |submodule|
|
25
25
|
super submodule
|
26
|
-
|
26
|
+
block.call submodule
|
27
27
|
self
|
28
28
|
end
|
29
29
|
|
metadata
CHANGED
@@ -1,21 +1,18 @@
|
|
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.2
|
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: 2015-02-
|
11
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
14
|
-
Use Extensible on your custom extensions in order to get
|
15
|
-
|
16
|
-
- Calls to `super` are handled internally to ensure all your _extensible_ extensions areproperly initialized.
|
17
|
-
- Your _extensible_ extensions will be automatically able to become the base of other, morespecific extensions while proper initialization is maintained by simply including them.
|
18
|
-
- Bundle several _extensible_ extensions in a single module by including them and they will allbe correctly initialized when extending the bundler module.
|
13
|
+
description: |
|
14
|
+
Use Extensible on your custom extensions in order to get a set of advantages over traditional extensions that override
|
15
|
+
the Module#extended method directly.
|
19
16
|
email:
|
20
17
|
- deoliveira.gab@gmail.com
|
21
18
|
executables: []
|
@@ -57,7 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
57
54
|
requirements:
|
58
55
|
- - ">="
|
59
56
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
57
|
+
version: '1.9'
|
61
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
59
|
requirements:
|
63
60
|
- - ">="
|