Sha256: 8cd89aa3c6dc0a5a210d2f283aba4a79f109b3c38e8e0894876658dcdd4d7899

Contents?: true

Size: 712 Bytes

Versions: 35

Compression:

Stored size: 712 Bytes

Contents

#!/usr/bin/env ruby -wW2

if $0 == __FILE__
  $: << '.'
  $: << '..'
  $: << '../lib'
  $: << '../ext'
end

require 'pp'
require 'ox'
require 'test/ox/file'
require 'test/ox/dir'

def files(dir)
  d = ::Test::Ox::Dir.new(dir)
  Dir.new(dir).each do |fn|
    next if fn.start_with?('.')
    filename = File.join(dir, fn)
    #filename = '.' == dir ? fn : File.join(dir, fn)
    if File.directory?(filename)
      d << files(filename)
    else
      d << Test::Ox::File.new(filename)
    end
  end
  #pp d
  d
end

if $0 == __FILE__
  File.open('files.xml', "w") { |f| f.write(Ox.dump(files('.'), :indent => 2, :opt_format => true)) }
  #Ox.to_file(files('.'), 'files2.xml', :indent => 2, :opt_format => true)
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
ox-1.4.6 test/files.rb
ox-1.4.5 test/files.rb
ox-1.4.4 test/files.rb
ox-1.4.3 test/files.rb
ox-1.4.2 test/files.rb
ox-1.4.1 test/files.rb
ox-1.4.0 test/files.rb
ox-1.3.5 test/files.rb
ox-1.3.4 test/files.rb
ox-1.3.3 test/files.rb
ox-1.3.2 test/files.rb
ox-1.3.1 test/files.rb
ox-1.3.0 test/files.rb
ox-1.2.15 test/files.rb
ox-1.2.14 test/files.rb
ox-1.2.13 test/files.rb
ox-1.2.12 test/files.rb
ox-1.2.11 test/files.rb
ox-1.2.10 test/files.rb
ox-1.2.9 test/files.rb