1
我有一個寶石nanoc,我想調試。調試寶石紅寶石
它的命令行,nanoc
執行以下腳本(在/.rvm/gems/ruby-1.9.2-p290/bin)
#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'nanoc' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0"
if ARGV.first
str = ARGV.first
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
if str =~ /\A_(.*)_\z/
version = $1
ARGV.shift
end
end
gem 'nanoc', version
load Gem.bin_path('nanoc', 'nanoc', version)
本身負載的最後一行是什麼被解析爲( /.rvm/gems/ruby-1.9.2-p290/gems/nanoc-3.6.2/bin)
#!/usr/bin/env ruby
# encoding: utf-8
# Try loading bundler if it's possible
begin
require 'bundler/setup'
rescue LoadError
# no problem
end
# Add lib to load path
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
# Load nanoc
require 'nanoc'
require 'nanoc/cli'
# Run base
Nanoc::CLI.run(ARGV)
什麼是侵入性最小的選項來調試這些類型的腳本? 如果我只是撬第一個文件,ARGV將是文件名本身..
我是否必須修改文件只運行一個調試器?
我有一個過濾器(一些nanoc概念),在lib中的異常。我很想知道如何輕鬆地設置斷點。 – nicolas 2013-03-24 15:48:29