我想追踪做event_calendar
什么,
所以我添加了 gem 然后捆绑安装,我发现它的安装位置在~/.rvm/gems/ruby-1.9.3-p448/gems/event-calendar-2.3.3/generators/event_calendar
所以我添加require 'pry'
并嵌入到binding.pry
我要调试的行中,
但是,当我运行rails g event_calendar
我以为它会调用event_calendar_generator.rb
in~/.rvm/gems/ruby-1.9.3-p448/gems/event-calendar-2.3.3/generators/event_calendar
然而,它并没有在我预期的线路上被阻止。
1 require 'pry'
2 require File.expand_path(File.dirname(__FILE__) + "/lib/insert_routes.rb")
3 binding.pry
4 class EventCalendarGenerator < Rails::Generator::Base
5 default_options :static_only => false,
6 :use_jquery => false,
7 :use_all_day => false
8
9 attr_reader :class_name, :view_name
10
11 def initialize(args, runtime_options = {})
12 super
13 binding.pry
14 usage if args.length > 0 and args.length < 2
15 @class_name = (args.shift || "event").underscore
16 @view_name = (args.shift || "calendar").underscore
17 end