lib/git_presenter/slide.rb in git_presenter-0.2.2 vs lib/git_presenter/slide.rb in git_presenter-0.3.0

- old
+ new

@@ -1,31 +1,29 @@ -module GitPresenter - class Slide - attr_reader :commit, :message, :run +class GitPresenter::Slide + attr_reader :commit, :message, :run - def initialize(slide) - @commit = slide["commit"] - @message = slide["message"] - @run = slide["run"] - end + def initialize(slide) + @commit = slide["commit"] + @message = slide["message"] + @run = slide["run"] + end - def execute - output = "" - output << checkout unless @commit.nil? - output << `#{run}` unless @run.nil? - output - end + def execute + output = "" + output << checkout unless @commit.nil? + output << `#{run}` unless @run.nil? + output + end - def to_s - return "#{@commit[0..9]}, #{@message}" unless @commit.nil? - "run: #{@run}" - end + def to_s + return "#{@commit[0..9]}, #{@message}" unless @commit.nil? + "run: #{@run}" + end - private + private - def checkout - `git checkout -q . ` - `git checkout -q #{@commit}` - @message + "\n" - end + def checkout + `git checkout -q . ` + `git checkout -q #{@commit}` + @message + "\n" end end