charcoal 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/charcoal/cross_origin.rb +5 -1
- data/lib/charcoal/cross_origin_controller.rb +5 -1
- data/lib/charcoal/jsonp.rb +6 -2
- data/lib/charcoal/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd99905bdc14133c87f559bc1cbd5bd95f6b44a3
|
4
|
+
data.tar.gz: 1122dffafdb9edb2953ac881a7bc6af2fc55b73a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
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
|
data/lib/charcoal/jsonp.rb
CHANGED
@@ -4,7 +4,11 @@ module Charcoal
|
|
4
4
|
module JSONP
|
5
5
|
def self.included(klass)
|
6
6
|
klass.extend(ClassMethods)
|
7
|
-
klass.
|
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
|
data/lib/charcoal/version.rb
CHANGED
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.
|
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:
|
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
|