critic 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/.gitignore +0 -1
- data/.travis.yml +0 -2
- data/CHANGELOG.md +2 -3
- data/Gemfile +1 -1
- data/gemfiles/activesupport_3.gemfile +13 -0
- data/gemfiles/activesupport_3.gemfile.lock +72 -0
- data/gemfiles/activesupport_4.gemfile +13 -0
- data/gemfiles/activesupport_4.gemfile.lock +79 -0
- data/gemfiles/activesupport_5.gemfile +13 -0
- data/gemfiles/activesupport_5.gemfile.lock +78 -0
- data/lib/critic/callbacks.rb +7 -1
- data/lib/critic/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4094e59ee71c2769e9e05d891dc36e4a95dd8aa2
|
4
|
+
data.tar.gz: 24336a0cf53571ea45cccd651f49fda0758d2e68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff851589a932c9e65322d6df6625d35a3148226d330842765262d70770b43c93493932ab70471094a819149be7017c42aaa61c74fd39e39006ecdfce11768a39
|
7
|
+
data.tar.gz: 201e017b6fe055d0779ab2cf09714082660266264cdb95614cc58fc1668199df9ed3ebefec0ade24197bedc2e66dee6aa12ddd8a08ef6b3f9e9aa344dc36ca81
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [
|
4
|
-
|
5
|
-
[Full Changelog](https://github.com/lanej/critic/compare/v0.2.0...HEAD)
|
3
|
+
## [v0.2.1](https://github.com/lanej/critic/tree/v0.2.1) (2016-12-28)
|
4
|
+
[Full Changelog](https://github.com/lanej/critic/compare/v0.2.0...v0.2.1)
|
6
5
|
|
7
6
|
**Merged pull requests:**
|
8
7
|
|
data/Gemfile
CHANGED
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
|
|
4
4
|
# Specify your gem's dependencies in critic.gemspec
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
gem 'activesupport', '~>
|
7
|
+
gem 'activesupport', '~> 5.0', require: false
|
8
8
|
gem 'appraisal', '~> 2.1'
|
9
9
|
gem 'rubocop', '~> 0.46.0', require: false
|
10
10
|
|
@@ -0,0 +1,72 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
critic (0.2.1)
|
5
|
+
activesupport (> 3.0, < 6.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activesupport (3.2.22.2)
|
11
|
+
i18n (~> 0.6, >= 0.6.4)
|
12
|
+
multi_json (~> 1.0)
|
13
|
+
appraisal (2.1.0)
|
14
|
+
bundler
|
15
|
+
rake
|
16
|
+
thor (>= 0.14.0)
|
17
|
+
ast (2.3.0)
|
18
|
+
coderay (1.1.1)
|
19
|
+
diff-lcs (1.2.5)
|
20
|
+
i18n (0.7.0)
|
21
|
+
method_source (0.8.2)
|
22
|
+
multi_json (1.12.1)
|
23
|
+
parser (2.3.3.1)
|
24
|
+
ast (~> 2.2)
|
25
|
+
powerpack (0.1.1)
|
26
|
+
pry (0.10.4)
|
27
|
+
coderay (~> 1.1.0)
|
28
|
+
method_source (~> 0.8.1)
|
29
|
+
slop (~> 3.4)
|
30
|
+
pry-nav (0.2.4)
|
31
|
+
pry (>= 0.9.10, < 0.11.0)
|
32
|
+
rainbow (2.2.1)
|
33
|
+
rake (10.5.0)
|
34
|
+
rspec (3.5.0)
|
35
|
+
rspec-core (~> 3.5.0)
|
36
|
+
rspec-expectations (~> 3.5.0)
|
37
|
+
rspec-mocks (~> 3.5.0)
|
38
|
+
rspec-core (3.5.4)
|
39
|
+
rspec-support (~> 3.5.0)
|
40
|
+
rspec-expectations (3.5.0)
|
41
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
+
rspec-support (~> 3.5.0)
|
43
|
+
rspec-mocks (3.5.0)
|
44
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
+
rspec-support (~> 3.5.0)
|
46
|
+
rspec-support (3.5.0)
|
47
|
+
rubocop (0.46.0)
|
48
|
+
parser (>= 2.3.1.1, < 3.0)
|
49
|
+
powerpack (~> 0.1)
|
50
|
+
rainbow (>= 1.99.1, < 3.0)
|
51
|
+
ruby-progressbar (~> 1.7)
|
52
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
53
|
+
ruby-progressbar (1.8.1)
|
54
|
+
slop (3.6.0)
|
55
|
+
thor (0.19.4)
|
56
|
+
unicode-display_width (1.1.2)
|
57
|
+
|
58
|
+
PLATFORMS
|
59
|
+
ruby
|
60
|
+
|
61
|
+
DEPENDENCIES
|
62
|
+
activesupport (~> 3.2)
|
63
|
+
appraisal (~> 2.1)
|
64
|
+
bundler (~> 1.10)
|
65
|
+
critic!
|
66
|
+
pry-nav
|
67
|
+
rake (~> 10.0)
|
68
|
+
rspec (~> 3.4)
|
69
|
+
rubocop (~> 0.46.0)
|
70
|
+
|
71
|
+
BUNDLED WITH
|
72
|
+
1.13.6
|
@@ -0,0 +1,79 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
critic (0.2.1)
|
5
|
+
activesupport (> 3.0, < 6.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activesupport (4.2.7.1)
|
11
|
+
i18n (~> 0.7)
|
12
|
+
json (~> 1.7, >= 1.7.7)
|
13
|
+
minitest (~> 5.1)
|
14
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
15
|
+
tzinfo (~> 1.1)
|
16
|
+
appraisal (2.1.0)
|
17
|
+
bundler
|
18
|
+
rake
|
19
|
+
thor (>= 0.14.0)
|
20
|
+
ast (2.3.0)
|
21
|
+
coderay (1.1.1)
|
22
|
+
diff-lcs (1.2.5)
|
23
|
+
i18n (0.7.0)
|
24
|
+
json (1.8.3)
|
25
|
+
method_source (0.8.2)
|
26
|
+
minitest (5.9.1)
|
27
|
+
parser (2.3.3.1)
|
28
|
+
ast (~> 2.2)
|
29
|
+
powerpack (0.1.1)
|
30
|
+
pry (0.10.4)
|
31
|
+
coderay (~> 1.1.0)
|
32
|
+
method_source (~> 0.8.1)
|
33
|
+
slop (~> 3.4)
|
34
|
+
pry-nav (0.2.4)
|
35
|
+
pry (>= 0.9.10, < 0.11.0)
|
36
|
+
rainbow (2.2.1)
|
37
|
+
rake (10.5.0)
|
38
|
+
rspec (3.5.0)
|
39
|
+
rspec-core (~> 3.5.0)
|
40
|
+
rspec-expectations (~> 3.5.0)
|
41
|
+
rspec-mocks (~> 3.5.0)
|
42
|
+
rspec-core (3.5.4)
|
43
|
+
rspec-support (~> 3.5.0)
|
44
|
+
rspec-expectations (3.5.0)
|
45
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
+
rspec-support (~> 3.5.0)
|
47
|
+
rspec-mocks (3.5.0)
|
48
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
49
|
+
rspec-support (~> 3.5.0)
|
50
|
+
rspec-support (3.5.0)
|
51
|
+
rubocop (0.46.0)
|
52
|
+
parser (>= 2.3.1.1, < 3.0)
|
53
|
+
powerpack (~> 0.1)
|
54
|
+
rainbow (>= 1.99.1, < 3.0)
|
55
|
+
ruby-progressbar (~> 1.7)
|
56
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
57
|
+
ruby-progressbar (1.8.1)
|
58
|
+
slop (3.6.0)
|
59
|
+
thor (0.19.4)
|
60
|
+
thread_safe (0.3.5)
|
61
|
+
tzinfo (1.2.2)
|
62
|
+
thread_safe (~> 0.1)
|
63
|
+
unicode-display_width (1.1.2)
|
64
|
+
|
65
|
+
PLATFORMS
|
66
|
+
ruby
|
67
|
+
|
68
|
+
DEPENDENCIES
|
69
|
+
activesupport (~> 4.2)
|
70
|
+
appraisal (~> 2.1)
|
71
|
+
bundler (~> 1.10)
|
72
|
+
critic!
|
73
|
+
pry-nav
|
74
|
+
rake (~> 10.0)
|
75
|
+
rspec (~> 3.4)
|
76
|
+
rubocop (~> 0.46.0)
|
77
|
+
|
78
|
+
BUNDLED WITH
|
79
|
+
1.13.6
|
@@ -0,0 +1,78 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
critic (0.2.1)
|
5
|
+
activesupport (> 3.0, < 6.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activesupport (5.0.0.1)
|
11
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
+
i18n (~> 0.7)
|
13
|
+
minitest (~> 5.1)
|
14
|
+
tzinfo (~> 1.1)
|
15
|
+
appraisal (2.1.0)
|
16
|
+
bundler
|
17
|
+
rake
|
18
|
+
thor (>= 0.14.0)
|
19
|
+
ast (2.3.0)
|
20
|
+
coderay (1.1.1)
|
21
|
+
concurrent-ruby (1.0.2)
|
22
|
+
diff-lcs (1.2.5)
|
23
|
+
i18n (0.7.0)
|
24
|
+
method_source (0.8.2)
|
25
|
+
minitest (5.9.1)
|
26
|
+
parser (2.3.3.1)
|
27
|
+
ast (~> 2.2)
|
28
|
+
powerpack (0.1.1)
|
29
|
+
pry (0.10.4)
|
30
|
+
coderay (~> 1.1.0)
|
31
|
+
method_source (~> 0.8.1)
|
32
|
+
slop (~> 3.4)
|
33
|
+
pry-nav (0.2.4)
|
34
|
+
pry (>= 0.9.10, < 0.11.0)
|
35
|
+
rainbow (2.2.1)
|
36
|
+
rake (10.5.0)
|
37
|
+
rspec (3.5.0)
|
38
|
+
rspec-core (~> 3.5.0)
|
39
|
+
rspec-expectations (~> 3.5.0)
|
40
|
+
rspec-mocks (~> 3.5.0)
|
41
|
+
rspec-core (3.5.4)
|
42
|
+
rspec-support (~> 3.5.0)
|
43
|
+
rspec-expectations (3.5.0)
|
44
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
+
rspec-support (~> 3.5.0)
|
46
|
+
rspec-mocks (3.5.0)
|
47
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
+
rspec-support (~> 3.5.0)
|
49
|
+
rspec-support (3.5.0)
|
50
|
+
rubocop (0.46.0)
|
51
|
+
parser (>= 2.3.1.1, < 3.0)
|
52
|
+
powerpack (~> 0.1)
|
53
|
+
rainbow (>= 1.99.1, < 3.0)
|
54
|
+
ruby-progressbar (~> 1.7)
|
55
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
56
|
+
ruby-progressbar (1.8.1)
|
57
|
+
slop (3.6.0)
|
58
|
+
thor (0.19.4)
|
59
|
+
thread_safe (0.3.5)
|
60
|
+
tzinfo (1.2.2)
|
61
|
+
thread_safe (~> 0.1)
|
62
|
+
unicode-display_width (1.1.2)
|
63
|
+
|
64
|
+
PLATFORMS
|
65
|
+
ruby
|
66
|
+
|
67
|
+
DEPENDENCIES
|
68
|
+
activesupport (~> 5.0)
|
69
|
+
appraisal (~> 2.1)
|
70
|
+
bundler (~> 1.10)
|
71
|
+
critic!
|
72
|
+
pry-nav
|
73
|
+
rake (~> 10.0)
|
74
|
+
rspec (~> 3.4)
|
75
|
+
rubocop (~> 0.46.0)
|
76
|
+
|
77
|
+
BUNDLED WITH
|
78
|
+
1.13.6
|
data/lib/critic/callbacks.rb
CHANGED
@@ -10,10 +10,16 @@ module Critic::Callbacks
|
|
10
10
|
define_callbacks :authorize,
|
11
11
|
terminator: 'authorization.result == false || result == false',
|
12
12
|
skip_after_callbacks_if_terminated: true
|
13
|
-
|
13
|
+
elsif ActiveSupport::VERSION::MAJOR < 5
|
14
14
|
define_callbacks :authorize,
|
15
15
|
terminator: ->(target, result) { target.authorization.result == false || false == result },
|
16
16
|
skip_after_callbacks_if_terminated: true
|
17
|
+
else
|
18
|
+
define_callbacks :authorize,
|
19
|
+
terminator: lambda { |target, result_lambda|
|
20
|
+
target.authorization.result == false || result_lambda.call == false
|
21
|
+
},
|
22
|
+
skip_after_callbacks_if_terminated: true
|
17
23
|
end
|
18
24
|
end
|
19
25
|
|
data/lib/critic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: critic
|
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
|
- Josh Lane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,6 +94,12 @@ files:
|
|
94
94
|
- bin/console
|
95
95
|
- bin/setup
|
96
96
|
- critic.gemspec
|
97
|
+
- gemfiles/activesupport_3.gemfile
|
98
|
+
- gemfiles/activesupport_3.gemfile.lock
|
99
|
+
- gemfiles/activesupport_4.gemfile
|
100
|
+
- gemfiles/activesupport_4.gemfile.lock
|
101
|
+
- gemfiles/activesupport_5.gemfile
|
102
|
+
- gemfiles/activesupport_5.gemfile.lock
|
97
103
|
- lib/critic.rb
|
98
104
|
- lib/critic/authorization.rb
|
99
105
|
- lib/critic/authorization_denied.rb
|