mandrill_event 0.0.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/.gitignore +18 -0
- data/.rspec +3 -0
- data/Gemfile +4 -0
- data/Guardfile +62 -0
- data/LICENSE.md +22 -0
- data/README.md +68 -0
- data/Rakefile +10 -0
- data/app/controllers/mandrill_event/events_controller.rb +15 -0
- data/config/routes.rb +3 -0
- data/lib/mandrill_event/engine.rb +5 -0
- data/lib/mandrill_event/version.rb +3 -0
- data/lib/mandrill_event.rb +60 -0
- data/mandrill_event.gemspec +34 -0
- data/spec/controllers/events_controller_spec.rb +44 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -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 +31 -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 +78 -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 +5 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -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/fixtures/rejects.json +54 -0
- data/spec/lib/mandrill_event_spec.rb +52 -0
- data/spec/rails_helper.rb +4 -0
- data/spec/spec_helper.rb +25 -0
- data/spec/support/webhook_request.rb +15 -0
- metadata +299 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 357fad87e433403ede41ebe47e29dea49ac64e27
|
4
|
+
data.tar.gz: f7c5bc7a8a2b84e18ae9ae10ac5e01afb73205d2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ac53717af144185c834bc2b90d54928eb0d59f31e7d9c0f9b842bee1ab1a4b7aa8528c6147d2cc28965f6c826f541914931915c6fd6719ff1050e6e58b2d862f
|
7
|
+
data.tar.gz: a99ce98a1a482f642c646e5db5a2690e72cb83de4b70e3c9d24791dd38100234659b4069637ac63d63444885315162e94f0b206e2b217d928da9bfe2d8bed445
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
|
2
|
+
## Uncomment to clear the screen before every task
|
3
|
+
# clearing :on
|
4
|
+
|
5
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
6
|
+
# rspec may be run, below are examples of the most common uses.
|
7
|
+
# * bundler: 'bundle exec rspec'
|
8
|
+
# * bundler binstubs: 'bin/rspec'
|
9
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
10
|
+
# installed the spring binstubs per the docs)
|
11
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
12
|
+
# * 'just' rspec: 'rspec'
|
13
|
+
|
14
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
15
|
+
require "ostruct"
|
16
|
+
|
17
|
+
# Generic Ruby apps
|
18
|
+
rspec = OpenStruct.new
|
19
|
+
rspec.spec = ->(m) { "spec/#{m}_spec.rb" }
|
20
|
+
rspec.spec_dir = "spec"
|
21
|
+
rspec.spec_helper = "spec/spec_helper.rb"
|
22
|
+
|
23
|
+
watch(%r{^spec/.+_spec\.rb$})
|
24
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| rspec.spec.("lib/#{m[1]}") }
|
25
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
26
|
+
|
27
|
+
# Rails example
|
28
|
+
rails = OpenStruct.new
|
29
|
+
# rails.app = %r{^app/(.+)\.rb$}
|
30
|
+
# rails.views_n_layouts = %r{^app/(.*)(\.erb|\.haml|\.slim)$}
|
31
|
+
rails.controllers = %r{^app/controllers/(.+)_controller\.rb$}
|
32
|
+
# rails.routes = "config/routes.rb"
|
33
|
+
# rails.app_controller = "app/controllers/application_controller.rb"
|
34
|
+
# rails.spec_helper = "spec/rails_helper.rb"
|
35
|
+
# rails.spec_support = %r{^spec/support/(.+)\.rb$}
|
36
|
+
# rails.views = %r{^app/views/(.+)/.*\.(erb|haml|slim)$}
|
37
|
+
|
38
|
+
# watch(rails.app) { |m| rspec.spec.(m[1]) }
|
39
|
+
# watch(rails.views_n_layouts) { |m| rspec.spec.("#{m[1]}#{m[2]}") }
|
40
|
+
watch(rails.controllers) do |m|
|
41
|
+
[
|
42
|
+
rspec.spec.("routing/#{m[1]}_routing"),
|
43
|
+
rspec.spec.("controllers/#{m[1]}_controller"),
|
44
|
+
rspec.spec.("acceptance/#{m[1]}")
|
45
|
+
]
|
46
|
+
end
|
47
|
+
|
48
|
+
# watch(rails.spec_support) { rspec.spec_dir }
|
49
|
+
# watch(rails.spec_helper) { rspec.spec_dir }
|
50
|
+
# watch(rails.routes) { "spec/routing" }
|
51
|
+
# watch(rails.app_controller) { "spec/controllers" }
|
52
|
+
|
53
|
+
# # Capybara features specs
|
54
|
+
# watch(rails.views) { |m| rspec.spec.("features/#{m[1]}") }
|
55
|
+
|
56
|
+
# # Turnip features and steps
|
57
|
+
# watch(%r{^spec/acceptance/(.+)\.feature$})
|
58
|
+
# watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
|
59
|
+
# Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
|
60
|
+
# end
|
61
|
+
|
62
|
+
end
|
data/LICENSE.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Netsign Communications Inc.
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
# MandrillEvent
|
2
|
+
|
3
|
+
MandrillEvent is built on the ActiveSupport::Notifications API. Define subscribers to handle specific event types. Subscribers can be a block or an object that responds to #call.
|
4
|
+
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
### Add it to your Gemfile
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
# Gemfile
|
12
|
+
gem 'mandrill_event', github: 'netsign/mandrill_event'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
### Mount the engine in your routes
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
# config/routes.rb
|
25
|
+
mount MandrillEvent::Engine => '/mandrill'
|
26
|
+
```
|
27
|
+
|
28
|
+
### Setup the initializer
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
# config/initializers/mandrill_event.rb
|
32
|
+
MandrillEvent.configure do |events|
|
33
|
+
events.subscribe 'reject', RejectHandler.new
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
### Create subscriber objects that respond to #call
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
# app/mandrill_handlers/reject_handler.rb
|
41
|
+
class RejectHandler
|
42
|
+
def call(event)
|
43
|
+
# your code here
|
44
|
+
end
|
45
|
+
end
|
46
|
+
```
|
47
|
+
|
48
|
+
## Thanks
|
49
|
+
|
50
|
+
MandrillEvent ~~takes inspiration from~~ is a direct rip-off of the [stripe_event](https://github.com/integrallis/stripe_event) gem, which takes it's inspiration from [Webmachine](https://github.com/seancribbs/webmachine-ruby/blob/6edaecea1ceab7c2c54fc5e83446317524f6bb8b/lib/webmachine/events.rb), which is inspired by Erlang. It's turtles all the way down.
|
51
|
+
|
52
|
+
|
53
|
+
## TODO:
|
54
|
+
|
55
|
+
* More test coverage
|
56
|
+
* Incoming webhook requests are authenticated
|
57
|
+
* Get it on Coveralls
|
58
|
+
* Get it on Travis
|
59
|
+
* Get it on Code Climate
|
60
|
+
|
61
|
+
|
62
|
+
## Contributing
|
63
|
+
|
64
|
+
1. Fork it ( https://github.com/[my-github-username]/mandrill_event/fork )
|
65
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
66
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
67
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
68
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/config/routes.rb
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'active_support/notifications'
|
2
|
+
require 'mandrill_event/version'
|
3
|
+
require 'mandrill_event/engine' if defined?(Rails)
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
module MandrillEvent
|
7
|
+
|
8
|
+
class << self
|
9
|
+
attr_accessor :adapter, :backend, :namespace
|
10
|
+
|
11
|
+
def configure(&block)
|
12
|
+
raise ArgumentError, 'must provide a block' unless block_given?
|
13
|
+
block.arity.zero? ? instance_eval(&block) : yield(self)
|
14
|
+
end
|
15
|
+
|
16
|
+
def process(params)
|
17
|
+
JSON.parse(params['mandrill_events'] || '[]').each do |event_params|
|
18
|
+
instrument(event_params)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def instrument(params)
|
23
|
+
backend.instrument namespace.call(params['event']), params
|
24
|
+
end
|
25
|
+
|
26
|
+
def subscribe(name, callable = Proc.new)
|
27
|
+
backend.subscribe namespace.to_regexp(name), adapter.call(callable)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
class Namespace < Struct.new(:value, :delimiter)
|
33
|
+
def call(name = nil)
|
34
|
+
"#{value}#{delimiter}#{name}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def to_regexp(name = nil)
|
38
|
+
%r{^#{Regexp.escape call(name)}}
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
class NotificationAdapter < Struct.new(:subscriber)
|
43
|
+
def self.call(callable)
|
44
|
+
new(callable)
|
45
|
+
end
|
46
|
+
|
47
|
+
def call(*args)
|
48
|
+
payload = args.last
|
49
|
+
subscriber.call(payload)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class Error < StandardError; end
|
54
|
+
class UnauthorizedError < Error; end
|
55
|
+
|
56
|
+
self.adapter = NotificationAdapter
|
57
|
+
self.backend = ActiveSupport::Notifications
|
58
|
+
self.namespace = Namespace.new('mandrill_event', '.')
|
59
|
+
|
60
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'mandrill_event/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'mandrill_event'
|
8
|
+
spec.version = MandrillEvent::VERSION
|
9
|
+
spec.authors = ['Weston Triemstra']
|
10
|
+
spec.email = ['weston@netsign.com']
|
11
|
+
spec.summary = %q{Mandrill webhook integration for Rails.}
|
12
|
+
# spec.description = %q{TODO: Write a longer description. Optional.}
|
13
|
+
spec.homepage = 'https://github.com/netsign/mandrill_event'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_dependency 'activesupport', '>= 3.1'
|
22
|
+
|
23
|
+
spec.add_development_dependency 'rails', '>= 4.1'
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
26
|
+
spec.add_development_dependency 'rspec'
|
27
|
+
spec.add_development_dependency 'rspec-rails', '~> 3.0'
|
28
|
+
spec.add_development_dependency 'guard'
|
29
|
+
spec.add_development_dependency 'guard-rspec'
|
30
|
+
spec.add_development_dependency 'pry'
|
31
|
+
spec.add_development_dependency 'pry-remote'
|
32
|
+
spec.add_development_dependency 'pry-nav'
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe MandrillEvent::EventsController, :type => :controller do
|
5
|
+
|
6
|
+
def webhook(params)
|
7
|
+
post :create, params.merge(use_route: :mandrill)
|
8
|
+
end
|
9
|
+
|
10
|
+
context 'mandrill checks for working endpoint' do
|
11
|
+
|
12
|
+
describe 'HEAD index' do
|
13
|
+
|
14
|
+
it 'returns status 200' do
|
15
|
+
head :index, use_route: :mandrill
|
16
|
+
expect(response.code).to eq('200')
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'with valid event params' do
|
24
|
+
|
25
|
+
describe 'POST create' do
|
26
|
+
|
27
|
+
let(:params) { {mandrill_events: webhook_example_events('rejects')} }
|
28
|
+
|
29
|
+
it 'returns status 200' do
|
30
|
+
webhook params
|
31
|
+
expect(response.code).to eq('200')
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'calls MandrillEvent.process' do
|
35
|
+
allow(MandrillEvent).to receive(:process).and_return(true)
|
36
|
+
expect(MandrillEvent).to receive(:process)
|
37
|
+
webhook params
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
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
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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,31 @@
|
|
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 'mandrill_event'
|
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
|
+
config.eager_load_paths += %W(#{config.root}/../../app/controllers)
|
21
|
+
|
22
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
23
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
24
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
25
|
+
|
26
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
27
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
28
|
+
# config.i18n.default_locale = :de
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
@@ -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
|