depwhack 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.textile +13 -0
  2. data/bin/depwhack +32 -0
  3. metadata +56 -0
@@ -0,0 +1,13 @@
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
+ <code>depwhack server</code>
10
+
11
+ h3. Installation
12
+
13
+ <code>gem install alexyoung-depwhack</code>
@@ -0,0 +1,32 @@
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
+ gem_list_code =<<RUBY
17
+ at_exit do
18
+ p Gem.loaded_specs.collect { |g| [g.first, g[1].version.to_s] }
19
+ end
20
+ RUBY
21
+
22
+ gems = eval `#{remote_command} "#{gem_list_code}"`
23
+
24
+ gems.each do |name, version|
25
+ output = %x{#{ssh_bin} #{server} '#{gem_bin} search #{name}'}
26
+
27
+ if !output.match(name)
28
+ puts "[#{red 'MISSING'}] #{name} gem not installed"
29
+ elsif !output.match(version)
30
+ puts "[#{green ' CHECK '}] #{name} (#{version}) not found on server, but found: #{output.strip}"
31
+ end
32
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: depwhack
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Alex R. Young
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-09-16 00:00:00 +01:00
13
+ default_executable: bin/depwhack
14
+ dependencies: []
15
+
16
+ description: depwhack is a tool for comparing local and remote gem dependencies for a Rails project.
17
+ email: alex@alexyoung.org
18
+ executables:
19
+ - depwhack
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - README.textile
26
+ - bin/depwhack
27
+ has_rdoc: false
28
+ homepage: http://github.com/alexyoung/depwhack
29
+ licenses: []
30
+
31
+ post_install_message:
32
+ rdoc_options: []
33
+
34
+ require_paths:
35
+ - lib
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: "0"
41
+ version:
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "0"
47
+ version:
48
+ requirements: []
49
+
50
+ rubyforge_project:
51
+ rubygems_version: 1.3.4
52
+ signing_key:
53
+ specification_version: 3
54
+ summary: depwhack is a tool for comparing local and remote Rails project dependencies.
55
+ test_files: []
56
+