3 require File
.join(File
.dirname(__FILE__
), '..', 'config', 'init')
5 $LOAD_PATH << File
.join(File
.dirname(__FILE__
), '..')
7 require 'lib/ruby_version_check'
8 Signal
.trap("INT") { puts
; exit
}
11 if ARGV.any
? { |arg
| %w(--version -v
).any
? { |flag
| arg
== flag
} }
12 puts
"MerbRadiant #{MerbRadiant::Version}"
19 require 'rubigen/scripts/generate'
23 def self.use_application_sources
!
25 sources
<< Rubigen
::PathSource.new(:builtin, "#{File.dirname(__FILE__)}/../lib/generators")
28 def add_general_options
!(opt
)
30 opt
.separator
'MerbRadiant Info:'
31 opt
.on('-v', '--version', 'Show the Radiant version number and quit.')
32 opt
.on('-h', '--help', 'Show this help message and quit.') { |v
| options
[:help] = v
}
35 opt
.separator
'General Options:'
37 opt
.on('-p', '--pretend', 'Run but do not make any changes.') { |v
| options
[:pretend] = v
}
38 opt
.on('-f', '--force', 'Overwrite files that already exist.') { options
[:collision] = :force }
39 opt
.on('-s', '--skip', 'Skip files that already exist.') { options
[:collision] = :skip }
40 opt
.on('-q', '--quiet', 'Suppress normal output.') { |v
| options
[:quiet] = v
}
41 opt
.on('-t', '--backtrace', 'Debugging: show backtrace on errors.') { |v
| options
[:backtrace] = v
}
42 opt
.on('-c', '--svn', 'Modify files with subversion. (Note: svn must be in path)') do
43 options
[:svn] = `svn status`.inject({}) do |opt
, e
|
44 opt
[e
.chomp
[7..-1]] = true
52 Rubigen
::Base.use_application_sources
!
53 Rubigen
::Scripts::Generate.new
.run(ARGV, :generator => 'instance')