Class: Baseband
- Inherits:
-
Object
- Object
- Baseband
- Defined in:
- lib/dasauto/baseband.rb
Class Method Summary collapse
- .dasautoandroid(n = "Baseband") ⇒ Object
- .dasautoios(n = "Baseband") ⇒ Object
- .dasautoweb(n = "Baseband") ⇒ Object
Class Method Details
.dasautoandroid(n = "Baseband") ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/dasauto/baseband.rb', line 31 def self.dasautoandroid(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 |
.dasautoios(n = "Baseband") ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/dasauto/baseband.rb', line 55 def self.dasautoios(n = "Baseband") puts "Writing ios project to : ", n # FileUtils.cp_r "../generator-dasautoios/app/templates/DefaultProject.", 'dst', :verbose => true dirname = __dir__ puts "Current........" puts dirname destinationdir = File.join("../dst/", n) puts destinationdir FileUtils.mkdir_p destinationdir FileUtils.cp_r "../generator-dasautoios/app/templates/DefaultProject/.", destinationdir, :verbose => true end |
.dasautoweb(n = "Baseband") ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/dasauto/baseband.rb', line 7 def self.dasautoweb(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 |