Skip to content

Instantly share code, notes, and snippets.

@mocoso
Created June 11, 2014 12:02
Show Gist options
  • Save mocoso/5fce468083596d5ba560 to your computer and use it in GitHub Desktop.
Save mocoso/5fce468083596d5ba560 to your computer and use it in GitHub Desktop.
Relative size of rails and other gems vs. our own code
$ bundle install --path ~/tmp/bundle && find ~/tmp/bundle/ruby/2.0.0/gems -name "*.rb" -print0 | xargs -0 -I file cat file | wc -l
1155178
$ find . -name "*.rb" -print0 | xargs -0 -I file cat file | wc -l
62654
$ irb
>> (1155178.0 / (1155178 + 62654) * 100).round.to_s + "% of ruby code in this project is in rails and other gems"
=> "95% of ruby code in this project is in rails and other gems"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment