<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/versionomy/formats/rubygems.rb</filename>
    </added>
    <added>
      <filename>tests/tc_rubygems_basic.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,12 @@
+=== 0.2.0 / 2009-??-??
+
+* Schemas can now add custom methods to value objects.
+* Added default field settings to schema DSL.
+* Added Rubygems format.
+
 === 0.1.3 / 2009-10-29
 
-* Fixed an issue with parsing the &quot;-p&quot; patchlevel delimiter (e.g. &quot;1.9.1-p243&quot;).
+* Fixed an issue with parsing the &quot;-p&quot; patchlevel delimiter, e.g. &quot;1.9.1-p243&quot;. (Reported by Luis Lavena.)
 
 === 0.1.2 / 2009-10-28
 </diff>
      <filename>History.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -54,6 +54,7 @@ includes_ = [
  'format/delimiter',
  'formats',
  'formats/standard',
+ 'formats/rubygems',
  'value',
  'interface',
  'version',</diff>
      <filename>lib/versionomy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -876,7 +876,7 @@ module Versionomy
         end
         
         def unparsed_value(value_, style_, unparse_params_)
-          value_
+          value_.to_s
         end
         
       end</diff>
      <filename>lib/versionomy/format/delimiter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -93,252 +93,276 @@ module Versionomy
     # unparsing as well.
     # 
     # For the exact annotated definition of the standard schema and format,
-    # see the source code for the _create_standard method.
+    # see the source code for Versionomy::Formats::Standard#_create.
     
     def self.standard
       get('standard')
     end
     
     
-    # Create the standard format.
-    # This method is called internally when Versionomy initializes itself,
-    # and you should not need to call it again. It is documented, however,
-    # so that you can inspect its source code from RDoc, since the source
-    # contains useful examples of how to use the schema and format
-    # definition DSLs.
-    
-    def self._create_standard
+    module Standard
+      
+      
+      # Extra methods added to version values that use the standard schema.
       
-      # The following is the definition of the standard schema
-      schema_ = Schema.create do
+      module ExtraMethods
         
-        # The major field has the default value of 1. Most other fields
-        # have a default value of 0. Thus, the default version number
-        # overall is &quot;1.0&quot;.
-        # We first create the core version fields &quot;major.minor.tiny.tiny2&quot;.
-        field(:major, :default_value =&gt; 1) do
-          field(:minor) do
-            field(:tiny) do
-              field(:tiny2) do
-                
-                # The next field is a symbolic field that specifies the
-                # release type: e.g. beta, release candidate, release, etc.
-                field(:release_type, :type =&gt; :symbol) do
-                  
-                  # Development releases are typically expressed like
-                  # &quot;1.0d3&quot; and are intended for unstable development
-                  # progress. Bumping the release type will change it to
-                  # alpha.
-                  symbol(:development, :bump =&gt; :alpha)
-                  
-                  # Alpha releases are typically expressed like &quot;1.0a2&quot; and
-                  # are intended for internal testing.
-                  # Bumping the release type advances to beta.
-                  symbol(:alpha, :bump =&gt; :beta)
-                  
-                  # Beta releases are typically expressed like &quot;1.0b2&quot; and
-                  # are intended for external or public testing.
-                  # Bumping the release type advances to release candidate.
-                  symbol(:beta, :bump =&gt; :release_candidate)
-                  
-                  # Release candidate releases are typically expressed like
-                  # &quot;1.0rc2&quot; and are intended for final public testing
-                  # prior to release.
-                  # Bumping the release type advances to final release.
-                  symbol(:release_candidate, :bump =&gt; :final)
-                  
-                  # Preview releases represent an alternative release type
-                  # progression, and are typically used for public testing
-                  # similar to beta or release candidate.
-                  # Bumping the release type advances to final release.
-                  symbol(:preview, :bump =&gt; :final)
-                  
-                  # This type represents a final release. This is the
-                  # default value for the release_type field if no value is
-                  # explicitly provided.
-                  # Bumping the release type has no effect.
-                  symbol(:final, :bump =&gt; :final)
-                  default_value(:final)
-                  
-                  # If the release type is development, these fields are
-                  # made available to indicate which development release
-                  # is being represented.
-                  field(:development_version, :only =&gt; :development,
-                        :default_value =&gt; 1) do
-                    field(:development_minor)
-                  end
-                  
-                  # If the release type is alpha, these fields are made
-                  # available to indicate which alpha release is being
-                  # represented.
-                  field(:alpha_version, :only =&gt; :alpha, :default_value =&gt; 1) do
-                    field(:alpha_minor)
-                  end
-                  
-                  # If the release type is beta, these fields are made
-                  # available to indicate which beta release is being
-                  # represented.
-                  field(:beta_version, :only =&gt; :beta, :default_value =&gt; 1) do
-                    field(:beta_minor)
-                  end
-                  
-                  # If the release type is release candidate, these fields
-                  # are made available to indicate which release candidate
-                  # is being represented.
-                  field(:release_candidate_version, :only =&gt; :release_candidate,
-                        :default_value =&gt; 1) do
-                    field(:release_candidate_minor)
-                  end
-                  
-                  # If the release type is preview, these fields are made
-                  # available to indicate which preview release is being
-                  # represented.
-                  field(:preview_version, :only =&gt; :preview, :default_value =&gt; 1) do
-                    field(:preview_minor)
-                  end
+        
+        # Returns true if the version is a prerelease version
+        
+        def prerelease?
+          self.release_type != :final
+        end
+        
+        
+      end
+      
+      
+      # Create the standard format.
+      # This method is called internally when Versionomy initializes itself,
+      # and you should not need to call it again. It is documented, however,
+      # so that you can inspect its source code from RDoc, since the source
+      # contains useful examples of how to use the schema and format
+      # definition DSLs.
+      
+      def self._create
+        
+        # The following is the definition of the standard schema
+        schema_ = Schema.create do
+          
+          # The major field has the default value of 1. Most other fields
+          # have a default value of 0. Thus, the default version number
+          # overall is &quot;1.0&quot;.
+          # We first create the core version fields &quot;major.minor.tiny.tiny2&quot;.
+          field(:major, :default_value =&gt; 1) do
+            field(:minor) do
+              field(:tiny) do
+                field(:tiny2) do
                   
-                  # If the release type is final, these fields are made
-                  # available to indicate an optional patchlevel.
-                  field(:patchlevel, :only =&gt; :final) do
-                    field(:patchlevel_minor)
+                  # The next field is a symbolic field that specifies the
+                  # release type: e.g. beta, release candidate, release, etc.
+                  field(:release_type, :type =&gt; :symbol) do
+                    
+                    # Development releases are typically expressed like
+                    # &quot;1.0d3&quot; and are intended for unstable development
+                    # progress. Bumping the release type will change it to
+                    # alpha.
+                    symbol(:development, :bump =&gt; :alpha)
+                    
+                    # Alpha releases are typically expressed like &quot;1.0a2&quot; and
+                    # are intended for internal testing.
+                    # Bumping the release type advances to beta.
+                    symbol(:alpha, :bump =&gt; :beta)
+                    
+                    # Beta releases are typically expressed like &quot;1.0b2&quot; and
+                    # are intended for external or public testing.
+                    # Bumping the release type advances to release candidate.
+                    symbol(:beta, :bump =&gt; :release_candidate)
+                    
+                    # Release candidate releases are typically expressed like
+                    # &quot;1.0rc2&quot; and are intended for final public testing
+                    # prior to release.
+                    # Bumping the release type advances to final release.
+                    symbol(:release_candidate, :bump =&gt; :final)
+                    
+                    # Preview releases represent an alternative release type
+                    # progression, and are typically used for public testing
+                    # similar to beta or release candidate.
+                    # Bumping the release type advances to final release.
+                    symbol(:preview, :bump =&gt; :final)
+                    
+                    # This type represents a final release. This is the
+                    # default value for the release_type field if no value is
+                    # explicitly provided.
+                    # Bumping the release type has no effect.
+                    symbol(:final, :bump =&gt; :final)
+                    default_value(:final)
+                    
+                    # If the release type is development, these fields are
+                    # made available to indicate which development release
+                    # is being represented.
+                    field(:development_version, :only =&gt; :development,
+                          :default_value =&gt; 1) do
+                      field(:development_minor)
+                    end
+                    
+                    # If the release type is alpha, these fields are made
+                    # available to indicate which alpha release is being
+                    # represented.
+                    field(:alpha_version, :only =&gt; :alpha, :default_value =&gt; 1) do
+                      field(:alpha_minor)
+                    end
+                    
+                    # If the release type is beta, these fields are made
+                    # available to indicate which beta release is being
+                    # represented.
+                    field(:beta_version, :only =&gt; :beta, :default_value =&gt; 1) do
+                      field(:beta_minor)
+                    end
+                    
+                    # If the release type is release candidate, these fields
+                    # are made available to indicate which release candidate
+                    # is being represented.
+                    field(:release_candidate_version, :only =&gt; :release_candidate,
+                          :default_value =&gt; 1) do
+                      field(:release_candidate_minor)
+                    end
+                    
+                    # If the release type is preview, these fields are made
+                    # available to indicate which preview release is being
+                    # represented.
+                    field(:preview_version, :only =&gt; :preview, :default_value =&gt; 1) do
+                      field(:preview_minor)
+                    end
+                    
+                    # If the release type is final, these fields are made
+                    # available to indicate an optional patchlevel.
+                    field(:patchlevel, :only =&gt; :final) do
+                      field(:patchlevel_minor)
+                    end
                   end
                 end
               end
             end
           end
+          
+          # Add the methods in this module to each value
+          add_module(Formats::Standard::ExtraMethods)
         end
-      end
-      
-      # The following is the definition of the standard format. It
-      # understands the standard schema defined above.
-      format_ = Format::Delimiter.new(schema_) do
         
-        # All version number strings must start with the major version.
-        # Unlike other fields, it is not preceded by any delimiter.
-        field(:major) do
-          recognize_number(:delimiter_regexp =&gt; '', :default_delimiter =&gt; '')
-        end
-        
-        # The remainder of the core version number are represented as
-        # integers delimited by periods by default. Each is also dependent
-        # on the presence of the previous field, so :requires_previous_field
-        # retains its default value of true. Finally, they can be optional
-        # in an unparsed string if they are set to the default value of 0.
-        field(:minor) do
-          recognize_number(:default_value_optional =&gt; true)
-        end
-        field(:tiny) do
-          recognize_number(:default_value_optional =&gt; true)
-        end
-        field(:tiny2) do
-          recognize_number(:default_value_optional =&gt; true)
-        end
-        
-        # The release type field is the most complex field because of the
-        # variety of syntaxes we support. The basic strategy is to map
-        # a few specific sets of characters as signaling particular release
-        # types. For example, the &quot;a&quot; in &quot;1.0a5&quot; signals an alpha release.
-        # If no such release type marker is found, it defaults to the final
-        # release type.
-        # We set up two styles, a short style and a long style. Short style
-        # syntax looks like &quot;1.0a5&quot;. Long syntax looks more like
-        # &quot;1.0 Alpha 5&quot;. The parsed value retains knowledge of which style
-        # it came from so it can be reconstructed when the value is unparsed.
-        # Finally, we turn requires_previous_field off because the release
-        # type syntax markers don't require any particular set of the core
-        # version number fields to be present. &quot;1.0a5&quot; and &quot;1.0.0.0a5&quot; are
-        # both valid version numbers.
-        field(:release_type, :requires_previous_field =&gt; false,
-              :default_style =&gt; :short) do
-          # First check for &quot;short form&quot; syntax. Not that we support post-
-          # delimiters; that is, we recognize &quot;1.0 pre-2&quot; where the hyphen
-          # is a post-delimiter. Also notice that we expect prerelease types
-          # to be followed by a numeric prerelease version number.
-          recognize_regexp_map(:style =&gt; :short, :default_delimiter =&gt; '',
-                               :delimiter_regexp =&gt; '-|\.|\s?',
-                               :post_delimiter_regexp =&gt; '\s?|-',
-                               :expected_follower_regexp =&gt; '\d') do
-            map(:development, 'd')
-            map(:alpha, 'a')
-            map(:beta, 'b')
-            map(:release_candidate, 'rc')
-            map(:preview, 'pre')
-            # Note that we omit the value &lt;tt&gt;:final&lt;/tt&gt;. This is because
-            # that value is signaled by the absence of any syntax in the
-            # version string, including the absence of any delimiters. So we
-            # just allow it to fall through to the default.
+        # The following is the definition of the standard format. It
+        # understands the standard schema defined above.
+        format_ = Format::Delimiter.new(schema_) do
+          
+          # All version number strings must start with the major version.
+          # Unlike other fields, it is not preceded by any delimiter.
+          field(:major) do
+            recognize_number(:delimiter_regexp =&gt; '', :default_delimiter =&gt; '')
           end
-          # Check for &quot;long form&quot; syntax. Note again that we omit :final.
-          recognize_regexp_map(:style =&gt; :long, :default_delimiter =&gt; '',
-                               :delimiter_regexp =&gt; '-|\.|\s?',
-                               :post_delimiter_regexp =&gt; '\s?|-',
-                               :expected_follower_regexp =&gt; '\d') do
-            map(:development, 'dev')
-            map(:alpha, 'alpha')
-            map(:beta, 'beta')
-            map(:release_candidate, 'rc')
-            map(:preview, 'preview')
+          
+          # The remainder of the core version number are represented as
+          # integers delimited by periods by default. Each is also dependent
+          # on the presence of the previous field, so :requires_previous_field
+          # retains its default value of true. Finally, they can be optional
+          # in an unparsed string if they are set to the default value of 0.
+          field(:minor) do
+            recognize_number(:default_value_optional =&gt; true)
           end
+          field(:tiny) do
+            recognize_number(:default_value_optional =&gt; true)
+          end
+          field(:tiny2) do
+            recognize_number(:default_value_optional =&gt; true)
+          end
+          
+          # The release type field is the most complex field because of the
+          # variety of syntaxes we support. The basic strategy is to map
+          # a few specific sets of characters as signaling particular release
+          # types. For example, the &quot;a&quot; in &quot;1.0a5&quot; signals an alpha release.
+          # If no such release type marker is found, it defaults to the final
+          # release type.
+          # We set up two styles, a short style and a long style. Short style
+          # syntax looks like &quot;1.0a5&quot;. Long syntax looks more like
+          # &quot;1.0 Alpha 5&quot;. The parsed value retains knowledge of which style
+          # it came from so it can be reconstructed when the value is unparsed.
+          # Finally, we turn requires_previous_field off because the release
+          # type syntax markers don't require any particular set of the core
+          # version number fields to be present. &quot;1.0a5&quot; and &quot;1.0.0.0a5&quot; are
+          # both valid version numbers.
+          field(:release_type, :requires_previous_field =&gt; false,
+                :default_style =&gt; :short) do
+            # First check for &quot;short form&quot; syntax. Not that we support post-
+            # delimiters; that is, we recognize &quot;1.0 pre-2&quot; where the hyphen
+            # is a post-delimiter. Also notice that we expect prerelease types
+            # to be followed by a numeric prerelease version number.
+            recognize_regexp_map(:style =&gt; :short, :default_delimiter =&gt; '',
+                                 :delimiter_regexp =&gt; '-|\.|\s?',
+                                 :post_delimiter_regexp =&gt; '\s?|-',
+                                 :expected_follower_regexp =&gt; '\d') do
+              map(:development, 'd')
+              map(:alpha, 'a')
+              map(:beta, 'b')
+              map(:release_candidate, 'rc')
+              map(:preview, 'pre')
+              # Note that we omit the value &lt;tt&gt;:final&lt;/tt&gt;. This is because
+              # that value is signaled by the absence of any syntax in the
+              # version string, including the absence of any delimiters. So we
+              # just allow it to fall through to the default.
+            end
+            # Check for &quot;long form&quot; syntax. Note again that we omit :final.
+            recognize_regexp_map(:style =&gt; :long, :default_delimiter =&gt; '',
+                                 :delimiter_regexp =&gt; '-|\.|\s?',
+                                 :post_delimiter_regexp =&gt; '\s?|-',
+                                 :expected_follower_regexp =&gt; '\d') do
+              map(:development, 'dev')
+              map(:alpha, 'alpha')
+              map(:beta, 'beta')
+              map(:release_candidate, 'rc')
+              map(:preview, 'preview')
+            end
+          end
+          
+          # The development version must appear in the string if it is present
+          # in the value, even if the value is 0. Similar for all the other
+          # prerelease version numbers: alpha, beta, release candidate, and
+          # preview. However, the minor fields are optional.
+          field(:development_version) do
+            recognize_number(:delimiter_regexp =&gt; '', :default_delimiter =&gt; '')
+          end
+          field(:development_minor) do
+            recognize_number(:default_value_optional =&gt; true)
+          end
+          field(:alpha_version) do
+            recognize_number(:delimiter_regexp =&gt; '', :default_delimiter =&gt; '')
+          end
+          field(:alpha_minor) do
+            recognize_number(:default_value_optional =&gt; true)
+          end
+          field(:beta_version) do
+            recognize_number(:delimiter_regexp =&gt; '', :default_delimiter =&gt; '')
+          end
+          field(:beta_minor) do
+            recognize_number(:default_value_optional =&gt; true)
+          end
+          field(:release_candidate_version) do
+            recognize_number(:delimiter_regexp =&gt; '', :default_delimiter =&gt; '')
+          end
+          field(:release_candidate_minor) do
+            recognize_number(:default_value_optional =&gt; true)
+          end
+          field(:preview_version) do
+            recognize_number(:delimiter_regexp =&gt; '', :default_delimiter =&gt; '')
+          end
+          field(:preview_minor) do
+            recognize_number(:default_value_optional =&gt; true)
+          end
+          
+          # The patchlevel field does not require the previous field (which is
+          # release_type). Here we also set up two styles: a numeric style and
+          # a letter style. So &quot;1.0a&quot; and &quot;1.0-1&quot; are equivalent.
+          field(:patchlevel, :requires_previous_field =&gt; false,
+                :default_value_optional =&gt; true, :default_style =&gt; :number) do
+            recognize_number(:style =&gt; :number, :default_delimiter =&gt; '-',
+                             :delimiter_regexp =&gt; '(-|\.|\s?)p|-')
+            recognize_letter(:style =&gt; :letter, :default_delimiter =&gt; '',
+                             :delimiter_regexp =&gt; '-|\.|\s?',
+                             :expected_follower_regexp =&gt; '$')
+          end
+          field(:patchlevel_minor) do
+            recognize_number(:default_value_optional =&gt; true)
+          end
+          
+          # By default, we require that at least the major and minor fields
+          # appear in an unparsed version string.
+          default_unparse_params(:required_fields =&gt; [:minor])
         end
-        
-        # The development version must appear in the string if it is present
-        # in the value, even if the value is 0. Similar for all the other
-        # prerelease version numbers: alpha, beta, release candidate, and
-        # preview. However, the minor fields are optional.
-        field(:development_version) do
-          recognize_number(:delimiter_regexp =&gt; '', :default_delimiter =&gt; '')
-        end
-        field(:development_minor) do
-          recognize_number(:default_value_optional =&gt; true)
-        end
-        field(:alpha_version) do
-          recognize_number(:delimiter_regexp =&gt; '', :default_delimiter =&gt; '')
-        end
-        field(:alpha_minor) do
-          recognize_number(:default_value_optional =&gt; true)
-        end
-        field(:beta_version) do
-          recognize_number(:delimiter_regexp =&gt; '', :default_delimiter =&gt; '')
-        end
-        field(:beta_minor) do
-          recognize_number(:default_value_optional =&gt; true)
-        end
-        field(:release_candidate_version) do
-          recognize_number(:delimiter_regexp =&gt; '', :default_delimiter =&gt; '')
-        end
-        field(:release_candidate_minor) do
-          recognize_number(:default_value_optional =&gt; true)
-        end
-        field(:preview_version) do
-          recognize_number(:delimiter_regexp =&gt; '', :default_delimiter =&gt; '')
-        end
-        field(:preview_minor) do
-          recognize_number(:default_value_optional =&gt; true)
-        end
-        
-        # The patchlevel field does not require the previous field (which is
-        # release_type). Here we also set up two styles: a numeric style and
-        # a letter style. So &quot;1.0a&quot; and &quot;1.0-1&quot; are equivalent.
-        field(:patchlevel, :requires_previous_field =&gt; false,
-              :default_value_optional =&gt; true, :default_style =&gt; :number) do
-          recognize_number(:style =&gt; :number, :default_delimiter =&gt; '-',
-                           :delimiter_regexp =&gt; '(-|\.|\s?)p|-')
-          recognize_letter(:style =&gt; :letter, :default_delimiter =&gt; '',
-                           :delimiter_regexp =&gt; '-|\.|\s?',
-                           :expected_follower_regexp =&gt; '$')
-        end
-        field(:patchlevel_minor) do
-          recognize_number(:default_value_optional =&gt; true)
-        end
-        
-        # By default, we require that at least the major and minor fields
-        # appear in an unparsed version string.
-        default_unparse_params(:required_fields =&gt; [:minor])
       end
+      
+      
     end
     
     
-    register('standard', _create_standard) unless get('standard')
+    register('standard', Standard._create) unless get('standard')
     
     
   end</diff>
      <filename>lib/versionomy/formats/standard.rb</filename>
    </modified>
    <modified>
      <diff>@@ -90,12 +90,12 @@ module Versionomy
     # Raises Versionomy::Errors::UnknownFormatError if a name is given that
     # is not registered.
     
-    def create(values_=[], format_=nil, unparse_params_=nil)
+    def create(values_=nil, format_=nil, unparse_params_=nil)
       if format_.kind_of?(String) || format_.kind_of?(Symbol)
         format_ = Formats.get(format_, true)
       end
       format_ ||= default_format
-      Value.new(values_, format_, unparse_params_)
+      Value.new(values_ || [], format_, unparse_params_)
     end
     
     </diff>
      <filename>lib/versionomy/interface.rb</filename>
    </modified>
    <modified>
      <diff>@@ -69,7 +69,6 @@ module Versionomy
       def initialize(name_, opts_={}, &amp;block_)
         @name = name_.to_sym
         @type = opts_[:type] || :integer
-        @default_value = opts_[:default_value]
         if @type == :symbol
           @symbol_info = ::Hash.new
           @symbol_order = ::Array.new
@@ -77,13 +76,21 @@ module Versionomy
           @symbol_info = nil
           @symbol_order = nil
         end
+        @default_value = opts_[:default_value]
         @bump_proc = nil
         @compare_proc = nil
         @canonicalize_proc = nil
+        master_builder_ = opts_[:master_builder]
+        if master_builder_
+          @bump_proc = master_builder_._get_default_setting(@type, :bump)
+          @compare_proc = master_builder_._get_default_setting(@type, :compare)
+          @canonicalize_proc = master_builder_._get_default_setting(@type, :canonicalize)
+          @default_value ||= master_builder_._get_default_setting(@type, :value)
+        end
         @ranges = nil
         @default_child = nil
         @children = []
-        ::Blockenspiel.invoke(block_, Schema::FieldBuilder.new(self)) if block_
+        ::Blockenspiel.invoke(block_, Schema::FieldBuilder.new(self, master_builder_)) if block_
         @default_value = canonicalize_value(@default_value)
       end
       
@@ -371,8 +378,9 @@ module Versionomy
       
       include ::Blockenspiel::DSL
       
-      def initialize(field_)  # :nodoc:
+      def initialize(field_, master_builder_)  # :nodoc:
         @field = field_
+        @master_builder = master_builder_
       end
       
       
@@ -474,6 +482,7 @@ module Versionomy
       
       def field(name_, opts_={}, &amp;block_)
         only_ = opts_.delete(:only)
+        opts_.merge!(:master_builder =&gt; @master_builder)
         @field.add_child(Schema::Field.new(name_, opts_, &amp;block_), only_)
       end
       </diff>
      <filename>lib/versionomy/schema/field.rb</filename>
    </modified>
    <modified>
      <diff>@@ -46,7 +46,7 @@ module Versionomy
     # fields. If you provide a block, you must use the methods in
     # Versionomy::Schema::Builder in the block to create the root field.
     
-    def self.create(field_=nil, &amp;block_)
+    def self.create(field_=nil, opts_={}, &amp;block_)
       if field_ &amp;&amp; block_
         raise ::ArgumentError, 'You may provide either a root field or block but not both'
       end
@@ -54,8 +54,11 @@ module Versionomy
         builder_ = Schema::Builder.new
         ::Blockenspiel.invoke(block_, builder_)
         field_ = builder_._get_field
+        modules_ = builder_._get_modules
+      else
+        modules_ = opts_[:modules] || []
       end
-      Schema::Wrapper.new(field_)
+      Schema::Wrapper.new(field_, modules_)
     end
     
     
@@ -68,9 +71,10 @@ module Versionomy
       # This is a low-level method. Usually you should call
       # Versionomy::Schema#create instead.
       
-      def initialize(field_)
+      def initialize(field_, modules_=[])
         @root_field = field_
         @names = @root_field._descendants_by_name
+        @modules = modules_
       end
       
       
@@ -80,7 +84,7 @@ module Versionomy
       
       def eql?(obj_)
         return false unless obj_.kind_of?(Schema::Wrapper)
-        return @root_field == obj_.root_field
+        return @root_field == obj_.root_field &amp;&amp; @modules == obj_.modules
       end
       
       
@@ -121,6 +125,14 @@ module Versionomy
       end
       
       
+      # Returns an array of modules that should be included in values that
+      # use this schema.
+      
+      def modules
+        @modules.dup
+      end
+      
+      
     end
     
     
@@ -133,6 +145,8 @@ module Versionomy
       
       def initialize()  # :nodoc:
         @field = nil
+        @modules = []
+        @defaults = { :integer =&gt; {}, :string =&gt; {}, :symbol =&gt; {} }
       end
       
       
@@ -161,7 +175,34 @@ module Versionomy
         if @field
           raise Errors::RangeOverlapError, &quot;Root field already defined&quot;
         end
-        @field = Schema::Field.new(name_, opts_, &amp;block_)
+        @field = Schema::Field.new(name_, opts_.merge(:master_builder =&gt; self), &amp;block_)
+      end
+      
+      
+      # Add a module to values that use this schema.
+      
+      def add_module(mod_)
+        @modules &lt;&lt; mod_
+      end
+      
+      
+      def to_bump_type(type_, &amp;block_)
+        @defaults[type_][:bump] = block_
+      end
+      
+      
+      def to_compare_type(type_, &amp;block_)
+        @defaults[type_][:compare] = block_
+      end
+      
+      
+      def to_canonicalize_type(type_, &amp;block_)
+        @defaults[type_][:canonicalize] = block_
+      end
+      
+      
+      def default_value_for_type(type_, value_)
+        @defaults[type_][:value] = value_
       end
       
       
@@ -169,6 +210,14 @@ module Versionomy
         @field
       end
       
+      def _get_modules  # :nodoc:
+        @modules
+      end
+      
+      def _get_default_setting(type_, setting_)  # :nodoc:
+        @defaults[type_][setting_]
+      end
+      
     end
     
     </diff>
      <filename>lib/versionomy/schema/wrapper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -68,7 +68,8 @@ module Versionomy
       @unparse_params = unparse_params_
       @field_path = []
       @values = {}
-      field_ = @format.schema.root_field
+      schema_ = @format.schema
+      field_ = schema_.root_field
       while field_
         value_ = values_.kind_of?(Hash) ? values_[field_.name] : values_.shift
         value_ = value_ ? field_.canonicalize_value(value_) : field_.default_value
@@ -76,6 +77,8 @@ module Versionomy
         @values[field_.name] = value_
         field_ = field_.child(value_)
       end
+      modules_ = schema_.modules
+      extend(*modules_) if modules_.size &gt; 0
     end
     
     </diff>
      <filename>lib/versionomy/value.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,7 +37,7 @@
 module Versionomy
   
   # Current gem version, as a frozen string.
-  VERSION_STRING = '0.1.3'.freeze
+  VERSION_STRING = '0.2.0'.freeze
   
   # Current gem version, as a Versionomy::Value.
   VERSION = ::Versionomy.parse(VERSION_STRING, :standard)</diff>
      <filename>lib/versionomy/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -169,6 +169,18 @@ module Versionomy
       end
       
       
+      # Test &quot;prerelase?&quot; custom method
+      
+      def test_prereleasep
+        value_ = Versionomy.create(:major =&gt; 2, :tiny =&gt; 1, :release_type =&gt; :beta, :beta_version =&gt; 3)
+        assert_equal(true, value_.prerelease?)
+        value_ = Versionomy.create(:major =&gt; 2, :tiny =&gt; 1, :release_type =&gt; :final, :patchlevel =&gt; 1)
+        assert_equal(false, value_.prerelease?)
+        value_ = Versionomy.create(:major =&gt; 2, :tiny =&gt; 1)
+        assert_equal(false, value_.prerelease?)
+      end
+      
+      
     end
     
   end</diff>
      <filename>tests/tc_standard_basic.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f839b96d15e91436042adc5b1c686e6b8518dd7e</id>
    </parent>
  </parents>
  <author>
    <name>Daniel Azuma</name>
    <email>dazuma@gmail.com</email>
  </author>
  <url>http://github.com/dazuma/versionomy/commit/42093b5932ea3327a3bb47812b2038e7e4b68523</url>
  <id>42093b5932ea3327a3bb47812b2038e7e4b68523</id>
  <committed-date>2009-11-03T11:51:58-08:00</committed-date>
  <authored-date>2009-11-03T11:51:58-08:00</authored-date>
  <message>Add rubygems format; support adding methods to value objects</message>
  <tree>1541825ae065b33f0f4182dd4776414e3a59138c</tree>
  <committer>
    <name>Daniel Azuma</name>
    <email>dazuma@gmail.com</email>
  </committer>
</commit>
