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' | |
| begin | |
| require 'cucumber' | |
| require 'cucumber/rake/task' | |
| Cucumber::Rake::Task.new(:features) do |t| | |
| t.cucumber_opts = "--format pretty" | |
| end | |
| task :features => 'db:test:prepare' | |
| rescue LoadError |
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
| $ git clone github:lenary/guides.git | |
| Cloning into guides... | |
| remote: Counting objects: 255, done. | |
| remote: Compressing objects: 100% (216/216), done. | |
| remote: Total 255 (delta 111), reused 163 (delta 35) | |
| Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done. | |
| Resolving deltas: 100% (111/111), done. | |
| $ cd guides | |
| $ git remote -v |
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
| #!/bin/sh | |
| export RUBY_HEAP_MIN_SLOTS=500000 | |
| export RUBY_HEAP_SLOTS_INCREMENT=250000 | |
| export RUBY_GC_MALLOC_LIMIT=50000000 | |
| export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 | |
| /opt/ruby-enterprise/bin/rake "$@" |
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
| paths = Rails.application.railties.engines.map {|e| e.root } | |
| paths.push Rails.root | |
| # Load every stylesheet in application.css | |
| sass "public/stylesheets/application.css" do | |
| # First load the basics/*.scss and then the rules | |
| ["basics/", ""].each do |prefix| | |
| paths.reverse.each do |path| |
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
| # using rvm with ruby-1.8.7-p249 | |
| # latest version 2.7.7 2010-06-17 | |
| brew install libxml2 | |
| # installing libxslt from source code | |
| wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz | |
| tar xvfz libxslt-1.1.26.tar.gz | |
| cd libxslt-1.1.26 | |
| ./configure --prefix=/usr/local/Cellar/libxslt/1.1.26 --with-libxml-prefix=/usr/local/Cellar/libxml2/2.7.7 |
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
| Capistrano::Configuration.instance(:must_exist).load do | |
| namespace :git do | |
| task :warn_unpushed_changes do | |
| master_rev = `git rev-parse master`.strip | |
| origin_master_rev = `git rev-parse origin/master`.strip | |
| if master_rev != origin_master_rev | |
| puts "*" * 80 | |
| answer = Capistrano::CLI.ui.ask(" You have local commits that have yet to be pushed to origin. Continue? (y/N)") | |
| exit(1) unless answer.downcase == 'y' |
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
| # This Rails template will generate a Rails 3 (MASTER) application, with MongoDB as ORM and Devise for authentication. | |
| # You will require ruby 1.9.2-HEAD to run generated app. | |
| file 'Gemfile', <<-GEMS | |
| source 'http://gemcutter.org' | |
| gem "rails", :git => "git://github.com/rails/rails.git" | |
| gem "mongoid", "2.0.0.beta4" | |
| gem "bson_ext", "0.20.1" | |
| gem "inherited_resources" | |
| gem "devise", :git => "git://github.com/plataformatec/devise.git" |
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
| map = [ | |
| "âãäåāăąÁÂÃÄÅĀĂĄèééêëēĕėęěĒĔĖĘĚìíîïìĩīĭÌÍÎÏÌĨĪĬóôõöōŏőÒÓÔÕÖŌŎŐùúûüũūŭůÙÚÛÜŨŪŬŮñÑçÇüÜ".mb_chars, | |
| "aaaaaaaaaaaaaaaeeeeeeeeeeeeeeeiiiiiiiiiiiiiiiiooooooooooooooouuuuuuuuuuuuuuuunnccuu" | |
| ] | |
| # ActiveSupport::Multibyte::Chars#tr broken? | |
| word = "anything" | |
| adapted_word = "%#{word.mb_chars.split(//).map {|e| (p = map[0].index(e)) ? map[1][p,1] : e.to_s }.join.downcase}%" | |
| Post.where("lower(translate(title, '#{map[0]}', '#{map[1]}')) like #{Post.connection.quote word}") |
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
| ## | |
| # CarrierWave Amazon S3 File Reprocessor Rake Task | |
| # | |
| # Written (specifically) for: | |
| # - CarrierWave | |
| # - Ruby on Rails 3 | |
| # - Amazon S3 | |
| # | |
| # Works with: | |
| # - Any server of which you have write-permissions in the Rails.root/tmp directory |
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 'action_controller/test_process' | |
| # Paperclip attachments in factories, made easy based on technicalpickles | |
| Factory.class_eval do | |
| def attach(name, path, content_type = nil) | |
| if content_type | |
| add_attribute name, ActionController::TestUploadedFile.new("#{RAILS_ROOT}/#{path}", content_type) | |
| else | |
| add_attribute name, ActionController::TestUploadedFile.new("#{RAILS_ROOT}/#{path}") | |
| end |