Sha256: d22bcf52bb487aadad091c8724a5c0c583a469c8d5c7e22b355308e61d215371

Contents?: true

Size: 703 Bytes

Versions: 8

Compression:

Stored size: 703 Bytes

Contents

#!/usr/bin/env ruby
#
# frake.rb: Wraps a little gui around rake tasks

require 'flammarion'
require 'open3'

f = Flammarion::Engraving.new(exit_on_disconnect:true)
f.title "frake #{Dir.pwd}"

def run(task)
  f2 = Flammarion::Engraving.new
  f2.title task
  f2.puts "Running #{task.light_magenta}"
  Open3.popen3(task) do |i,o,e,t|
    Thread.new {e.each_line{|l| f2.print l.red}}
    o.each_line {|l| f2.print l}
    f2.status t.value.success? ? "Done!".light_green : "Failed!".light_red
  end
end

f.markdown "# Rake Tasks: "
`rake -T`.each_line do |l|
  f.break
  parts = l.split("#")
  task = parts[0]
  desc = parts[1]
  f.puts desc
  f.button(task) do
    run(task)
  end
end

f.wait_until_closed

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
flammarion-utils-0.2.1 bin/frake
flammarion-utils-0.2.0 bin/frake
flammarion-utils-0.1.14 bin/frake
flammarion-utils-0.1.13 bin/frake
flammarion-utils-0.1.12 bin/frake
flammarion-utils-0.1.11 bin/frake
flammarion-utils-0.1.10pre2 bin/frake
flammarion-utils-0.1.10pre bin/frake