lib/rubocop/git/commit.rb in rubocop-git2-0.1.4 vs lib/rubocop/git/commit.rb in rubocop-git2-0.1.5
- old
+ new
@@ -1,22 +1,18 @@
require 'shellwords'
-module RuboCop
- module Git
- # ref. https://github.com/thoughtbot/hound/blob/d2f3933/app/models/commit.rb
- class Commit
- def initialize(options)
- @options = options
- end
+class RuboCop::Git::Commit
+ # ref. https://github.com/thoughtbot/hound/blob/d2f3933/app/models/commit.rb
+ def initialize(options)
+ @options = options
+ end
- def file_content(filename)
- if @options.cached
- `git show :#{filename.shellescape}`
- elsif @options.commit_last
- `git show #{@options.commit_last.shellescape}:#{filename.shellescape}`
- else
- File.read(filename)
- end
- end
+ def file_content(filename)
+ if @options.cached
+ `git show :#{filename.shellescape}`
+ elsif @options.commit_last
+ `git show #{@options.commit_last.shellescape}:#{filename.shellescape}`
+ else
+ File.read(filename)
end
end
end