Class: Burn::BurnTasks
- Inherits:
-
Thor
- Object
- Thor
- Burn::BurnTasks
- Includes:
- Thor::Actions
- Defined in:
- lib/burn/cli.rb
Class Method Summary collapse
-
.source_root ⇒ Object
desc “release”, “To be designed”.
Instance Method Summary collapse
- #fire(mainfile = nil) ⇒ Object
- #fuel(filename = nil) ⇒ Object
- #init ⇒ Object
-
#initialize(*args) ⇒ BurnTasks
constructor
A new instance of BurnTasks.
- #version ⇒ Object
Constructor Details
Class Method Details
.source_root ⇒ Object
desc “release”, “To be designed”
77 78 79 |
# File 'lib/burn/cli.rb', line 77 def self.source_root File.dirname(__FILE__) + "/.." end |
Instance Method Details
#fire(mainfile = nil) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/burn/cli.rb', line 51 def fire(mainfile=nil) mainfile="main.rb" if mainfile.nil? (mainfile) if [:rom_server] then server "#{@workspace_root}/tmp/burn/release/js/", mainfile else if @conf.app.target==:rom then make_and_play mainfile, [:preview] elsif @conf.app.target==:telnet then say "starting telnet server #{@conf.server.ip_addr}:#{@conf.server.port}...." Server::Telnet.new(File.read("#{@workspace_root}/#{mainfile}"), @conf).start end end end |
#fuel(filename = nil) ⇒ Object
41 42 43 44 45 |
# File 'lib/burn/cli.rb', line 41 def fuel(filename=nil) textfile = !filename.nil? ? File.read(filename) : $stdin.read fuel = Util::Txt2Fuel.new([:width], [:height], [:separator], [:rabbit_timer]) say fuel.convert(textfile) end |
#init ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/burn/cli.rb', line 16 def init base_path = "#{File.dirname(__FILE__)}/tools" remove_dir base_path+ "/"+@os.name, :verbose => [:verbose] Util::Unpack.new.unpack "#{base_path}/#{@os.name}.tar.gz", base_path if !@os.is_win? && ![:quick] then Util::Unpack.new.unpack "#{base_path}/src.tar.gz", base_path run "/bin/bash #{File.dirname(__FILE__)}/tools/make_exec.sh #{base_path}" ["cc","ca","ld"].each do |pre| copy_file "#{base_path}/src/#{pre}65/#{pre}65", "#{base_path}/#{@os.name}/cc65/bin/#{pre}65", :force => true end end say <<-EOS #{Util::Logo.new(VERSION).to_s} successfully finished. you've got ready to burn. EOS end |