alexyoung-depwhack 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +13 -0
- data/bin/depwhack +32 -0
- metadata +55 -0
data/README.textile
ADDED
@@ -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>
|
data/bin/depwhack
ADDED
@@ -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,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: alexyoung-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 -07: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
|
+
post_install_message:
|
31
|
+
rdoc_options: []
|
32
|
+
|
33
|
+
require_paths:
|
34
|
+
- lib
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: "0"
|
40
|
+
version:
|
41
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: "0"
|
46
|
+
version:
|
47
|
+
requirements: []
|
48
|
+
|
49
|
+
rubyforge_project:
|
50
|
+
rubygems_version: 1.3.5
|
51
|
+
signing_key:
|
52
|
+
specification_version: 2
|
53
|
+
summary: depwhack is a tool for comparing local and remote Rails project dependencies.
|
54
|
+
test_files: []
|
55
|
+
|