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
namespace :heroku do | |
desc "Generate the Heroku gems manifest from gem dependencies" | |
task :gems do | |
RAILS_ENV='production' | |
Rake::Task[:environment].invoke | |
list = Rails.configuration.gems.collect do |g| | |
command, *options = g.send(:install_command) | |
options.join(" ") + "\n" | |
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
<!-- elgalu: Adding ruby regular expression detection starting and ending with slashes --> | |
<dict> | |
<key>begin</key> | |
<string>/</string> | |
<key>beginCaptures</key> | |
<dict> | |
<key>0</key> | |
<dict> | |
<key>name</key> | |
<string>punctuation.definition.string.begin.ruby</string> |
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
Great book! Here are my quiz notes: | |
- What is the diff bt raise and fail? | |
=> no diff | |
- Are raise//fail ruby keywords or methods? | |
=> Kernel#raise (are methods) | |
- Re-raise last exception | |
=> |
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
- Returns? | |
module Module | |
def const_missing(name) | |
"sorry i don't have #{name} yet" | |
end | |
end | |
Untitled #=> ? | |
Monkeys #=> ? | |
=> | |
You get `TypeError: Module is not a module` before reaching Untitled code |
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
$ bundle gem lagema | |
\E[30m black \E[31mred \E[32mgreen \E[33myellow \E[34mblue \E[35mmagenta \E[36mcyan \E[37mwhite | |
<span>create</span> lagema/Gemfile | |
LIGHTGREEN="\033[1;32m" | |
LIGHTRED="\033[1;31m" | |
WHITE="\033[0;37m" | |
RESET="\033[0;00m" | |
create lagema/Rakefile | |
create lagema/LICENSE.txt | |
create lagema/README.md |
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
## | |
- How is the git `staging area` a.k.a? | |
=> | |
# Is also known as the index | |
## | |
- List all available git configurations within current dir | |
=> | |
git config --list | |
#=> |
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
source 'https://rubygems.org' | |
# Specify your gem's dependencies in <%= gem_name %>.gemspec | |
gemspec |
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 'rspec' | |
require 'stringio' | |
# Custom matcher to test text written to standard output and standard error | |
# | |
# @example | |
# expect { $stderr.puts "Some random error" }.to write(/Some.* error/).to(:stderr) | |
# | |
# @example | |
# expect { $stderr.puts "Some specific error" }.to write('Some specific error').to(:stderr) |
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/bash | |
pushd ${OPENSHIFT_REPO_DIR} > /dev/null | |
# Set env vars | |
source ${OPENSHIFT_REPO_DIR}/.env.openshift | |
# Run jobs | |
# bundle exec rake jobs:work | |
bundle exec foreman start > ${OPENSHIFT_RUBY_LOG_DIR}/foreman.log & |
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
# config/application.rb | |
module SpeakerDeck | |
class Application < Rails::Application | |
# … | |
console do | |
require 'speaker_deck/console' | |
Rails::ConsoleMethods.send :include, SpeakerDeck::Console | |
end | |
end |
OlderNewer