class RSGem::Tasks::EnsureAuthor
Constants
- OUTPUT
- TEMP_EMAIL
- TEMP_USERNAME
Public Instance Methods
perform()
click to toggle source
# File lib/rsgem/tasks/ensure_author.rb, line 13 def perform ensure_author end
Private Instance Methods
gemspec()
click to toggle source
# File lib/rsgem/tasks/ensure_author.rb, line 19 def gemspec @gemspec ||= File.read(context.gemspec_path) end
missing_git_user?()
click to toggle source
# File lib/rsgem/tasks/ensure_author.rb, line 38 def missing_git_user? `git config user.email`.strip.empty? || `git config user.name`.strip.empty? end
warning_message()
click to toggle source
# File lib/rsgem/tasks/ensure_author.rb, line 42 def warning_message return unless missing_git_user? "No git user set. Setting #{TEMP_EMAIL} and #{TEMP_USERNAME} in gemspec, "\ 'please change this before publishing your gem.' end
write_gemspec()
click to toggle source
# File lib/rsgem/tasks/ensure_author.rb, line 23 def write_gemspec File.write(context.gemspec_path, gemspec) end