easily_typable 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +13 -5
  2. data/README.md +1 -1
  3. data/lib/easily_typable.rb +19 -1
  4. metadata +60 -32
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0221935b88c5cbac4176a0085bd516a6aa2bbec2
4
- data.tar.gz: e2a24f81c4e66ddc96bb68a6b2f86dd2532c44f8
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NmY1Y2QzNjQ1N2VlNDk1NWY1YTg5MTg5MGY3YThhNDE3NGQ0ZjkxYw==
5
+ data.tar.gz: !binary |-
6
+ M2JkZGI4MDcxMGI5ZGJjOTM3NWI1MTg4ZThjZGNkZDk4ODY2ODAzMw==
5
7
  SHA512:
6
- metadata.gz: 779755f35a05255d541f1e8d8feddad158922967d830f5cd1867d274f4cc96dbebc734dbb7ec083cc644497f889a50569f92bc728acdefed858956d913ae4641
7
- data.tar.gz: c4de309f4db5af0d07f230fda47a3e68001fd45aa3a5f81b572bcc92321d616e57c6b12bb1b0dcd4de98f22447b38a360c28a3de8c73a80503c5a1fe20638b66
8
+ metadata.gz: !binary |-
9
+ MjExM2RmYTM1MWE5MjgxMTU5NmU0Yjg5MGQ2OGUzYjMwNDEzZGEwNTkxMTVk
10
+ MDg0NWI0MGMxNDY2NjAzZjY4Zjk1NDAwYmIyMjg3YzYwY2JjYmE4MjMzNmM4
11
+ ZmZmYzZmZjdjZjYxNTZiYzVlMDlmZmRhODdjZTRjNmZmNmEzMGM=
12
+ data.tar.gz: !binary |-
13
+ NWE4NGRlOTFiMGMyYzgyZmMxNGE1MGRmYjNkMjQ0MDZiZDZlZDQzYWE3ZmU4
14
+ ZDM2YzM2MjI5MDBjN2NhMTVlOWNiNGY4YjRkYmU2MjEzZjMwMGQyNzQ4Nzk4
15
+ M2NkOGZhMmUyNmVmMmMxNDdiODc0OGFjY2E3MjEzMTk1MDUzNTQ=
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Easily Typable v1.0.0
1
+ # Easily Typable v1.0.1
2
2
  [![Gem Version](https://badge.fury.io/rb/easily_typable.svg)](http://badge.fury.io/rb/easily_typable)
3
3
  [![Build Status](https://api.travis-ci.org/AndyObtiva/easily_typable.svg?branch=master)](https://travis-ci.org/AndyObtiva/easily_typable)
4
4
  [![Coverage Status](https://coveralls.io/repos/AndyObtiva/easily_typable/badge.svg?branch=master)](https://coveralls.io/r/AndyObtiva/easily_typable?branch=master)
@@ -13,6 +13,24 @@ module EasilyTypable
13
13
  end_eval
14
14
  end
15
15
 
16
+ # NOTE: Rails Specific Feature
17
+ # Retroactively load Rails model class matching missing method name to add to
18
+ # EasilyTypable hierarchy when it fails on first attempt.
19
+ # This shall result in it working on second attempt if model class exists.
20
+ # Example:
21
+ alias method_missing_without_easily_typable method_missing
22
+ def method_missing(name, *args, &block)
23
+ if name.to_s.end_with?('?') && !@easily_typable_class_load_attempted
24
+ # attempt to load Rails class and re-invoke once
25
+ class_name = name.to_s.sub(/\?$/, '').split('_').map(&:capitalize).join
26
+ Object.const_get(class_name) rescue nil
27
+ @easily_typable_class_load_attempted = true
28
+ send(name, *args, &block)
29
+ else
30
+ method_missing_without_easily_typable(name, *args, &block)
31
+ end
32
+ end
33
+
16
34
  module SubClassMethods
17
35
  def self.included(subclass_constant)
18
36
  super
@@ -41,5 +59,5 @@ module EasilyTypable
41
59
  gsub(/([a-z])([A-Z])/,'\1_\2').
42
60
  downcase
43
61
  end
44
-
62
+
45
63
  end
metadata CHANGED
@@ -1,125 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easily_typable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyObtiva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-07 00:00:00.000000000 Z
11
+ date: 2017-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jeweler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.0.1
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.0.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rdoc
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: 5.0.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 5.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: 3.5.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.5.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: rake
56
+ name: coveralls
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 10.4.2
61
+ version: 0.8.5
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 10.4.2
68
+ version: 0.8.5
69
69
  - !ruby/object:Gem::Dependency
70
- name: rack
70
+ name: simplecov
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: 1.6.5
75
+ version: 0.10.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: 1.6.5
82
+ version: 0.10.0
83
83
  - !ruby/object:Gem::Dependency
84
- name: nokogiri
84
+ name: codeclimate-test-reporter
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: 1.6.8.1
89
+ version: 1.0.5
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
- version: 1.6.8.1
96
+ version: 1.0.5
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: 10.4.2
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: 10.4.2
111
+ - !ruby/object:Gem::Dependency
112
+ name: rack
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 1.6.5
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: 1.6.5
97
125
  - !ruby/object:Gem::Dependency
98
- name: tins
126
+ name: nokogiri
99
127
  requirement: !ruby/object:Gem::Requirement
100
128
  requirements:
101
- - - "~>"
129
+ - - ~>
102
130
  - !ruby/object:Gem::Version
103
- version: 1.6.0
131
+ version: 1.6.8.1
104
132
  type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
- - - "~>"
136
+ - - ~>
109
137
  - !ruby/object:Gem::Version
110
- version: 1.6.0
138
+ version: 1.6.8.1
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: term-ansicolor
113
141
  requirement: !ruby/object:Gem::Requirement
114
142
  requirements:
115
- - - "~>"
143
+ - - ~>
116
144
  - !ruby/object:Gem::Version
117
145
  version: 1.3.2
118
146
  type: :development
119
147
  prerelease: false
120
148
  version_requirements: !ruby/object:Gem::Requirement
121
149
  requirements:
122
- - - "~>"
150
+ - - ~>
123
151
  - !ruby/object:Gem::Version
124
152
  version: 1.3.2
125
153
  description: Although polymorphism is a recommended standard in Object-Oriented programming
@@ -151,12 +179,12 @@ require_paths:
151
179
  - lib
152
180
  required_ruby_version: !ruby/object:Gem::Requirement
153
181
  requirements:
154
- - - ">="
182
+ - - ! '>='
155
183
  - !ruby/object:Gem::Version
156
184
  version: '0'
157
185
  required_rubygems_version: !ruby/object:Gem::Requirement
158
186
  requirements:
159
- - - ">="
187
+ - - ! '>='
160
188
  - !ruby/object:Gem::Version
161
189
  version: '0'
162
190
  requirements: []