-[ ] one
-[ ] two
-[ ] three
-[ ] one
-[ ] two
-[ ] three
| def empty?(s) | |
| return s.size == 0 | |
| end | |
| class B | |
| def ==(s) | |
| "not boolean" | |
| end | |
| end |
| Rails.application.config.database_configuration | |
| Rails.application.load_generators | |
| Rails.application.load_seed | |
| Rails.application.paths['db/migrate'].to_a | |
| Rails.application.railties.all | |
| Rails::Engine.find(ENGINE_PATH) | |
| Rails.env | |
| Rails.env.development? | |
| Rails::Generators::SessionMigrationGenerator.start [ ENV['MIGRATION'] || 'add_sessions_table' ] | |
| Rails.root |
| source :gemcutter | |
| source 'http://gems.github.com' | |
| gem 'rails', '3.2.7' | |
| gem 'rake', '0.9.2.2' | |
| gem 'foreman' | |
| gem 'sidekiq', '= 2.4.0' | |
| gem 'sinatra', require: false | |
| # Database and data related [Putting pg to the end because of a weird bug with Lion, pg and openssl] |
| # spec/support/carrierwave.rb | |
| class TestStorage < CarrierWave::Storage::File | |
| def store!(file) | |
| end | |
| def retrieve!(identifier) | |
| identifier | |
| end | |
| end |
| # encoding: utf-8 | |
| def gas(name = "", acct = "") | |
| url = "http://sevgaz.com.ua/index.php?option=com_content&view=article&id=52" | |
| data = `curl -F "afam=#{name}" -F "peracc=#{acct}" "#{url}" 2>/dev/null` | |
| data.scan(%r{Адрес.*?<tr><td>(.*?)</td>\s*<td>\s*<strong>(.*?)</strong>}).flatten | |
| end | |
| def water(name = "", acct = "") |
| class FirstController < ApplicationController | |
| def edit | |
| prepare_model_for_form | |
| end | |
| def update | |
| current_user.attributes = params[:user] | |
| current_user.validates_email! | |
| if current_user.save |
| describe SomeController do | |
| context "if user is not logged in" do | |
| specify "GET 'show' should redirect to login page" do | |
| get :show | |
| response.should redirect_to login_path | |
| end | |
| specify "PUT 'update' should redirect to login page" do | |
| put :update | |
| response.should redirect_to login_path |