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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3820825f72ea24881e17662498e419f3aba04e78
4
- data.tar.gz: 7c5ae702b5d0e293ba188ea4362fe8d4ece9c935
3
+ metadata.gz: 2f7f30e1bcf362f74f31d504c1d8dcde61186cd8
4
+ data.tar.gz: c62e74cf53de5e985e17e5c6d80b7eb06cbb55a4
5
5
  SHA512:
6
- metadata.gz: b235afa4781dbc735133ef2635d15924bd62ce2fe5e5821f697f11c27b44f2697ffc33497cbfba6bb7e7f6cfd9e98d94e45300c1148e5aee3060ad0f0dceefdd
7
- data.tar.gz: 246d2b78ebc8fce4b396dec9eb5368e15951f4571cb1e29de0f90402296da40ba99fe967d7d45bd724d91fc7887715a3c6abccb19f388608dd73f957b79b49b0
6
+ metadata.gz: 56fadf0636c4eefa597f4e8f4ee0b518e21bc0ef512746160131ea248742884977b1d7f80d303256ebd80658f6f2b7fe47a9c22d439aa4adf364901051f48df1
7
+ data.tar.gz: 19a2ec805bb337dc7a404d2f9452812667bcac73e8742814934b91b4ae08d5017183d6c41a0a019dee4b11b17023a3a60a51c08fcc161fddde4a9170d5bc863f
data/.travis.yml CHANGED
@@ -1,10 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
4
- - 2.1.0
5
- - 2.1.5
6
- - 2.2.0
7
- - 2.2.2
8
- - 2.2.3
9
- - 2.3.0
3
+ - 2.1.10
4
+ - 2.2.5
5
+ - 2.3.1
10
6
  before_install: gem install bundler -v 1.10.5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,6 @@
1
1
  2.2.0 (9/30/2016)
2
2
  ==================
3
3
 
4
- * Usable config options can now accept blocks as values, which will be lazy loaded once and memoized for future calls ([#6](https://github.com/ridiculous/usable/pull/6))
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
 
@@ -1,3 +1,3 @@
1
1
  module Usable
2
- VERSION = "2.2.0".freeze
2
+ VERSION = "2.2.1".freeze
3
3
  end
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
- unless base.is_a? Class
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
- usable_options = { only: options.delete(:only), method: options.delete(:method) }
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.0
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-09-30 00:00:00.000000000 Z
11
+ date: 2016-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler