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
~/Projects/firstapp$ heroku logs | |
2017-05-10T10:36:49.910770+00:00 app[web.1]: from /app/config.ru:3:in `block in <main>' | |
2017-05-10T10:36:49.910773+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval' | |
2017-05-10T10:36:49.910774+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize' | |
2017-05-10T10:36:49.910774+00:00 app[web.1]: from /app/config.ru:in `new' | |
2017-05-10T10:36:49.910775+00:00 app[web.1]: from /app/config.ru:in `<main>' | |
2017-05-10T10:36:49.910775+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval' | |
2017-05-10T10:36:49.910776+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string' | |
2017-05-10T10:36:49.910777+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file' | |
2017-05-10T10:36:49.910777+00:00 app[web.1]: from /app/vendor/bund |
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
require 'rails_helper' | |
describe UsersController, :type => :controller do | |
before do | |
@user = User.create!(email: 'test1@gmail.com', password: 'test1122') | |
@user2 = User.create!(email: 'test2@gmail.com', password: 'test1122') | |
end | |
describe 'GET #show' do | |
context 'User is logged in' do |
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
require 'rails_helper' | |
describe UsersController, :type => :controller do | |
before do | |
@user = User.create!(email: 'test1@gmail.com', password: 'test1122') | |
@user2 = User.create!(email: 'test2@gmail.com', password: 'test1122') | |
end | |
describe 'GET #show' do | |
context 'User is logged in' do |
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
require 'rails_helper' | |
describe UsersController, :type => :controller do | |
before do | |
@user = User.create!(email: 'test1@gmail.com', password: 'test1122') | |
@user2 = User.create!(email: 'test2@gmail.com', password: 'test1122') | |
sign_in @user | |
end | |
describe 'GET #show' do |
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
require 'rails_helper' | |
describe UsersController, :type => :controller do | |
let(:user) User.create!(email: "testRSPEC@gmail.com", password: "test11") } | |
describe "GET#show" do | |
context "User is logged in" do | |
before do | |
sign_in user |
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
def game | |
choices = ["Rock", "Paper", "Scissors"] | |
puts "Please choose a number:" | |
puts "1. #{choices[0]}" | |
puts "2. #{choices[1]}" | |
puts "3. #{choices[2]}" | |
puts "4. Quit" | |
player = 0 | |
input = 0 | |
found = false |
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 Pet | |
attr_reader :color, :breed | |
attr_accessor :name | |
def initialize(color, breed) | |
@color = color | |
@breed = breed | |
@hungry = true | |
end | |
def feed(food) |
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 Cat | |
attr_reader :color, :breed | |
attr_accessor :name | |
def initialize(color, breed) | |
@color = color | |
@breed = breed | |
@hungry = true | |
end | |
def feed(food) |
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
def fav_foods | |
food_array = [] | |
3.times do | |
puts "Name a favorite food." | |
food_array << gets.chomp | |
end | |
p food_array | |
puts "Your favorite foods are #{food_array.join(", ")}." | |
food_array.each do |food| | |
puts "I like #{food} too!" |
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
if true | |
puts "this is true" | |
else | |
puts "this is false" | |
end |
NewerOlder