Skip to content
Snippets Groups Projects
Commit abbb81a8 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Code Climate

parent 4e4780db
No related branches found
No related tags found
No related merge requests found
......@@ -29,8 +29,17 @@ class Git::Analyzer
path.nil?
end
def commit_message
git_file.about.nil? ? "[#{ git_file.class.name }] #{ action } Git file"
: "[#{ git_file.about.class.name }] #{ action } #{ git_file.about }"
end
protected
def action
should_destroy? ? "Destroy" : "Save"
end
def path
git_file.path
end
......
......@@ -12,10 +12,9 @@ class Git::Repository
def add_git_file(git_file)
puts "Adding #{git_file.path}"
if git_files.empty?
# The first file gives the commit name
analyzer.git_file = git_file
action = analyzer.should_destroy? ? "Destroy" : "Save"
@commit_message = git_file.about.nil? ? "[#{ git_file.class.name }] #{ action } Git file"
: "[#{ git_file.about.class.name }] #{ action } #{ git_file.about }"
@commit_message = analyzer.commit_message
end
git_files << git_file
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment