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
| xml.products do | |
| @products.each do |product| | |
| xml.product do | |
| xml.title product.title | |
| end | |
| end | |
| 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 ProductsController < ApplicationController | |
| before_action :set_product, only: [:show, :edit, :update, :destroy] | |
| include ActionController::Live | |
| before_action :authorize, only: [:edit, :destroy] | |
| # GET /products | |
| # GET /products.json | |
| def index | |
| @products = Product.all | |
| 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 'gorp/test' | |
| class BasicRailsTest < Gorp::TestCase | |
| test "basic functionality" do | |
| desc 'Create the application.' | |
| rails 'depot' | |
| desc 'Create a simple resource.' |
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
| unless File.exists?('Gemfile') | |
| File.write('Gemfile', <<-GEMFILE) | |
| source 'https://rubygems.org' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'sqlite3' | |
| GEMFILE | |
| system 'bundle' | |
| 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
| ruby-2.0.0-p0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake). | |
| Log file: /usr/local/rvm/log/ruby-2.0.0-p0/gemsets.initial.log | |
| [2013-03-26 15:43:43] __rvm_with | |
| __rvm_with () | |
| { | |
| ( __rvm_use "$1"; | |
| shift; | |
| "$@" || return $? ) | |
| } | |
| current path: /usr/local/rvm/src/ruby-2.0.0-p0 |
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
| $ rvm requirements | |
| Installing requirements for ubuntu, might require sudo password. | |
| Running 'apt-get --quiet --yes update' would require sudo. | |
| Cowardly refusing to continue, please read 'rvm autolibs'. | |
| Updating repositories | |
| Missing required packages: libgdbm-dev, libffi-dev. | |
| Cowardly refusing to continue, please read 'rvm autolibs'. | |
| $ sudo rvm requirements | |
| [sudo] password for rubys: |
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
| $ rvm ruby-head-n39832 | |
| $ gem list mysql2 | |
| *** LOCAL GEMS *** | |
| mysql2 (0.3.11) | |
| $ ruby -r mysql2 -e 0 | |
| $ | |
| $ rvm ruby-head-n39842 | |
| $ gem list mysql2 | |
| *** LOCAL GEMS *** | |
| mysql2 (0.3.11) |
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
| Go to http://connect.apple.com | |
| Download and install the latest (January 2013) Command Line Tools for Xcode | |
| for your operating system (OS X Lion or OS X Mountain Lion). | |
| \curl -L https://get.rvm.io | bash | |
| check for, and follow, any Upgrade Notes in the output from that command. | |
| rvm install 2.0.0 --autolibs=3 |
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
| Index: submit-account-request.rb | |
| =================================================================== | |
| --- submit-account-request.rb (revision 800677) | |
| +++ submit-account-request.rb (working copy) | |
| @@ -81,6 +81,9 @@ | |
| # add the list of userids that are pending | |
| taken += File.read(REQUESTS).scan(/^(\w.*?);/).flatten | |
| +# add member ids that do not have ICLAs | |
| +taken += %w(andi andrei arved dgaudet pcs rasmus ssb zeev) |
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
| #!/usr/bin/ruby | |
| $SAFE = 1 | |
| print "Content-type: text/plain\r\n\r\n" | |
| Dir.chdir ENV['DOCUMENT_ROOT'] do | |
| print ENV['DOCUMENT_ROOT'] | |
| end |