Skip to content

Instantly share code, notes, and snippets.

@smileart
Last active September 15, 2023 21:50
Show Gist options
  • Save smileart/9d1d17e9da8cba19f792304fd4b0e58d to your computer and use it in GitHub Desktop.
Save smileart/9d1d17e9da8cba19f792304fd4b0e58d to your computer and use it in GitHub Desktop.
gemspec cli tools
# deps and their versions in gemspec
cat name.gemspec | ack -o '(?<=dependency).*(?<=[<>=]\s)(?>\d+\.?\d+)' | tr -d "',><=~"
# deps and their version on RubyGems
cat british.gemspec | ack -o '(?<=dependency).*(?<=[<>=]\s)(?>\d+\.?\d+)' | tr -d "',><=~" | awk '{ print $1 }' | xargs gem info -r | ack '\(\d+\.\d+\.\d+\)'
# gemspec and current remote versions side-by-side
paste <(cat $(ls | ack gemspec) | ack -o '(?<=dependency).*(?<=[<>=]\s)(?>\d+\.?\d+)' | tr -d "',><=~") <(cat $(ls | ack gemspec) | ack -o '(?<=dependency).*(?<=[<>=]\s)(?>\d+\.?\d+)' | tr -d "',><=~" | awk '{ print $1 }' | xargs gem info -r | ack -o '(?<=\()(\d+\.\d+\.\d+)(?!>\))')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment