aboutsummaryrefslogtreecommitdiff
path: root/doc/api/ruby
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-06 14:40:53 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-06 14:40:53 +0000
commitf7096d1f89430e7b199f2e2c26b33c8c233fb728 (patch)
tree3578c58ff10854c7293e159f77d905f97fc7069a /doc/api/ruby
parent550c857e9c3aa30b6084c6d4927b0ccc5f102ca8 (diff)
downloadpaludis-f7096d1f89430e7b199f2e2c26b33c8c233fb728.tar.gz
paludis-f7096d1f89430e7b199f2e2c26b33c8c233fb728.tar.xz
(ruby) Add missing VersionSpec methods to Ruby. Implement example_version_spec in Ruby.
Diffstat (limited to 'doc/api/ruby')
-rw-r--r--doc/api/ruby/Makefile.am3
-rw-r--r--doc/api/ruby/example_version_spec.rb26
2 files changed, 28 insertions, 1 deletions
diff --git a/doc/api/ruby/Makefile.am b/doc/api/ruby/Makefile.am
index b7e305bf4..91b8cf661 100644
--- a/doc/api/ruby/Makefile.am
+++ b/doc/api/ruby/Makefile.am
@@ -26,7 +26,8 @@ examples = \
example_about.rb \
example_action.rb \
example_contents.rb \
- example_dep_spec.rb
+ example_dep_spec.rb \
+ example_version_spec.rb
EXTRA_DIST = $(examples)
diff --git a/doc/api/ruby/example_version_spec.rb b/doc/api/ruby/example_version_spec.rb
new file mode 100644
index 000000000..8a2669d8c
--- /dev/null
+++ b/doc/api/ruby/example_version_spec.rb
@@ -0,0 +1,26 @@
+#!/usr/bin/env ruby
+# vim: set sw=4 sts=4 et tw=100 :
+
+require 'Paludis'
+
+include Paludis
+
+# Make a set of versions
+versions = %w{1.0 1.1 1.2 1.2-r1 2.0 2.0-try1 2.0-scm 9999}.map do | v |
+ VersionSpec.new v
+end.sort
+
+# For each version...
+versions.each do | v |
+ puts "#{v}:"
+
+ # Show the output of various members.
+ puts " Remove revision: #{v.remove_revision}"
+ puts " Revision only: #{v.revision_only}"
+ puts " Bump: #{v.bump}"
+ puts " Is SCM? #{v.is_scm?}"
+ puts " Has -try? #{v.has_try_part?}"
+ puts " Has -scm? #{v.has_scm_part?}"
+ puts
+end
+