deleted actual book files from example
This commit is contained in:
parent
f54f19eb77
commit
05a92cf774
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -5,8 +5,20 @@ db = couch.database('word-count-example')
|
|||
db.delete! rescue nil
|
||||
db = couch.create_db('word-count-example')
|
||||
|
||||
%w{america.txt da-vinci.txt outline-of-science.txt ulysses.txt}.each do |book|
|
||||
# %w{}.each do |book|
|
||||
books = {
|
||||
'outline-of-science.txt' => 'http://www.gutenberg.org/files/20417/20417.txt',
|
||||
'ulysses.txt' => 'http://www.gutenberg.org/dirs/etext03/ulyss12.txt',
|
||||
'america.txt' => 'http://www.gutenberg.org/files/16960/16960.txt',
|
||||
'da-vinci.txt' => 'http://www.gutenberg.org/dirs/etext04/7ldv110.txt'
|
||||
}
|
||||
|
||||
books.each do |file, url|
|
||||
pathfile = File.join(File.dirname(__FILE__),file)
|
||||
`curl #{url} > #{pathfile}` unless File.exists?(pathfile)
|
||||
end
|
||||
|
||||
|
||||
books.keys.each do |book|
|
||||
title = book.split('.')[0]
|
||||
puts title
|
||||
File.open(File.join(File.dirname(__FILE__),book),'r') do |file|
|
||||
|
|
|
@ -6,7 +6,7 @@ command = ARGV[0]
|
|||
|
||||
if !commands.include?(command)
|
||||
puts <<-USAGE
|
||||
Usage: script/views (pull|push) my-database-name
|
||||
Usage: couchview (pull|push) my-database-name
|
||||
For help on pull and push run script/views (pull|push) without a database name.
|
||||
USAGE
|
||||
exit
|
||||
|
@ -16,7 +16,7 @@ if ARGV.length == 1
|
|||
case command
|
||||
when "pull"
|
||||
puts <<-PULL
|
||||
script/views pull my-database-name
|
||||
couchview pull my-database-name
|
||||
|
||||
I will automagically create a "views" directory in your current working directory if none exists.
|
||||
Then I copy the design documents and views into a directory structure like:
|
||||
|
@ -29,7 +29,7 @@ If your view names don't end in "map" or "reduce" I'll add those suffixes as a p
|
|||
PULL
|
||||
when "push"
|
||||
puts <<-PUSH
|
||||
script/views push my-database-name
|
||||
couchview push my-database-name
|
||||
|
||||
I'll push all the files in your views directory to the specified database. Because CouchDB caches the results of view calculation by function content, there's no performance penalty for duplicating the map function twice, which I'll do if you have a reduce function. This makes it possible to browse the results of just the map, which can be useful for both queries and debugging.
|
||||
|
||||
|
|
Loading…
Reference in a new issue