Skip to content

Commit

Permalink
Merge pull request #107 from arax/rails_update
Browse files Browse the repository at this point in the history
Fixes #106, updated to Rails 4.2 (w/ responders)
  • Loading branch information
Boris Parak committed Feb 17, 2015
2 parents cc7f97b + 12ddac2 commit 73409ea
Show file tree
Hide file tree
Showing 14 changed files with 173 additions and 128 deletions.
10 changes: 6 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 4.1.9'
gem 'rails-api', '~> 0.3.1'
gem 'rails', '~> 4.2.0'
gem 'rails-api', '~> 0.4.0'
gem 'responders', '~> 2.1.0'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
#gem 'jbuilder', '~> 2.1.0'
Expand All @@ -25,6 +26,7 @@ gem 'rvm-capistrano', :group => :development
# Use debugger
gem 'debugger', :group => :development, :platforms => :ruby if RUBY_VERSION == '1.9.3'
gem 'byebug', :group => :development, :platforms => :ruby if RUBY_VERSION.split('.').first == '2'
gem 'web-console', '~> 2.0', :group => :development

# Use whenever for scheduled jobs
gem 'whenever', :require => false
Expand All @@ -37,7 +39,7 @@ gem 'rake', '~> 10.3.2'
gem 'simplecov', :group => [:development, :test]

# Use RSpec for unit tests
gem 'rspec-rails', '~> 3.1.0', :group => [:development, :test]
gem 'rspec-rails', '~> 3.2.0', :group => [:development, :test]
gem 'fuubar', '~> 2.0.0', :group => [:development, :test]

# Use Pry for debugging
Expand Down Expand Up @@ -80,7 +82,7 @@ gem 'kgio', :group => :stuff_breaking_travis_ci
gem 'warden', '~> 1.2.3'

# Sensible logging with LogStash support
gem 'logstasher', :git => "git://github.com/arax/logstasher.git", :branch => "master"
gem 'logstasher', '~> 0.6.2'

# Use Hashie::Mash to simplify hash-related stuff
gem 'hashie'
Expand Down
179 changes: 103 additions & 76 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
GIT
remote: git://github.com/arax/logstasher.git
revision: 1c7bf1d6faab03062cd656eb67694677c87f5765
branch: master
specs:
logstasher (0.6.2)
logstash-event (~> 1.1.0)
request_store

GIT
remote: https://github.com/arax/openssl-cms.git
revision: b6d079c076a9b8e15c573bf6660772ee83e34dd4
Expand Down Expand Up @@ -38,34 +29,43 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.1.9)
actionpack (= 4.1.9)
actionview (= 4.1.9)
actionmailer (4.2.0)
actionpack (= 4.2.0)
actionview (= 4.2.0)
activejob (= 4.2.0)
mail (~> 2.5, >= 2.5.4)
actionpack (4.1.9)
actionview (= 4.1.9)
activesupport (= 4.1.9)
rack (~> 1.5.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.0)
actionview (= 4.2.0)
activesupport (= 4.2.0)
rack (~> 1.6.0)
rack-test (~> 0.6.2)
actionview (4.1.9)
activesupport (= 4.1.9)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
actionview (4.2.0)
activesupport (= 4.2.0)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.9)
activesupport (= 4.1.9)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
activejob (4.2.0)
activesupport (= 4.2.0)
globalid (>= 0.3.0)
activemodel (4.2.0)
activesupport (= 4.2.0)
builder (~> 3.1)
activerecord (4.1.9)
activemodel (= 4.1.9)
activesupport (= 4.1.9)
arel (~> 5.0.0)
activesupport (4.1.9)
i18n (~> 0.6, >= 0.6.9)
activerecord (4.2.0)
activemodel (= 4.2.0)
activesupport (= 4.2.0)
arel (~> 6.0)
activesupport (4.2.0)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (5.0.1.20140414130214)
aws-sdk-core (2.0.21)
arel (6.0.0)
aws-sdk-core (2.0.24)
builder (~> 3.0)
jmespath (~> 1.0)
multi_json (~> 1.0)
Expand Down Expand Up @@ -101,7 +101,9 @@ GEM
fuubar (2.0.0)
rspec (~> 3.0)
ruby-progressbar (~> 1.4)
guard (2.11.1)
globalid (0.3.3)
activesupport (>= 4.1.0)
guard (2.12.1)
formatador (>= 0.2.4)
listen (~> 2.7)
lumberjack (~> 1.0)
Expand All @@ -115,12 +117,13 @@ GEM
guard (~> 2.2)
guard-compat (~> 1.1)
guard-compat (1.2.1)
guard-rails (0.7.0)
guard (~> 2.0)
guard-rails (0.7.1)
guard (~> 2.11)
guard-compat (~> 1.0)
guard-test (2.0.5)
guard (~> 2.0)
test-unit (~> 2.2)
hashie (3.3.2)
hashie (3.4.0)
highline (1.6.21)
hike (1.2.3)
hirb (0.7.3)
Expand All @@ -139,6 +142,11 @@ GEM
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
logstash-event (1.1.5)
logstasher (0.6.2)
logstash-event (~> 1.1.0)
request_store
loofah (2.0.1)
nokogiri (>= 1.5.9)
lumberjack (1.0.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
Expand All @@ -158,7 +166,7 @@ GEM
net-ssh (>= 2.6.5)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
notiffany (0.0.3)
notiffany (0.0.5)
nenv (~> 0.1)
shellany (~> 0.0)
occi-core (4.3.2)
Expand All @@ -170,43 +178,52 @@ GEM
opennebula (4.4.0)
json
nokogiri
ox (2.1.7)
passenger (4.0.58)
ox (2.1.8)
passenger (4.0.59)
daemon_controller (>= 1.2.0)
rack
rake (>= 0.8.1)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-rails (0.3.2)
pry-rails (0.3.3)
pry (>= 0.9.10)
pry-rescue (1.4.1)
interception (>= 0.5)
pry
pry-stack_explorer (0.4.9.1)
pry-stack_explorer (0.4.9.2)
binding_of_caller (>= 0.7)
pry (>= 0.9.11)
rack (1.5.2)
rack (1.6.0)
rack-cors (0.3.1)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.1.9)
actionmailer (= 4.1.9)
actionpack (= 4.1.9)
actionview (= 4.1.9)
activemodel (= 4.1.9)
activerecord (= 4.1.9)
activesupport (= 4.1.9)
rails (4.2.0)
actionmailer (= 4.2.0)
actionpack (= 4.2.0)
actionview (= 4.2.0)
activejob (= 4.2.0)
activemodel (= 4.2.0)
activerecord (= 4.2.0)
activesupport (= 4.2.0)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.9)
sprockets-rails (~> 2.0)
rails-api (0.3.1)
railties (= 4.2.0)
sprockets-rails
rails-api (0.4.0)
actionpack (>= 3.2.11)
railties (>= 3.2.11)
railties (4.1.9)
actionpack (= 4.1.9)
activesupport (= 4.1.9)
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.5)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.1)
loofah (~> 2.0)
railties (4.2.0)
actionpack (= 4.2.0)
activesupport (= 4.2.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.3.2)
Expand All @@ -217,26 +234,29 @@ GEM
json (~> 1.4)
redcarpet (3.2.2)
request_store (1.1.0)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
responders (2.1.0)
railties (>= 4.2.0, < 5)
rspec (3.2.0)
rspec-core (~> 3.2.0)
rspec-expectations (~> 3.2.0)
rspec-mocks (~> 3.2.0)
rspec-core (3.2.0)
rspec-support (~> 3.2.0)
rspec-expectations (3.2.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-rails (3.1.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
rspec-support (~> 3.2.0)
rspec-mocks (3.2.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-rails (3.2.0)
actionpack (>= 3.0, <= 4.2)
activesupport (>= 3.0, <= 4.2)
railties (>= 3.0, <= 4.2)
rspec-core (~> 3.2.0)
rspec-expectations (~> 3.2.0)
rspec-mocks (~> 3.2.0)
rspec-support (~> 3.2.0)
rspec-support (3.2.1)
ruby-progressbar (1.7.1)
rvm-capistrano (1.5.6)
capistrano (~> 2.15.4)
Expand Down Expand Up @@ -271,6 +291,11 @@ GEM
uuidtools (2.1.5)
warden (1.2.3)
rack (>= 1.0)
web-console (2.0.0)
activemodel (~> 4.0)
binding_of_caller (>= 0.7.2)
railties (~> 4.0)
sprockets-rails (>= 2.0, < 4.0)
whenever (0.9.4)
chronic (>= 0.6.3)
yard (0.8.7.6)
Expand All @@ -279,7 +304,7 @@ PLATFORMS
ruby

DEPENDENCIES
aws-sdk-core (~> 2.0.21)
aws-sdk-core (~> 2.0.24)
bond
byebug
capistrano
Expand All @@ -294,7 +319,7 @@ DEPENDENCIES
ice_nine
kgio
libnotify
logstasher!
logstasher (~> 0.6.2)
occi-core (~> 4.3.2)
opennebula (~> 4.4.0)
openssl_cms_1_9_3!
Expand All @@ -307,15 +332,17 @@ DEPENDENCIES
pry-rescue
pry-stack_explorer
rack-cors
rails (~> 4.1.9)
rails-api (~> 0.3.1)
rails (~> 4.2.0)
rails-api (~> 0.4.0)
rake (~> 10.3.2)
rb-inotify
redcarpet
rspec-rails (~> 3.1.0)
responders (~> 2.1.0)
rspec-rails (~> 3.2.0)
rvm-capistrano
sdoc
simplecov
warden (~> 1.2.3)
web-console (~> 2.0)
whenever
yard
9 changes: 7 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
require "application_responder"

# Base class for all rOCCI-server's controllers. Implements
# parsing and authentication callbacks, exposes user information,
# declares supported media formats and handles raised errors.
class ApplicationController < ActionController::API
class ApplicationController < ActionController::Base
self.responder = ApplicationResponder

# Include some stuff present in the full ActionController
include ActionController::ImplicitRender
include ActionController::MimeResponds
Expand Down Expand Up @@ -47,7 +51,8 @@ class ApplicationController < ActionController::API

# Register supported MIME formats
# @see 'config/initializers/mime_types.rb' for details
respond_to :occi_header, :text #, :json, :occi_json, :xml, :occi_xml
respond_to :json, :occi_json if ROCCI_SERVER_CONFIG.common.allow_experimental_mimes
respond_to :occi_header, :text #, :xml, :occi_xml
respond_to :uri_list, only: [:index]
respond_to :html, only: [:index, :show]

Expand Down
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

module ROCCIServer
class Application < Rails::Application
# Use the responders controller from the responders gem
config.app_generators.scaffold_controller :responders_controller

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# config.action_dispatch.rack_cache = true

# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_assets = false
config.serve_static_files = false

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
Expand Down
2 changes: 1 addition & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
config.eager_load = false

# Configure static asset server for tests with Cache-Control for performance.
config.serve_static_assets = true
config.serve_static_files = false
config.static_cache_control = 'public, max-age=3600'

# Show full error reports and disable caching.
Expand Down
Loading

0 comments on commit 73409ea

Please sign in to comment.