durable_decorator 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/lib/durable_decorator/validator.rb +2 -2
- data/lib/durable_decorator/version.rb +1 -1
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e07461083460e4784dc2fc16c4630477bec3cf6f
|
4
|
+
data.tar.gz: d8b906b812caa06a846b247da74e16dac6d04966
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 465039b68bca2b06fb33af48cafdf873522fd7eee7b230dc4085fc92d2e6881d06d7d51857d6a5b1b98011202b240a81af3d1a76d4c21a3ad8f368c243f8cdf3
|
7
|
+
data.tar.gz: a4d25f080b6ae1d536ff85b5ea44ba22f61fb7f5a2710a29b84afdf22bd28e5cc71a90eb884db96f4774cd4b06fa1e6b4efa6a4ea2fe34d431e8f6fe334c518f
|
data/README.md
CHANGED
@@ -18,7 +18,11 @@ Some additional background: http://stackoverflow.com/questions/4470108/when-monk
|
|
18
18
|
|
19
19
|
Add this line to your application's Gemfile:
|
20
20
|
|
21
|
-
gem 'durable_decorator', :
|
21
|
+
gem 'durable_decorator', github: 'jumph4x/durable_decorator'
|
22
|
+
|
23
|
+
Or to include rake tasks for Rails you can use [DurableDecoratorRails](https://github.com/jumph4x/durable_decorator_rails):
|
24
|
+
|
25
|
+
gem 'durable_decorator_rails', github: 'jumph4x/durable_decorator_rails'
|
22
26
|
|
23
27
|
And then execute:
|
24
28
|
|
@@ -100,7 +104,7 @@ instance.string_method('test')
|
|
100
104
|
# => "original test and new"
|
101
105
|
```
|
102
106
|
|
103
|
-
DurableDecorator also maintains explicit versions of each method overriden by creating aliases with
|
107
|
+
DurableDecorator also maintains explicit versions of each method overriden by creating aliases with prepended SHAs of the form ```_1234abcd_some_method``` so you can always target explicit method versions without relying on ```original_some_method```.
|
104
108
|
|
105
109
|
DurableDecorator maintains 3 versions of aliases to previous method versions, 2 of which are short-SHA versions, akin to Github:
|
106
110
|
```ruby
|
@@ -31,8 +31,8 @@ module DurableDecorator
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def handle_soft_fault clazz, method_name, expected_sha, provided_sha
|
34
|
-
Util.logger.
|
35
|
-
Util.logger.
|
34
|
+
Util.logger.warn "#{clazz}##{method_name} decoration uses an invalid SHA. The original method definition could have been tampered with!"
|
35
|
+
Util.logger.warn "Expected SHA was #{expected_sha} but the provided SHA is #{provided_sha}"
|
36
36
|
end
|
37
37
|
|
38
38
|
def validate_method_arity clazz, method_name, old_method, &block
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: durable_decorator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Ivanov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: method_source
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '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
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: logging
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
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: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.3'
|
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: '1.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
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
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '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
82
|
version: '0'
|
83
83
|
description: Allows method redefinitions while maintaining *super*
|
@@ -87,9 +87,9 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
-
- .gitignore
|
91
|
-
- .rspec
|
92
|
-
- .travis.yml
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- ".travis.yml"
|
93
93
|
- Gemfile
|
94
94
|
- LICENSE.txt
|
95
95
|
- README.md
|
@@ -120,17 +120,17 @@ require_paths:
|
|
120
120
|
- lib
|
121
121
|
required_ruby_version: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
|
-
- -
|
123
|
+
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: 1.9.2
|
126
126
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- -
|
128
|
+
- - ">="
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
132
|
rubyforge_project:
|
133
|
-
rubygems_version: 2.
|
133
|
+
rubygems_version: 2.2.1
|
134
134
|
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: Allows method redefinitions while maintaining *super*
|