This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'rails', '4.2.1' | |
gem 'sqlite3' | |
gem 'mysql2', '~> 0.3.0' | |
gem 'sass-rails', '~> 5.0' | |
gem 'uglifier', '>= 1.3.0' | |
gem 'coffee-rails', '~> 4.1.0' | |
gem 'jquery-rails' | |
gem 'turbolinks' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path('../boot', __FILE__) | |
require 'active_model/railtie' | |
require 'active_job/railtie' | |
require 'active_record/railtie' | |
require 'action_controller/railtie' | |
require 'action_mailer/railtie' | |
require 'action_view/railtie' | |
require 'sprockets/railtie' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: &default | |
adapter: mysql2 | |
encoding: utf8 | |
pool: 60 | |
username: root | |
password: | |
host: localhost | |
development: | |
<<: *default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
octopus: | |
replicated : true | |
environments: | |
- development | |
development: | |
m01: | |
host : localhost | |
adapter : mysql2 | |
database: basic_app_development | |
s01: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :shards do | |
def databases | |
databases = [] | |
hash = YAML::load(File.read("#{Rails.root}/config/shards.yml")) | |
data = hash['octopus'][Rails.env] | |
data.each do |key, val| | |
val.each do |key2, val2| | |
if key2 == 'database' | |
databases << val2 | |
elsif val2.is_a?(Hash) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path('../boot', __FILE__) | |
require 'active_model/railtie' | |
require 'active_job/railtie' | |
require 'active_record/railtie' | |
require 'action_controller/railtie' | |
require 'action_mailer/railtie' | |
require 'action_view/railtie' | |
require 'sprockets/railtie' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class API < Grape::API | |
version 'v1', using: :path | |
format :json | |
formatter :json, Grape::Formatter::Jbuilder | |
desc 'Ping pong.' | |
get '/ping', jbuilder: 'ping' do | |
@pong = { | |
message: 'pong', | |
now: Time.now, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
json.response do | |
json.(@pong, :message, :now) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
mount API => '/api/' | |
get 'welcome/index' | |
root to: 'welcome#index' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"directory": "vendor/bower_components" | |
} |