22 Jun '13, 10am

“Pryが真の力を発揮してくれる19個のコマンドとコマンドの自作方法[Rails] - 酒と泪とRubyとRailsと”

%w[ rubygems pp logger] .each do |gem| begin require gem rescue LoadError end end Pry.config.editor = "mate -w" # Default Command Set, add custom methods here: default_command_set = Pry::CommandSet.new do command "copy" , "Copy argument to the clip-board" do |str| IO.popen( 'pbcopy' , 'w' ) { |f| f << str.to_s } end command "clear" do syst em 'clear' if ENV[ 'RAILS_ENV' ] output.puts "Rails Environment: " + ENV[ 'RAILS_ENV' ] end end command "sql" , "Send sql over AR." do |query| if ENV[ 'RAILS_ENV' ] || defined?( Rails) pp ActiveRecord::Base.connection.select_all( query) else pp "Pry did not require the environment, try `pconsole`" end end command "caller_method" do |depth| depth = depth.to_i || 1 if /^( .+?) :( \d +)( ?::in ` ( .*) ' ) ?/ = ~ caller ( depth+1) .first file = Regexp.last_match[ 1] line = Regexp.last_match[ 2] .to_i method = Regexp.last_match[ 3] output.put...

Full article: http://morizyun.github.io/blog/pry-command-rails-ruby/

Tweets

[Rails 高速化] ページキャッシュとN+1対策 - 酒と泪とRubyとRailsと

morizyun.github.io 22 Jun '13, 9am

AppName::Application.configure do config.after_initialize do Bullet.enable = true # Bulletプラグインを有効 Bullet.alert = true # J...

“Draperで驚くほどRailsコードがわかりやすくなったよ! - 酒と泪とRubyとRai...

morizyun.github.io 23 Jun '13, 2am

git clone git://github.com/JumpstartLab/blogger_advanced.git

“ひと味ちがうTwitter Bootstrapリソースまとめ、UIパーツ編 - 酒と泪とRubyとRailsと”

“ひと味ちがうTwitter Bootstrapリソースまとめ、UIパーツ編 - 酒と泪とRu...

morizyun.github.io 23 Jun '13, 2am

(04/05 15:15) Bootstrap Form Helpersを追加しました (04/09 15:25) jQuery-menu-aimを追加しました (04/09 15:40) bootstrap-datetimepickerを追加...

“RSpec/Spork/Guard/Growl/Rails 3.2.11で作る - プリチーなTDD環境! - 酒と泪とRubyとRailsと”

“RSpec/Spork/Guard/Growl/Rails 3.2.11で作る - プリチー...

morizyun.github.io 16 Jun '13, 4pm

Guard uses Growl to send notifications. Guard uses TerminalTitle to send notifications. Guard is now watching at '/path/to...

“seed-fuで始める効率的なRails Seed管理 - 酒と泪とRubyとRailsと”

“seed-fuで始める効率的なRails Seed管理 - 酒と泪とRubyとRailsと”

morizyun.github.io 14 Jun '13, 7am

ruby on rails - w RSpec, how to seed the database on load? - Stack Overflow