public
Description: The web app builder for Rails
Homepage: http://hobocentral.net
Clone URL: git://github.com/tablatom/hobo.git
Fixes to doctests
tablatom (author)
Fri Aug 22 05:13:54 -0700 2008
commit  8f49b8ed542e37457c8c1848bcb932912fa31e06
tree    099dee142bbfc88fd13a0af70eeb8976d6fdfe17
parent  91ffd7ceed7622fb78ead70849613da126351b62
...
9
10
11
 
12
13
14
...
9
10
11
12
13
14
15
0
@@ -9,6 +9,7 @@ In order for the API examples to run we need a connection to a database. You can
0
     >> Dependencies.load_paths << '.'
0
     >> Dependencies.mechanism = :require
0
     >> require 'activerecord'
0
+ >> require 'action_controller'
0
     >> require 'hobofields'
0
     >> mysql_database = "hobofields_doctest"
0
     >> system("mysqladmin create #{mysql_database}") or raise "could not create database"
...
2
3
4
5
 
6
7
 
8
9
10
11
12
13
 
14
15
16
...
2
3
4
 
5
6
 
7
8
9
10
11
12
 
13
14
15
16
0
@@ -2,15 +2,15 @@
0
 
0
     >> require 'hobosupport'
0
 
0
-## `Enumerable#search`
0
+## `Enumerable#map_and_find`
0
 
0
-* `enum.search(not_found) { |element| block}`
0
+* `enum.map_and_find(not_found) { |element| block}`
0
 
0
 Iterates through an enumerable passing each element in turn to the block. Returns the first true value returned by the block, or `not_found` if the block never returns a true value.
0
 
0
 E.g. The length of the first word that starts with a capital letter
0
 
0
- >> %w(my name is Fred).search { |s| s.length if s =~ /^[A-Z]/ }
0
+ >> %w(my name is Fred).map_and_find { |s| s.length if s =~ /^[A-Z]/ }
0
     => 4
0
 
0
 ## `Enumerable#map_with_index`

Comments

    No one has commented yet.