charcoal 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Appraisals +4 -10
- data/Gemfile +0 -1
- data/README.md +1 -1
- data/charcoal.gemspec +5 -6
- data/gemfiles/rails_2.3.gemfile +1 -2
- data/gemfiles/rails_2.3.gemfile.lock +1 -2
- data/gemfiles/rails_3.0.gemfile +15 -0
- data/gemfiles/rails_3.0.gemfile.lock +104 -0
- data/gemfiles/rails_3.1.gemfile +0 -1
- data/gemfiles/rails_3.1.gemfile.lock +5 -6
- data/gemfiles/rails_3.2.gemfile +0 -1
- data/gemfiles/rails_3.2.gemfile.lock +5 -6
- data/lib/charcoal/cors_controller.rb +6 -1
- data/lib/charcoal/version.rb +1 -1
- metadata +6 -20
data/Appraisals
CHANGED
@@ -1,11 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
appraise "rails-3.1" do
|
6
|
-
gem "rails", "~> 3.1.0"
|
7
|
-
end
|
8
|
-
|
9
|
-
appraise "rails-3.2" do
|
10
|
-
gem "rails", "~> 3.2.0"
|
1
|
+
["2.3", "3.0", "3.1", "3.2"].each do |version|
|
2
|
+
appraise "rails-#{version}" do
|
3
|
+
gem "rails", "~> #{version}.0"
|
4
|
+
end
|
11
5
|
end
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -30,7 +30,7 @@ Included is a CORS pre-flight controller that must be hooked up to the Rails rou
|
|
30
30
|
|
31
31
|
Rails 2:
|
32
32
|
```ruby
|
33
|
-
map.connect "*path.:format", :conditions => { :method => :options }, :action => "preflight", :controller => "CORS", :namespace => "charcoal"
|
33
|
+
map.connect "*path.:format", :conditions => { :method => :options }, :action => "preflight", :controller => "CORS", :namespace => "charcoal/"
|
34
34
|
```
|
35
35
|
|
36
36
|
Rails 3:
|
data/charcoal.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "charcoal"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Steven Davidovitz"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2013-04-25"
|
13
13
|
s.description = "Helps you support JSONP and CORS in your Rails app"
|
14
14
|
s.email = "sdavidovitz@zendesk.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -26,6 +26,8 @@ Gem::Specification.new do |s|
|
|
26
26
|
"charcoal.gemspec",
|
27
27
|
"gemfiles/rails_2.3.gemfile",
|
28
28
|
"gemfiles/rails_2.3.gemfile.lock",
|
29
|
+
"gemfiles/rails_3.0.gemfile",
|
30
|
+
"gemfiles/rails_3.0.gemfile.lock",
|
29
31
|
"gemfiles/rails_3.1.gemfile",
|
30
32
|
"gemfiles/rails_3.1.gemfile.lock",
|
31
33
|
"gemfiles/rails_3.2.gemfile",
|
@@ -46,7 +48,7 @@ Gem::Specification.new do |s|
|
|
46
48
|
s.homepage = "http://github.com/steved555/charcoal"
|
47
49
|
s.licenses = ["MIT"]
|
48
50
|
s.require_paths = ["lib"]
|
49
|
-
s.rubygems_version = "1.8.
|
51
|
+
s.rubygems_version = "1.8.25"
|
50
52
|
s.summary = "Cross-Origin helper for Rails"
|
51
53
|
|
52
54
|
if s.respond_to? :specification_version then
|
@@ -57,14 +59,12 @@ Gem::Specification.new do |s|
|
|
57
59
|
s.add_runtime_dependency(%q<actionpack>, [">= 2.3.5"])
|
58
60
|
s.add_development_dependency(%q<rake>, [">= 0"])
|
59
61
|
s.add_development_dependency(%q<yard>, ["~> 0.7"])
|
60
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.2.0"])
|
61
62
|
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
62
63
|
else
|
63
64
|
s.add_dependency(%q<activesupport>, [">= 2.3.5"])
|
64
65
|
s.add_dependency(%q<actionpack>, [">= 2.3.5"])
|
65
66
|
s.add_dependency(%q<rake>, [">= 0"])
|
66
67
|
s.add_dependency(%q<yard>, ["~> 0.7"])
|
67
|
-
s.add_dependency(%q<bundler>, ["~> 1.2.0"])
|
68
68
|
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
69
69
|
end
|
70
70
|
else
|
@@ -72,7 +72,6 @@ Gem::Specification.new do |s|
|
|
72
72
|
s.add_dependency(%q<actionpack>, [">= 2.3.5"])
|
73
73
|
s.add_dependency(%q<rake>, [">= 0"])
|
74
74
|
s.add_dependency(%q<yard>, ["~> 0.7"])
|
75
|
-
s.add_dependency(%q<bundler>, ["~> 1.2.0"])
|
76
75
|
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
77
76
|
end
|
78
77
|
end
|
data/gemfiles/rails_2.3.gemfile
CHANGED
@@ -6,11 +6,10 @@ gem "activesupport", ">= 2.3.5"
|
|
6
6
|
gem "actionpack", ">= 2.3.5"
|
7
7
|
gem "rake", :group=>:development
|
8
8
|
gem "yard", "~> 0.7", :group=>:development
|
9
|
-
gem "bundler", "~> 1.2.0", :group=>:development
|
10
9
|
gem "jeweler", "~> 1.8.4", :group=>:development
|
11
10
|
gem "appraisal", ">= 0.5.0", :group=>:test
|
12
11
|
gem "shoulda", ">= 0", :group=>:test
|
13
12
|
gem "shoulda-context", ">= 0", :group=>:test
|
14
13
|
gem "mocha", :group=>:test, :require=>false
|
15
|
-
gem "rails", "~> 2.3.
|
14
|
+
gem "rails", "~> 2.3.0"
|
16
15
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "http://rubygems.org"
|
4
|
+
|
5
|
+
gem "activesupport", ">= 2.3.5"
|
6
|
+
gem "actionpack", ">= 2.3.5"
|
7
|
+
gem "rake", :group=>:development
|
8
|
+
gem "yard", "~> 0.7", :group=>:development
|
9
|
+
gem "jeweler", "~> 1.8.4", :group=>:development
|
10
|
+
gem "appraisal", ">= 0.5.0", :group=>:test
|
11
|
+
gem "shoulda", ">= 0", :group=>:test
|
12
|
+
gem "shoulda-context", ">= 0", :group=>:test
|
13
|
+
gem "mocha", :group=>:test, :require=>false
|
14
|
+
gem "rails", "~> 3.0.0"
|
15
|
+
|
@@ -0,0 +1,104 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
abstract (1.0.0)
|
5
|
+
actionmailer (3.0.17)
|
6
|
+
actionpack (= 3.0.17)
|
7
|
+
mail (~> 2.2.19)
|
8
|
+
actionpack (3.0.17)
|
9
|
+
activemodel (= 3.0.17)
|
10
|
+
activesupport (= 3.0.17)
|
11
|
+
builder (~> 2.1.2)
|
12
|
+
erubis (~> 2.6.6)
|
13
|
+
i18n (~> 0.5.0)
|
14
|
+
rack (~> 1.2.5)
|
15
|
+
rack-mount (~> 0.6.14)
|
16
|
+
rack-test (~> 0.5.7)
|
17
|
+
tzinfo (~> 0.3.23)
|
18
|
+
activemodel (3.0.17)
|
19
|
+
activesupport (= 3.0.17)
|
20
|
+
builder (~> 2.1.2)
|
21
|
+
i18n (~> 0.5.0)
|
22
|
+
activerecord (3.0.17)
|
23
|
+
activemodel (= 3.0.17)
|
24
|
+
activesupport (= 3.0.17)
|
25
|
+
arel (~> 2.0.10)
|
26
|
+
tzinfo (~> 0.3.23)
|
27
|
+
activeresource (3.0.17)
|
28
|
+
activemodel (= 3.0.17)
|
29
|
+
activesupport (= 3.0.17)
|
30
|
+
activesupport (3.0.17)
|
31
|
+
appraisal (0.5.1)
|
32
|
+
bundler
|
33
|
+
rake
|
34
|
+
arel (2.0.10)
|
35
|
+
builder (2.1.2)
|
36
|
+
erubis (2.6.6)
|
37
|
+
abstract (>= 1.0.0)
|
38
|
+
git (1.2.5)
|
39
|
+
i18n (0.5.0)
|
40
|
+
jeweler (1.8.4)
|
41
|
+
bundler (~> 1.0)
|
42
|
+
git (>= 1.2.5)
|
43
|
+
rake
|
44
|
+
rdoc
|
45
|
+
json (1.7.5)
|
46
|
+
mail (2.2.19)
|
47
|
+
activesupport (>= 2.3.6)
|
48
|
+
i18n (>= 0.4.0)
|
49
|
+
mime-types (~> 1.16)
|
50
|
+
treetop (~> 1.4.8)
|
51
|
+
metaclass (0.0.1)
|
52
|
+
mime-types (1.19)
|
53
|
+
mocha (0.13.0)
|
54
|
+
metaclass (~> 0.0.1)
|
55
|
+
polyglot (0.3.3)
|
56
|
+
rack (1.2.5)
|
57
|
+
rack-mount (0.6.14)
|
58
|
+
rack (>= 1.0.0)
|
59
|
+
rack-test (0.5.7)
|
60
|
+
rack (>= 1.0)
|
61
|
+
rails (3.0.17)
|
62
|
+
actionmailer (= 3.0.17)
|
63
|
+
actionpack (= 3.0.17)
|
64
|
+
activerecord (= 3.0.17)
|
65
|
+
activeresource (= 3.0.17)
|
66
|
+
activesupport (= 3.0.17)
|
67
|
+
bundler (~> 1.0)
|
68
|
+
railties (= 3.0.17)
|
69
|
+
railties (3.0.17)
|
70
|
+
actionpack (= 3.0.17)
|
71
|
+
activesupport (= 3.0.17)
|
72
|
+
rake (>= 0.8.7)
|
73
|
+
rdoc (~> 3.4)
|
74
|
+
thor (~> 0.14.4)
|
75
|
+
rake (10.0.2)
|
76
|
+
rdoc (3.12)
|
77
|
+
json (~> 1.4)
|
78
|
+
shoulda (3.3.2)
|
79
|
+
shoulda-context (~> 1.0.1)
|
80
|
+
shoulda-matchers (~> 1.4.1)
|
81
|
+
shoulda-context (1.0.1)
|
82
|
+
shoulda-matchers (1.4.1)
|
83
|
+
activesupport (>= 3.0.0)
|
84
|
+
thor (0.14.6)
|
85
|
+
treetop (1.4.12)
|
86
|
+
polyglot
|
87
|
+
polyglot (>= 0.3.1)
|
88
|
+
tzinfo (0.3.35)
|
89
|
+
yard (0.8.3)
|
90
|
+
|
91
|
+
PLATFORMS
|
92
|
+
ruby
|
93
|
+
|
94
|
+
DEPENDENCIES
|
95
|
+
actionpack (>= 2.3.5)
|
96
|
+
activesupport (>= 2.3.5)
|
97
|
+
appraisal (>= 0.5.0)
|
98
|
+
jeweler (~> 1.8.4)
|
99
|
+
mocha
|
100
|
+
rails (~> 3.0.0)
|
101
|
+
rake
|
102
|
+
shoulda
|
103
|
+
shoulda-context
|
104
|
+
yard (~> 0.7)
|
data/gemfiles/rails_3.1.gemfile
CHANGED
@@ -6,7 +6,6 @@ gem "activesupport", ">= 2.3.5"
|
|
6
6
|
gem "actionpack", ">= 2.3.5"
|
7
7
|
gem "rake", :group=>:development
|
8
8
|
gem "yard", "~> 0.7", :group=>:development
|
9
|
-
gem "bundler", "~> 1.2.0", :group=>:development
|
10
9
|
gem "jeweler", "~> 1.8.4", :group=>:development
|
11
10
|
gem "appraisal", ">= 0.5.0", :group=>:test
|
12
11
|
gem "shoulda", ">= 0", :group=>:test
|
@@ -81,11 +81,11 @@ GEM
|
|
81
81
|
rake (10.0.2)
|
82
82
|
rdoc (3.12)
|
83
83
|
json (~> 1.4)
|
84
|
-
shoulda (3.
|
85
|
-
shoulda-context (~> 1.0)
|
86
|
-
shoulda-matchers (~> 1.
|
87
|
-
shoulda-context (1.0.
|
88
|
-
shoulda-matchers (1.
|
84
|
+
shoulda (3.3.2)
|
85
|
+
shoulda-context (~> 1.0.1)
|
86
|
+
shoulda-matchers (~> 1.4.1)
|
87
|
+
shoulda-context (1.0.1)
|
88
|
+
shoulda-matchers (1.4.1)
|
89
89
|
activesupport (>= 3.0.0)
|
90
90
|
sprockets (2.0.4)
|
91
91
|
hike (~> 1.2)
|
@@ -106,7 +106,6 @@ DEPENDENCIES
|
|
106
106
|
actionpack (>= 2.3.5)
|
107
107
|
activesupport (>= 2.3.5)
|
108
108
|
appraisal (>= 0.5.0)
|
109
|
-
bundler (~> 1.2.0)
|
110
109
|
jeweler (~> 1.8.4)
|
111
110
|
mocha
|
112
111
|
rails (~> 3.1.0)
|
data/gemfiles/rails_3.2.gemfile
CHANGED
@@ -6,7 +6,6 @@ gem "activesupport", ">= 2.3.5"
|
|
6
6
|
gem "actionpack", ">= 2.3.5"
|
7
7
|
gem "rake", :group=>:development
|
8
8
|
gem "yard", "~> 0.7", :group=>:development
|
9
|
-
gem "bundler", "~> 1.2.0", :group=>:development
|
10
9
|
gem "jeweler", "~> 1.8.4", :group=>:development
|
11
10
|
gem "appraisal", ">= 0.5.0", :group=>:test
|
12
11
|
gem "shoulda", ">= 0", :group=>:test
|
@@ -79,11 +79,11 @@ GEM
|
|
79
79
|
rake (10.0.2)
|
80
80
|
rdoc (3.12)
|
81
81
|
json (~> 1.4)
|
82
|
-
shoulda (3.
|
83
|
-
shoulda-context (~> 1.0)
|
84
|
-
shoulda-matchers (~> 1.
|
85
|
-
shoulda-context (1.0.
|
86
|
-
shoulda-matchers (1.
|
82
|
+
shoulda (3.3.2)
|
83
|
+
shoulda-context (~> 1.0.1)
|
84
|
+
shoulda-matchers (~> 1.4.1)
|
85
|
+
shoulda-context (1.0.1)
|
86
|
+
shoulda-matchers (1.4.1)
|
87
87
|
activesupport (>= 3.0.0)
|
88
88
|
sprockets (2.1.3)
|
89
89
|
hike (~> 1.2)
|
@@ -104,7 +104,6 @@ DEPENDENCIES
|
|
104
104
|
actionpack (>= 2.3.5)
|
105
105
|
activesupport (>= 2.3.5)
|
106
106
|
appraisal (>= 0.5.0)
|
107
|
-
bundler (~> 1.2.0)
|
108
107
|
jeweler (~> 1.8.4)
|
109
108
|
mocha
|
110
109
|
rails (~> 3.2.0)
|
@@ -9,6 +9,8 @@ require 'charcoal/cors_helper'
|
|
9
9
|
class Charcoal::CORSController < ActionController::Base
|
10
10
|
include Charcoal::CORS
|
11
11
|
|
12
|
+
allow_cors :all
|
13
|
+
|
12
14
|
# OPTIONS *
|
13
15
|
def preflight
|
14
16
|
allowed_methods = ActionController::Routing::HTTP_METHODS.select do |verb|
|
@@ -27,7 +29,10 @@ class Charcoal::CORSController < ActionController::Base
|
|
27
29
|
|
28
30
|
action = route[:action] || params[:path].last.split(".").first
|
29
31
|
|
30
|
-
|
32
|
+
instance = controller.new
|
33
|
+
instance.request = request
|
34
|
+
|
35
|
+
controller.respond_to?(:cors_allowed) && controller.cors_allowed?(instance, action)
|
31
36
|
else
|
32
37
|
false
|
33
38
|
end
|
data/lib/charcoal/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: charcoal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-04-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -75,22 +75,6 @@ dependencies:
|
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0.7'
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: bundler
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - ~>
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: 1.2.0
|
86
|
-
type: :development
|
87
|
-
prerelease: false
|
88
|
-
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: 1.2.0
|
94
78
|
- !ruby/object:Gem::Dependency
|
95
79
|
name: jeweler
|
96
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,6 +108,8 @@ files:
|
|
124
108
|
- charcoal.gemspec
|
125
109
|
- gemfiles/rails_2.3.gemfile
|
126
110
|
- gemfiles/rails_2.3.gemfile.lock
|
111
|
+
- gemfiles/rails_3.0.gemfile
|
112
|
+
- gemfiles/rails_3.0.gemfile.lock
|
127
113
|
- gemfiles/rails_3.1.gemfile
|
128
114
|
- gemfiles/rails_3.1.gemfile.lock
|
129
115
|
- gemfiles/rails_3.2.gemfile
|
@@ -155,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
141
|
version: '0'
|
156
142
|
segments:
|
157
143
|
- 0
|
158
|
-
hash:
|
144
|
+
hash: 1307675170924878136
|
159
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
146
|
none: false
|
161
147
|
requirements:
|
@@ -164,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
150
|
version: '0'
|
165
151
|
requirements: []
|
166
152
|
rubyforge_project:
|
167
|
-
rubygems_version: 1.8.
|
153
|
+
rubygems_version: 1.8.25
|
168
154
|
signing_key:
|
169
155
|
specification_version: 3
|
170
156
|
summary: Cross-Origin helper for Rails
|