charcoal 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 257a79e961264afcc25572a670f923de1cd23d8d
4
- data.tar.gz: 44acf3c34baf250bd418a657870c9c11448d4a00
3
+ metadata.gz: fd99905bdc14133c87f559bc1cbd5bd95f6b44a3
4
+ data.tar.gz: 1122dffafdb9edb2953ac881a7bc6af2fc55b73a
5
5
  SHA512:
6
- metadata.gz: bf9d1b46a477ed166559db85575d6b586d4369d4d47db0c8ac1844526cf4898c30356644e269990749510f3d56697de0cfd1e4229756da5df9fd7bd226c679c8
7
- data.tar.gz: 899221ade18086627484ad80a6b15653509137b69b1b4302bf109189554fff273224b1727b4414e29e70bca0eedbf10264a6bb9612610cb3c600c27760b58937
6
+ metadata.gz: 3619644700d9e3db18045865085568a017630de36c9bf5de472a63555be90c264eaa6cae762d158e05a5da545daece0b50c07670cb2bacf9ab6518cca640c8d9
7
+ data.tar.gz: 771ec9e559eb78d1a897e657dc887418d8f865bb7980bb10e8ff0088fb5f0174b3c3d575e1b58b88f13988c5efcb899792ab409dc2a0cbd34190b537c0eb59a7
@@ -4,7 +4,11 @@ module Charcoal
4
4
  module CrossOrigin
5
5
  def self.included(klass)
6
6
  klass.extend(ClassMethods)
7
- klass.around_filter :set_cors_headers_filter, :if => :cors_allowed?
7
+ if klass.respond_to?(:around_action)
8
+ klass.around_action :set_cors_headers_filter, :if => :cors_allowed?
9
+ else
10
+ klass.around_filter :set_cors_headers_filter, :if => :cors_allowed?
11
+ end
8
12
  end
9
13
 
10
14
  module ClassMethods
@@ -10,7 +10,11 @@ class Charcoal::CrossOriginController < ActionController::Base
10
10
  Routing = defined?(ActionDispatch) ? ActionDispatch::Routing : ActionController::Routing
11
11
 
12
12
  allow_cors :all
13
- skip_around_filter :set_cors_headers_filter
13
+ if respond_to?(:skip_around_action)
14
+ skip_around_action :set_cors_headers_filter
15
+ else
16
+ skip_around_filter :set_cors_headers_filter
17
+ end
14
18
 
15
19
  # OPTIONS *
16
20
  def preflight
@@ -4,7 +4,11 @@ module Charcoal
4
4
  module JSONP
5
5
  def self.included(klass)
6
6
  klass.extend(ClassMethods)
7
- klass.prepend_around_filter :add_jsonp_callback
7
+ if klass.respond_to?(:prepend_around_action)
8
+ klass.prepend_around_action :add_jsonp_callback
9
+ else
10
+ klass.prepend_around_filter :add_jsonp_callback
11
+ end
8
12
  end
9
13
 
10
14
  module ClassMethods
@@ -38,8 +42,8 @@ module Charcoal
38
42
  yield
39
43
 
40
44
  if response.status.to_s.starts_with?('200') && jsonp_request?
41
- response.body = "#{params[:callback]}(#{response.body})"
42
45
  response.content_type = "application/javascript"
46
+ response.body = "#{params[:callback]}(#{response.body})"
43
47
  end
44
48
  end
45
49
  end
@@ -1,3 +1,3 @@
1
1
  module Charcoal
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charcoal
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Davidovitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-30 00:00:00.000000000 Z
11
+ date: 2016-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 3.2.21
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5'
22
+ version: '5.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 3.2.21
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5'
32
+ version: '5.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: actionpack
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: 3.2.21
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '5'
42
+ version: '5.1'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: 3.2.21
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '5'
52
+ version: '5.1'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rake
55
55
  requirement: !ruby/object:Gem::Requirement