Permalink
Browse files

Fix irb includes

  • Loading branch information...
1 parent fb27fa4 commit 6095a5745dc8a702a0942027ffd2813ee3ea3d95 Joshua Clayton committed Jul 4, 2009
Showing with 11 additions and 9 deletions.
  1. +3 −3 irbrc
  2. +1 −1 irbrc.d/completion.rb
  3. +1 −1 irbrc.d/core_extensions.rb
  4. +3 −3 irbrc.d/history.rb
  5. +3 −1 irbrc.d/snip.rb
View
6 irbrc
@@ -1,11 +1,11 @@
-require 'rubygems'
+require "rubygems"
def require_rb_files_from(dir)
- Dir.glob(File.join(dir, '*.rb')) do |file|
+ Dir.glob(File.join(dir, "*.rb")) do |file|
require file
end
end
-require_rb_files_from(File.join(ENV['HOME'], '.irb_scripts.d'))
+require_rb_files_from(File.join(ENV["HOME"], ".irbrc.d"))
IRB.conf[:PROMPT_MODE] = :SIMPLE
View
@@ -1 +1 @@
-require 'irb/completion'
+require "irb/completion"
@@ -12,6 +12,6 @@ def self.file_to_string(path)
def self.string_to_file(string, path)
directory = File.dirname(path)
FileUtils.mkdir_p directory unless File.directory?(directory)
- File.open(path, 'w') { |f| f << string }
+ File.open(path, "w") { |file| file << string }
end
end
View
@@ -2,7 +2,7 @@
module Readline
module History
- LOG = "#{ENV['HOME']}/.irb-save-history"
+ LOG = "#{ENV["HOME"]}/.irb-save-history"
def self.write_log(line)
File.open(LOG, 'ab') {|f| f << "#{line}\n"} unless line == "exit"
end
@@ -19,6 +19,6 @@ def readline(*args)
end
end
-require 'irb/ext/save-history'
+require "irb/ext/save-history"
IRB.conf[:SAVE_HISTORY] = 100
-IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
+IRB.conf[:HISTORY_FILE] = "#{ENV["HOME"]}/.irb-save-history"
View
@@ -9,7 +9,9 @@ def self.create(name, &blk)
end
def self.[](name)
- raise SnippetNotFoundError, "the snippet '#{name.to_s}' was not found" unless @@snips.has_key?(name.to_s)
+ unless @@snips.has_key?(name.to_s)
+ raise SnippetNotFoundError, "the snippet '#{name.to_s}' was not found"
+ end
@@snips[name.to_s].call
end

0 comments on commit 6095a57

Please sign in to comment.