Class: App
- Inherits:
-
Thor
- Object
- Thor
- App
- Defined in:
- bin/mach5
Instance Method Summary collapse
Instance Method Details
#benchmark ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'bin/mach5', line 13 def benchmark runner = Mach5::Runner.new(eval(File.open("Mach5file").readlines.join)) if .list runner.list_benchmarks.each do |benchmark| puts benchmark end elsif .only runner.benchmark(only: .only) else runner.benchmark(all: .all) end end |
#chart ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'bin/mach5', line 30 def chart runner = Mach5::Runner.new(eval(File.open("Mach5file").readlines.join)) if .list runner.list_charts.each do |chart| puts chart end elsif .only runner.chart(only: .only) else runner.chart(all: .all) end end |
#init ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'bin/mach5', line 49 def init if File.exists?("Mach5file") puts "There is already a Mach5file. If you want to overwrite it, try to remove it first and then generate a new one." else File.open("Mach5file", "w") do |f| f.write(File.open(File.join(File.dirname(__FILE__), "../lib/templates/Mach5file")).readlines.join.gsub("{{PROJECT_NAME}}", File.basename(Dir.getwd))) end end end |
#version ⇒ Object
44 45 46 |
# File 'bin/mach5', line 44 def version puts "v#{File.open(File.join(File.dirname(__FILE__), "../VERSION")).readlines.join}" end |