This file contains 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
module EngineControllerPatch | |
def self.included(base) | |
@http_methods ||= [ :get, :post, :put, :patch, :delete ] | |
@http_methods.each { |http_method| patch_http_method http_method } | |
end | |
def self.patch_http_method(http_method) | |
define_method(http_method) do |action, parameters = nil, session = nil, flash = nil| | |
process_action(action, parameters, session, flash, http_method.to_s.upcase) | |
end |
This file contains 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 'active_support' | |
require 'active_support/core_ext' | |
require 'active_record' | |
require 'test/unit' | |
# Setup | |
ActiveRecord::Base.establish_connection( | |
:adapter => "sqlite3", | |
:database => ":memory:" |
This file contains 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 'factory_girl' | |
require 'faker' | |
class JsonStrategy # From http://git.io/vT8kC | |
def initialize | |
@strategy = FactoryGirl.strategy_by_name(:create).new | |
end | |
delegate :association, to: :@strategy |
This file contains 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' | |
ruby '2.2.2' | |
group :development do | |
# Handle file system changes and run things | |
gem 'guard', '~> 2.12.4' | |
# Intelligently Autorun Tests | |
gem 'guard-rspec', '~> 4.2.0' |
This file contains 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
AllCops: | |
Include: | |
- "**/*.rake" | |
- "**/Gemfile" | |
- "**/Rakefile" | |
Exclude: | |
- "vendor/**/*" | |
- "db/**/*" | |
DisplayCopNames: true | |
RunRailsCops: true |
This file contains 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
$ reek -v | |
reek 3.5.0 | |
$ tree -d | |
. | |
├── command_line | |
│ ├── fixtures | |
│ └── shared | |
├── core | |
│ ├── argf | |
│ │ ├── fixtures |
This file contains 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
$ CI=true be mutant -j1 -I . -r mutant-freezer --use rspec 'Foo*'Mutant configuration: | |
Matcher: #<Mutant::Matcher::Config match_expressions: [Foo*]> | |
Integration: Mutant::Integration::Rspec | |
Expect Coverage: 100.00% | |
Jobs: 1 | |
Includes: ["."] | |
Requires: ["mutant-freezer"] | |
(00/08) 100% - killtime: 0.00s runtime: 0.00s overhead: 0.00s | |
(07/08) 87% - killtime: 0.18s runtime: 1.01s overhead: 0.83s | |
Foo#bar:/Users/johnbackus/Dropbox/coding/gists/mutant-freezer.rb:13 |
This file contains 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
import urllib2 | |
import json | |
import datetime | |
'''Constants''' | |
catSubreddits = ['cat','catpictures','cats','flyingcats','catgifs','lolcats'] | |
''' Prompt for num days back ''' | |
nDaysSet=False | |
while nDaysSet is not True: |
This file contains 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
--- | |
Style/BarePercentLiterals: | |
EnforcedStyle: percent_q | |
SupportedStyles: | |
- percent_q | |
- bare_percent |
This file contains 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 'active_model' | |
class Example | |
include ActiveModel::Model | |
validates :foo, inclusion: [1] | |
attr_accessor :foo | |
end |
OlderNewer