require 'rubygems'
def print_hello
puts "Hello, World"
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
require 'rubygems' | |
require 'spork' | |
#uncomment the following line to use spork with the debugger | |
#require 'spork/ext/ruby-debug' | |
Spork.prefork do | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' |
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 'spec_helper' | |
require 'capybara/rails' | |
require 'capybara/rspec' | |
require 'headless' | |
RSpec.configure do |config| | |
config.use_transactional_fixtures = false | |
Capybara.javascript_driver = :webkit |
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
module Reporting::OrderScopes | |
# Returns orders with the scopes injected. | |
def self.inject_to(orders) | |
orders.scoped.extend(self) | |
end | |
# scopes | |
def payed |
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
module ModelForm | |
extend ActiveSupport::Concern | |
included do | |
class_attribute :model_class | |
self.model_class = self.superclass | |
end | |
module ClassMethods | |
def model_name |
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
module ModelForm | |
extend ActiveSupport::Concern | |
included do | |
class_attribute :model_class | |
self.model_class = self.superclass | |
class_attribute :permitted_attrs | |
self.permitted_attrs = [] | |
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
require 'warden/test/helpers' | |
# Usage: | |
# rspec: | |
# config.include Helpers::Controllers::Auth, type: :controller | |
# | |
module Helpers | |
module Controllers | |
module Auth | |
extend ActiveSupport::Concern |
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
# frozen_string_literal: true | |
class DoubleLinkedList | |
include Enumerable | |
def initialize | |
@head_guard = { prev: nil } | |
@tail_guard = { prev: @head_guard, next: nil } | |
@head_guard[:next] = @tail_guard | |
end |