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 'highline' | |
| cli = HighLine.new | |
| cli.say "Cannot pull because Git repository is dirty" | |
| cli.choose do |menu| | |
| menu.prompt = "WHAT TO DO?" | |
| menu.choice(:reset) { sh 'git reset --hard' } | |
| menu.choice(:stash) { sh 'git stash' } | |
| menu.choice(:quit, "Exit program") { abort 'Quiting. Nothing to do.' } | |
| menu.default = :quit |
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
| # See https://github.com/teampoltergeist/poltergeist/issues/677#issuecomment-222919584 | |
| # https://dzone.com/articles/precompiling-rails-assets | |
| RSpec.configure do |config| | |
| config.before :all do | |
| ENV['PRECOMPILE_ASSETS'] ||= begin | |
| case self.class.metadata[:type] | |
| when :feature, :view | |
| STDOUT.write "Precompiling assets..." | |
| require 'rake' |
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
| ----- Esc ----- | |
| Quick change directory: Esc + c | |
| Quick change directory history: Esc + c and then Esc + h | |
| Quick change directory previous entry: Esc + c and then Esc + p | |
| Command line history: Esc + h | |
| Command line previous command: Esc + p | |
| View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
| Print current working directory in command line: Esc + a | |
| Switch between background command line and MC: Ctrl + o | |
| Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory 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
| require 'wisper' | |
| module FailFastWisperRectify | |
| def self.included(base) | |
| base.include Wisper::Publisher | |
| base.include Helpers | |
| base.prepend Proxy | |
| base.extend ClassMethods | |
| 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 'wisper' | |
| module FailFastWisper | |
| def self.included(base) | |
| base.include Wisper::Publisher | |
| base.include Helpers | |
| base.prepend Proxy | |
| 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
| # Class UniquenessValidator adds 'model' option to the options so it can be used | |
| # outside the model. | |
| # | |
| # See http://stackoverflow.com/a/14671979/807647 | |
| # | |
| # Example: | |
| # | |
| # class SignupForm | |
| # include ActiveModel::Model | |
| # attr_reader :email |
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 RichReturn | |
| def self.included(base) | |
| base.extend Exposures | |
| base.prepend Proxy | |
| end | |
| module Exposures | |
| def exposes(*args) | |
| @__exposures = args | |
| attr_reader(*args) |
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 FailFast | |
| class Success | |
| attr_reader :data, :error | |
| def initialize(data) | |
| @data = data | |
| end | |
| def success? |
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 "inflecto" | |
| require "site_prism" | |
| # Load all the page classes | |
| Dir[SPEC_ROOT.join("pages/**/*.rb").to_s].each(&method(:require)) | |
| # Add a helper method for accessing each page class, with a name to match. A | |
| # `_page` suffix is added for clarity, and to avoid name collisions, e.g. | |
| # | |
| # MyFriendsPage -> TestPageHelpers#my_friends_page |
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 Base | |
| end | |
| class A < Base | |
| end | |
| class A | |
| class Create | |
| end | |
| end |