I hereby claim:
- I am christhekeele on github.
- I am christhekeele (https://keybase.io/christhekeele) on keybase.
- I have a public key whose fingerprint is FD54 8218 8153 75DB 2F2E 31E4 4F18 C524 2FAE 4D97
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
# A pre-commit hook script to ensure that no local gem dependencies (gem 'asdf', path: '~/local') | |
# exist in your Gemfile before commiting.` | |
# Allows gems to be loaded from source within the current project directory, but not from outside. | |
puts 'Checking for local dependencies in your Gemfile.' | |
ROOT_PATH = File.expand_path('../../..', __FILE__) | |
NESTED_GEMSPECS = Dir["#{ROOT_PATH}/**/*.gemspec"] | |
GEMFILE = ENV['BUNDLE_GEMFILE'] || File.join(ROOT_PATH, 'Gemfile') |
class Pipeline < Module | |
attr_accessor :transforms | |
def initialize(*transforms, &implementation) | |
@transforms = transforms | |
instance_eval &implementation if block_given? | |
end | |
def call(*args, &block) | |
transformers.reduce(block || default_block) do |pipeline, transformer| |
I hereby claim:
To claim this, I am signing this object:
# Put in your .iex, and `require Pattern` | |
defmodule Pattern do | |
defmacro match?(pattern, input, code_block // []) do | |
code = Dict.get(code_block, :do, nil) | |
quote do | |
case unquote(input) do | |
unquote(pattern) -> | |
unquote(code) | |
:ok | |
_ -> |
# FORCE RAILS REDIRECTS TO HONOR CONTENT-TYPE HEADERS | |
# https://github.com/rails/rails/issues/17194 | |
require 'action_controller/metal/redirecting' | |
module ActionController | |
module Redirecting | |
def redirect_to(options = {}, response_status = {}) #:doc: | |
raise ActionControllerError.new("Cannot redirect to nil!") unless options |
# config.rb | |
after_configuration do | |
if defined?(RailsAssets) | |
RailsAssets.load_paths.each do |path| | |
sprockets.append_path path unless sprockets.paths.include? path | |
Dir[File.join(path, '*')].select do |contents| | |
File.file? contents | |
end.map do |file| | |
Pathname.new File.basename file |
require 'active_record' | |
require 'postgres_ext' | |
require 'minitest/autorun' | |
require 'logger' | |
# DB created on localhost with `createdb first_or_initialize` | |
ActiveRecord::Base.establish_connection('postgres://localhost/first_or_initialize') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Schema.define do |
require 'active_model/serializer/associations' | |
module ActiveModel | |
class Serializer | |
def initialize(object, options={}) | |
@object = object | |
@scope = options[:scope] | |
@root = options.fetch(:root, self.class._root) | |
@meta_key = options[:meta_key] || :meta | |
@meta = options[@meta_key] |
Gem::Specification.new do |s| | |
s.name = 'quack' | |
s.summary = '' | |
s.description = '' | |
s.version = '0.0.1' | |
s.platform = Gem::Platform::RUBY | |
s.files = ['quack.rb'] | |
s.require_path = '.' | |