I am trying to learn Ruby on Rails by playing around with stuff and I'm attempting to play around with Grit. However I am a bit confused coming from a PHP background where I get the repo stuff from. My code
class RepoController < ApplicationController
require "grit"
repo = Grit::Repo.new("blahblahblah")
def index()
puts YAML::dump(repo)
end
def show()
repo.commits('master', 10)
puts repo.inspect
end
end
I am trying to dump out information on the objects, but I cannot seem to access the repo variable. My IDE and Ruby keep saying undefined local variable or method repo' and I don't know why it cannot access the repo variable, it's declared at the top of the class?