usable 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 +4 -4
- data/.travis.yml +3 -7
- data/CHANGELOG.md +2 -1
- data/lib/usable/version.rb +1 -1
- data/lib/usable.rb +9 -8
- 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: 2f7f30e1bcf362f74f31d504c1d8dcde61186cd8
|
4
|
+
data.tar.gz: c62e74cf53de5e985e17e5c6d80b7eb06cbb55a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56fadf0636c4eefa597f4e8f4ee0b518e21bc0ef512746160131ea248742884977b1d7f80d303256ebd80658f6f2b7fe47a9c22d439aa4adf364901051f48df1
|
7
|
+
data.tar.gz: 19a2ec805bb337dc7a404d2f9452812667bcac73e8742814934b91b4ae08d5017183d6c41a0a019dee4b11b17023a3a60a51c08fcc161fddde4a9170d5bc863f
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
2.2.0 (9/30/2016)
|
2
2
|
==================
|
3
3
|
|
4
|
-
*
|
4
|
+
* [[PR #6](https://github.com/ridiculous/usable/pull/6))] Config options accept blocks that will be lazy loaded once and memoized for future calls
|
5
|
+
* [[Issue #4](https://github.com/ridiculous/usable/issues/4)] Fix bug in `Config#respond_to_missing?`
|
5
6
|
|
data/lib/usable/version.rb
CHANGED
data/lib/usable.rb
CHANGED
@@ -6,18 +6,20 @@ require 'usable/config'
|
|
6
6
|
|
7
7
|
module Usable
|
8
8
|
|
9
|
-
# @description Define an instance level version of +usables+
|
10
9
|
def self.extended(base)
|
11
10
|
base.class_eval do
|
12
|
-
def usables
|
13
|
-
self.class.usables
|
14
|
-
end
|
15
|
-
|
16
11
|
def usable_method(method_name)
|
17
12
|
self.class.usable_method(self, method_name)
|
18
13
|
end
|
19
14
|
end
|
20
|
-
|
15
|
+
if base.is_a? Class
|
16
|
+
# Define an instance level version of +usables+
|
17
|
+
base.class_eval do
|
18
|
+
def usables
|
19
|
+
self.class.usables
|
20
|
+
end
|
21
|
+
end
|
22
|
+
else
|
21
23
|
base.instance_eval do
|
22
24
|
def config(&block)
|
23
25
|
usables(&block)
|
@@ -53,7 +55,7 @@ module Usable
|
|
53
55
|
# @option [String,Symbol] :method (:include) The method to use for including the module
|
54
56
|
# @return self
|
55
57
|
def usable(mod, options = {}, &block)
|
56
|
-
|
58
|
+
ModExtender.new(mod, only: options.delete(:only), method: options.delete(:method)).call self
|
57
59
|
# Define settings on @usables and on the scoped @usables
|
58
60
|
scope = Config.new
|
59
61
|
if mod.name
|
@@ -77,7 +79,6 @@ module Usable
|
|
77
79
|
if mod.const_defined?(:ClassMethods)
|
78
80
|
send :extend, mod.const_get(:ClassMethods)
|
79
81
|
end
|
80
|
-
ModExtender.new(mod, usable_options).call self
|
81
82
|
self
|
82
83
|
end
|
83
84
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: usable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Buckley
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|