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
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 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 has been truncated, but you can view the full file.
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
> gemini@1.0.4 test /home/user/oss/gemini | |
> istanbul test _mocha -- --recursive test/unit test/functional test/browser | |
Tue, 27 Oct 2015 10:45:07 GMT mocha:suite bail undefined | |
Tue, 27 Oct 2015 10:45:07 GMT mocha:suite enableTimeouts true | |
Tue, 27 Oct 2015 10:45:07 GMT mocha:suite timeout 0 | |
Tue, 27 Oct 2015 10:45:07 GMT mocha:suite bail undefined | |
Tue, 27 Oct 2015 10:45:07 GMT mocha:suite timeout 0 | |
Tue, 27 Oct 2015 10:45:07 GMT mocha:suite enableTimeouts false |
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
$ 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 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 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 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 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 |
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 Decorator | |
def initialize(decorated) | |
@decorated = decorated | |
end | |
def method_missing(method, *args) | |
args.empty? ? @decorated.send(method) : @decorated.send(method, args) | |
end | |
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
module OrderService | |
def self.create(listener, user, order_attrs) | |
Order.new(order_attrs.merge(user: current_user)) | |
if order.save | |
transaction = PaymentProcessor.create_payment(order) | |
listener.order_creation_succeeded(order, transaction) | |
else | |
listener.order_creation_failed(order) | |
end | |
end |