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
guard 'annotate', notify: false do | |
watch( 'db/schema.rb' ) | |
end | |
guard 'cucumber', cli: '--format progress --no-profile', all_on_start: false do | |
watch(%r{features/.+\.feature}) | |
watch(%r{features/step_definitions/(.+)_steps\.rb}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] } | |
end | |
guard 'minitest', drb: false do |
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
# Dependencies: pdftotext (included in xpdf) | |
# OSX: brew install xpdf | |
# Ubuntu/Debian: apt-get install xpdf | |
Then /^I should have get a pdf with the business name$/ do | |
page.response_headers['Content-Type'].should include 'application/pdf' | |
pdf_to_text.should include @current_business.name | |
end | |
def pdf_to_text |
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
require "xpath" # XPath is a separate gem now | |
module Cucumber | |
module Rails | |
module CapybaraSelectDatesAndTimes | |
def select_date(field, options = {}) | |
date = Date.parse(options[:with]) | |
find(:xpath, %Q{//select[contains(@id, "#{field}_1i")]}).find(:xpath, ::XPath::HTML.option(date.year.to_s)).select_option | |
find(:xpath, %Q{//select[contains(@id, "#{field}_2i")]}).find(:xpath, %Q{option[@value='#{date.month.to_s}']}).select_option | |
find(:xpath, %Q{//select[contains(@id, "#{field}_3i")]}).find(:xpath, ::XPath::HTML.option(date.day.to_s)).select_option |
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
Oriols-Mac-Pro:spinach(851m|master!?) $ RBXOPT=-X19 irb | |
~> Console extensions: wirble hirb ap rails2 rails3 pm interactive_editor blueprints | |
rbx-head :001 > def foo | |
rbx-head :002?> 3 | |
rbx-head :003?> end | |
=> #<Rubinius::CompiledMethod foo file=(irb)> | |
rbx-head :004 > m = method(:foo) | |
=> #<Method: Object#foo (defined in Object from "def foo")> | |
rbx-head :005 > p = proc { 3 } | |
=> #<Proc:0x3184@(irb):5> |
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
Rubinius Crash Report #rbxcrashreport | |
Error: signal SIGSEGV | |
[[Backtrace]] | |
0 rbx 0x00000001000225b1 _ZN8rubiniusL12segv_handlerEi + 241 | |
1 libSystem.B.dylib 0x00007fff8666067a _sigtramp + 26 | |
2 ??? 0x0000000102ecf080 0x0 + 4344049792 | |
3 rbx 0x00000001002136b6 _ZN8rubinius16GarbageCollector11scan_objectEPNS_6ObjectE + 182 | |
4 rbx 0x0000000100211d6b _ZN8rubinius7BakerGC14copy_unscannedEv + 283 |
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 ValidateSpanishVat | |
module ClassMethods | |
# Implements model level validator for Spanish's VAT number. | |
# Usage: | |
# | |
# Inside a model with a vat field, simply put | |
# | |
# validates_spanish_vat field_name | |
# | |
def validates_spanish_vat(*attr_names) |
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
Oriols-Mac-Pro:test_3_2_1 $ bundle exec rails console | |
Loading development environment (Rails 3.2.1) | |
~> Console extensions: wirble hirb ap rails2 rails3 pm interactive_editor blueprints | |
1.9.3-p0 :001 > Subject.first.student_ids | |
SCHEMA (0.3ms) SHOW client_min_messages | |
SCHEMA (0.1ms) SET client_min_messages TO 'panic' | |
SCHEMA (0.1ms) SET standard_conforming_strings = on | |
SCHEMA (0.0ms) SET client_min_messages TO 'notice' | |
SCHEMA (0.3ms) SET time zone 'UTC' | |
SCHEMA (0.1ms) SHOW TIME ZONE |
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
One of the possible consequences of the welfare state is the lack of culture of the effort. Everything is easy and free. | |
A clear example is the university (at least in Spain), it's very easy to get to college (both financially and academically), | |
but since it is almost free it is not given enough importance: it's OK if I spend the day lying on the grass or don't | |
go to class or I just left college because the cost is zero. | |
Details of abandonment: http://www.consumer.es/web/es/educacion/universidad/2010/03/21/191878.php (Spanish) | |
Just see the last few years in Spain, the real estate boom is the best example of the lack of the culture of effort. |
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
def do_it(ids) | |
contacts = contact_finder(ids) | |
contacts = contacts.my_nice_scope if should_apply_nice_scope? | |
contacts | |
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
# Read last HAL draft first: http://tools.ietf.org/html/draft-kelly-json-hal-03 | |
api = MyBlogAPI.new | |
# Entry point | |
api.links #=> {'self' => link_to_self, 'relation' => link1} | |
api.links.self.url #=> '/' | |
api.embedded #=> {} | |
# Links |