Sha256: c3ce6defb0d6fddd67127507577acad2a04c11960357194a7f06e58f56821354
Contents?: true
Size: 1.12 KB
Versions: 1
Compression:
Stored size: 1.12 KB
Contents
#!/usr/bin/ruby curpath = __dir__ require 'rubygems' require 'optparse' require 'fileutils' require 'xml/smart' def wrap(s, width=78, indent=18) lines = [] line, s = s[0..indent-2], s[indent..-1] s.split(/\n/).each do |ss| ss.split(/[ \t]+/).each do |word| if line.size + word.size >= width lines << line line = (" " * (indent)) + word else line << " " << word end end lines << line if line line = (" " * (indent-1)) end return lines.join "\n" end ARGV.options { |opt| opt.summary_indent = ' ' * 2 opt.summary_width = 15 opt.banner = "Usage:\n#{opt.summary_indent}#{File.basename($0)} [DIR]\n" opt.on("Options:") opt.on("--help", "-h", "This text") { puts opt; exit } opt.on("") opt.on(wrap("[DIR] scaffolds a sample logging service. Add a handler to a cpee instance to experience the pleasure.")) opt.parse! } if (ARGV.length != 1) puts ARGV.options exit else p1 = ARGV[0] end if !File.exists?(p1) FileUtils.cp_r(File.join(curpath,'..','server'),p1) FileUtils.mkdir(File.join(p1,'logs')) rescue nil else puts 'Directory already exists.' end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cpee-logging-xes-yaml-1.0 | tools/cpee-logging-xes-yaml |