Class: RuboCop::Git::Commit
- Inherits:
-
Object
- Object
- RuboCop::Git::Commit
- Defined in:
- lib/rubocop/git/commit.rb
Overview
Instance Method Summary collapse
- #file_content(filename) ⇒ Object
-
#initialize(options) ⇒ Commit
constructor
A new instance of Commit.
Constructor Details
#initialize(options) ⇒ Commit
Returns a new instance of Commit.
7 8 9 |
# File 'lib/rubocop/git/commit.rb', line 7 def initialize() @options = end |
Instance Method Details
#file_content(filename) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/rubocop/git/commit.rb', line 11 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 |