coder_decorator 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/coder_decorator/coders/coder.rb +11 -2
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 632b576de3c05ef79d82ba749cba8f22f6f62fed
|
4
|
+
data.tar.gz: 226f7e428d62b83dd1996f25a0c6d8c3364f4e44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ed5494544fab2529cdefd5247ecefe87efe4e636b5d0a5d3d29121220db2974cf5b1698b985a2f0c84316aa31706f3a5b72f577832ea9bc0e233da8726325ae
|
7
|
+
data.tar.gz: 25a6c1b6b5dd5ccf9e7352ee9972a2efe76fe0085cb8f478940bbdf7b4849921a301a96f3fe552c48f1e8c7e31c6b3146425eb589054ce72e5f714b58d0840bc
|
@@ -25,6 +25,8 @@ module CoderDecorator
|
|
25
25
|
# end
|
26
26
|
#
|
27
27
|
class Coder < BasicObject
|
28
|
+
DELEGATE = %i(raise respond_to? respond_to_missing?).freeze
|
29
|
+
|
28
30
|
# Can optionally pass a base coder which is going to be decorated.
|
29
31
|
def initialize(coder = nil)
|
30
32
|
@_coder = coder
|
@@ -44,8 +46,15 @@ module CoderDecorator
|
|
44
46
|
::Kernel.raise ::NotImplementedError
|
45
47
|
end
|
46
48
|
|
47
|
-
|
48
|
-
|
49
|
+
private
|
50
|
+
|
51
|
+
def method_missing(name, *args, &block)
|
52
|
+
super unless DELEGATE.include? name
|
53
|
+
::Kernel.send(name, *args, &block)
|
54
|
+
end
|
55
|
+
|
56
|
+
def respond_to_missing?(name, include_private = false)
|
57
|
+
DELEGATE.include?(name) || super
|
49
58
|
end
|
50
59
|
end
|
51
60
|
|
metadata
CHANGED
@@ -1,52 +1,52 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coder_decorator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jian Weihang
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2016-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: minitest
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: '0'
|
20
|
-
|
19
|
+
name: minitest
|
21
20
|
prerelease: false
|
21
|
+
type: :development
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - ">="
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: '0'
|
34
|
-
|
33
|
+
name: rake
|
35
34
|
prerelease: false
|
35
|
+
type: :development
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: rubocop
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - ">="
|
46
45
|
- !ruby/object:Gem::Version
|
47
46
|
version: '0'
|
48
|
-
|
47
|
+
name: rubocop
|
49
48
|
prerelease: false
|
49
|
+
type: :development
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
@@ -69,11 +69,11 @@ files:
|
|
69
69
|
- lib/coder_decorator/coders/rescue.rb
|
70
70
|
- lib/coder_decorator/coders/zip.rb
|
71
71
|
- lib/coder_decorator/errors.rb
|
72
|
-
homepage:
|
72
|
+
homepage:
|
73
73
|
licenses:
|
74
74
|
- MIT
|
75
75
|
metadata: {}
|
76
|
-
post_install_message:
|
76
|
+
post_install_message:
|
77
77
|
rdoc_options: []
|
78
78
|
require_paths:
|
79
79
|
- lib
|
@@ -88,9 +88,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
requirements: []
|
91
|
-
rubyforge_project:
|
91
|
+
rubyforge_project:
|
92
92
|
rubygems_version: 2.6.8
|
93
|
-
signing_key:
|
93
|
+
signing_key:
|
94
94
|
specification_version: 4
|
95
95
|
summary: An encoding/decoding library with decorator pattern.
|
96
96
|
test_files: []
|