action_policy 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 1214a9618cb6a1dc99c244664e9c3bb38217c941a1a721f75c55d74bda56407d
4
- data.tar.gz: fb2466a77823ef0db9cb422430695ae7a2ff448f47d0c39fd968bebc9ee12ddc
3
+ metadata.gz: dd1a7f10e0934ff905e63da4fe68970165813f062ee10c2534eba30acbdcb04b
4
+ data.tar.gz: 0e26b4d23cd11d96accad3c4ba15ff7dfbd68483b1592a98dff181afe6c699a3
5
5
  SHA512:
6
- metadata.gz: 4d17ebf03ff8c893aa63278fadeeea3c8b151ba8aff4b9fd81cee907eab03db60bfc62503636b742b8e964077c066f77967638b3fd3feebb0240de604a1e8de9
7
- data.tar.gz: f522c4ade334c607251829e571ea502c8881dd8fb5283be9a0041a7c20370780a499466b1800ced5bce77bacb3e9a39c7dcb8d50c1729d56fc57c8bf0e59cb21
6
+ metadata.gz: b9643d2b9298058b34d42717b25cb258f53d8cd1aa4314889fab4c830fe781af82e3688400453c1edb0fd41273c5abcdf77f36031d6afc984ececb666570b4f0
7
+ data.tar.gz: ea54f95f99eeb8e60f0554c9bc4b1ae1dccd235c34efba012c08e7a222f3ea1b6fcb873bc19fad1f147af526724e326ad913e6663a8e88b072b315f0e25e3ac4
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ Gemfile.local
data/.travis.yml CHANGED
@@ -13,15 +13,15 @@ matrix:
13
13
  gemfile: gemfiles/railsmaster.gemfile
14
14
  - rvm: jruby-9.1.0.0
15
15
  gemfile: gemfiles/jruby.gemfile
16
- - rvm: 2.5.0
16
+ - rvm: 2.5.1
17
17
  gemfile: Gemfile
18
+ - rvm: 2.5.1
19
+ gemfile: gemfiles/rails42.gemfile
18
20
  - rvm: 2.4.3
19
21
  gemfile: Gemfile
20
22
  - rvm: 2.3.1
21
23
  gemfile: gemfiles/rails42.gemfile
22
24
  allow_failures:
23
- - rvm: 2.3.1
24
- gemfile: gemfiles/rails42.gemfile
25
25
  - rvm: ruby-head
26
26
  gemfile: gemfiles/railsmaster.gemfile
27
27
  - rvm: jruby-9.1.0.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## master
2
2
 
3
+ ## 0.1.4 (2018-06-06)
4
+
5
+ - Fix Railtie injection hook. ([@palkan][])
6
+
7
+ - Fix Ruby 2.3 compatibility. ([@palkan])
8
+
3
9
  ## 0.1.3 (2018-05-20)
4
10
 
5
11
  - Fix modules order in `ActionPolicy::Base`. ([@ilyasgaraev][])
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Action Policy is an authorization framework for Ruby and Rails applications.
8
8
 
9
- 📑 [Documentation][https://actionpolicy.evilmartians.io]
9
+ 📑 [Documentation](https://actionpolicy.evilmartians.io)
10
10
 
11
11
  <a href="https://evilmartians.com/?utm_source=action_policy">
12
12
  <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54"></a>
@@ -10,6 +10,11 @@ module ActionPolicy
10
10
  using ActionPolicy::Ext::StringConstantize
11
11
  end
12
12
 
13
+ unless "".respond_to?(:match?)
14
+ require "action_policy/ext/string_match"
15
+ using ActionPolicy::Ext::StringMatch
16
+ end
17
+
13
18
  def namespace
14
19
  return unless name.match?(/[^^]::/)
15
20
 
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActionPolicy
4
+ module Ext
5
+ # Add match? to String for older Rubys
6
+ module StringMatch
7
+ refine String do
8
+ def match?(regexp)
9
+ !regexp.match(self).nil?
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -49,7 +49,7 @@ module ActionPolicy # :nodoc:
49
49
  app.executor.to_complete { ActionPolicy::PerThreadCache.clear_all }
50
50
  end
51
51
 
52
- config.after_initialize do |_app|
52
+ config.to_prepare do |_app|
53
53
  ActiveSupport.on_load(:action_controller) do
54
54
  next unless Rails.application.config.action_policy.auto_inject_into_controller
55
55
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionPolicy
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_policy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-20 00:00:00.000000000 Z
11
+ date: 2018-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -162,6 +162,7 @@ files:
162
162
  - lib/action_policy/ext/module_namespace.rb
163
163
  - lib/action_policy/ext/policy_cache_key.rb
164
164
  - lib/action_policy/ext/string_constantize.rb
165
+ - lib/action_policy/ext/string_match.rb
165
166
  - lib/action_policy/lookup_chain.rb
166
167
  - lib/action_policy/policy/aliases.rb
167
168
  - lib/action_policy/policy/authorization.rb