7月 132013
来週16日(火) 15時からSFCデルタ棟S112でRuby初心者向け勉強会をやる予定があるので(だれでもどうぞご自由にいらしてください)
Rubyの基本的な構文のほかに、どんなgemを普段使っているんだっけと思って調べている。
ワンライナーで集計
Gemfile内に書かれたgem名を数えるワンライナー。GemfileについてはRuby書くならBundler使えで解説した。find $HOME -name Gemfile | grep "^$HOME/.*Gemfile$" | xargs grep "^gem " | ruby -lane 'puts $_.scan(%r{["'\\\'']([^"'\\\'']+)["'\\\'']})[0]' | sort | uniq -c | sort -nr
.rbと.ruファイル内のrequireを数えるワンライナー。
find $HOME -name "*.r[bu]" | grep "^$HOME/.*\.r[bu]$" | xargs grep "^ *require " | ruby -lane 'puts $_.scan(%r{["'\\\'']([^"'\\\'']+)["'\\\'']})[0]' | sort | uniq -c | sort -nr
集計結果
最近使い始めたMacbook Air内のGemfileに書かれたgemを数えた。Gemfileに書いているもの == 明示的に俺が自分で「このgemを使う」と思って書いている物。
jsonはすごい。
手元で開発しているアプリの他に、CUIツールで使うようなgemも多い。args_parserとかrainbowとかmarkdown系とか。
126 json
75 sinatra
75 haml
74 thin
67 rack
61 rake
55 sass
51 foreman
42 oauth
41 twitter
41 hoe
41 args_parser
39 sinatra-contrib
36 newgem
31 mongoid
31 bson_ext
29 sinatra-reloader
28 rainbow
24 rspec
21 bson
20 userstream
19 rdoc
19 eventmachine
18 coffee-script
17 parallel
17 minitest
15 nokogiri
15 erubis
15 creole
14 radius
14 maruku
14 markaby
14 kramdown
14 builder
14 backports
12 yard
12 sinatra-rocketio-linda
12 sinatra-rocketio
12 event_emitter
11 redcarpet
11 json_pure
10 slim
10 arduino_firmata
9 temple
9 rack-test
9 ci_reporter
8 tw
8 therubyracer
8 dalli
8 bump
7 wlang
7 utils
7 test-unit
7 sinatra-content-for
7 rabl
7 net-http-server
7 mongo
7 liquid
7 extlib
7 debugger
7 bluecloth
7 ArgsParser
6 wikicloth
6 tmp_cache
6 asciidoctor
5 yajl-ruby
5 sinatra-cometio
5 rubyforge
5 rails
5 oj
5 less
5 jruby-openssl
5 jquery-rails
5 gyazz
5 eventmachine_httpserver
5 diff-lcs
5 contest
4 twitter-text
4 sqlite3
4 sprockets
4 rb-fsevent
4 omniauth-twitter
4 omniauth-github
4 omniauth
4 octokit
4 logger
4 httparty
4 hashie
4 em-rocketio-linda-client
4 data_mapper
3 tokyocabinet
3 tiqav
3 skype
3 sequel
3 ruby-dbus
3 redis
3 rb-skypemac
3 pygments.rb
3 multi_json
3 mongrel
3 im-kayac
3 idn
3 hugeurl
3 httpclient
3 hoe-git
3 hoe-bundler
3 fakeweb
3 em-websocket
3 dm-mysql-adapter
3 cucumber
2 weather_jp
2 sys-filesystem
2 sinatra-websocketio
2 simple-rss
2 serialport
2 redis-namespace
2 racc
2 pg
2 paperclip
2 mini_magick
2 mini_exiftool
2 memcached
2 launch-agent
2 kuro-rs
2 igo-ruby
2 idn-ruby
2 hoe-travis
2 hoe-rubygems
2 hoe-gemspec
2 hoe-doofus
2 headless
2 guard-rspec
2 guard-bundler
2 feed-normalizer
2 dm-types
2 dm-sqlite-adapter
1 youtube_search
1 xmpp4r
1 wifi_location
1 websocket
1 wdm
1 wav-file
1 tumblife
1 treetop
1 tlsmail
1 sinatra-static-assets
1 sinatra-multi-screen
1 sinatra-auto-reload
1 sfc_ikiteru
1 rexical
1 rb-kqueue
1 rb-inotify
1 rake-compiler
1 rails-trash
1 rails-permalink
1 rack-cache
1 prawn
1 pp
1 pit
1 phidgets-ffi
1 org-ruby
1 nfc
1 mysql2
1 mini_portile
1 mime-types
1 mechanize
1 mdslide
1 literati
1 libwebsocket
1 kgio
1 kaminari
1 i18n
1 hoe-gemspec2
1 hoe-debugging
1 hiredis
1 guard-sass
1 guard-coffeescript
1 guard
1 growl
1 ffi
1 factory_girl_rails
1 em-websocketio-client
1 em-cometio-client
1 dragonfly
1 devise
1 curb
1 ckeditor-rails
1 cf-runtime
1 capybara-webkit
1 capybara
1 async_sinatra
1 asearch
1 appraisal
1 addressable
1 acts_as_tree
1 acts_as_list
1 activesupport
1 activerecord-jdbcsqlite3-adapter
1 Ruby4Skype
1 RedCloth
ホームディレクトリ内の.rb/.ruファイル内のrequireを数えた。多すぎるので上位300件だけコピペ。
こちらはホームディレクトリにインストールしているrbenv内のgemがrequireしたものも含まれている。
自分がrequireしているgem以外にもGemfileと違ってbackports、strigio、rbconfigやテスト関係などアプリよりgem内で使われる事が多く見える。
2269 rubygems
2208 backports/tools
1376 helper
962 spec_helper
841 tk
747 stringio
738 ../helper
647 json
611 test/unit
524 uri
492 fileutils
484 test_helper
469
391 rubygems/command
361 yaml
329 rubygems/test_case
321 bundler/setup
314 rack/mock
309 time
308 rbconfig
298 enumerator
294 spec/spec_helper
290 thread
278 twitter/base
278 tempfile
261 socket
258 net/http
250 rack
242 sinatra
241 spec
240 /../../spec_helper.rb
230 tilt
221 cgi
215 ../test_helper
214 rack/lint
213 contest
202 zlib
202 date
200 em_test_helper
192 bundler
189 rubygems/user_interaction
187 yajl
187 digest/md5
185 forwardable
183 timeout
182 eventmachine
181 sinatra/base
173 optparse
172 open-uri
170 pp
166 twitter/user
161 minitest/autorun
160 /../../spec_helper
159 tkextlib/iwidgets.rb
158 rack/utils
157 twitter/api/utils
156 rubygems/version_option
156 openssl
147 java
143 rubygems/package
140 set
135 rake
133 /test_helper.rb
132 twitter/error/client_error
132 twitter/creatable
132 tkextlib/setup.rb
131 erb
131 /spec_helper
129 pathname
127 tmpdir
125 tilt/template
123 rubygems/local_remote_options
117 ../integration
113 kconv
112 setup_variant
112 rack/protection
111 twitter
110 faraday
108 ostruct
107 /../spec_helper.rb
105 simplecov
102 tkextlib/bwidget.rb
102 sinatra/reloader
101 rspec
100 wsdl/info
100 twitter/api/arguments
100 event_emitter
98 twitter/identity
98 oauth
97 mkmf
96 webrick
95 /helper
94 active_support/core_ext/object/blank
92 rubygems/installer
91 logger
90 tkextlib/tcllib.rb
90 drb/drb
90 ../spec_helper.rb
89 rubygems/remote_fetcher
89 base64
89 args_parser
89 /main
88 haml
88 backports
87 benchmark
84 rack/request
83 sass
83 monitor
83 ..
82 twitter/error/forbidden
82 e2mmap
82 arduino_firmata
81 nokogiri
80 twitter/tweet
80 oauth/request_proxy/base
80 digest/sha1
79 rdoc
76 rubygems/security
75 tw
74 rubygems/spec_fetcher
73 rack/content_length
72 twitter/error/server_error
72 tkextlib/blt.rb
71 net/https
70 rexml/child
68 twitter/error
68 singleton
68 ArgsParser
67 foo
66 rubygems/deprecate
65 appscript
65 active_support
63 yajl/http_stream
63 rss/1.0
63 rexml/parseexception
63 httparty
62 twitter/entity
62 tkextlib/tile.rb
62 strscan
62 rake/tasklib
61 rubygems/specification
61 /spec_helper.rb
60 webrick/httpstatus
60 oauth/signature/plaintext
60 oauth/signature/base
60 oauth/helper
60 multi_json
60 iconv
59 httpclient
58 rubygems/rdoc
57 twitter/cursor
57 ../testrequest
56 rss/maker/1.0
56 rexml/xmltokens
56 em-http
56 active_support/core_ext/array/wrap
54 multi_json/adapter
53 webrick/httputils
52 shellwords
52 nkf
52 minitest/unit
51 tkextlib/tkimg/setup.rb
51 skype
51 json/common
50 tzinfo
50 rack/response
50 actionpack
49 yajl/gzip
49 yajl/deflate
49 rdoc/test_case
49 parts
49 mocha
49 composite_io
48 rubygems/uninstaller
48 json/pure
47 user_stream
47 twitter/place
46 rubygems/dependency_list
46 psych
46 gearman
45 securerandom
45 rake/early_time
45 active_support/core_ext/class/attribute
45 /tools
45 /setter
44 rubygems/ext/builder
44 rubygems/exceptions
44 find
44 erubis
44 <%=
43 tmp_cache
43 rainbow
42 yajl/bzip2
42 twitter/factory
42 twitter/error/not_found
42 twitter/configurable
42 twitter/basic_user
42 twitter/action/tweet
42 tk/frame
42 sinatra/rocketio
42 rubygems/dependency_installer
42 rss/2.0
42 rexml/source
42 rexml/parsers/baseparser
42 rexml/namespace
42 open3
42 dbus
42 action_controller/test_process
42 /bootstrap
42 ../bootstrap
41 rake/file_list
41 /../config/environment
40 oauth/signature/hmac/base
40 oauth/client/helper
40 dl
40 ../../../oauth_case
39 delegate
39 /../test_helper
38 sinatra/rocketio/linda/client
38 rack/session/abstract/id
38 rack/lobster
38 parallel
38 hashie
37 thin
37 mongoid
37 generator
37 /test_helper
36 rubygems/requirement
36 rss/rss
36 readline
36 rake/file_utils_ext
36 rack/showexceptions
36 json/version
36 /story_helper
35 webrick/config
35 uri/generic
35 uri/common
35 tsort
35 test/unit/assertions
35 sinatra/content_for
35 rubygems/gemcutter_utilities
35 etc
35 digest
34 wav-file
34 rubygems/command_manager
34 rss/dublincore
34 fcntl
34 bigdecimal
34 active_support/core_ext/string/inflections
33 rdoc/rdoc
33 rack/test
33 rack/chunked
33 irb/cmd/nop.rb
32 test/spec
32 spec/runner/formatter/base_text_formatter
32 rexml/document
32 rack/rewindable_input
32 multi_json/adapters/json_common
32 json/ext
32 ffi/platform
32 active_support/core_ext/object/inclusion
31 twitter/list
31 tw/conf
31 active_support/core_ext/module/delegation
31 /../spec_helper
31 /../lib/ArgsParser
31 ../../lib/TimeLine
31 ../../lib/MovieClip
30 xsd/namedelements
30 tw/client/request
30 tw/client/error
30 tw/client/auth
30 render
30 rake/dsl_definition
30 opt_parser
30 oauth/consumer
30 net/protocol
30 lib
30 heroku/command/base
30 ffi
30 cmds
30 builder
30 app
30 active_support/deprecation
30 English
30 ../endpoint
29 rake/testtask
29 rake/task_manager
29 rake/file_task
29 rake/application
29 im-kayac
29 active_support/core_ext/array/extract_options
29 Win32API
28 twitter/geo
28 twitter/error/identity_map_key_error
28 tw/client/stream
28 thor/actions/empty_directory
28 simple_oauth
28 rubygems/version
28 rubygems/dependency
さくらVPSのUbuntuにあるGemfile内のgem。純粋にSinatraを使ったwebサービス用のgemが多いと思う。
64 rake
42 json
30 haml
21 sass
18 sinatra
17 json_pure
16 yard
16 rspec
15 rack
15 erubis
15 builder
14 thin
14 rdoc
14 radius
14 maruku
14 markaby
14 kramdown
14 creole
14 coffee-script
11 twitter
11 oauth
10 mongoid
10 bson
9 slim
9 rb-fsevent
9 rack-test
9 liquid
9 less
9 dm-core
9 bson_ext
8 temple
8 nokogiri
8 ci_reporter
7 sinatra-reloader
7 sinatra-contrib
6 wlang
6 wikicloth
6 therubyracer
6 redcarpet
6 rabl
6 net-http-server
6 multi_json
6 foreman
6 contest
6 bump
6 bluecloth
6 asciidoctor
5 guard-rspec
5 guard-bundler
5 backports
5 args_parser
4 wdm
4 tw
4 sinatra-rocketio
4 rb-kqueue
4 rb-inotify
4 rainbow
4 mongrel
4 mongo
4 minitest
4 idn
4 feed-normalizer
4 fakeweb
4 dm-mysql-adapter
4 data_mapper
4 cucumber
3 yajl-ruby
3 utils
3 userstream
3 test-unit
3 kgio
3 idn-ruby
3 eventmachine
3 event_emitter
3 debugger
3 appraisal
2 tiqav
2 sinatra-websocketio
2 sinatra-content-for
2 oj
2 im-kayac
2 hugeurl
2 httpclient
2 fastercsv
2 dm-types
2 dalli
1 xmpp4r
1 weather_jp
1 uuidtools
1 tokyocabinet
1 sys-filesystem
1 stringex
1 sinatra-rocketio-linda
1 sinatra-cometio
1 sfc_ikiteru
1 RedCloth
1 parallel
1 octokit
1 newgem
1 mini_magick
1 logger
1 jruby-openssl
1 httparty
1 hoe
1 headless
1 hashie
1 em-websocket
1 do_mysql
1 dm-do-adapter
1 diff-lcs
1 data_objects
1 bcrypt-ruby
1 ArgsParser
1 addressable