Skip to content

Commit

Permalink
Cleanup comments and messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonforums committed Jul 30, 2010
1 parent fcaed1e commit 7ee9d2e
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions resources/devkit/dk.rb
Expand Up @@ -93,18 +93,25 @@ def self.installed_rubies
private_class_method :installed_rubies

def self.init
# get all known installed Ruby bindirs and write
# them to 'config.yml', overwriting existing file
# get all known installed Ruby root dirs and write the root dirs
# to 'config.yml', overwriting any existing config file.
ir = installed_rubies

File.open(CONFIG_FILE, 'w') do |f|
f.write <<-EOT
# This configuration file is meant to contain the absolute path locations
# of all installed Rubies that should be enhanced to work with the DevKit.
# It is generated by the 'init' step and may be modified before running the
# 'install' step. For example, to include any installed Rubies that were
# not automagically discovered, simply add a line with the absolute path
# location to the desired Ruby's root directory.
# The config file is generated by the 'init' step and may be modified
# before running the 'install' step. To include any installed Rubies that
# were not automagically discovered, simply add a line below the triple
# hyphens with the absolute path to the desired Ruby root directory.
#
# Example:
#
# ---
# - C:/ruby19trunk
# - C:/ruby192dev
#
EOT
f.write(ir.to_yaml)
end
Expand All @@ -118,7 +125,7 @@ def self.review
Based upon the results contained in your '#{CONFIG_FILE}' config
file resulting from running 'ruby dk.rb init' and any of your
customizations, DevKit functionality will be injected into the
following Rubies when you run 'ruby dk.rb install'
following Rubies when you run 'ruby dk.rb install'.
EOT
puts YAML.load(f.read)
Expand Down Expand Up @@ -148,7 +155,7 @@ def self.install
target = File.join(path, 'bin', "#{command}.bat")

if File.exist?(target)
puts "Renaming #{command}.bat to #{command}.bat.orig..."
puts "Renaming #{command}.bat to #{command}.bat.orig"
File.rename(target, "#{target}.orig")
end

Expand All @@ -157,7 +164,7 @@ def self.install
end
end
else
# either or both site_ruby or core_ruby contains RubyGems; favor
# either (or both) site_ruby or core_ruby contains RubyGems; favor
# injecting RubyGems override into site_ruby over core_ruby
target_ruby = site_ruby.empty? ? core_ruby : site_ruby

Expand All @@ -170,13 +177,13 @@ def self.install
if File.exist?(target)
content = File.read(target)
unless content.include?('DevKit')
puts '[INFO] Updating existing RubyGems override...'
puts '[INFO] Updating existing RubyGems override.'
File.open(target, 'a') { |f| f.write(gem_override) }
else
puts "[INFO] RubyGems override already in place for #{path}, skipping."
end
else
puts "[INFO] Installing #{target}..."
puts "[INFO] Installing #{target}"
File.open(target, 'w') { |f| f.write(gem_override) }
end
end
Expand Down

0 comments on commit 7ee9d2e

Please sign in to comment.