setsy 0.1.7 → 0.1.9

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: e111b87f78f0b73594a4d1620b12f9fd6528e4f2
4
- data.tar.gz: 114aa5a61577f4e4b4b3b3e12956ce2305c3b8db
3
+ metadata.gz: 04ad40699e1872b91abc97f51dfb50fb2cdd3b55
4
+ data.tar.gz: 7c0ea1f4548c5728329f8760139bec404c7ec4a6
5
5
  SHA512:
6
- metadata.gz: 842e7f5f80a74a1ce549583ca3ed6e51ccfdccb0ac082b120e55c6ddd65ffa56d60ebe9360a7155d3ed088bf4234cd7ea61b24b3b87f5687e787f8ca05581d5c
7
- data.tar.gz: 47591f015f8d41abb6a9e95c57c8e70b42847c78aa3239e85dbfe3062b4df5548615572a8cc8ce51c9210c32ac2ac728addb64e50ffc0406b8b76bfe9470fefd
6
+ metadata.gz: 6030dc90b781559cdb3c93e145ad10d7b36ceae0efb7096571501c99bce4612dd1b8f399b0e348551aa333478708d963ef2a54066e7add4d447ab324028b714e
7
+ data.tar.gz: e2ac06fc4dd7f8f2cb0fef6a122b1eb78aa7b1ddc908e216a56b721824ecc7e2d40e6ae1ffa68bf3ad263aae5fd8cc6b310e36657d11c8bc5caa05c4111a8d1d
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Setsy
2
2
 
3
- Settings for your classes. Depends on ActiveRecord, ActiveModel, and ActiveSupport 5.1 (okay so Rails 5.1+), but a PR can take care of this easily!
3
+ Settings for your classes. Depends on ActiveModel 3.0+.
4
4
 
5
5
  ## Note
6
6
 
@@ -8,7 +8,6 @@ module Setsy
8
8
  'fixnum' => 'Integer'
9
9
  }.freeze
10
10
 
11
- delegate_missing_to :to_s
12
11
  def initialize(options)
13
12
  @attribute_value = options[:value]
14
13
  @default = options[:default]
@@ -32,6 +31,27 @@ module Setsy
32
31
  value == default
33
32
  end
34
33
 
34
+ def respond_to_missing?(name, include_private = false)
35
+ to_s.respond_to?(name) || super
36
+ end
37
+
38
+ def method_missing(method, *args, &block)
39
+ if to_s.respond_to?(method)
40
+ to_s.public_send(method, *args, &block)
41
+ else
42
+ begin
43
+ super
44
+ rescue NoMethodError
45
+ if to_s.nil?
46
+ raise DelegationError, "\#{to_s} delegated to #{to_s}, but #{to_s} is nil"
47
+ else
48
+ raise
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+
35
55
  private
36
56
 
37
57
  def klass
@@ -1,3 +1,3 @@
1
1
  module Setsy
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.9"
3
3
  end
@@ -22,7 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ['lib']
23
23
  spec.files += Dir['lib/**/*.rb']
24
24
 
25
- spec.add_dependency 'rails', '>= 5.1.0'
25
+ spec.add_dependency 'activemodel', '>= 3.0'
26
+ spec.add_development_dependency 'rails', '>= 3.0'
26
27
  spec.add_development_dependency 'sqlite3'
27
28
  spec.add_development_dependency 'bundler', '~> 1.15'
28
29
  spec.add_development_dependency 'rake', '~> 10.0'
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: setsy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Brody
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-14 00:00:00.000000000 Z
11
+ date: 2018-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: activemodel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.1.0
19
+ version: '3.0'
20
20
  type: :runtime
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: 5.1.0
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '3.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: sqlite3
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -133,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
147
  version: '0'
134
148
  requirements: []
135
149
  rubyforge_project:
136
- rubygems_version: 2.6.13
150
+ rubygems_version: 2.6.14
137
151
  signing_key:
138
152
  specification_version: 4
139
153
  summary: Settings for your classes