This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %w{readline rubygems bond}.each {|e| require e } | |
| Bond.start | |
| history_file = File.join(ENV["HOME"], '.mini_irb_history') | |
| IO.readlines(history_file).each {|e| Readline::HISTORY << e.chomp } if File.exists?(history_file) | |
| while (input = Readline.readline('>> ', true)) != 'exit' | |
| begin puts "=> #{eval(input).inspect}"; rescue Exception; puts "Error: #{$!}" end | |
| end | |
| File.open(history_file, 'w') {|f| f.write Readline::HISTORY.to_a.join("\n") } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CmdUtils.makeBookmarkletCommand({ | |
| name: 'github-user', | |
| icon: "http://github.com/favicon.ico", | |
| homepage: 'http://tagaholic.me/2009/04/06/github-bookmarklet-for-user-pages.html', | |
| license: 'MIT', | |
| author: {name: 'Gabriel', email: 'gabriel.horner@gmail.com'}, | |
| description: 'Enhances github user pages by providing repository sorting and inserting additional repository stats.', | |
| help: 'Use it on a github user page i.e. http://github.com/defunkt', | |
| url: 'javascript:(function(){$.getScript("http://tagaholic.me/javascripts/jquery.githubUserPage.js",function(){$.githubUserPage()})})();' | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'ostruct' | |
| class ConfigStruct < OpenStruct | |
| def self.block_to_hash(block=nil) | |
| config = self.new | |
| if block | |
| block.call(config) | |
| config.to_hash | |
| else | |
| {} |
NewerOlder