usable 2.1.1 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f7fc4e1f907b22a327f91c9415896392fbbe293
4
- data.tar.gz: cd2c34022445da9c3529a485c0ebda6f685ed84d
3
+ metadata.gz: 302091dea6e4c83d5b143e02ff10f6f04d242750
4
+ data.tar.gz: c5106c2329acd29b966f8a166de811fe5e9dfc03
5
5
  SHA512:
6
- metadata.gz: e55c0deda9d076b00bede32a192a36e2fb6807d9cfa01f51d131b680dae4741caa4bb640fd8d4ebcba267f19fcb99ba186b11bf303b968e5c06eee48c543170f
7
- data.tar.gz: 2a9e6cc8a0d9db31631d7d840d7770bc21cf3c77b6b6d857120d53b3e541cedc320947af2f741f7302d27cc89c7e9d76201e6cd12e6c39450102716e89a890fd
6
+ metadata.gz: 4fa5f3463f1fa6c23114e04fa5fbed769c788026614d00758975c73dce0bce3df6637de41dcc99efaec48aed30396882581d348d581f01185573d11f948ea754
7
+ data.tar.gz: 4375b84ab60d8f7f3c5b52432743815d2cf1943a571c5aa4e9729c346c34984de9c788e5f4fecdf20551b7d036b066870d536a517ad5b7b6ef4141fcf6477010
data/README.md CHANGED
@@ -6,11 +6,11 @@ available to both the module and including class. Allows you to include only the
6
6
  ```ruby
7
7
  module VersionMixin
8
8
  extend Usable
9
- usables[:max_versions] = 25
10
- usables[:table_name] = 'versions'
9
+ config.max_versions = 25
10
+ config.table_name = 'versions'
11
11
 
12
12
  def save_version
13
- "Saving up to #{usables.max_versions} versions to #{usables.table_name}"
13
+ "Saving #{usables.max_versions} #{usables.table_name}"
14
14
  end
15
15
 
16
16
  def destroy_version
@@ -23,7 +23,6 @@ class Model
23
23
 
24
24
  usable VersionMixin, only: :save_version do
25
25
  max_versions 10
26
- table_name 'custom_versions'
27
26
  end
28
27
 
29
28
  def save
@@ -32,7 +31,7 @@ class Model
32
31
  end
33
32
 
34
33
  model = Model.new
35
- model.save_version # => "Saving up to 10 versions to custom_versions"
34
+ model.save_version # => "Saving 10 versions"
36
35
  model.destroy_version # => NoMethodError: undefined method `destroy_version' for #<Model:...
37
36
  ```
38
37
  `Model` now has a `#save_versions` method but no `#destroy_version` method. Usable has effectively mixed in the given module
@@ -93,7 +92,8 @@ Model.usable_method(model, :destroy_version).call # => nil
93
92
 
94
93
  Modules with the following names found within the target module's namespace will be automatically used.
95
94
 
96
- `ClassMethods` - extended onto the target module.
95
+ * `ClassMethods`
96
+ * `InstanceMethods`
97
97
 
98
98
  ## Notes
99
99
 
@@ -1,3 +1,3 @@
1
1
  module Usable
2
- VERSION = "2.1.1".freeze
2
+ VERSION = "2.1.2".freeze
3
3
  end
data/lib/usable.rb CHANGED
@@ -68,8 +68,8 @@ module Usable
68
68
  [scope, usables].each { |x| options.each { |k, v| x[k] = v } }
69
69
  [scope, usables].each { |x| x.instance_eval &block } if block_given?
70
70
  ModExtender.new(mod, usable_options).call self
71
- send :include, mod.const_get(:InstanceMethods) if const_defined? :InstanceMethods
72
- send :extend, mod.const_get(:ClassMethods) if const_defined? :ClassMethods
71
+ send :include, mod.const_get(:InstanceMethods) if mod.const_defined?(:InstanceMethods)
72
+ send :extend, mod.const_get(:ClassMethods) if mod.const_defined?(:ClassMethods)
73
73
  self
74
74
  end
75
75
 
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.1.1
4
+ version: 2.1.2
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-08-19 00:00:00.000000000 Z
11
+ date: 2016-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler