Created
July 2, 2012 13:28
-
-
Save kbarber/3033250 to your computer and use it in GitHub Desktop.
Reverse engineer modules
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/env ruby | |
| require 'rubygems' | |
| require 'json' | |
| require 'pathname' | |
| current_dir = Pathname.new(Dir.pwd) | |
| current_dir.children.each do |child| | |
| md = child + 'metadata.json' | |
| md_version = JSON.parse(md.read)['version'] if md.exist? | |
| git_version = nil | |
| Dir.chdir(child) do | |
| git_version = `git describe --tags 2>/dev/null`.chomp | |
| end | |
| puts <<-EOS | |
| Directory: #{child} | |
| Metadata Version: #{md_version} | |
| Git Version: #{git_version} | |
| EOS | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment