ae_declarative_authorization 0.11.0.pre1 → 0.11.0

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: cdac3b23cd265e87af2b4fa946cd3420d3f72383da302c63cc3178aa0a5d4aa5
4
- data.tar.gz: cd5cf8ca8959bf0fa6fb388e997fe4bea2835d9abdc94b71213a03eb107e0af2
3
+ metadata.gz: e24437f98ca9123a9e0c007325f8cfe0b88ed691b4cfcba2be9e9972d413b263
4
+ data.tar.gz: 7c2b45c40951f5bc8ffc71f8c6b739727ee83aaaaea9f27f0d39f07640d3febb
5
5
  SHA512:
6
- metadata.gz: a3c6d73c6af0ec42ac5881323ab4d926e74253ec658234dec0866aa74052e689db6f51e289e4d5a9f75bfb2f4defb0b3fa52a45d93b1a74a25ec0ec079320af3
7
- data.tar.gz: 67ea6f76363ab72f6fac1139482e4f22ce295591198e96c6cd7fc1657ace2c35a8ea63bcd32351e500851469b50e3d84f22a2a37ecd48fdb90fd2647c892faa7
6
+ metadata.gz: 6e437f0d1a24441216a86efd1213973be469838819409445c5af8c892c80939a460c2d789493954ec5c5f74ae41c429e2dc66b39d02fbd505f28954c442ff1cb
7
+ data.tar.gz: f25064eb69ea987a0387fc152dbf98cc1ac87e8b01de4fba54a87cfe2a5aa4acd5ecf525d39095a7a39f973c2e44ddc664b92ca90b814f3632b0fc79758cdd96
@@ -8,6 +8,12 @@ commands:
8
8
  - run: bundle exec appraisal rake test
9
9
 
10
10
  jobs:
11
+ test-ruby-233:
12
+ docker:
13
+ - image: circleci/ruby:2.3.3
14
+ steps:
15
+ - bundle_install_and_test
16
+
11
17
  test-ruby-253:
12
18
  docker:
13
19
  - image: circleci/ruby:2.5.3
@@ -23,6 +29,8 @@ jobs:
23
29
  workflows:
24
30
  rc:
25
31
  jobs:
32
+ - test-ruby-233:
33
+ context: appfolio_test_context
26
34
  - test-ruby-253:
27
35
  context: appfolio_test_context
28
36
  - test-ruby-263:
@@ -1 +1 @@
1
- ruby-2.6.3
1
+ ruby-2.3.3
data/Appraisals CHANGED
@@ -1,26 +1,40 @@
1
- RAILS_VERSIONS = ['5.2.2.1', '6.0.2.1']
2
- GRAPE_VERSIONS = ['1.1.0', '1.2.3', '1.3.0']
3
-
4
1
  case RUBY_VERSION
5
2
 
6
- when '2.5.3', '2.6.3' then
7
- RAILS_VERSIONS.product(GRAPE_VERSIONS).each do |rails_version, grape_version|
8
- appraise "ruby-#{RUBY_VERSION}-rails#{rails_version}-grape#{grape_version}" do
9
- gem 'rails', rails_version
10
- gem 'grape', grape_version
11
-
12
- if Gem::Version.new(grape_version) < Gem::Version.new('1.3.0')
13
- # https://github.com/ruby-grape/grape/pull/1956
14
- gem "rack", "< 2.1.0"
15
- end
16
-
17
- if Gem::Version.new(rails_version) >= Gem::Version.new('6')
18
- gem 'sqlite3', '~> 1.4'
19
- else
20
- gem 'sqlite3', '~> 1.3.0'
21
- end
3
+ when '2.3.3', '2.5.3', '2.6.3' then
4
+
5
+ appraise "ruby-#{RUBY_VERSION}-rails507" do
6
+ gem 'rails', '5.0.7'
7
+ gem 'grape', '1.1.0'
8
+ gem 'rails-controller-testing'
9
+ end
10
+
11
+ appraise "ruby-#{RUBY_VERSION}-rails516" do
12
+ gem 'rails', '5.1.6'
13
+ gem 'grape', '1.2.3'
14
+ gem 'rails-controller-testing'
15
+ end
16
+
17
+ appraise "ruby-#{RUBY_VERSION}-rails521" do
18
+ gem 'rails', '5.2.1'
19
+ gem 'grape', '1.2.3'
20
+ gem 'rails-controller-testing'
21
+ end
22
+
23
+ appraise "ruby-#{RUBY_VERSION}-rails522" do
24
+ gem 'rails', '5.2.2'
25
+ gem 'grape', '1.2.3'
26
+ gem 'rails-controller-testing'
27
+ end
28
+
29
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.5.0')
30
+ appraise "ruby-#{RUBY_VERSION}-rails6" do
31
+ gem 'rails', '~> 6.0'
32
+ gem 'grape', '1.2.3'
33
+ gem 'rails-controller-testing'
34
+ gem 'sqlite3', '~> 1.4'
22
35
  end
23
36
  end
37
+
24
38
  else
25
39
  raise "Unsupported Ruby version #{RUBY_VERSION}"
26
40
 
data/Gemfile CHANGED
@@ -5,5 +5,4 @@ gemspec
5
5
  gem 'appraisal', '~> 2.1'
6
6
  gem 'mocha', '~> 1.0', require: false
7
7
  gem 'sprockets', '< 4'
8
-
9
- gem 'rails-controller-testing'
8
+ gem 'sqlite3', '~> 1.3.0'
@@ -57,18 +57,13 @@ module Authorization
57
57
  ::Rails.logger
58
58
  end
59
59
 
60
+ protected
61
+
60
62
  def api_class
61
63
  if options[:for].respond_to?(:base)
62
- # Grape >= 1.2.0 endpoint
63
- # Authorization::Controller::Grape can be included into either Grape::API
64
- # or Grape::API::Instance, so we need to check both.
65
- [
66
- options[:for],
67
- options[:for].base
68
- ].detect { |api| api.respond_to?(:decl_auth_context) }
64
+ options[:for].base # Grape >= 1.2.0 controller
69
65
  else
70
- # Grape < 1.2.0 endpoint
71
- options[:for]
66
+ options[:for] # Grape < 1.2.0 controller
72
67
  end
73
68
  end
74
69
  end
@@ -68,7 +68,11 @@ module Authorization
68
68
 
69
69
  def controller_class(contr)
70
70
  if defined?(Grape) && contr.class < Grape::Endpoint
71
- contr.api_class
71
+ if contr.options[:for].respond_to?(:base)
72
+ contr.options[:for].base # Grape >= 1.2.0 controller
73
+ else
74
+ contr.options[:for] # Grape < 1.2.0 controller
75
+ end
72
76
  else
73
77
  contr.class # Rails controller
74
78
  end
@@ -1,3 +1,3 @@
1
1
  module DeclarativeAuthorization
2
- VERSION = '0.11.0.pre1'.freeze
2
+ VERSION = '0.11.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ae_declarative_authorization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0.pre1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AppFolio
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-02-12 00:00:00.000000000 Z
12
+ date: 2020-01-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blockenspiel
@@ -99,11 +99,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">"
102
+ - - ">="
103
103
  - !ruby/object:Gem::Version
104
- version: 1.3.1
104
+ version: '0'
105
105
  requirements: []
106
- rubygems_version: 3.0.6
106
+ rubygems_version: 3.0.3
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: ae_declarative_authorization is a Rails gem for maintainable authorization