snorlax 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: be13f32a9698ae9750463da812a2ed87659b7c29
4
- data.tar.gz: 06ac5cd2284cf73a824082e603588a3ae68ebaed
3
+ metadata.gz: 2275e30723ffb0f1d7e9892ec4398cd0715e90f0
4
+ data.tar.gz: 05b2977a32bb2c0102fb6bad962c66692523607a
5
5
  SHA512:
6
- metadata.gz: 5aa804452d8a9ae79275abb60e6498390faa8dd28d23e62ce0052c618d670a27f87781696e7f7c223495f10a983f11addafa10af4b3286e01c9691945f95d19d
7
- data.tar.gz: 829cc1b3f7afa7bf1dba86ec76420899d4411b04ead11d94137c4275536a37d39e5bbe0cf9c3c5f0c24fb12da9236d034bce528d98a47a9da63e53a214aec223
6
+ metadata.gz: 60299279a6e0e7e7d48e0307d4c5b3571bda085df43f3569ae28e94565e415b697313022e175e2ac34b690f82f071e9dbc6ef5456ad65ff5bed149ca3854ae06
7
+ data.tar.gz: 95366fa304596bbdb4e3d99d06dc2bb6685dd0ae5e5703eacadadde54a7078b06a876d2b5e1150cda58dc9418ce8e32c4422da53f50edbd16af5b01b2ba97360
data/Gemfile CHANGED
@@ -4,7 +4,6 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem 'rails', '> 4.1.0'
7
- gem 'cancancan', '~> 1.12.0'
8
7
 
9
8
  group :development, :test do
10
9
  gem 'byebug', require: nil
data/README.md CHANGED
@@ -146,7 +146,7 @@ If you want to disallow timeframing and/or pagination for a particular action, s
146
146
  ```
147
147
  class SquirtlesController < Snorlax::Base
148
148
  def all_squirtles
149
- instantiate_collection paginate_collection: false, timeframe_collection: false
149
+ instantiate_collection page_collection: false, timeframe_collection: false
150
150
  respond_with_collection
151
151
  end
152
152
  end
@@ -3,7 +3,13 @@ module Snorlax
3
3
 
4
4
  def self.snorlax_used_rest!(controller)
5
5
  controller.class_eval do
6
- rescue_from(CanCan::AccessDenied) { |e| respond_with_standard_error e, 403 }
6
+ if defined? CanCan::AccessDenied
7
+ rescue_from(CanCan::AccessDenied) { |e| respond_with_standard_error e, 403 }
8
+ end
9
+ if defined? Pundit::NotAuthorizedError
10
+ rescue_from(Pundit::NotAuthorizedError) { |e| respond_with_standard_error e, 403 }
11
+ end
12
+
7
13
  rescue_from(ActionController::UnpermittedParameters) { |e| respond_with_standard_error e, 400 }
8
14
  rescue_from(ActionController::ParameterMissing) { |e| respond_with_standard_error e, 400 }
9
15
  rescue_from(ActiveRecord::RecordNotFound) { |e| respond_with_standard_error e, 404 }
@@ -18,7 +24,7 @@ module Snorlax
18
24
  end
19
25
 
20
26
  def create
21
- instantiate_resouce
27
+ instantiate_resource
22
28
  create_action
23
29
  respond_with_resource
24
30
  end
@@ -65,7 +71,7 @@ module Snorlax
65
71
  instance_variable_set :"@#{resource_name.pluralize}", value
66
72
  end
67
73
 
68
- def instantiate_resouce
74
+ def instantiate_resource
69
75
  self.resource = resource_class.new(resource_params)
70
76
  end
71
77
 
@@ -1,3 +1,3 @@
1
1
  module Snorlax
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
data/snorlax.gemspec CHANGED
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_runtime_dependency "rails", "> 4.1"
22
- spec.add_runtime_dependency "cancancan", "~> 1.10.1"
23
22
 
24
23
  spec.add_development_dependency "bundler", "~> 1.10"
25
24
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snorlax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Kiesel (gdpelican)
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-25 00:00:00.000000000 Z
11
+ date: 2016-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.1'
27
- - !ruby/object:Gem::Dependency
28
- name: cancancan
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: 1.10.1
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: 1.10.1
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: bundler
43
29
  requirement: !ruby/object:Gem::Requirement