├── .gitignore ├── README.textile ├── depwhack.gemspec └── bin └── depwhack /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | -------------------------------------------------------------------------------- /README.textile: -------------------------------------------------------------------------------- 1 | This script compares dependencies between local and remote environments based on the gems a Rails project uses. 2 | 3 | !http://dl.getdropbox.com/u/221414/github/depwhack.png! 4 | 5 | h3. Usage 6 | 7 | Change directory to your Rails project and run: 8 | 9 | depwhack server 10 | 11 | This works best with ssh keys set up, else it'll prompt you a lot. 12 | 13 | h3. Installation 14 | 15 | This gem is hosted on "gemcutter":http://gemcutter.org 16 | 17 | gem install depwhack 18 | -------------------------------------------------------------------------------- /depwhack.gemspec: -------------------------------------------------------------------------------- 1 | Gem::Specification.new do |s| 2 | s.name = %q{depwhack} 3 | s.version = '0.0.5' 4 | 5 | s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version= 6 | s.authors = ['Alex R. Young'] 7 | s.date = %q{2009-09-16} 8 | s.description = %q{depwhack is a tool for comparing local and remote gem dependencies for a Rails project.} 9 | s.email = %q{alex@alexyoung.org} 10 | s.files = %w{README.textile bin/depwhack} 11 | s.has_rdoc = false 12 | s.bindir = 'bin' 13 | s.executables = ['depwhack'] 14 | s.default_executable = 'depwhack' 15 | s.homepage = %q{http://github.com/alexyoung/depwhack} 16 | s.summary = %q{depwhack is a tool for comparing local and remote Rails project dependencies.} 17 | end 18 | -------------------------------------------------------------------------------- /bin/depwhack: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | server = ARGV[0] 4 | 5 | remote_command = 'script/runner' 6 | ssh_bin = 'ssh' 7 | gem_bin = 'gem' 8 | 9 | def colorize(text, color_code) 10 | "#{color_code}#{text}#{27.chr}[0m" 11 | end 12 | 13 | def red(text); colorize(text, "#{27.chr}[31m"); end 14 | def green(text); colorize(text, "#{27.chr}[32m"); end 15 | 16 | begin 17 | gems = eval `#{remote_command} "#{gem_list_code}"` 18 | rescue 19 | puts "Change directory to a Rails project and specify a server:" 20 | puts 21 | puts "For example:" 22 | puts "\tcd ~/Documents/Code/rails_project" 23 | puts "\tdepwhack myserver" 24 | exit 1 25 | end 26 | 27 | gem_list_code =<