Sha256: b9a3914b0f70c41f0a04ce3dce451c1a08a4b578a940a45bd500e37beff4e631

Contents?: true

Size: 1.33 KB

Versions: 2

Compression:

Stored size: 1.33 KB

Contents

require 'rubygems'
require 'nokogiri'


class Baseband
  def self.bootstrapweb(n = "Baseband")
    puts "Writing output.html to : #{Dir.pwd}"
    doc = Nokogiri::HTML <<-EOHTML
     <html>
     <body>
        <item>
          <time>05.04.2011 9:53:23</time>
          <iddqd>42</iddqd>
          <idkfa>woot</idkfa>
        </item>
      </body>
      </html>
      EOHTML

      hammer = doc.at_css "time"
      hammer.name = n
      doc.css("iddqd").remove
      doc.css("idkfa").remove

      outfile = File.new("output.html", "w")
      outfile.puts doc.to_html
      outfile.close
  end

  def self.bootstrapandroid(n = "Baseband")
    puts "Writing output.xml to : #{Dir.pwd}"
    doc = Nokogiri::HTML <<-EOHTML
    <?xml version="1.0" encoding="utf-8"?>
     <body>
        <item>
          <time>05.04.2011 9:53:23</time>
          <iddqd>42</iddqd>
          <idkfa>woot</idkfa>
        </item>
      </body>
      </xml>
      EOHTML

      hammer = doc.at_css "time"
      hammer.name = n
      doc.css("iddqd").remove
      doc.css("idkfa").remove

      outfile = File.new("output.xml", "w")
      outfile.puts doc.to_html
      outfile.close
  end

  def self.bootstrapios(n = "Baseband")
    puts "Writing ios project to : ", n
  end

  def self.usage
    puts "Usage is as follows | bootstrapweb | bootstrapandroid | bootstrapios |"
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
daslabs-0.18.0 lib/daslabs/baseband.rb
daslabs-0.17.0 lib/daslabs/baseband.rb