/usr/share/doc/ruby-roxml/examples/posts.rb is in ruby-roxml 3.3.1-4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #!/usr/bin/env ruby
require_relative './../spec/spec_helper'
class Post
include ROXML
xml_reader :href, :from => :attr
xml_reader :hash, :from => :attr
xml_reader :description, :from => :attr
xml_reader :tag, :from => :attr
xml_reader :created_at, :from => '@time'
xml_reader :others, :from => :attr, :as => Integer
xml_reader :extended, :from => :attr
end
class Posts
include ROXML
xml_reader :posts, :as => [Post]
end
unless defined?(RSpec)
posts = Posts.from_xml(xml_for('posts'))
posts.posts.each do |post|
puts post.description, post.href, post.extended, ''
end
end
|