Join Qiita and make the sharing of programming knowledge more efficient! Stock Posts Let's stock interesting posts so that you can review them later at any time! Follow Tags You can subscribe to a feed of latest posts relating to your favorite language by following tags! Follow Users ...
http://qiita.com/teams/frogapps
特徴的なgem: Parallel(並列処理), Resque(遅延実行) サーバー:Nginx,unicorn (+capistrano) 認証:devise, omniauth DB: MySQL, redis assets: coffeescript,scss,less,haml (twitter bootstrapを利用)
upstart + god + rails + daemons-railsでworkerを生かし続ける
%w[password password_confirmation encrypted_password]
gem build animate-rails.gemspec WARNING: description and summary are identical Successfully built RubyGem Name: animate-rails Version: 0.0.1 File: animate-rails-0.0.1.gem
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" ---------- ==> This script will install: /usr/local/bin/brew /usr/local/Library/... /usr/local/share/man/man1/brew.1 Press ENTER to continue or any other key to abort ★ENTER ==> /usr/bin/sudo /bin/mkdir /usr/local WARNING: Impro...
例えば http://hoge.com/data.xml というXMLを返すAPIがあったとして、ここからJSONデータに変換したいなら以下のコード。 ただしActiveSupportが必要なので、Rails以外の環境では、ActiveSupportを別途インストールすること。 require 'active_support/core_ext' require 'open-uri' hash = Hash.from_xml open('http://hoge.com/ext/data.xml').read json = hash.to_json ActiveSup...
# 一度目のfetchなのでmissする Rails.cache.fetch('key'){'value'}.should_not be_from_cache # 二度目なのでhitする Rails.cache.fetch('key'){'value'}.should be_from_cache # deleteした後はmissする Rails.cache.delete('key') Rails.cache.fetch('key'){'value'}.should_not be_from_cache
http://shijimiii.info/technical-memo/semver/
$ brew install rbenv $ brew install ruby-build $ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv $ echo 'eval "$(rbenv init -)"' >> ~/.zshenv
VCR . configure do | c | c . cassette_library_dir = 'test/vcr_cassettes' c . allow_http_connections_when_no_cassette = true #VCRブロック外のHTTP通信は許可する c . hook_into :webmock # or :fakeweb end
Basic usage: mina help # Show help. mina init # Creates a sample config file. mina tasks # Show all tasks. Server tasks: mina console # Starts an interactive console. mina deploy # Deploys the current version to the server. mina rails[arguments] # Execute a Rails command in the curren...
function rezeus() { \rm .zeus.sock || true ps -ef | grep zeus | awk ' { print $2 } ' | xargs kill || true bundle exec zeus start }
after_commit内ではchangesが空になってるので注意 FactoryGirlでpaperclip用のダミー画像を登録する方法
# CIサーバー等 bundle package --all ## capistranoのcopy方式等で本番機側にアプリケーションをデプロイする。 ## capistranoのレシピ上で、以下の形でbundlerを実行させるようにする。 bundle install --deployment
みたいなカウント保持するカラムはunsigned intで定義するのが普通な気がするのですが、ActiveRecord::Migrationではunsignedをサポートしていません。 かるく調べた限りだと、unsignedをサポートしてるのってMySQLぐらいらしく、PostgreSQLはサポートしてないしSQLite3はスキーマ定義のときにunsignedって書いてもエラーにならないけど完全に無視されてて余裕でマイナスの値を保持できてしまう。 そういう背景があってunsignedを扱いたいという要件はActiveRecordやRailsにおいてはエッジケースだ...
" SuperTab like snippets behavior. imap < expr>< TAB> neocomplcache#sources#snippets_complete#expandable() ? "\<Plug>(neocomplcache_snippets_expand)" : pumvisible() ? "\<C-n>" : "\<TAB>"
rails g bootstrap:layout application fixed
install_name_toolというコマンドを使う。readline.bundleというのはライブラリのエイリアスみたいなもので、別の場所にある実体を参照しているだけである。よって、install_name_toolでreadline.bundleにreadlineを使わせればいい。同時に、libeditから切り離す必要もある。
Ruby on Rails Advent Calendar / Sep. Ruby on Rails Advent Calendar / Sep. に参加しているユーザー 参加者募集中! 詳細や参加登録はこちら: Ruby on Railsアドベントカレンダー/Sep.を開催します! Railsの投稿一覧 , 他のアドベントカレンダー ツイート タイトルリスト 9/10 rack_after_reply でレスポンス後に処理を行う> 9/9 RailsのApplication templateを使って開発の初速をあげよう!> 9/8 Arel でサブクエリ> 9/...
最初 Rack ミドルウェアかなと思ったけど、Rack ミドルウェアではレスポンス後に処理を行うことはできない。中身をみてみると、代表的な Rack サーバが各リクエストを処理するメソッドをフックして、コールバックを実行しているようです。
RailsのApplication templateを使って開発の初速をあげよう! Rails AdventCalendar Ruby TakashiChi_ba++! 0++ TakashiChi_ba が2時間前にKobito から投稿 (2時間前に編集) Rails Advent Calendar 9日目です。 どのくらい認知があるのか知りたい、という意味も込めての投稿です:-) Railsに標準で備わっているApplication Template(アプリケーションテンプレート)の概要とサンプルの紹介です。 RailsはGemが増えると最初の設定だるい よ...
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
Qiita毎月恒例のアドベントカレンダー,来月9月のテーマはRuby on Rails です. Railsの黒魔術,エディタをからめた開発環境,あみ出した便利なTipsなど,皆さんの経験から得られた知見を共有/自慢しませんか? アドベントカレンダーへの投稿は特設ページに表示されます.アドベントカレンダー予定地: Ruby on Rails Advent Calendar / Sep. 過去のアドベントカレンダー一覧 参加方法 参加するにはこの投稿にコメントを投稿 してください.投稿順で担当日時が決まります.例えば10番目にコメントした人は9/10担当になります. ...