Permalink
Browse files

added WEBrick example to doc

  • Loading branch information...
1 parent c274480 commit f80db4fdd30d6f569656fc095a6eaac58f0ba2c1 Irio Irineu Musskopf Junior committed Apr 6, 2012
Showing with 7 additions and 11 deletions.
  1. +0 −7 Gemfile.lock
  2. +3 −1 README.rdoc
  3. +3 −2 app/controllers/bookshelf_controller.rb
  4. +1 −1 config/routes.rb
View
@@ -56,7 +56,6 @@ GEM
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.6.6)
- kgio (2.7.4)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@@ -92,7 +91,6 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
- raindrops (0.8.0)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
@@ -115,10 +113,6 @@ GEM
uglifier (1.2.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
- unicorn (4.2.1)
- kgio (~> 2.6)
- rack
- raindrops (~> 0.7)
PLATFORMS
ruby
@@ -134,4 +128,3 @@ DEPENDENCIES
rails (= 3.2.2)
sass-rails (~> 3.2.3)
uglifier (>= 1.0.3)
- unicorn
View
@@ -7,4 +7,6 @@
For instance:
http://www.skoob.com.br/usuario/10258
- http://127.0.0.1:3000/10258
+ http://127.0.0.1:3000/10258
+
+And wait. 270 books ≈ 20min
@@ -1,3 +1,4 @@
+# encoding: UTF-8
class BookshelfController < ApplicationController
def index
end
@@ -6,14 +7,14 @@ def show
if params[:id]
unless params[:format] == "csv"
- redirect_to controller: "bookshelf", action: "show", format: "csv"
+ redirect_to format: "csv"
return false
end
bookshelf = Bookshelf.new(params[:id])
bookshelf.fetch do |books_count|
- puts "books_count=#{books_count}"
+ puts "#{books_count} books' info saved."
end
response.headers["Content-Type"] = 'text/csv'
View
@@ -1,5 +1,5 @@
Skoob2CSV::Application.routes.draw do
- get '/estante(/:id)' => 'bookshelf#show', as: "show_bookshelf"
+ get '/:id' => 'bookshelf#show', as: "show_bookshelf"
root :to => 'bookshelf#index'
end

0 comments on commit f80db4f

Please sign in to comment.