3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/monofile/tool.rb', line 3
def self.main( args=ARGV )
options = {}
OptionParser.new do |parser|
parser.on( '-r NAME', '--require NAME') do |name|
options[:requires] ||= []
options[:requires] << name
end
end.parse!( args )
if args.size == 0 monofile_path = Monofile.find
if monofile_path.nil?
puts "!! ERROR: no mono configuration file found; looking for #{Monofile::NAMES.join(', ')} in (#{Dir.getwd})"
exit 1
end
args << monofile_path
end
if options[:requires] options[:requires].each do |path|
puts "[monofile] auto-require >#{path}<..."
require( path )
end
else config_path = "./config.rb"
if File.exist?( config_path )
puts "[monofile] auto-require (default) >#{config_path}<..."
require( config_path )
end
end
args.each do |path|
puts "[monofile] reading >#{path}<..."
monofile=Monofile.read( path )
pp monofile
puts "---"
monofile.each do |proj|
puts proj.to_s
end
end
end
|