Class: Codeguard::Diff
- Inherits:
-
Object
- Object
- Codeguard::Diff
- Extended by:
- Forwardable
- Defined in:
- lib/codeguard/diff.rb
Instance Attribute Summary collapse
-
#lint ⇒ Object
Returns the value of attribute lint.
-
#message ⇒ Object
Returns the value of attribute message.
-
#raw_diff ⇒ Object
Returns the value of attribute raw_diff.
Class Method Summary collapse
Instance Method Summary collapse
- #diff ⇒ Object
-
#initialize(lint) ⇒ Diff
constructor
A new instance of Diff.
- #perform ⇒ Object
Constructor Details
#initialize(lint) ⇒ Diff
Returns a new instance of Diff.
11 12 13 |
# File 'lib/codeguard/diff.rb', line 11 def initialize(lint) @lint = lint end |
Instance Attribute Details
#lint ⇒ Object
Returns the value of attribute lint.
5 6 7 |
# File 'lib/codeguard/diff.rb', line 5 def lint @lint end |
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/codeguard/diff.rb', line 5 def @message end |
#raw_diff ⇒ Object
Returns the value of attribute raw_diff.
5 6 7 |
# File 'lib/codeguard/diff.rb', line 5 def raw_diff @raw_diff end |
Class Method Details
.perform(lint) ⇒ Object
7 8 9 |
# File 'lib/codeguard/diff.rb', line 7 def self.perform(lint) new(lint).tap(&:perform) end |
Instance Method Details
#diff ⇒ Object
21 22 23 |
# File 'lib/codeguard/diff.rb', line 21 def diff raw_diff.to_s(:color) unless diff_empty? end |
#perform ⇒ Object
15 16 17 18 19 |
# File 'lib/codeguard/diff.rb', line 15 def perform self.raw_diff = Diffy::Diff.new(config_gem_path.to_s, config_project_path.to_s, source: 'files') end |