##Integration capybara with minitest
Requirements:
- ruby 1.9
- gem capybara
All you have to do is to require file test_helper.rb at the beginning of your test files.
| class Canine | |
| VERSION = '1.3' | |
| def initialize(&block) | |
| @commands = Hash.new | |
| @default = @latest = :commands | |
| @empty = nil | |
| @auto = { | |
| :commands => hash_command("commands","Show a list of commands",Proc.new { | |
| @commands.each { |cmd| c = cmd[1] | |
| name = c[:name].to_s |
| source :rubygems | |
| # Server requirements | |
| gem 'unicorn' | |
| # Project requirements | |
| gem 'rake' | |
| gem 'rack-flash' | |
| gem 'heroku' |
##Integration capybara with minitest
Requirements:
All you have to do is to require file test_helper.rb at the beginning of your test files.
| // to build: | |
| // lessc <filename> > site.css | |
| // lessc <filename> > site.min.css --compress | |
| // the swatch | |
| @color1: #55626b; | |
| @color2: #6c9380; | |
| @color3: #c1ca55; | |
| @color4: #f07d6b; | |
| @color5: #ad5472; |
| require 'rubygems' | |
| require 'sinatra' | |
| require 'omniauth/oauth' | |
| set :sessions, true | |
| set :layout, true | |
| use OmniAuth::Builder do | |
| provider :twitter, 'key', 'secret' | |
| end |
| require 'sinatra/base' | |
| require 'rack/flash' | |
| require 'warden' | |
| require 'slim' | |
| require 'sequel' | |
| require 'sqlite3' | |
| DB = Sequel.sqlite | |
| DB.create_table :users do | |
| primary_key :id |
| # Build an inverted index for a full-text search engine with Redis. | |
| # Copyright (C) 2009 Salvatore Sanfilippo. Under the BSD License. | |
| # USAGE: | |
| # | |
| # ruby invertedindex.rb add somedir/*.c | |
| # ruby invertedindex.rb add somedir/*.txt | |
| # ruby search your query string | |
| require 'rubygems' | |
| require 'redis' |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| module My | |
| module Helpers | |
| # Nanoc helper to display blog post summary and a link to the full post. | |
| # Used inside <% sorted_articles.each do |item| %>...<% end %> block etc. | |
| # | |
| # @example Put the following in your layout: | |
| # | |
| # <%= article_summary(item,'Read the full article>>') %> | |
| # | |
| # To customize the link text you can add 'read_more' attribute to your |
| /** | |
| * Force location of /tmp | |
| */ | |
| $AF_tmp = realpath($_SERVER['DOCUMENT_ROOT'].'/../tmp'); | |
| variable_set('file_temporary_path', $AF_tmp); | |
| return $AF_tmp; | |
| /* END */ |