perl: Translate C examples into Perl and include a manual page.
[libguestfs.git] / ruby / examples / guestfs-ruby.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 guestfs-ruby - How to use libguestfs from Ruby
6
7 =head1 SYNOPSIS
8
9  require 'guestfs'
10  g = Guestfs::Guestfs.new()
11  g.add_drive_opts("disk.img",
12                   :readonly => 1, :format => "raw")
13  g.launch()
14
15 =head1 DESCRIPTION
16
17 This manual page documents how to call libguestfs from the Ruby
18 programming language.  This page just documents the differences from
19 the C API and gives some examples.  If you are not familiar with using
20 libguestfs, you also need to read L<guestfs(3)>.
21
22 =head2 EXCEPTIONS
23
24 Errors from libguestfs functions are mapped into the C<Error>
25 exception.  This has a single parameter which is the error message (a
26 string).
27
28 =head1 EXAMPLE 1: CREATE A DISK IMAGE
29
30 @EXAMPLE1@
31
32 =head1 EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE
33
34 @EXAMPLE2@
35
36 =head1 SEE ALSO
37
38 L<guestfs(3)>,
39 L<guestfs-examples(3)>,
40 L<guestfs-ocaml(3)>,
41 L<guestfs-perl(3)>,
42 L<guestfs-python(3)>,
43 L<http://libguestfs.org/>.
44
45 =head1 AUTHORS
46
47 Richard W.M. Jones (C<rjones at redhat dot com>)
48
49 =head1 COPYRIGHT
50
51 Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>
52
53 The examples in this manual page may be freely copied, modified and
54 distributed without any restrictions.
55
56 This library is free software; you can redistribute it and/or
57 modify it under the terms of the GNU Lesser General Public
58 License as published by the Free Software Foundation; either
59 version 2 of the License, or (at your option) any later version.
60
61 This library is distributed in the hope that it will be useful,
62 but WITHOUT ANY WARRANTY; without even the implied warranty of
63 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
64 Lesser General Public License for more details.
65
66 You should have received a copy of the GNU Lesser General Public
67 License along with this library; if not, write to the Free Software
68 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA