lib/core/text.rb in radon-0.1.4 vs lib/core/text.rb in radon-0.1.5

- old
+ new

@@ -3,14 +3,15 @@ def vprint(*args) puts args if $verbose && !$quiet end def error(*args) - puts Paint["ERROR", '#e74c3c'] + " - #{args}" + puts Paint["ERROR", '#e74c3c'] + " - #{args.join(' ')}" end def report_error_to_github(trace) + commit_string = File.directory?(File.join(PROJECT_ROOT, '.git')) ? "Commit `#{File.read(File.join(PROJECT_ROOT, '.git', 'refs', 'heads', 'master')).strip}`" : nil puts %Q{ :::::::::::::::::: COPY BELOW :::::::::::::::::: ### Ruby version `#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}` @@ -29,10 +30,12 @@ ### Backtrace ``` #{trace} ``` + + #{commit_string} :::::::::::::::::: COPY ABOVE :::::::::::::::::: #{Paint["Whoops! Looks like you've found a bug in radon. Please copy the text above and open a new issue at ", '#e74c3c'] + Paint['https://github.com/cbrnrd/radon/issues', :bold, :bright]} } end @@ -70,10 +73,10 @@ name = name.gsub(/-[a-z]/) {|s| s.upcase } name.delete!('-') return name.slice(0,1).capitalize + name.slice(1..-1) end -# Replaces `find` with `repl` in every file and directory +# Replaces 'find' with 'repl' in every file and directory def find_and_replace_all(target_dir, find, repl) files = Dir[File.join(target_dir,'**','*')] files.each do |file_name| next if File.directory?(file_name) begin \ No newline at end of file