sue445
2017/06/22 Rails Developers Meetup #2
https://gist.github.com/sue445/538c7339ccfb35decdb3463511acf21e
# parse_gemfile.rb
ARGV.each do |source_file|
File.read(source_file).each_line do |line|
match_data = line.match(/^\s*gem\s*+["'](.+?)["']/)
next unless match_data
gem_name = match_data[1]
next if EXCLUDE_GEMS.include?(gem_name)
puts gem_name
end
end
$ ruby parse_gemfile.rb *.gemfile | sort | uniq -c | sort -nr
rails new
するとデフォで入ってるgemやOSSじゃない社内gem除く 11 sentry-raven
11 rspec-rails
11 komachi_heartbeat
11 factory_girl_rails
11 annotate
10 sidekiq
10 pry-byebug
10 jemalloc
10 global
9 sinatra
9 sidekiq-cron
9 redis-objects
9 pry-rails
9 newrelic_rpm
9 kaminari
8 onkcop
8 jquery-rails
8 capistrano
8 bullet
8 activerecord-import
7 timecop
7 redis-namespace
7 pry-doc
7 oj
7 guard-rspec
6 unicorn
6 quiet_assets
6 dalli
6 capistrano-bundler
6 better_errors
5 slim-rails
5 shibaraku
5 rubocop
5 rspec-parameterized
5 roo
5 pry-stack_explorer
5 newrelic-redis
5 aws-sdk
5 active_hash
4 weighted_sample
4 walker_method
4 simplecov-rcov
4 rspec-sidekiq
4 redis-rails
4 rails-erd
4 pry
4 pre-commit
4 oj_mimic_json
4 faraday
4 devise
4 chatwork
4 bootstrap-sass
4 barrage
4 activerecord-turntable
4 activerecord-simple_index_name
4 active_model_serializers
https://github.com/mitaku/komachi_heartbeat
/MOUNT_PATH/heartbeat
にアクセスしたらDB, Redis, memcachedの接続をチェックして問題なければokを返すhttps://github.com/railsware/global
https://github.com/tomykaira/rspec-parameterized
describe "plus" do
using RSpec::Parameterized::TableSyntax
where(:a, :b, :answer) do
1 | 2 | 3
5 | 8 | 13
0 | 0 | 0
end
with_them do
it "should do additions" do
expect(a + b).to eq answer
end
end
end
https://github.com/onk/shibaraku
Campaign.in_time
# => SELECT start_at <= now < end_at records
Campaign.in_time(super_user)
# => SELECT test_start_at <= now < test_end_at records
https://github.com/sue445/activerecord-simple_index_name
index_user_stocks_on_user_id_and_article_id
(43文字) -> user_id_and_article_id
(22文字)create_table :user_stocks do |t|
t.integer :user_id, null: false
t.integer :article_id, null: false
t.timestamps null: false
end
add_index :user_stocks, [:user_id, :article_id]
https://github.com/drecom/activerecord-turntable
メンバー積極採用中です。
社員・契約社員・個人事業主・アルバイト etc..
http://www.drecom.co.jp/recruit/