-
-
Save crisptrutski/5194679 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/ruby | |
files = Dir["reports*"] | |
files.each do |f| | |
dir = File.join(`cat #{f}|grep DocumentRoot`.lines.first.split(/\s+/).last.split(/\//)[0..-2]) | |
rails_version = `cd #{dir}; rvm exec bundle list|grep ' rack'`.match(/\(([^)]+)\)/)[1] | |
deployed_version = `cd #{dir}; cat version` | |
deployed_branch = `cd #{dir}; cat config/environments/capistrano/#{f.to_s.gsub(/reports_/, '')}.rb|grep :branch` | |
puts "#{f}: #{rails_version}@#{deployed_version} - #{deployed_branch}" | |
end |
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
#!/usr/bin/ruby | |
files = Dir["reports*"] | |
files.each do |f| | |
dir = File.join(`cat #{f}|grep DocumentRoot`.lines.first.split(/\s+/).last.split(/\//)[0..-2]) | |
rails_gems = `cd #{dir}; rvm exec bundle list|grep ' rails'` | |
if rails_gems == "" | |
puts "#{f}: unknown (gem not found)" | |
next | |
else | |
rails_version = rails_gems.match(/\(([^)]+)\)/)[1] | |
puts "#{f}: #{rails_version}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment