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
def nav_link(name, path, options={}) | |
options[:class] = append_class(options[:class], "#{"active" if active_path?(path)}") | |
options[:role] ||= "menuitem" | |
link_to name, path, options | |
end | |
def active_path?(path) | |
request.path == path | |
end |
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
ab -k -c 10 -n 100 http://localhost:1337/ | |
This is ApacheBench, Version 2.3 <$Revision: 1604373 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking localhost (be patient).....done | |
Server Software: | |
Server Hostname: localhost |
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
//MAKE SURE YOU RENAME THE FILE TO application.css.scss (adding .scss) | |
/* | |
* This is a manifest file that'll be compiled into application.css, which will include all the files | |
* listed below. | |
* | |
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, | |
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. | |
* | |
* You're free to add application-wide styles to this file and they'll appear at the bottom of the |
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
u = User.find(4) | |
=> #<User id: 4, .... > | |
u.save! | |
ActiveRecord::RecordInvalid: Validation failed: Path has already been taken | |
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/protected_attributes-1.0.5/lib/active_record/mass_assignment_security/associations.rb:109:in `create_record' | |
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/protected_attributes-1.0.5/lib/active_record/mass_assignment_security/associations.rb:94:in `create!' | |
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activerecord-4.0.3/lib/active_record/associations/builder/singular_association.rb:27:in `create_namespace!' | |
from /home/git/gitlab/app/observers/user_observer.rb:14:in `after_save' | |
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rails-observers-0.1.2/lib/rails/observers/active_model/observing.rb:352:in `update' |
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
before(:all) do | |
module CanCan; end | |
end | |
# ... test as if CanCan exists | |
after(:all) do | |
Object.send(:remove_const, :CanCan) | |
end |
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
#Only include this during your tests, no need in Development or production. | |
class Hash | |
def stringify | |
inject({}){|memo,(k,v)| memo[k.to_s] = v.to_s; memo} | |
end | |
end |
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
Bundle install/update: | |
Bundler could not find compatible versions for gem "mongoid": | |
In Gemfile: | |
carrierwave-mongoid (~> 0.6.2) ruby depends on | |
mongoid (~> 3.0.1) ruby | |
mongoid (4.0.0) | |
https://rubygems.org/gems/carrierwave-mongoid says: |
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
upstream proxy_parador.com_staging { | |
server 10.144.144.144; | |
} | |
server { | |
listen 80; | |
server_name parador.paradorstaging.com; | |
access_log /var/log/nginx/log/parador.com_staging.access.log; | |
error_log /var/log/nginx/log/parador.com_staging.error.log; |
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
ArgumentError (invalid byte sequence in US-ASCII): | |
vendor/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/core_ext/object/blank.rb:105:in `=~' | |
vendor/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/core_ext/object/blank.rb:105:in `!~' | |
vendor/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/core_ext/object/blank.rb:105:in `blank?' | |
vendor/ruby/1.9.1/gems/mail-2.4.4/lib/mail/body.rb:36:in `initialize' | |
vendor/ruby/1.9.1/gems/mail-2.4.4/lib/mail/message.rb:1909:in `new' | |
vendor/ruby/1.9.1/gems/mail-2.4.4/lib/mail/message.rb:1909:in `process_body_raw' | |
vendor/ruby/1.9.1/gems/mail-2.4.4/lib/mail/message.rb:1155:in `body' | |
vendor/ruby/1.9.1/gems/mail-2.4.4/lib/mail/message.rb:1514:in `parts' |
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
{21:20}[1.9.3-p194]~/code/rails_apps/mongify:master ✓ ➭ cucumber features | |
Feature: Mongify can be controlled using command-line options | |
In order to change Mongify's default behaviour | |
As a user | |
I want to supply options on the command line | |
Scenario: returns non-zero status on bad options # features/options.feature:6 | |
When I run mongify --no-such-option # features/step_definitions/mongify_steps.rb:1 | |
Then the exit status indicates an error # features/step_definitions/mongify_steps.rb:26 | |
And it reports the error "Error: invalid option: --no-such-option" # features/step_definitions/mongify_steps.rb:30 |