ocean-rails 1.17.1 → 1.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f4c9f1d0cf3130fbe82b956e01e7282f05a745c
4
- data.tar.gz: 012d4bb1419a3c9b8c03797458f693b73bd5ab2c
3
+ metadata.gz: fd5977e6afad651145c7c9cc95297d8a75d99c33
4
+ data.tar.gz: 7d7ab9cbad3c22ae3e9453f1642e9d3c7e680f40
5
5
  SHA512:
6
- metadata.gz: b4987a49ded6766c8f9544976bc3c59bec852f54a4ed719de68964001db72fcda1ecf7e877e9b45dc6b080a444b09b01fa931543b748604380b16e9d0165940c
7
- data.tar.gz: 821fbd0ca06f22ab1ca12314a9a6c75bc00e2afee92dc58dddd47aa8a65f9c7e50b2bc3e527739144a4bafe09c7a8ddb8e5da08752854a30949740d1a22c8e1a
6
+ metadata.gz: 23550b1f69775920f6d7e4b8be5384896165aecb1790ec635055e7c4d539e2920e17c1b0665e4e7b27874e503c8eeac89715587986989c66b8abb8bbf3ef2f1e
7
+ data.tar.gz: 4d4f4c0064a79fb2729713a0da96a9f0084ec1c68dff4796d61fff18c93afa37fd0d4db0309a58e3f9cb5f81948c4e665e2924d019dcfc95a478c2b2e7a86691
data/Rakefile CHANGED
@@ -1,16 +1,10 @@
1
- #!/usr/bin/env rake
2
1
  begin
3
2
  require 'bundler/setup'
4
3
  rescue LoadError
5
4
  puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
5
  end
7
- begin
8
- require 'rdoc/task'
9
- rescue LoadError
10
- require 'rdoc/rdoc'
11
- require 'rake/rdoctask'
12
- RDoc::Task = Rake::RDocTask
13
- end
6
+
7
+ require 'rdoc/task'
14
8
 
15
9
  RDoc::Task.new(:rdoc) do |rdoc|
16
10
  rdoc.rdoc_dir = 'rdoc'
@@ -20,6 +14,8 @@ RDoc::Task.new(:rdoc) do |rdoc|
20
14
  rdoc.rdoc_files.include('lib/**/*.rb')
21
15
  end
22
16
 
17
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
23
19
 
24
20
 
25
21
 
@@ -35,4 +31,4 @@ Rake::TestTask.new(:test) do |t|
35
31
  end
36
32
 
37
33
 
38
- task :default => :test
34
+ task default: :test
@@ -1,11 +1,5 @@
1
- #
2
- # The path /alive is implemented solely for the benefit of Varnish,
3
- # which is set up to use it for health checking. Due to the routing
4
- # implemented in Varnish, /alive can never be reached from the outside.
5
- #
6
-
7
1
  class AliveController < ApplicationController
8
-
2
+
9
3
  skip_before_action :require_x_api_token
10
4
  skip_before_action :authorize_action
11
5
 
@@ -14,5 +8,5 @@ class AliveController < ApplicationController
14
8
  # If there is a DB, call to it here to ensure it too is healthy
15
9
  render text: "ALIVE", status: 200
16
10
  end
17
-
11
+
18
12
  end
@@ -0,0 +1,5 @@
1
+ Rails.application.routes.draw do
2
+
3
+ get "/alive" => "alive#index"
4
+
5
+ end
@@ -20,10 +20,6 @@ class OceanSetupGenerator < Rails::Generators::NamedBase #:nodoc: all
20
20
  copy_file "application_controller.rb", "#{Rails.root}/app/controllers/application_controller.rb"
21
21
  end
22
22
 
23
- def install_application_helper
24
- copy_file "application_helper.rb", "#{Rails.root}/app/helpers/application_helper.rb"
25
- end
26
-
27
23
  def install_spec_helper_and_support_files
28
24
  copy_file "spec_helper.rb", "#{Rails.root}/spec/spec_helper.rb"
29
25
  copy_file "hyperlinks.rb", "#{Rails.root}/spec/support/hyperlinks.rb"
@@ -33,13 +29,6 @@ class OceanSetupGenerator < Rails::Generators::NamedBase #:nodoc: all
33
29
  template "routes.rb", "#{Rails.root}/config/routes.rb"
34
30
  end
35
31
 
36
- def install_alive_controller_and_specs
37
- copy_file "alive_controller.rb", "#{Rails.root}/app/controllers/alive_controller.rb"
38
- route 'get "/alive" => "alive#index"'
39
- copy_file "alive_routing_spec.rb", "#{Rails.root}/spec/routing/alive_routing_spec.rb"
40
- copy_file "alive_spec.rb", "#{Rails.root}/spec/requests/alive_spec.rb"
41
- end
42
-
43
32
  def turn_off_asset_pipeline
44
33
  application "# Disable the asset pipeline
45
34
  config.assets.enabled = false
@@ -50,7 +39,6 @@ class OceanSetupGenerator < Rails::Generators::NamedBase #:nodoc: all
50
39
  application "# Handle our own exceptions internally, so we can return JSON error bodies
51
40
  config.exceptions_app = ->(env) { ErrorsController.action(:show).call(env) }
52
41
  "
53
- copy_file "errors_controller.rb", "#{Rails.root}/app/controllers/errors_controller.rb"
54
42
  end
55
43
 
56
44
  def turn_off_sessions_and_cookies
@@ -72,12 +60,9 @@ class OceanSetupGenerator < Rails::Generators::NamedBase #:nodoc: all
72
60
  "
73
61
  end
74
62
 
75
- def install_initializers
76
- copy_file "api_constants.rb", "#{Rails.root}/config/initializers/api_constants.rb"
63
+ def install_config_yml_files
77
64
  template "config.yml.example", "#{Rails.root}/config/config.yml.example"
78
65
  template "config.yml.example", "#{Rails.root}/config/config.yml"
79
- copy_file "ocean_constants.rb", "#{Rails.root}/config/initializers/ocean_constants.rb"
80
- copy_file "zeromq_logger.rb", "#{Rails.root}/config/initializers/zeromq_logger.rb"
81
66
  end
82
67
 
83
68
  def replace_gemfile
@@ -1,3 +1,5 @@
1
+ require "ocean/engine"
2
+
1
3
  require "ocean/api"
2
4
  require "ocean/api_resource"
3
5
  require "ocean/ocean_resource_model" if defined? ActiveRecord
@@ -11,7 +13,9 @@ require "ocean/flooding"
11
13
  INVALIDATE_MEMBER_DEFAULT = ["($|/|\\?)"]
12
14
  INVALIDATE_COLLECTION_DEFAULT = ["($|\\?)"]
13
15
 
16
+
14
17
  module Ocean
18
+
15
19
  class Railtie < Rails::Railtie
16
20
  # Silence the /alive action
17
21
  initializer "ocean.swap_logging_middleware" do |app|
@@ -22,6 +26,7 @@ module Ocean
22
26
  g.templates.unshift File::expand_path('../templates', __FILE__)
23
27
  end
24
28
  end
29
+
25
30
  end
26
31
 
27
32
 
@@ -0,0 +1,4 @@
1
+ module Ocean
2
+ class Engine < ::Rails::Engine
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "1.17.1"
2
+ VERSION = "1.18.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.1
4
+ version: 1.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-23 00:00:00.000000000 Z
11
+ date: 2013-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -201,6 +201,13 @@ executables: []
201
201
  extensions: []
202
202
  extra_rdoc_files: []
203
203
  files:
204
+ - app/controllers/alive_controller.rb
205
+ - app/controllers/errors_controller.rb
206
+ - app/helpers/application_helper.rb
207
+ - config/initializers/api_constants.rb
208
+ - config/initializers/ocean_constants.rb
209
+ - config/initializers/zeromq_logger.rb
210
+ - config/routes.rb
204
211
  - lib/generators/ocean_scaffold/ocean_scaffold_generator.rb
205
212
  - lib/generators/ocean_scaffold/templates/controller_specs/create_spec.rb
206
213
  - lib/generators/ocean_scaffold/templates/controller_specs/delete_spec.rb
@@ -213,24 +220,17 @@ files:
213
220
  - lib/generators/ocean_scaffold/templates/views/_resource.json.jbuilder
214
221
  - lib/generators/ocean_scaffold/USAGE
215
222
  - lib/generators/ocean_setup/ocean_setup_generator.rb
216
- - lib/generators/ocean_setup/templates/alive_controller.rb
217
- - lib/generators/ocean_setup/templates/alive_routing_spec.rb
218
- - lib/generators/ocean_setup/templates/alive_spec.rb
219
- - lib/generators/ocean_setup/templates/api_constants.rb
220
223
  - lib/generators/ocean_setup/templates/application_controller.rb
221
- - lib/generators/ocean_setup/templates/application_helper.rb
222
224
  - lib/generators/ocean_setup/templates/config.yml.example
223
- - lib/generators/ocean_setup/templates/errors_controller.rb
224
225
  - lib/generators/ocean_setup/templates/Gemfile
225
226
  - lib/generators/ocean_setup/templates/gitignore
226
227
  - lib/generators/ocean_setup/templates/hyperlinks.rb
227
- - lib/generators/ocean_setup/templates/ocean_constants.rb
228
228
  - lib/generators/ocean_setup/templates/routes.rb
229
229
  - lib/generators/ocean_setup/templates/spec_helper.rb
230
- - lib/generators/ocean_setup/templates/zeromq_logger.rb
231
230
  - lib/generators/ocean_setup/USAGE
232
231
  - lib/ocean/api.rb
233
232
  - lib/ocean/api_resource.rb
233
+ - lib/ocean/engine.rb
234
234
  - lib/ocean/flooding.rb
235
235
  - lib/ocean/ocean_application_controller.rb
236
236
  - lib/ocean/ocean_resource_controller.rb
@@ -241,7 +241,6 @@ files:
241
241
  - lib/ocean/zeromq_logger.rb
242
242
  - lib/ocean-rails.rb
243
243
  - lib/tasks/ocean_tasks.rake
244
- - lib/template.rb
245
244
  - lib/templates/rails/scaffold_controller/controller.rb
246
245
  - MIT-LICENSE
247
246
  - Rakefile
@@ -1,11 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe AliveController do
4
- describe "routing" do
5
-
6
- it "routes to #index" do
7
- get("/alive").should route_to("alive#index")
8
- end
9
-
10
- end
11
- end
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "/alive (for Varnish health checking)" do
4
-
5
- it "should return a 200 with a body of OK" do
6
- get "/alive", {}, {'HTTP_ACCEPT' => "application/json"}
7
- response.status.should be(200)
8
- response.body.should == "ALIVE"
9
- end
10
-
11
-
12
- end
@@ -1,31 +0,0 @@
1
- # Update the Gemfile
2
- gem "ocean-rails", git: "git://github.com/OceanDev/ocean-rails.git"
3
-
4
- # Install a .rvmrc file
5
- run "rvm rvmrc create ruby-2.0.0-p195@rails-4.0.0"
6
- # Select the ruby and gem bag
7
- run "rvm use ruby-2.0.0-p195@rails-4.0.0"
8
- # Run bundle install - we need the generators in it now
9
- run "bundle install"
10
-
11
- # Set up the application as a SOA service Rails application
12
- generate "ocean_setup", app_name
13
-
14
- # Install the required gems and package them with the app
15
- run "bundle install"
16
- run "bundle package --all"
17
-
18
- # Remove the asset stuff from the application conf file
19
- gsub_file "config/application.rb",
20
- / # Enable the asset pipeline.+config\.assets\.version = '1\.0'\s/m, ''
21
-
22
- # Set up SQLite to run tests in memory
23
- gsub_file "config/database.yml",
24
- /test:\s+adapter: sqlite3\s+database: db\/test.sqlite3/m,
25
- 'test:
26
- adapter: sqlite3
27
- database: ":memory:"
28
- verbosity: quiet'
29
-
30
- # Get the DBs in order
31
- rake "db:migrate"