charcoal 0.3.0 → 1.0.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e8998af772ef41fcf01ce20bdfba50310f77cae
|
4
|
+
data.tar.gz: 25019fe15c3c29209b2f084ac052788817a58077
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d8541b0db4bb762e5bc81c3429a472e2fc2462f9e7eea023246286921213b3bad94fe9f7a8d1a2b85ad22d8a2f7a7e36375cc83fca0b835aa195ce2a72051b9
|
7
|
+
data.tar.gz: ab75aa0690fd0ee5155c291261a8c2609803b52978b75f254d7664df8fe4db2ceabdb77b9bd68695059a84dbd44a73f61ed009b7662d090c47f3e5ed8e8df5f9
|
data/README.md
CHANGED
@@ -23,19 +23,19 @@ will have the response body wrapped in that callback and the content type change
|
|
23
23
|
|
24
24
|
Please familiarize yourself with the [documentation](https://developer.mozilla.org/En/HTTP_access_control) ([wikipedia](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) before proceeding.
|
25
25
|
|
26
|
-
Include the module `Charcoal::
|
26
|
+
Include the module `Charcoal::CrossOrigin` in the controller you'd like to allow CORS.
|
27
27
|
`allow_cors` accepts the same arguments as `allow_jsonp`
|
28
28
|
|
29
29
|
Included is a CORS pre-flight controller that must be hooked up to the Rails router:
|
30
30
|
|
31
31
|
Rails 2:
|
32
32
|
```ruby
|
33
|
-
map.connect "*path.:format", :conditions => { :method => :options }, :action => "preflight", :controller => "
|
33
|
+
map.connect "*path.:format", :conditions => { :method => :options }, :action => "preflight", :controller => "cross_origin", :namespace => "charcoal/"
|
34
34
|
```
|
35
35
|
|
36
36
|
Rails 3 / 4:
|
37
37
|
```ruby
|
38
|
-
match '*path.:format' => 'charcoal/
|
38
|
+
match '*path.:format' => 'charcoal/cross_origin#preflight', :via => :options
|
39
39
|
```
|
40
40
|
|
41
41
|
#### Configuration
|
@@ -4,10 +4,8 @@
|
|
4
4
|
require 'action_controller'
|
5
5
|
require 'active_support/version'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
class Charcoal::CORSController < ActionController::Base
|
10
|
-
include Charcoal::CORS
|
7
|
+
class Charcoal::CrossOriginController < ActionController::Base
|
8
|
+
include Charcoal::CrossOrigin
|
11
9
|
|
12
10
|
Routing = defined?(ActionDispatch) ? ActionDispatch::Routing : ActionController::Routing
|
13
11
|
|
data/lib/charcoal/version.rb
CHANGED
data/lib/charcoal.rb
CHANGED
@@ -10,10 +10,9 @@ module Charcoal
|
|
10
10
|
end
|
11
11
|
|
12
12
|
autoload :ControllerFilter, 'charcoal/controller_filter'
|
13
|
-
autoload :
|
13
|
+
autoload :CrossOrigin, 'charcoal/cross_origin'
|
14
14
|
autoload :JSONP, 'charcoal/jsonp'
|
15
15
|
|
16
|
-
autoload :
|
17
|
-
# autoload :ParameterWhitelist, "charcoal/parameter_whitelist"
|
16
|
+
autoload :CrossOriginController, 'charcoal/cross_origin_controller'
|
18
17
|
end
|
19
18
|
|
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: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Davidovitz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -62,9 +62,8 @@ files:
|
|
62
62
|
- README.md
|
63
63
|
- lib/charcoal.rb
|
64
64
|
- lib/charcoal/controller_filter.rb
|
65
|
-
- lib/charcoal/
|
66
|
-
- lib/charcoal/
|
67
|
-
- lib/charcoal/cors_helper.rb
|
65
|
+
- lib/charcoal/cross_origin.rb
|
66
|
+
- lib/charcoal/cross_origin_controller.rb
|
68
67
|
- lib/charcoal/jsonp.rb
|
69
68
|
- lib/charcoal/version.rb
|
70
69
|
homepage: https://github.com/steved555/charcoal
|
data/lib/charcoal/cors_helper.rb
DELETED