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
| p ['foo', 'foo', 'foo'].map(&:object_id) | |
| p [:foo, :foo, :foo].map(&:object_id) |
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
| #export SSL_CERT_FILE=/usr/local/opt/curl-ca-bundle/share/ca-bundle.crt # this was the old one... | |
| export SSL_CERT_FILE=/usr/local/etc/openssl/cert.pem # this is OS X I think? |
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
| web: bundle exec puma -e $RAILS_ENV -p 1234 -S ~/puma -C config/puma.rb |
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
| Hi, I haven't used Gemfury at all (yet) and I've only briefly clicked around... | |
| I hope you don't mind answering some questions that might be covered elsewhere that | |
| I just haven't found yet. | |
| I want to distribute code to RubySteps members. I've been using git, which is obviously awesome, | |
| but it doesn't really let me limit who gets what and when. I thought that was an advantage at | |
| first, but it turns out that people get overwhelmed when I just throw the whole thing at them. | |
| I could create a separate git repository for each member and push their new code there... |
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' | |
| class Order | |
| def initialize(customer_name) | |
| @customer_name = customer_name | |
| @items = [] | |
| end | |
| def purchase(name, quantity, price) | |
| @items << {name: name, quantity: quantity, price: price} |
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 StarWrapper | |
| def initialize(stream) | |
| @stream = stream | |
| end | |
| def puts(string) | |
| print_header_line string | |
| @stream.print "* " | |
| @stream.print string | |
| @stream.puts " *" |
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 'approvals/rspec' | |
| def output_methods(target, methods) | |
| methods.inject([]) do |results, m| | |
| results << %("#{target}".#{m} => #{target.send(m)}) | |
| end | |
| end | |
| describe "Ruby standard library" do | |
| it "has a useful String class" do |
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
| pat-jukely:active_rest_client pat$ pwd | |
| /Users/pat/code/opensource/active_rest_client | |
| pat-jukely:active_rest_client pat$ bundle install | |
| OH HAI! I am /Users/pat/code/opensource/active_rest_client/Gemfile | |
| OH HAI! I am /Users/pat/code/opensource/active_rest_client/Gemfile | |
| Resolving dependencies... | |
| ... | |
| Your bundle is complete! | |
| It was installed into ./vendor/bundle | |
| OH HAI! I am /Users/pat/code/opensource/active_rest_client/Gemfile |
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
| # Original Rails controller and action | |
| class EmployeesController < ApplicationController | |
| def create | |
| @employee = Employee.new(employee_params) | |
| if @employee.save | |
| redirect_to @employee, notice: "Employee #{@employee.name} created" | |
| else | |
| render :new | |
| end |