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
# This implementation causes error: | |
# ArgumentError: wrong number of arguments (0 for 1..3) | |
# config.ru:10:in `instance_eval' | |
# config.ru:10:in `initialize' | |
# config.ru:26:in `new' | |
# config.ru:26:in `block in inner_app' | |
# /Users/ograbek/.rvm/gems/ruby-2.1.2@owning_rails/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval' | |
# /Users/ograbek/.rvm/gems/ruby-2.1.2@owning_rails/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize' | |
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 Heroku | |
module Rake | |
class Task | |
attr_accessor :name | |
def initialize(name) | |
@name = name | |
end | |
def self.[](name) | |
Heroku::Rake::Task.new(name) |
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
function deploy(env) { | |
var bucketSuffix = env === 'staging' ? '-staging' : ''; | |
var publisher = $.awspublish.create({ | |
key: 'xxxx', | |
secret: 'xxx', | |
bucket: 'picaly.co' + bucketSuffix, | |
region: 'eu-west-1' | |
}); | |
return gulp.src('./dist/**/*') |
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
#to use this module the class has to mixin it and define <=> method | |
class Bid | |
include Comparable | |
attr_accessor :estimate | |
def <=>(other_bid) | |
if self.estimate > other_bid.estimate | |
1 |
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
# to do it we have to define === method inside our class | |
class Ticket | |
attr_accessor :venue, :date, :price | |
def initialize(venue, date, price) | |
self.venue = venue | |
self.date = date | |
self.price = price |
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
# in application.rb | |
config.to_prepare do | |
Devise::Mailer.layout "email_template" # in views/layouts | |
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
# in spec_helper | |
RSpec.configure do |config| do | |
#other code | |
config.include FactoryGirl::Syntax::Methods | |
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
class FollowingRelationshipsController < ApplicationController | |
def create | |
current_user.follow user | |
redirect_to user | |
end | |
def destroy | |
current_user.unfollow user | |
redirect_to user |
OlderNewer