Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

intial commit copying rubyforge

  • Loading branch information...
commit 158c7b457acbcd09f1580bdb79e441bf8381430b 0 parents
Reg Braithwaite authored
Showing with 8,596 additions and 0 deletions.
  1. +16 −0 History.txt
  2. +26 −0 License.txt
  3. +24 −0 Manifest.txt
  4. +136 −0 README.textile
  5. +4 −0 Rakefile
  6. +70 −0 config/hoe.rb
  7. +17 −0 config/requirements.rb
  8. +114 −0 doc/classes/AndAnd.html
  9. +152 −0 doc/classes/AndAnd/BlankSlate.html
  10. +18 −0 doc/classes/AndAnd/BlankSlate.src/M000007.html
  11. +18 −0 doc/classes/AndAnd/BlankSlate.src/M000008.html
  12. +163 −0 doc/classes/AndAnd/MockReturningMe.html
  13. +19 −0 doc/classes/AndAnd/MockReturningMe.src/M000005.html
  14. +18 −0 doc/classes/AndAnd/MockReturningMe.src/M000006.html
  15. +242 −0 doc/classes/AndAnd/ObjectGoodies.html
  16. +32 −0 doc/classes/AndAnd/ObjectGoodies.src/M000001.html
  17. +26 −0 doc/classes/AndAnd/ObjectGoodies.src/M000002.html
  18. +24 −0 doc/classes/AndAnd/ObjectGoodies.src/M000004.html
  19. +163 −0 doc/classes/AndAnd/ProxyReturningMe.html
  20. +19 −0 doc/classes/AndAnd/ProxyReturningMe.src/M000009.html
  21. +19 −0 doc/classes/AndAnd/ProxyReturningMe.src/M000010.html
  22. +120 −0 doc/classes/Object.html
  23. +1 −0  doc/created.rid
  24. +163 −0 doc/files/History_txt.html
  25. +134 −0 doc/files/License_txt.html
  26. +135 −0 doc/files/README_txt.html
  27. +101 −0 doc/files/lib/andand/version_rb.html
  28. +101 −0 doc/files/lib/andand_rb.html
  29. +374 −0 doc/files/website/index_txt.html
  30. +32 −0 doc/fr_class_index.html
  31. +32 −0 doc/fr_file_index.html
  32. +36 −0 doc/fr_method_index.html
  33. +24 −0 doc/index.html
  34. +208 −0 doc/rdoc-style.css
  35. +148 −0 lib/andand.rb
  36. +9 −0 lib/andand/version.rb
  37. 0  log/debug.log
  38. BIN  pkg/andand-1.3.1.gem
  39. BIN  pkg/andand-1.3.1.tgz
  40. +16 −0 pkg/andand-1.3.1/History.txt
  41. +26 −0 pkg/andand-1.3.1/License.txt
  42. +24 −0 pkg/andand-1.3.1/Manifest.txt
  43. +17 −0 pkg/andand-1.3.1/README.txt
  44. +4 −0 pkg/andand-1.3.1/Rakefile
  45. +70 −0 pkg/andand-1.3.1/config/hoe.rb
  46. +17 −0 pkg/andand-1.3.1/config/requirements.rb
  47. +148 −0 pkg/andand-1.3.1/lib/andand.rb
  48. +9 −0 pkg/andand-1.3.1/lib/andand/version.rb
  49. 0  pkg/andand-1.3.1/log/debug.log
  50. +14 −0 pkg/andand-1.3.1/script/destroy
  51. +14 −0 pkg/andand-1.3.1/script/generate
  52. +74 −0 pkg/andand-1.3.1/script/txt2html
  53. +1,585 −0 pkg/andand-1.3.1/setup.rb
  54. +34 −0 pkg/andand-1.3.1/tasks/deployment.rake
  55. +7 −0 pkg/andand-1.3.1/tasks/environment.rake
  56. +17 −0 pkg/andand-1.3.1/tasks/website.rake
  57. +11 −0 pkg/andand-1.3.1/test/test_andand.rb
  58. +2 −0  pkg/andand-1.3.1/test/test_helper.rb
  59. +230 −0 pkg/andand-1.3.1/website/index.html
  60. +136 −0 pkg/andand-1.3.1/website/index.txt
  61. +285 −0 pkg/andand-1.3.1/website/javascripts/rounded_corners_lite.inc.js
  62. +138 −0 pkg/andand-1.3.1/website/stylesheets/screen.css
  63. +50 −0 pkg/andand-1.3.1/website/template.rhtml
  64. +14 −0 script/destroy
  65. +14 −0 script/generate
  66. +74 −0 script/txt2html
  67. +1,585 −0 setup.rb
  68. +34 −0 tasks/deployment.rake
  69. +7 −0 tasks/environment.rake
  70. +17 −0 tasks/website.rake
  71. +133 −0 test/andand_spec.rb
  72. +11 −0 test/test_andand.rb
  73. +2 −0  test/test_helper.rb
  74. +230 −0 website/index.html
  75. +136 −0 website/index.txt
  76. +285 −0 website/javascripts/rounded_corners_lite.inc.js
  77. +138 −0 website/stylesheets/screen.css
  78. +50 −0 website/template.rhtml
16 History.txt
@@ -0,0 +1,16 @@
+== 1.3.1 2008-07-12
+
+* 1 major enhancement:
+ * Initial release
+* 2 tiny enhancement:
+ * fixed specifications
+* 3 minor enhancement
+ * tap is now a synonym for me
+* 4 minor enhancement
+ * Object#dont
+* 5 bug fix
+ * Plays well with other patch-artists
+* 6 minor enhancement
+ * uses existing BlankSlate class if already defined
+* 7 tiny enhancement
+ * use BasicObject as well
26 License.txt
@@ -0,0 +1,26 @@
+Copyright (c) 2008 Reginald Braithwaite
+http://weblog.raganwald.com/2008/01/objectandand-objectme-in-ruby.html
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Some code adapted from Jim Weirich's post:
+http://onestepback.org/index.cgi/Tech/Ruby/BlankSlate.rdoc
24 Manifest.txt
@@ -0,0 +1,24 @@
+History.txt
+License.txt
+Manifest.txt
+README.txt
+Rakefile
+config/hoe.rb
+config/requirements.rb
+lib/andand.rb
+lib/andand/version.rb
+log/debug.log
+script/destroy
+script/generate
+script/txt2html
+setup.rb
+tasks/deployment.rake
+tasks/environment.rake
+tasks/website.rake
+test/test_andand.rb
+test/test_helper.rb
+website/index.html
+website/index.txt
+website/javascripts/rounded_corners_lite.inc.js
+website/stylesheets/screen.css
+website/template.rhtml
136 README.textile
@@ -0,0 +1,136 @@
+h1. Object#andand
+
+h1. → 'andand'
+
+h2. What
+
+_Object#andand_ lets us write:
+
+<pre syntax="ruby">
+@phone = Location.find(:first, ...elided... ).andand.phone
+</pre>And get a _guarded method invocation_ or _safe navigation method_. This snippet performs a @.find@ on the Location class, then sends @.phone@ to the result _if the result is not nil_. If the result is nil, then the expression returns nil without throwing a NoMethodError.
+
+As Dejan Simic "put it":http://rors.org/2008/3/18/andand:
+
+Why would you want to write this:
+
+<pre syntax="ruby">
+entry.at('description') && entry.at('description').inner_text
+</pre>when you can write this:
+
+<pre syntax="ruby">
+entry.at('description').andand.inner_text
+</pre>Why indeed! As a bonus, install andand and you will also receive an enhanced Object#tap method, _at no extra charge_!
+
+h2. Installing
+
+<pre syntax="ruby">sudo gem install andand</pre>
+
+h2. The basics
+
+h3. Object#andand
+
+Ruby programmers are familiar with the two _guarded assignment_ operators @&&=@ and @||=@. The typical use for them is when you have a variable that might be nil. For example:
+
+<pre syntax="ruby">
+first_name &&= @first_name.trim
+@phone ||= '612-777-9311'
+</pre>You are trimming the first name provided it isn’t nil, and you are assigning ‘612-777-9311’ to the phone if it _is_ nil (or false, but that isn’t important right now). The other day we were discussing the guards and we agreed that we wished there was a _guarded method invocation_ operator. Here’s an example of when you would use it:
+
+<pre syntax="ruby">
+@phone = Location.find(:first, ...elided... )&&.phone
+</pre>Meaning, search the location table for the first record matching some criteria, and if you find a location, get its phone. If you don’t, get nil. (Groovy provides this exact functionality, although Groovy uses @?.@ instead of @&&.@) However, @&&.@ won’t work because @&&.@ is not a real Ruby operator.
+
+Object#andand let&rsquo;s us write:
+
+<pre syntax="ruby">
+@phone = Location.find(:first, ...elided... ).andand.phone
+</pre>And get the same effect as:
+
+<pre syntax="ruby">
+@phone = ->(loc){ loc && loc.phone }.call(Location.find(:first, ...elided... ))
+</pre>Note that because you accept any method using Ruby’s method invocation syntax, you can accept methods with parameters and/or blocks:
+
+<pre syntax="ruby">
+list_of_lists.detect { ...elided... }.andand.inject(42) { ...elided ... }
+</pre>Object#andand emphasizes syntactic regularity: the goal was to make an @&&.@ operation that worked like @&&=@. @&&=@ looks just like normal assignment, you can use any expression on the RHS, only the semantics are different. The andand method also works just like a normal method invocation, only the semantics are modified.
+
+h3. Use andand to simplify your regular expression matching and extraction
+
+Do you ever find yourself wanting to extract a single value from a string using a regular expression? For example, Ruby's Tempfile class creates paths to files that end in .pid.n (where pid is your process id and n is some number). Do you have a path that might be a tempfile and you want to obtain the base name?
+
+Do you currently retrieve the MatchData object, check if it is nil, and get the first matching group if it isn't? How about:
+
+<pre syntax="ruby">
+require 'tempfile'
+path = Tempfile.new('foo.bar').path
+ => "/var/folders/UZ/UZyZsbVPEWqC7tTXrQBYGU+++TI/-Tmp-/foo.bar.1280.0"
+path.match('/([^/]+)\.[0-9]+\.[0-9]+$').andand[1]
+ => "foo.bar"
+</pre>With @.andand[1]@, you extract the group in the regular expression safely: if the expression matches, you get the group. If the expression fails to match, you get nil. Which is what you want, isn't it? The contents of the group if the expression matches? Why should you need more than one line for something so simple?
+
+h3. Enhanced Object#tap
+
+Ruby 1.9 introduces "Object#tap":http://moonbase.rydia.net/mental/blog/programming/eavesdropping-on-expressions. This library implements Object#tap for Ruby 1.8 *and* enhances it. As in Ruby 1.9, you can call @.tap@ with a block:
+
+<pre syntax="ruby">
+ blah.sort.grep( /foo/ ).tap { |xs| p xs }.map { |x| x.blah }
+</pre> But like its sibling @.andand@, you can now call @.tap@ with a method as well:
+
+<pre syntax="ruby">
+ [1, 2, 3, 4, 5].tap.pop.map { |n| n * 2 }
+ => [2, 4, 6, 8]
+</pre>
+
+h3. Doctor, it hurts when I do that
+
+_So don't do that!_
+
+The popular use case for Object#tap is poor man's debugging:
+
+<pre syntax="ruby">
+ blah.sort.grep( /foo/ ).tap { |xs| p xs }.map { |x| x.blah }
+</pre>Perhaps you want to remove the tap, you can delete it:
+
+<pre syntax="ruby">
+ blah.sort.grep( /foo/ ).map { |x| x.blah }
+</pre>Or, you can change it to @.dont@:
+
+<pre syntax="ruby">
+ blah.sort.grep( /foo/ ).dont { |xs| p xs }.map { |x| x.blah }
+</pre>Like @.andand@ and @.tap@, @.dont@ works with arbitrary methods, not just blocks:
+
+<pre syntax="ruby">
+ (1..10).to_a.reverse!
+ => [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
+ (1..10).to_a.dont.reverse!
+ => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+</pre>
+
+h2. A little more background
+
+"Object#andand & Object#me in Ruby":http://weblog.raganwald.com/2008/01/objectandand-objectme-in-ruby.html explains the original motivations, as well as providing links to similar implementations you may want to consider. A few people have pointed out that Object#andand is similar to Haskell's Maybe monad. "The Maybe Monad in Ruby":http://blog.pretheory.com/arch/2008/02/the_maybe_monad_in_ruby.php is a good introduction for Ruby programmers.
+
+h2. That's cool, but&hellip;
+
+No problem, I get that andand isn't exactly what you need. Have a look at the "Invocation Construction Kit":http://ick.rubyforge.org or "Ick." The Ick gem _generalizes_ #andand and #tap: Ick provides four useful ways to block-structure your code, the methods #let, #returning, #inside, and #my. Ick also includes four quasi-monadic invocations, #maybe, #please, #tee, and #fork.
+
+"Ick":http://ick.rubyforge.org provides abstractions for building your own invocations, so you can branch out and build some of your own abstractions with Ick's building blocks.
+
+h2. How to submit patches
+
+Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/.
+
+The trunk repository is @svn://rubyforge.org/var/svn/andand/trunk@ for anonymous access.
+
+h2. License
+
+This code is free to use under the terms of the "MIT license":http://en.wikipedia.org/wiki/MIT_License.
+
+h2. Shout Out
+
+"Mobile Commons":http://mcommons.com/. Huge.
+
+h2. Contact
+
+Comments are welcome. Send an email to "Reginald Braithwaite":mailto:raganwald+rubyforge@gmail.com.
4 Rakefile
@@ -0,0 +1,4 @@
+require 'config/requirements'
+require 'config/hoe' # setup Hoe + all gem configuration
+
+Dir['tasks/**/*.rake'].each { |rake| load rake }
70 config/hoe.rb
@@ -0,0 +1,70 @@
+require 'andand/version'
+
+AUTHOR = 'Reginald Braithwaite' # can also be an array of Authors
+EMAIL = "reg@braythwayt.com"
+DESCRIPTION = "adds guarded method invocation to Ruby"
+GEM_NAME = 'andand' # what ppl will type to install your gem
+RUBYFORGE_PROJECT = 'andand' # The unix name for your project
+HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
+DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
+
+@config_file = "~/.rubyforge/user-config.yml"
+@config = nil
+RUBYFORGE_USERNAME = "raganwald"
+def rubyforge_username
+ unless @config
+ begin
+ @config = YAML.load(File.read(File.expand_path(@config_file)))
+ rescue
+ puts <<-EOS
+ERROR: No rubyforge config file found: #{@config_file}
+Run 'rubyforge setup' to prepare your env for access to Rubyforge
+ - See http://newgem.rubyforge.org/rubyforge.html for more details
+ EOS
+ exit
+ end
+ end
+ RUBYFORGE_USERNAME.replace @config["username"]
+end
+
+
+REV = nil
+# UNCOMMENT IF REQUIRED:
+# REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
+VERS = Andand::VERSION::STRING + (REV ? ".#{REV}" : "")
+RDOC_OPTS = ['--quiet', '--title', 'andand documentation',
+ "--opname", "index.html",
+ "--line-numbers",
+ "--main", "README",
+ "--inline-source"]
+
+class Hoe
+ def extra_deps
+ @extra_deps.reject! { |x| Array(x).first == 'hoe' }
+ @extra_deps
+ end
+end
+
+# Generate all the Rake tasks
+# Run 'rake -T' to see list of generated tasks (from gem root directory)
+hoe = Hoe.new(GEM_NAME, VERS) do |p|
+ p.developer(AUTHOR, EMAIL)
+ p.description = DESCRIPTION
+ p.summary = DESCRIPTION
+ p.url = HOMEPATH
+ p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
+ p.test_globs = ["test/**/test_*.rb"]
+ p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
+
+ # == Optional
+ p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
+ #p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
+
+ #p.spec_extras = {} # A hash of extra values to set in the gemspec.
+
+end
+
+CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
+PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
+hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
+hoe.rsync_args = '-av --delete --ignore-errors'
17 config/requirements.rb
@@ -0,0 +1,17 @@
+require 'fileutils'
+include FileUtils
+
+require 'rubygems'
+%w[rake hoe newgem rubigen].each do |req_gem|
+ begin
+ require req_gem
+ rescue LoadError
+ puts "This Rakefile requires the '#{req_gem}' RubyGem."
+ puts "Installation: gem install #{req_gem} -y"
+ exit
+ end
+end
+
+$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
+
+require 'andand'
114 doc/classes/AndAnd.html
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Module: AndAnd</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Module</strong></td>
+ <td class="class-name-in-header">AndAnd</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../files/lib/andand_rb.html">
+ lib/andand.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+ <div id="class-list">
+ <h3 class="section-bar">Classes and Modules</h3>
+
+ Module <a href="AndAnd/ObjectGoodies.html" class="link">AndAnd::ObjectGoodies</a><br />
+Class <a href="AndAnd/BlankSlate.html" class="link">AndAnd::BlankSlate</a><br />
+Class <a href="AndAnd/MockReturningMe.html" class="link">AndAnd::MockReturningMe</a><br />
+Class <a href="AndAnd/ProxyReturningMe.html" class="link">AndAnd::ProxyReturningMe</a><br />
+
+ </div>
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
152 doc/classes/AndAnd/BlankSlate.html
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Class: AndAnd::BlankSlate</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Class</strong></td>
+ <td class="class-name-in-header">AndAnd::BlankSlate</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../../files/lib/andand_rb.html">
+ lib/andand.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ <tr class="top-aligned-row">
+ <td><strong>Parent:</strong></td>
+ <td>
+ BasicObject
+ </td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+
+
+ </div>
+
+ <div id="method-list">
+ <h3 class="section-bar">Methods</h3>
+
+ <div class="name-list">
+ <a href="#M000008">new</a>&nbsp;&nbsp;
+ <a href="#M000007">wipe</a>&nbsp;&nbsp;
+ </div>
+ </div>
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+ <div id="methods">
+ <h3 class="section-bar">Public Class methods</h3>
+
+ <div id="method-M000008" class="method-detail">
+ <a name="M000008"></a>
+
+ <div class="method-heading">
+ <a href="BlankSlate.src/M000008.html" target="Code" class="method-signature"
+ onclick="popupCode('BlankSlate.src/M000008.html');return false;">
+ <span class="method-name">new</span><span class="method-args">()</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ </div>
+ </div>
+
+ <div id="method-M000007" class="method-detail">
+ <a name="M000007"></a>
+
+ <div class="method-heading">
+ <a href="BlankSlate.src/M000007.html" target="Code" class="method-signature"
+ onclick="popupCode('BlankSlate.src/M000007.html');return false;">
+ <span class="method-name">wipe</span><span class="method-args">()</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ </div>
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
18 doc/classes/AndAnd/BlankSlate.src/M000007.html
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>wipe (AndAnd::BlankSlate)</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+ <pre><span class="ruby-comment cmt"># File lib/andand.rb, line 110</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">wipe</span>
+ <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">m</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^__/</span> }.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">undef_method</span> <span class="ruby-identifier">m</span> }
+ <span class="ruby-keyword kw">end</span></pre>
+</body>
+</html>
18 doc/classes/AndAnd/BlankSlate.src/M000008.html
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>new (AndAnd::BlankSlate)</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+ <pre><span class="ruby-comment cmt"># File lib/andand.rb, line 113</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
+ <span class="ruby-constant">BlankSlate</span>.<span class="ruby-identifier">wipe</span>
+ <span class="ruby-keyword kw">end</span></pre>
+</body>
+</html>
163 doc/classes/AndAnd/MockReturningMe.html
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Class: AndAnd::MockReturningMe</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Class</strong></td>
+ <td class="class-name-in-header">AndAnd::MockReturningMe</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../../files/lib/andand_rb.html">
+ lib/andand.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ <tr class="top-aligned-row">
+ <td><strong>Parent:</strong></td>
+ <td>
+ <a href="BlankSlate.html">
+ BlankSlate
+ </a>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+A proxy that returns its target without invoking the method you invoke.
+Useful for nil.andand and dont
+</p>
+
+ </div>
+
+
+ </div>
+
+ <div id="method-list">
+ <h3 class="section-bar">Methods</h3>
+
+ <div class="name-list">
+ <a href="#M000006">method_missing</a>&nbsp;&nbsp;
+ <a href="#M000005">new</a>&nbsp;&nbsp;
+ </div>
+ </div>
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+ <div id="methods">
+ <h3 class="section-bar">Public Class methods</h3>
+
+ <div id="method-M000005" class="method-detail">
+ <a name="M000005"></a>
+
+ <div class="method-heading">
+ <a href="MockReturningMe.src/M000005.html" target="Code" class="method-signature"
+ onclick="popupCode('MockReturningMe.src/M000005.html');return false;">
+ <span class="method-name">new</span><span class="method-args">(me)</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ </div>
+ </div>
+
+ <h3 class="section-bar">Public Instance methods</h3>
+
+ <div id="method-M000006" class="method-detail">
+ <a name="M000006"></a>
+
+ <div class="method-heading">
+ <a href="MockReturningMe.src/M000006.html" target="Code" class="method-signature"
+ onclick="popupCode('MockReturningMe.src/M000006.html');return false;">
+ <span class="method-name">method_missing</span><span class="method-args">(*args)</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ </div>
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
19 doc/classes/AndAnd/MockReturningMe.src/M000005.html
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>new (AndAnd::MockReturningMe)</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+ <pre><span class="ruby-comment cmt"># File lib/andand.rb, line 126</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">me</span>)
+ <span class="ruby-keyword kw">super</span>()
+ <span class="ruby-ivar">@me</span> = <span class="ruby-identifier">me</span>
+ <span class="ruby-keyword kw">end</span></pre>
+</body>
+</html>
18 doc/classes/AndAnd/MockReturningMe.src/M000006.html
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>method_missing (AndAnd::MockReturningMe)</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+ <pre><span class="ruby-comment cmt"># File lib/andand.rb, line 130</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
+ <span class="ruby-ivar">@me</span>
+ <span class="ruby-keyword kw">end</span></pre>
+</body>
+</html>
242 doc/classes/AndAnd/ObjectGoodies.html
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Module: AndAnd::ObjectGoodies</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Module</strong></td>
+ <td class="class-name-in-header">AndAnd::ObjectGoodies</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../../files/lib/andand_rb.html">
+ lib/andand.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+This module is included in <a href="../Object.html">Object</a>, so each of
+these methods are added to <a href="../Object.html">Object</a> when you
+require &#8216;<a href="ObjectGoodies.html#M000001">andand</a>&#8217;. Each
+method is an <b>adverb</b>: they are intended to be enchained with another
+method, such as receiver.adverb.method
+</p>
+<p>
+The purpose of an adverb is to modify what the primary method returns.
+</p>
+<p>
+Adverbs also take blocks or procs, passing the receiver as an argument to
+the block or proc. They retain the same semantics with a block or proc as
+they do with a method. This behaviour weakly resembles a monad.
+</p>
+
+ </div>
+
+
+ </div>
+
+ <div id="method-list">
+ <h3 class="section-bar">Methods</h3>
+
+ <div class="name-list">
+ <a href="#M000001">andand</a>&nbsp;&nbsp;
+ <a href="#M000004">dont</a>&nbsp;&nbsp;
+ <a href="#M000002">me</a>&nbsp;&nbsp;
+ <a href="#M000003">tap</a>&nbsp;&nbsp;
+ </div>
+ </div>
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+ <div id="methods">
+ <h3 class="section-bar">Public Instance methods</h3>
+
+ <div id="method-M000001" class="method-detail">
+ <a name="M000001"></a>
+
+ <div class="method-heading">
+ <a href="ObjectGoodies.src/M000001.html" target="Code" class="method-signature"
+ onclick="popupCode('ObjectGoodies.src/M000001.html');return false;">
+ <span class="method-name">andand</span><span class="method-args">(p = nil) {|self| ...}</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+Returns nil if its receiver is nil, regardless of whether nil actually
+handles the actual method ot what it might return.
+</p>
+<pre>
+ 'foo'.andand.size =&gt; 3
+ nil.andand.size =&gt; nil
+ 'foo'.andand { |s| s &lt;&lt; 'bar' } =&gt; 'foobar'
+ nil.andand { |s| s &lt;&lt; 'bar' } =&gt; nil
+</pre>
+ </div>
+ </div>
+
+ <div id="method-M000004" class="method-detail">
+ <a name="M000004"></a>
+
+ <div class="method-heading">
+ <a href="ObjectGoodies.src/M000004.html" target="Code" class="method-signature"
+ onclick="popupCode('ObjectGoodies.src/M000004.html');return false;">
+ <span class="method-name">dont</span><span class="method-args">(p = nil)</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+Does not invoke the method or block and returns the receiver. Useful for
+comemnting stuff out, especially if you are using <a
+href="ObjectGoodies.html#M000002">me</a> for debugging purposes: change the
+.<a href="ObjectGoodies.html#M000002">me</a> to .<a
+href="ObjectGoodies.html#M000004">dont</a> and the semantics of your
+program are unchanged.
+</p>
+<pre>
+ [1, 2, 3, 4, 5].me { |x| p x }
+ =&gt; prints and returns the array
+ [1, 2, 3, 4, 5].dont { |x| p x }
+ =&gt; returns the array without printing it
+</pre>
+ </div>
+ </div>
+
+ <div id="method-M000002" class="method-detail">
+ <a name="M000002"></a>
+
+ <div class="method-heading">
+ <a href="ObjectGoodies.src/M000002.html" target="Code" class="method-signature"
+ onclick="popupCode('ObjectGoodies.src/M000002.html');return false;">
+ <span class="method-name">me</span><span class="method-args">(p = nil) {|self| ...}</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+Invokes the method and returns the receiver if nothing is raised.
+Therefore, the purpose of calling the method is strictly for side effects.
+In the block form, it resembles <a
+href="ObjectGoodies.html#M000003">tap</a> from Ruby 1.9, and is useful for
+debugging. It also resembles returning from Rails, with slightly different
+syntax.
+</p>
+<pre>
+ Object.new.me do |o|
+ def o.foo
+ 'foo'
+ end
+ end
+ =&gt; your new object
+</pre>
+<p>
+In the method form, it is handy for chaining methods that don&#8216;t
+ordinarily return the receiver:
+</p>
+<pre>
+ [1, 2, 3, 4, 5].me.pop.reverse
+ =&gt; [4, 3, 2, 1]
+</pre>
+ </div>
+ </div>
+
+ <div id="method-M000003" class="method-detail">
+ <a name="M000003"></a>
+
+ <div class="method-heading">
+ <span class="method-name">tap</span><span class="method-args">(p = nil)</span>
+ </div>
+
+ <div class="method-description">
+ <p>
+Alias for <a href="ObjectGoodies.html#M000002">me</a>
+</p>
+ </div>
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
32 doc/classes/AndAnd/ObjectGoodies.src/M000001.html
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>andand (AndAnd::ObjectGoodies)</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+ <pre><span class="ruby-comment cmt"># File lib/andand.rb, line 23</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">andand</span> (<span class="ruby-identifier">p</span> = <span class="ruby-keyword kw">nil</span>)
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>)
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">p</span>
+ <span class="ruby-identifier">p</span>.<span class="ruby-identifier">to_proc</span>.<span class="ruby-identifier">call</span>(<span class="ruby-keyword kw">self</span>)
+ <span class="ruby-keyword kw">else</span>
+ <span class="ruby-keyword kw">self</span>
+ <span class="ruby-keyword kw">end</span>
+ <span class="ruby-keyword kw">else</span>
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">p</span>
+ <span class="ruby-keyword kw">self</span>
+ <span class="ruby-keyword kw">else</span>
+ <span class="ruby-constant">MockReturningMe</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
+ <span class="ruby-keyword kw">end</span>
+ <span class="ruby-keyword kw">end</span>
+ <span class="ruby-keyword kw">end</span></pre>
+</body>
+</html>
26 doc/classes/AndAnd/ObjectGoodies.src/M000002.html
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>me (AndAnd::ObjectGoodies)</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+ <pre><span class="ruby-comment cmt"># File lib/andand.rb, line 58</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">me</span> (<span class="ruby-identifier">p</span> = <span class="ruby-keyword kw">nil</span>)
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>)
+ <span class="ruby-keyword kw">self</span>
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">p</span>
+ <span class="ruby-identifier">p</span>.<span class="ruby-identifier">to_proc</span>.<span class="ruby-identifier">call</span>(<span class="ruby-keyword kw">self</span>)
+ <span class="ruby-keyword kw">self</span>
+ <span class="ruby-keyword kw">else</span>
+ <span class="ruby-constant">ProxyReturningMe</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
+ <span class="ruby-keyword kw">end</span>
+ <span class="ruby-keyword kw">end</span></pre>
+</body>
+</html>
24 doc/classes/AndAnd/ObjectGoodies.src/M000004.html
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>dont (AndAnd::ObjectGoodies)</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+ <pre><span class="ruby-comment cmt"># File lib/andand.rb, line 83</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dont</span> (<span class="ruby-identifier">p</span> = <span class="ruby-keyword kw">nil</span>)
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+ <span class="ruby-keyword kw">self</span>
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">p</span>
+ <span class="ruby-keyword kw">self</span>
+ <span class="ruby-keyword kw">else</span>
+ <span class="ruby-constant">MockReturningMe</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
+ <span class="ruby-keyword kw">end</span>
+ <span class="ruby-keyword kw">end</span></pre>
+</body>
+</html>
163 doc/classes/AndAnd/ProxyReturningMe.html
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Class: AndAnd::ProxyReturningMe</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Class</strong></td>
+ <td class="class-name-in-header">AndAnd::ProxyReturningMe</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../../files/lib/andand_rb.html">
+ lib/andand.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ <tr class="top-aligned-row">
+ <td><strong>Parent:</strong></td>
+ <td>
+ <a href="BlankSlate.html">
+ BlankSlate
+ </a>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+A proxy that returns its target after invoking the method you invoke.
+Useful for me
+</p>
+
+ </div>
+
+
+ </div>
+
+ <div id="method-list">
+ <h3 class="section-bar">Methods</h3>
+
+ <div class="name-list">
+ <a href="#M000010">method_missing</a>&nbsp;&nbsp;
+ <a href="#M000009">new</a>&nbsp;&nbsp;
+ </div>
+ </div>
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+ <div id="methods">
+ <h3 class="section-bar">Public Class methods</h3>
+
+ <div id="method-M000009" class="method-detail">
+ <a name="M000009"></a>
+
+ <div class="method-heading">
+ <a href="ProxyReturningMe.src/M000009.html" target="Code" class="method-signature"
+ onclick="popupCode('ProxyReturningMe.src/M000009.html');return false;">
+ <span class="method-name">new</span><span class="method-args">(me)</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ </div>
+ </div>
+
+ <h3 class="section-bar">Public Instance methods</h3>
+
+ <div id="method-M000010" class="method-detail">
+ <a name="M000010"></a>
+
+ <div class="method-heading">
+ <a href="ProxyReturningMe.src/M000010.html" target="Code" class="method-signature"
+ onclick="popupCode('ProxyReturningMe.src/M000010.html');return false;">
+ <span class="method-name">method_missing</span><span class="method-args">(sym, *args, &amp;block)</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ </div>
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
19 doc/classes/AndAnd/ProxyReturningMe.src/M000009.html
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>new (AndAnd::ProxyReturningMe)</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+ <pre><span class="ruby-comment cmt"># File lib/andand.rb, line 138</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">me</span>)
+ <span class="ruby-keyword kw">super</span>()
+ <span class="ruby-ivar">@me</span> = <span class="ruby-identifier">me</span>
+ <span class="ruby-keyword kw">end</span></pre>
+</body>
+</html>
19 doc/classes/AndAnd/ProxyReturningMe.src/M000010.html
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+ <title>method_missing (AndAnd::ProxyReturningMe)</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+</head>
+<body class="standalone-code">
+ <pre><span class="ruby-comment cmt"># File lib/andand.rb, line 142</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+ <span class="ruby-ivar">@me</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+ <span class="ruby-ivar">@me</span>
+ <span class="ruby-keyword kw">end</span></pre>
+</body>
+</html>
120 doc/classes/Object.html
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Class: Object</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Class</strong></td>
+ <td class="class-name-in-header">Object</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../files/lib/andand_rb.html">
+ lib/andand.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ <tr class="top-aligned-row">
+ <td><strong>Parent:</strong></td>
+ <td>
+ <a href="Object.html">
+ Object
+ </a>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+ <div id="includes">
+ <h3 class="section-bar">Included Modules</h3>
+
+ <div id="includes-list">
+ <span class="include-name"><a href="AndAnd/ObjectGoodies.html">AndAnd::ObjectGoodies</a></span>
+ </div>
+ </div>
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
1  doc/created.rid
@@ -0,0 +1 @@
+Sun, 13 Jul 2008 00:34:44 -0400
163 doc/files/History_txt.html
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: History.txt</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>History.txt</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>History.txt
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Sun Jul 13 00:34:14 -0400 2008</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <h2>1.3.1 2008-07-12</h2>
+<ul>
+<li>1 major enhancement:
+
+<ul>
+<li>Initial release
+
+</li>
+</ul>
+</li>
+<li>2 tiny enhancement:
+
+<ul>
+<li>fixed specifications
+
+</li>
+</ul>
+</li>
+<li>3 minor enhancement
+
+<ul>
+<li>tap is now a synonym for me
+
+</li>
+</ul>
+</li>
+<li>4 minor enhancement
+
+<ul>
+<li>Object#dont
+
+</li>
+</ul>
+</li>
+<li>5 bug fix
+
+<ul>
+<li>Plays well with other patch-artists
+
+</li>
+</ul>
+</li>
+<li>6 minor enhancement
+
+<ul>
+<li>uses existing BlankSlate class if already defined
+
+</li>
+</ul>
+</li>
+<li>7 tiny enhancement
+
+<ul>
+<li>use BasicObject as well
+
+</li>
+</ul>
+</li>
+</ul>
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
134 doc/files/License_txt.html
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: License.txt</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>License.txt</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>License.txt
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Sun Feb 03 13:07:10 -0500 2008</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+Copyright (c) 2008 Reginald Braithwaite <a
+href="http://weblog.raganwald.com/2008/01/objectandand-objectme-in-ruby.html">weblog.raganwald.com/2008/01/objectandand-objectme-in-ruby.html</a>
+</p>
+<p>
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+&quot;Software&quot;), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to the
+following conditions:
+</p>
+<p>
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+</p>
+<p>
+THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+</p>
+<p>
+Some code adapted from Jim Weirich&#8216;s post: <a
+href="http://onestepback.org/index.cgi/Tech/Ruby/BlankSlate.rdoc">onestepback.org/index.cgi/Tech/Ruby/BlankSlate.rdoc</a>
+</p>
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
135 doc/files/README_txt.html
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: README.txt</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>README.txt</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>README.txt
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Sun Feb 03 13:07:21 -0500 2008</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+README
+</p>
+<p>
+andand is a method that provides _guarded method invocation_, analagous to
+the &amp;&amp; operator in Ruby, and especially &amp;&amp;=.
+</p>
+<p>
+For example:
+</p>
+<p>
+Instead of phone &amp;&amp; phone = phone.trim, Ruby lets you say phone
+&amp;&amp;= phone.trim. So with andand, instead of:
+</p>
+<p>
+phone &amp;&amp; phone.call
+</p>
+<p>
+We can write:
+</p>
+<p>
+phone.andand.call (A poor man&#8216;s attempt to write
+phone&amp;&amp;.call)
+</p>
+<p>
+See:
+</p>
+<p>
+<a
+href="http://weblog.raganwald.com/2008/01/objectandand-objectme-in-ruby.html">weblog.raganwald.com/2008/01/objectandand-objectme-in-ruby.html</a>
+</p>
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
101 doc/files/lib/andand/version_rb.html
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: version.rb</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>version.rb</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>lib/andand/version.rb
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Sun Jul 13 00:34:17 -0400 2008</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
101 doc/files/lib/andand_rb.html
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: andand.rb</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>andand.rb</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>lib/andand.rb
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Sun Jul 13 00:27:13 -0400 2008</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
374 doc/files/website/index_txt.html
@@ -0,0 +1,374 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: index.txt</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>index.txt</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>website/index.txt
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Sat Jul 12 23:56:15 -0400 2008</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+h1. Object#andand
+</p>
+<p>
+h1. &amp;x2192; &#8216;andand&#8216;
+</p>
+<p>
+h2. What
+</p>
+<p>
+_Object#andand_ lets us write:
+</p>
+<p>
+&lt;pre syntax=&quot;ruby&quot;&gt; @phone = Location.find(:first,
+&#8230;elided&#8230; ).andand.phone &lt;/pre&gt;And get a _guarded method
+invocation_ or _safe navigation method_. This snippet performs a @.find@ on
+the Location class, then sends @.phone@ to the result _if the result is not
+nil_. If the result is nil, then the expression returns nil without
+throwing a NoMethodError.
+</p>
+<p>
+As Dejan Simic &quot;put it&quot;:<a
+href="http://rors.org/2008/3/18/andand">rors.org/2008/3/18/andand</a>:
+</p>
+<p>
+Why would you want to write this:
+</p>
+<p>
+&lt;pre syntax=&quot;ruby&quot;&gt; entry.at(&#8216;description&#8217;)
+&amp;&amp; entry.at(&#8216;description&#8217;).inner_text &lt;/pre&gt;when
+you can write this:
+</p>
+<p>
+&lt;pre syntax=&quot;ruby&quot;&gt;
+entry.at(&#8216;description&#8217;).andand.inner_text &lt;/pre&gt;Why
+indeed! As a bonus, install andand and you will also receive an enhanced
+Object#tap method, _at no extra charge_!
+</p>
+<p>
+h2. Installing
+</p>
+<p>
+&lt;pre syntax=&quot;ruby&quot;&gt;sudo gem install andand&lt;/pre&gt;
+</p>
+<p>
+h2. The basics
+</p>
+<p>
+h3. Object#andand
+</p>
+<p>
+Ruby programmers are familiar with the two _guarded assignment_ operators
+@&amp;&amp;=@ and @||=@. The typical use for them is when you have a
+variable that might be nil. For example:
+</p>
+<p>
+&lt;pre syntax=&quot;ruby&quot;&gt; first_name &amp;&amp;= @first_name.trim
+@phone ||= &#8216;612-777-9311&#8217; &lt;/pre&gt;You are trimming the
+first name provided it isn’t nil, and you are assigning
+‘612-777-9311’ to the phone if it <em>is</em> nil (or false, but that
+isn’t important right now). The other day we were discussing the guards
+and we agreed that we wished there was a _guarded method invocation_
+operator. Here’s an example of when you would use it:
+</p>
+<p>
+&lt;pre syntax=&quot;ruby&quot;&gt; @phone = Location.find(:first,
+&#8230;elided&#8230; )&amp;&amp;.phone &lt;/pre&gt;Meaning, search the
+location table for the first record matching some criteria, and if you find
+a location, get its phone. If you don’t, get nil. (Groovy provides this
+exact functionality, although Groovy uses @?.@ instead of @&amp;&amp;.@)
+However, @&amp;&amp;.@ won’t work because @&amp;&amp;.@ is not a real
+Ruby operator.
+</p>
+<p>
+Object#andand let&amp;rsquo;s us write:
+</p>
+<p>
+&lt;pre syntax=&quot;ruby&quot;&gt; @phone = Location.find(:first,
+&#8230;elided&#8230; ).andand.phone &lt;/pre&gt;And get the same effect as:
+</p>
+<p>
+&lt;pre syntax=&quot;ruby&quot;&gt; @phone = -&gt;(loc){ loc &amp;&amp;
+loc.phone }.call(Location.find(:first, &#8230;elided&#8230; ))
+&lt;/pre&gt;Note that because you accept any method using Ruby’s method
+invocation syntax, you can accept methods with parameters and/or blocks:
+</p>
+<p>
+&lt;pre syntax=&quot;ruby&quot;&gt; list_of_lists.detect {
+&#8230;elided&#8230; }.andand.inject(42) { &#8230;elided &#8230; }
+&lt;/pre&gt;Object#andand emphasizes syntactic regularity: the goal was to
+make an @&amp;&amp;.@ operation that worked like @&amp;&amp;=@.
+@&amp;&amp;=@ looks just like normal assignment, you can use any expression
+on the RHS, only the semantics are different. The andand method also works
+just like a normal method invocation, only the semantics are modified.
+</p>
+<p>
+h3. Use andand to simplify your regular expression matching and extraction
+</p>
+<p>
+Do you ever find yourself wanting to extract a single value from a string
+using a regular expression? For example, Ruby&#8216;s Tempfile class
+creates paths to files that end in .pid.n (where pid is your process id and
+n is some number). Do you have a path that might be a tempfile and you want
+to obtain the base name?
+</p>
+<p>
+Do you currently retrieve the MatchData object, check if it is nil, and get
+the first matching group if it isn&#8216;t? How about:
+</p>
+<p>
+&lt;pre syntax=&quot;ruby&quot;&gt; require &#8216;tempfile&#8217; path =
+Tempfile.new(&#8216;foo.bar&#8217;).path