cloudfuji 0.0.38 → 0.0.39

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,12 +4,14 @@ module Cloudfuji
4
4
  # POST /cloudfuji/data/
5
5
  def index
6
6
  @key = params.delete("key")
7
+
7
8
  if ENV["CLOUDFUJI_APP_KEY"] != @key
8
9
  respond_to do |format|
9
10
  format.html { render :layout => false, :text => true, :status => :forbidden }
10
- format.json { render :status => 401 }
11
- return
11
+ format.json { render :json => {:error => "Not authorized to submit data to this app" }, :status => 401 }
12
12
  end
13
+
14
+ return
13
15
  end
14
16
 
15
17
  puts "Idobus Data rec'd: #{params.inspect}"
@@ -5,7 +5,7 @@ module Cloudfuji
5
5
  if ENV["CLOUDFUJI_APP_KEY"] != params[:key] or params[:id] == "CLOUDFUJI_KEY"
6
6
  respond_to do |format|
7
7
  format.html { render :layout => false, :text => true, :status => :forbidden }
8
- format.json { render :status => :unprocessable_entity }
8
+ format.json { render :json => {:error => "Not authorized to submit data to this app" }, :status => :unprocessable_entity }
9
9
  end
10
10
 
11
11
  else
@@ -1,4 +1,4 @@
1
1
  module Cloudfuji
2
2
  # Current version of the Cloudfuji gem
3
- VERSION = "0.0.38"
3
+ VERSION = "0.0.39"
4
4
  end
data/lib/rails/routes.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  if ActionController::Routing.name =~ /ActionDispatch/
2
-
3
2
  # Rails 3.x
4
-
5
3
  module ActionDispatch::Routing
6
4
  class RouteSet #:nodoc:
7
5
  Mapper.class_eval do
@@ -9,9 +7,9 @@ if ActionController::Routing.name =~ /ActionDispatch/
9
7
  Rails.application.routes.draw do
10
8
  namespace 'cloudfuji' do
11
9
  resources :envs, :only => [ :update ]
12
- match '/data' => "data#index"
13
10
 
14
11
  # TODO restrict to POST-only
12
+ match '/data' => "data#index"
15
13
  match '/mail' => "mail#index"
16
14
  end
17
15
  end
@@ -25,7 +23,6 @@ else
25
23
  # Rails 2.x
26
24
  module ActionController::Routing
27
25
  class RouteSet
28
-
29
26
  Mapper.class_eval do
30
27
  def cloudfuji_routes
31
28
  namespace 'cloudfuji' do |cloudfuji|
@@ -35,8 +32,6 @@ else
35
32
  end
36
33
  end
37
34
  end
38
-
39
35
  end
40
36
  end
41
-
42
37
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cloudfuji
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.38
5
+ version: 0.0.39
6
6
  platform: ruby
7
7
  authors:
8
8
  - Sean Grove
@@ -251,7 +251,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
251
251
  requirements:
252
252
  - - ">="
253
253
  - !ruby/object:Gem::Version
254
- hash: 4366806130073604874
254
+ hash: 634122366155286373
255
255
  segments:
256
256
  - 0
257
257
  version: "0"
@@ -260,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
260
  requirements:
261
261
  - - ">="
262
262
  - !ruby/object:Gem::Version
263
- hash: 4366806130073604874
263
+ hash: 634122366155286373
264
264
  segments:
265
265
  - 0
266
266
  version: "0"