event_capture 0.1.1
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 +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +104 -0
- data/Rakefile +31 -0
- data/app/assets/javascripts/event_capture/client.js +23 -0
- data/app/assets/javascripts/event_capture.js +1 -0
- data/app/controllers/event_capture/application_controller.rb +4 -0
- data/app/controllers/event_capture/events_controller.rb +37 -0
- data/app/models/event_capture/event.rb +14 -0
- data/config/routes.rb +4 -0
- data/db/migrate/20140829235335_create_event_capture_events.rb +13 -0
- data/db/migrate/20150727145934_change_events_recorded_at_to_null.rb +5 -0
- data/db/migrate/20150727151245_change_events_emitted_at_to_null.rb +5 -0
- data/lib/event_capture/engine.rb +12 -0
- data/lib/event_capture/version.rb +4 -0
- data/lib/event_capture.rb +5 -0
- data/lib/tasks/event_capture_tasks.rake +4 -0
- data/spec/controllers/event_capture/events_controller_spec.rb +60 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config/application.rb +29 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +85 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +82 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/schema.rb +29 -0
- data/spec/dummy/log/development.log +265 -0
- data/spec/dummy/log/test.log +48 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/spec/javascripts/support/jasmine.yml +50 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/support/controller_helpers.rb +7 -0
- metadata +224 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9dea72d63dba4d78a8c82cb2e7ebf88a0a69c1d3
|
4
|
+
data.tar.gz: ff1bd8a0ca07ac4ba84eb889e54f6ebaf8fc8cc2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6cfed7b71bda8e30617531553cce44c4d9a093188c89be66ae03abdf2b444fe1fdaedf7eaddb006437fd652ae07676623cc4ef7c62545ecd2ac7f486e98f47a0
|
7
|
+
data.tar.gz: a5dfca3d871efda0e01ca25ac19e6c9e42b0dfe0409a111d05829f85c218daa72f203721a8be91cd4f7e32a5066bb8fb89dff1bd94a6c63c5e923d3fc9efd48e
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2014 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
# Event Capture
|
2
|
+
|
3
|
+
[](https://travis-ci.org/cbitstech/event_capture) [](https://hakiri.io/github/cbitstech/event_capture/master)
|
4
|
+
|
5
|
+
Server and client components for capturing events.
|
6
|
+
|
7
|
+
## Dependencies/assumptions
|
8
|
+
|
9
|
+
The JS client bundled with this engine assumes that jQuery is present.
|
10
|
+
Due to the use of some methods, such as `Date.prototype.toISOString`, the JS
|
11
|
+
client is not compatible with older browsers such as IE8.
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
Add to your `Gemfile`
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
gem 'event_capture', git: 'git@github.com:cbitstech/event_capture.git'
|
19
|
+
```
|
20
|
+
|
21
|
+
Then
|
22
|
+
|
23
|
+
bundle install
|
24
|
+
|
25
|
+
Add the migrations
|
26
|
+
|
27
|
+
rake event_capture:install:migrations
|
28
|
+
|
29
|
+
And run them
|
30
|
+
|
31
|
+
rake db:migrate
|
32
|
+
|
33
|
+
## Usage
|
34
|
+
|
35
|
+
Mount the engine in `config/routes.rb`
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
mount EventCapture::Engine, at: "event_capture"
|
39
|
+
```
|
40
|
+
|
41
|
+
If you want to add controller filters, such as for authentication, you can do
|
42
|
+
so in an initializer. E.g. in `config/initializers/event_capture.rb`
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
require "event_capture/events_controller"
|
46
|
+
|
47
|
+
class EventCapture::EventsController
|
48
|
+
before_action :authenticate_participant!
|
49
|
+
end
|
50
|
+
```
|
51
|
+
|
52
|
+
Additionally, you can add additional parameters to an event in the controller.
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
class EventCapture::EventsController
|
56
|
+
|
57
|
+
# ...
|
58
|
+
|
59
|
+
def event_params
|
60
|
+
{
|
61
|
+
payload: params[:payload],
|
62
|
+
emitted_at: params[:emittedAt],
|
63
|
+
participant_id: current_participant.id
|
64
|
+
}
|
65
|
+
end
|
66
|
+
end
|
67
|
+
```
|
68
|
+
|
69
|
+
### JS client
|
70
|
+
|
71
|
+
Load the JavaScript in your manifest
|
72
|
+
|
73
|
+
//= require event_capture
|
74
|
+
|
75
|
+
Use the client to emit data and handle server responses
|
76
|
+
|
77
|
+
```javascript
|
78
|
+
var client = new EventCaptureClient('https://my.server.api');
|
79
|
+
var response = client.log({ kind: 'myEvent', payload: { foo: 'bar' } });
|
80
|
+
response.done(function(event) {
|
81
|
+
// ...
|
82
|
+
});
|
83
|
+
response.fail(function(xhr, status, error) {
|
84
|
+
// ...
|
85
|
+
});
|
86
|
+
```
|
87
|
+
|
88
|
+
## Run Ruby specs
|
89
|
+
|
90
|
+
Create the database
|
91
|
+
|
92
|
+
rake app:db:create app:db:migrate
|
93
|
+
|
94
|
+
Run the specs
|
95
|
+
|
96
|
+
rake spec
|
97
|
+
|
98
|
+
## Run rubocop linter
|
99
|
+
|
100
|
+
rake rubocop
|
101
|
+
|
102
|
+
## Run jsHint linter
|
103
|
+
|
104
|
+
rake jshint
|
data/Rakefile
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
begin
|
2
|
+
require "bundler/setup"
|
3
|
+
rescue LoadError
|
4
|
+
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
|
5
|
+
end
|
6
|
+
|
7
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
8
|
+
load "rails/tasks/engine.rake"
|
9
|
+
|
10
|
+
Bundler::GemHelper.install_tasks
|
11
|
+
|
12
|
+
require "rspec/core"
|
13
|
+
require "rspec/core/rake_task"
|
14
|
+
|
15
|
+
desc "Run all specs in spec directory (excluding plugin specs)"
|
16
|
+
RSpec::Core::RakeTask.new(spec: "app:db:test:prepare")
|
17
|
+
|
18
|
+
require "jshintrb/jshinttask"
|
19
|
+
Jshintrb::JshintTask.new :jshint do |t|
|
20
|
+
t.pattern = "app/assets/javascripts/**/*.js"
|
21
|
+
t.options = :defaults
|
22
|
+
t.globals = ["$"]
|
23
|
+
end
|
24
|
+
|
25
|
+
require "rubocop/rake_task"
|
26
|
+
RuboCop::RakeTask.new
|
27
|
+
|
28
|
+
task :default do
|
29
|
+
Rake::Task["rubocop"].invoke
|
30
|
+
Rake::Task["spec"].invoke
|
31
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
;(function() {
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
function EventCaptureClient(serverUrl) {
|
5
|
+
this.serverUrl = serverUrl;
|
6
|
+
}
|
7
|
+
|
8
|
+
EventCaptureClient.prototype.log = function(options) {
|
9
|
+
var data = {
|
10
|
+
kind: options.kind,
|
11
|
+
payload: options.payload,
|
12
|
+
emittedAt: (new Date()).toISOString()
|
13
|
+
};
|
14
|
+
|
15
|
+
return $.ajax({
|
16
|
+
type: 'POST',
|
17
|
+
url: this.serverUrl,
|
18
|
+
data: data
|
19
|
+
});
|
20
|
+
};
|
21
|
+
|
22
|
+
window.EventCaptureClient = EventCaptureClient;
|
23
|
+
})();
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require event_capture/client
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module EventCapture
|
2
|
+
# Provide event creation.
|
3
|
+
class EventsController < ApplicationController
|
4
|
+
def create
|
5
|
+
@event = Event.create!(event_params)
|
6
|
+
|
7
|
+
render json: {
|
8
|
+
id: @event.id,
|
9
|
+
emittedAt: @event.emitted_at,
|
10
|
+
recordedAt: @event.recorded_at,
|
11
|
+
payload: @event.payload,
|
12
|
+
userId: @event.user_id,
|
13
|
+
userAgent: @event.user_agent,
|
14
|
+
source: @event.source,
|
15
|
+
kind: @event.kind
|
16
|
+
}, status: :created
|
17
|
+
|
18
|
+
rescue ActiveRecord::ActiveRecordError => invalid
|
19
|
+
render json: { error: model_errors(invalid.record) },
|
20
|
+
status: :bad_request
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def event_params
|
26
|
+
{
|
27
|
+
kind: params[:kind],
|
28
|
+
payload: params[:payload],
|
29
|
+
emitted_at: params[:emittedAt]
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
def model_errors(event)
|
34
|
+
event.errors.full_messages.join(", ")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateEventCaptureEvents < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :event_capture_events do |t|
|
4
|
+
t.datetime :emitted_at
|
5
|
+
t.datetime :recorded_at
|
6
|
+
t.text :payload
|
7
|
+
t.string :user_id
|
8
|
+
t.string :user_agent
|
9
|
+
t.string :source
|
10
|
+
t.string :kind
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module EventCapture
|
4
|
+
class FakeARError < ActiveRecord::ActiveRecordError
|
5
|
+
attr_reader :record
|
6
|
+
def initialize(record)
|
7
|
+
@record = record
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
describe EventsController, type: :controller do
|
12
|
+
describe "POST create" do
|
13
|
+
let(:event) do
|
14
|
+
double("event",
|
15
|
+
id: 1234,
|
16
|
+
emitted_at: DateTime.new,
|
17
|
+
recorded_at: DateTime.new,
|
18
|
+
payload: {}.to_json,
|
19
|
+
user_id: "abcd",
|
20
|
+
user_agent: "efgh",
|
21
|
+
source: "foobar",
|
22
|
+
kind: "barfoo")
|
23
|
+
end
|
24
|
+
|
25
|
+
before(:each) do
|
26
|
+
@routes = Engine.routes
|
27
|
+
end
|
28
|
+
|
29
|
+
context "when the event validates" do
|
30
|
+
before do
|
31
|
+
expect(Event).to receive(:create!) { event }
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should return an error message" do
|
35
|
+
post :create, format: :json
|
36
|
+
|
37
|
+
assert_response 201
|
38
|
+
expect(json["id"]).to eq(1234)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
context "when the event doesn't validate" do
|
43
|
+
let(:errors) { double("errors", full_messages: ["baz"]) }
|
44
|
+
|
45
|
+
before do
|
46
|
+
expect(Event).to receive(:create!)
|
47
|
+
.and_raise(FakeARError.new(event))
|
48
|
+
allow(event).to receive(:errors) { errors }
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should return an error message" do
|
52
|
+
post :create, format: :json
|
53
|
+
|
54
|
+
assert_response 400
|
55
|
+
expect(json["error"]).to eq("baz")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
== README
|
2
|
+
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
|
+
|
6
|
+
Things you may want to cover:
|
7
|
+
|
8
|
+
* Ruby version
|
9
|
+
|
10
|
+
* System dependencies
|
11
|
+
|
12
|
+
* Configuration
|
13
|
+
|
14
|
+
* Database creation
|
15
|
+
|
16
|
+
* Database initialization
|
17
|
+
|
18
|
+
* How to run the test suite
|
19
|
+
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
21
|
+
|
22
|
+
* Deployment instructions
|
23
|
+
|
24
|
+
* ...
|
25
|
+
|
26
|
+
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
6
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
# Pick the frameworks you want:
|
4
|
+
require "active_record/railtie"
|
5
|
+
require "action_controller/railtie"
|
6
|
+
# require "action_mailer/railtie"
|
7
|
+
require "action_view/railtie"
|
8
|
+
require "sprockets/railtie"
|
9
|
+
# require "rails/test_unit/railtie"
|
10
|
+
|
11
|
+
Bundler.require(*Rails.groups)
|
12
|
+
require "event_capture"
|
13
|
+
|
14
|
+
module Dummy
|
15
|
+
class Application < Rails::Application
|
16
|
+
# Settings in config/environments/* take precedence over those specified here.
|
17
|
+
# Application configuration should go into files in config/initializers
|
18
|
+
# -- all .rb files in that directory are automatically loaded.
|
19
|
+
|
20
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
21
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
22
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
23
|
+
|
24
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
25
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
26
|
+
# config.i18n.default_locale = :de
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# PostgreSQL. Versions 8.2 and up are supported.
|
2
|
+
#
|
3
|
+
# Install the pg driver:
|
4
|
+
# gem install pg
|
5
|
+
# On OS X with Homebrew:
|
6
|
+
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
|
7
|
+
# On OS X with MacPorts:
|
8
|
+
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
|
9
|
+
# On Windows:
|
10
|
+
# gem install pg
|
11
|
+
# Choose the win32 build.
|
12
|
+
# Install PostgreSQL and put its /bin directory on your path.
|
13
|
+
#
|
14
|
+
# Configure Using Gemfile
|
15
|
+
# gem 'pg'
|
16
|
+
#
|
17
|
+
default: &default
|
18
|
+
adapter: postgresql
|
19
|
+
encoding: unicode
|
20
|
+
# For details on connection pooling, see rails configuration guide
|
21
|
+
# http://guides.rubyonrails.org/configuring.html#database-pooling
|
22
|
+
pool: 5
|
23
|
+
|
24
|
+
development:
|
25
|
+
<<: *default
|
26
|
+
database: dummy_development
|
27
|
+
|
28
|
+
# The specified database role being used to connect to postgres.
|
29
|
+
# To create additional roles in postgres see `$ createuser --help`.
|
30
|
+
# When left blank, postgres will use the default role. This is
|
31
|
+
# the same name as the operating system user that initialized the database.
|
32
|
+
#username: dummy
|
33
|
+
|
34
|
+
# The password associated with the postgres role (username).
|
35
|
+
#password:
|
36
|
+
|
37
|
+
# Connect on a TCP socket. Omitted by default since the client uses a
|
38
|
+
# domain socket that doesn't need configuration. Windows does not have
|
39
|
+
# domain sockets, so uncomment these lines.
|
40
|
+
#host: localhost
|
41
|
+
|
42
|
+
# The TCP port the server listens on. Defaults to 5432.
|
43
|
+
# If your server runs on a different port number, change accordingly.
|
44
|
+
#port: 5432
|
45
|
+
|
46
|
+
# Schema search path. The server defaults to $user,public
|
47
|
+
#schema_search_path: myapp,sharedapp,public
|
48
|
+
|
49
|
+
# Minimum log levels, in increasing order:
|
50
|
+
# debug5, debug4, debug3, debug2, debug1,
|
51
|
+
# log, notice, warning, error, fatal, and panic
|
52
|
+
# Defaults to warning.
|
53
|
+
#min_messages: notice
|
54
|
+
|
55
|
+
# Warning: The database defined as "test" will be erased and
|
56
|
+
# re-generated from your development database when you run "rake".
|
57
|
+
# Do not set this db to the same as development or production.
|
58
|
+
test:
|
59
|
+
<<: *default
|
60
|
+
database: dummy_test
|
61
|
+
|
62
|
+
# As with config/secrets.yml, you never want to store sensitive information,
|
63
|
+
# like your database password, in your source code. If your source code is
|
64
|
+
# ever seen by anyone, they now have access to your database.
|
65
|
+
#
|
66
|
+
# Instead, provide the password as a unix environment variable when you boot
|
67
|
+
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
|
68
|
+
# for a full rundown on how to provide these environment variables in a
|
69
|
+
# production deployment.
|
70
|
+
#
|
71
|
+
# On Heroku and other platform providers, you may have a full connection URL
|
72
|
+
# available as an environment variable. For example:
|
73
|
+
#
|
74
|
+
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
|
75
|
+
#
|
76
|
+
# You can use this database configuration with:
|
77
|
+
#
|
78
|
+
# production:
|
79
|
+
# url: <%= ENV['DATABASE_URL'] %>
|
80
|
+
#
|
81
|
+
production:
|
82
|
+
<<: *default
|
83
|
+
database: dummy_production
|
84
|
+
username: dummy
|
85
|
+
password: <%= ENV['DUMMY_DATABASE_PASSWORD'] %>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports and disable caching.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send.
|
17
|
+
# config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Raise an error on page load if there are pending migrations.
|
23
|
+
config.active_record.migration_error = :page_load
|
24
|
+
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
28
|
+
config.assets.debug = true
|
29
|
+
|
30
|
+
# Adds additional error checking when serving assets at runtime.
|
31
|
+
# Checks for improperly declared sprockets dependencies.
|
32
|
+
# Raises helpful error messages.
|
33
|
+
config.assets.raise_runtime_errors = true
|
34
|
+
|
35
|
+
# Raises error for missing translations
|
36
|
+
# config.action_view.raise_on_missing_translations = true
|
37
|
+
end
|