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
#!/bin/sh | |
rvmdir="$HOME/.rvm" | |
rubyversion=$(${rvmdir}/bin/rvm-auto-ruby -e 'puts ENV.fetch("RUBY_VERSION")') | |
export PATH="${rvmdir}/gems/${rubyversion}/bin"\ | |
":${rvmdir}/gems/${rubyversion}@global/bin"\ | |
":${rvmdir}/rubies/${rubyversion}/bin"\ | |
":${rvmdir}/bin"\ | |
":$PATH" |
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
defmodule KVServer do | |
use Application | |
def start(_type, _args) do | |
import Supervisor.Spec | |
children = [ | |
supervisor(Task.Supervisor, [[name: KVServer.TaskSupervisor]]), | |
worker(Task, [KVServer, :accept, [4040]]) | |
] |
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 'yaml' | |
require 'recursive-open-struct' | |
# Read app.yml, users.yml and vendor.yml | |
%w(app users vendor).each do |name| | |
config = YAML.load_file("#{Rails.root}/config/#{name}.yml") || {} | |
struct = RecursiveOpenStruct.new(config, recurse_over_arrays: true) | |
Kernel.const_set("#{name}_config".camelize, struct) | |
end |