Skip to content

Commit

Permalink
Introduce rainbow for colorizing text on ANSI terminals
Browse files Browse the repository at this point in the history
  • Loading branch information
emsk committed Jun 16, 2016
1 parent 85f11e9 commit 25e971d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/romajic.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
require 'rainbow'
require 'romajic/version'
require 'romajic/cli'
4 changes: 2 additions & 2 deletions lib/romajic/initializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ class Initializer
# Copy a configuration file from template to working directory
def self.copy_template
to = File.expand_path(TEMPLATE_CONFIG_FILE)
return puts "exist #{to}" if FileTest.exist?(to)
return puts Rainbow("exist #{to}").yellow if FileTest.exist?(to)

from = File.expand_path("../initializer/#{TEMPLATE_CONFIG_FILE}", __FILE__)
FileUtils.copy(from, to)
puts "create #{to}"
puts Rainbow("create #{to}").green
end
end
end
1 change: 1 addition & 0 deletions romajic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'coderay', '~> 1.1'
spec.add_runtime_dependency 'levenshtein', '~> 0.2'
spec.add_runtime_dependency 'romajify', '~> 0.1'
spec.add_runtime_dependency 'rainbow', '~> 2.1'
spec.add_development_dependency 'bundler', '~> 1.11'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.4'
Expand Down
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'simplecov'
require 'coveralls'
require 'rainbow'

SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
Expand All @@ -10,5 +11,7 @@
add_filter '/spec/'
end

Rainbow.enabled = false

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'romajic'

0 comments on commit 25e971d

Please sign in to comment.