Paludis Logo Introduction Examples
Bugs, Requests, Support C++ (core)
Overview Ruby (bindings)
FAQ Python (bindings)
Clients  
Configuration  
API  

example_version_spec.rb

This example demonstrates how use VersionSpec.

00001 #!/usr/bin/env ruby
00002 # vim: set sw=4 sts=4 et tw=100 :
00003 
00004 =begin description
00005 This example demonstrates how use VersionSpec.
00006 =end
00007 
00008 require 'Paludis'
00009 
00010 include Paludis
00011 
00012 # Make a set of versions
00013 versions = %w{1.0 1.1 1.2 1.2-r1 2.0 2.0-try1 2.0-scm 9999}.map do | v |
00014     VersionSpec.new v
00015 end.sort
00016 
00017 # For each version...
00018 versions.each do | v |
00019     puts "#{v}:"
00020 
00021     # Show the output of various members.
00022     puts "    Remove revision:             #{v.remove_revision}"
00023     puts "    Revision only:               #{v.revision_only}"
00024     puts "    Bump:                        #{v.bump}"
00025     puts "    Is SCM?                      #{v.is_scm?}"
00026     puts "    Has -try?                    #{v.has_try_part?}"
00027     puts "    Has -scm?                    #{v.has_scm_part?}"
00028     puts
00029 end
00030