Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Writing now...
rack-var-dumpはphpのvar_dump()のようなデバッグ用のメソッドを提供します
Objectにvar_dumpメソッドを提供し、Rackがレスポンスを返すまでにModel,Controller,View,
その他コンテキストで実行されたvar_dump()のすべてのレシーバーをviewに自動的に出力します
出力には michaeldv / awesome_print を使用しています。
Ruby 1.8.7, 1.9.x
Rackを利用しているアプリケーション全般 (rails, sinatra, padrino, etc...)
$ gem install rack-var-dump
Gemfileに追加
gem 'rack-var-dump'
Bundle Install
% bundle install
config/application.rb等でRails用に用意されている
require 'rails-var-dump'
をrequire
rack/var_dumpをrequire
require 'rack/var_dump'
Rack::VarDumpミドルウェアをuse
use Rack::VarDump
rails-var-dumpもしくはrack/var_dumpをrequireしている場合、全てのオブジェクトに
var_dump(subject = nil)
が提供されています
@users = User.all.var_dump
@users.var_dump("user.all")
var_dumpの返り値は常にselfのため、チェーンが途切れずに使用できます
@first_name = User.find(3).var_dump('user.id(3)').first_name
引数にハッシュを与えることで、awesome_printのオプションを使用することができます。
@users.var_dump("user.all") #=> 通常出力
@users.var_dump("user.all", :plain => true) #=> plain text(obj.inspect)の出力
@users.var_dump(:plain => true) #=> subjectは省略してもok
Copyright (c) 2012 Daichi Hirata. See LICENSE for details.
FAQs
Unknown package
We found that rack-var-dump demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.