(from a scratch install). Kinda, I imported my user home (~) from a Time Machine backup.
sudo mkdir /usr/local
sudo chown -R `whoami` /usr/local
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C /usr/local
| #!/bin/bash | |
| # run with: curl -s http://gist.github.com/265272.txt | bash | |
| set -e | |
| localdir=$HOME/.mongodb | |
| datadir=$localdir/data | |
| conf=$localdir/mongod.conf | |
| agentdir=$HOME/Library/LaunchAgents | |
| agent=$agentdir/org.mongodb.mongod.plist |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| task :copy_jquery_files do | |
| # Jasmine doesn't work with the asset pipeline; therefore we copy the jquery | |
| # files manually. | |
| spec = Gem::Specification.find_by_name("jquery-rails") | |
| jquery_dir = Pathname.new(Gem.dir) + | |
| "gems" + | |
| "#{spec.name}-#{spec.version}" + | |
| "vendor" + | |
| "assets" + | |
| "javascripts" |
| $ brew install bash-completion | |
| ==> Downloading http://bash-completion.alioth.debian.org/files/bash-completion-1.3.tar.bz2 | |
| ######################################################################## 100.0% | |
| ==> ./configure --prefix=/usr/local/Cellar/bash-completion/1.3 | |
| ==> make install | |
| ==> Caveats | |
| Add the following lines to your ~/.bash_profile file: | |
| if [ -f `brew --prefix`/etc/bash_completion ]; then | |
| . `brew --prefix`/etc/bash_completion | |
| fi |
Well, to get Bootstrap working, first install [Less Rails Bootstrap][lrb].
Then create a button with a [fancy icon][fi] like so:
<%= link_to raw('<i class="icon-trash icon-white"></i>'), card, confirm: 'Are you sure?', method: :delete, :class => 'btn btn-danger' %>Note that you have to link to raw to get it to not escape the HTML.
| Jbuilder.encode do |json| | |
| json.content format_content(@message.content) | |
| json.(@message, :created_at, :updated_at) | |
| json.author do |json| | |
| json.name @message.creator.name.familiar | |
| json.email_address @message.creator.email_address_with_name | |
| json.url url_for(@message.creator, format: :json) | |
| end |
This Gist shows how to set up a Rails project to practice BDD with CoffeeScript, Guard and Jasmine. You can see this setup in action on Vimeo
bundle installmate Guardfilebundle exec jasmine initmate spec/support/yasmine.ymbundle exec guard| # Requires nokogiri and jsonpath | |
| # Only works with rack test | |
| World(Rack::Test::Methods) | |
| # Feel free to customize this for whatever API auth scheme you use | |
| Given /^I am a valid API user$/ do | |
| user = Factory(:user) | |
| authorize(user.email, user.password) | |
| end |