Permalink
Commits on Jun 17, 2010
  1. @bendiken

    Bumped the version to 0.2.0.

    bendiken committed Jun 17, 2010
  2. @bendiken
  3. @bendiken
Commits on Jun 16, 2010
  1. @bendiken
  2. @bendiken

    Optimized RDF::Repository#has_context? and #each_context in the defau…

    …lt in-memory implementation.
    bendiken committed Jun 16, 2010
  3. @bendiken
  4. @bendiken
  5. @bendiken

    Refactored RDF::Writer for better integration with RDF::Writable; als…

    …o added more YARD type annotations and removed some obsolete methods.
    bendiken committed Jun 16, 2010
  6. @bendiken
  7. @bendiken

    Overloaded the RDF::Writable#<< method to also accept instances of RD…

    …F::Graph and RDF::Enumerable as its argument.
    bendiken committed Jun 16, 2010
  8. @bendiken

    Factored out the append-only bits of RDF::Mutable into RDF::Writable.

    In particular, the #<< and #insert methods are now defined in RDF::Writable instead of RDF::Mutable (though the latter includes everything from the former, of course).
    
    This change benefits stream-oriented classes, such as RDF::Writer, which will want to mix in RDF::Writable but not the rest of RDF::Mutable.
    bendiken committed Jun 16, 2010
  9. @bendiken

    Mixed in RDF::Writable into the RDF::Writer base class (and removed E…

    …numerable; what was that doing in there?).
    bendiken committed Jun 16, 2010
  10. @bendiken
  11. @bendiken
  12. @bendiken
  13. @bendiken
  14. @bendiken

    Bumped the minimum Ruby dependency to 1.8.7 (or 1.8.1 with Backports).

    Note that older Ruby 1.8.x versions are still supported with help of the Backports gem, but it is time to follow the lead of Rails, RDoc, RubyGems, etc, in ceasing to actively prop up Ruby 1.8.6 or yet older versions.
    
    This means it is now permitted and safe to use Ruby 1.8.7+ idioms in the RDF.rb code base (as well as all gems relying on RDF.rb). In particular, note that on 1.8.7+:
    
    * #each_* methods generally return an Enumerator when called without a block.
    * Array#combination, #cycle, #permutation, #shuffle, #sample, #pop(n) and #shift(n) are available.
    * Enumerable#first, #count(x), #none?, #one?, #take, #drop and #reverse_each are available.
    * Enumerator#next and #rewind are available.
    * Integer#even?, #odd? and #ord are available.
    * IO#each_char, #chars, #lines, #bytes, #getbyte and #readbyte are available.
    * Kernel#tap and #__method__ are available.
    * Kernel#instance_exec, Module#module_exec and Module#class_exec are available.
    * String#start_with? and #end_with? are available.
    * String#each_char, #chars, #chr, #lines, #bytes, and #bytesize are available.
    * Symbol#to_proc is available, enabling map(&:to_s) as shorthand for map{|s| s.to_s}.
    bendiken committed Jun 16, 2010
Commits on Jun 15, 2010
  1. @bendiken
  2. @bendiken
  3. @bendiken
  4. @bendiken

    Ensured that enumerators returned from RDF::Graph support the #empty?…

    … and #count methods.
    bendiken committed Jun 15, 2010
  5. @bendiken

    Ensured that enumerators returned from RDF::Enumerable support the #e…

    …mpty? and #count methods.
    bendiken committed Jun 15, 2010
  6. @bendiken
  7. @bendiken

    Factored out the RDF::Enumerable#count and #empty? methods into an RD…

    …F::Countable mixin.
    
    Now that we are as of RDF.rb 0.2.0 generally returning enumerators instead of arrays, we've also inadvertently introduced a bit of a usability problem: enumerables and enumerators don't support the #empty? or #size methods.
    
    This new mixin defines #empty? and #count (and the latter's alias #size) in terms of #each. It can be mixed into any enumerator return value that reasonably enough should also be countable.
    bendiken committed Jun 15, 2010
Commits on Jun 14, 2010
  1. @bendiken
  2. @bendiken
  3. @bendiken

    Cleaned up coding conventions in the specs and added @see references …

    …to RDF::Spec files where appropriate.
    bendiken committed Jun 14, 2010
  4. @bendiken
  5. @bendiken
  6. @bendiken
  7. @bendiken

    Reverted the RDF::Inferable mixin back to basics.

    All of the proposed functionality should go into the RDFS.rb gem, not into RDF.rb. The dependency structure here should be strictly one-way, i.e. RDF.rb should not require RDFS.rb for anything.
    bendiken committed Jun 14, 2010
  8. @bendiken
  9. @bendiken

    Improved the RDF::Util::Aliasing::LateBound mixin.

    Anything that extends this module will obtain an alias_method class method that creates late-bound instance method aliases instead of the default early-bound aliases created by Ruby's standard Module#alias_method.
    
    This is useful because RDF.rb mixins typically alias a number of overridable methods. For example, RDF::Enumerable#count has the aliases #size and #length. Normally if implementing classes were to override the default method, the aliased methods would still be bound to the mixin's original reference implementation rather than the new overridden method. Mixing in this module into the implementing class fixes this problem.
    bendiken committed Jun 14, 2010
  10. @bendiken
  11. @bendiken

    Changed RDF::Enumerable#{statements,triples,quads,subjects,predicates…

    …,objects,contexts} to return enumerators instead of arrays.
    
    Pervasively using enumerators instead of arrays facilitates dealing with larger resultsets, enabling optimizations for both memory usage and (in the case of remote repositories) bandwidth utilization.
    
    If you really need the previous behavior of an array result, you need simply call #to_a on the returned enumerator object.
    bendiken committed Jun 14, 2010