GithubHelp home page GithubHelp logo

sinatra / sinatra-book Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cschneid/sinatra-book

673.0 35.0 163.0 21.55 MB

Tutorial + Cookbook

Home Page: http://sinatra-org-book.herokuapp.com/

Ruby 64.33% CSS 35.67%

sinatra-book's People

Contributors

bmizerany avatar bryanwoods avatar burningtyger avatar cschneid avatar csiszarattila avatar cypher avatar foca avatar gruner avatar hayley avatar jdp avatar jeffharrington avatar johnisom avatar karmi avatar kathgironpe avatar kgrz avatar locks avatar lucasjosh avatar mark24code avatar namelessjon avatar nanodeath avatar olleolleolle avatar rkh avatar rtomayko avatar snyff avatar sr avatar syd avatar taylorrf avatar tedlee avatar vikhyat avatar zzak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sinatra-book's Issues

Caching: rack-cache

handle caching various parts of application, including sessions, using some of rack-cache store options. Such as dalli.

Error installing wkhtmltopdf-binary

I use OS X version 10.9 and ruby 2.0.0p247

Error after trying bundle

 NoMethodError: undefined method `size' for nil:NilClass
 An error occurred while installing wkhtmltopdf-binary (0.9.9.1), and Bundler     cannot continue.
  Make sure that `gem install wkhtmltopdf-binary -v '0.9.9.1'` succeeds before   bundling.

View page

This is a very small issue, so I didn't want to fork this repo and submit a pull. The tutorial at http://sinatra-book.gittr.com/ says "Finally, the view at ./view/index.html:" in the "models" section. I believe the view subsequently shown should be stored at ./view/index.erb instead.

QSslSocket: cannot resolve SSLv2_client_method

i'm on Ubuntu 12.04 and ruby 2.1.0

I'm trying to build the sinatra book. I'am already following step on README.md. but, its show me error about QSsslSocket.

this is my error-trace:

2.1.0 in sinatra-book.gittr.com/ on master 
› bundle install        
Using rake (0.9.2.2)
Using pdfkit (0.5.2)
Using rack (1.4.1)
Using rack-protection (1.2.0)
Using redcarpet (2.1.1)
Using tilt (1.3.3)
Using sinatra (1.3.3)
Using wkhtmltopdf-binary (0.9.9.1)
Using bundler (1.5.0)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

2.1.0 in sinatra-book.gittr.com/ on master 
› bundle exec rake book:build
QSslSocket: cannot resolve SSLv2_client_method
QSslSocket: cannot resolve SSLv2_server_method
QSslSocket: cannot resolve SSLv2_client_method
QSslSocket: cannot resolve SSLv2_server_method

thankyou 👍

update:
i tried on Ruby 1.9.4-p448 too. raise the same QSslSocket error.

Dreamhost deployment

A fellow came into #sinatra today and also posted their question on the mailinglist

He managed to solve the problem by modifying ENV and using Sinatra 1.0, I guess because tilt 1.1 is not working so well with dreamhost.

I hope to use their example to update the dreamhost documentation of the book so that others with the same problem can follow suit.

thor book:build pdf doesn't work

The '#' symbol gets unescaped in the produced .tex file thus causing an error: 'You can't use `macro parameter character #' in horizontal mode.'

http://sinatra-book.gittr.com link broken

The link to the rendered book doesn't have a DNS entry. I get:

The server at sinatra-book.gittr.com can't be found, because the DNS lookup failed. DNS is 
the network service that translates a website's name to its Internet address. This error is 
most often caused by having no connection to the Internet or a misconfigured network. It can
 also be caused by an unresponsive DNS server or a firewall preventing Google Chrome
from accessing the network.

Error code: ERR_NAME_NOT_RESOLVED

Testing

  • Howto to integrate each major testing framework
    • rspec
    • test::unit
    • cucumber

Use selenium / capybara to run real browser tests

Models chapter

Would like to expand on the models chapter to cover the following subjects:

  • Mongo (mongomapper, etc)
  • Redis (ohm, resque, etc)
  • delayed_job
  • Riak (ripple)
  • Memcached (dalli, etc)

Any other suggestions / help here is, as always, much appreciated!

Authentication

One of the questions that come up most on IRC is how to do user authentication. I think this should be covered (at least partially).

Organizing your application

This will be a new chapter covering some extensions and common conventions for organizing a sinatra application. Included is Issue #28.

The book doesn't build

I get this error when I try building the book in any format
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.

.bundle/config file content

Do we really need this .bundle/config in repo? Because bundle install on OS X tries to install all required gems to /usr/local/ruby (which is not available on OS X by default) instead of /Library/Ruby/Gems/*?

cd .bundle/
mv config config.weird
fixes the issue

Full report below:

  • What did you do?

    I ran the command /usr/local/bin/bundle install

  • What did you expect to happen?

    I expected Bundler to output following:
    Using rake 0.9.2.2
    Using pdfkit 0.5.2
    Using rack 1.4.1
    Using rack-protection 1.2.0
    Using redcarpet 2.1.1
    Using tilt 1.3.3
    Using sinatra 1.3.3
    Using wkhtmltopdf-binary 0.9.9.1
    Using bundler 1.10.6
    Bundle complete! 5 Gemfile dependencies, 9 gems now installed.
    Use bundle show [gemname] to see where a bundled gem is installed.

  • What happened instead?

    Instead, what actually happened was...

Error details

Errno::EACCES: Permission denied - /usr/local/ruby
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in mkdir_p'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `each'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler.rb:308:in `mkdir_p'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/installer.rb:278:in `create_bundle_path'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/installer.rb:54:in `run'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/installer.rb:18:in `install'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/cli/install.rb:107:in `run'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/cli.rb:162:in `install'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/cli.rb:10:in `start'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/bin/bundle:20:in `block in <top (required)>'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/bin/bundle:18:in `<top (required)>'
  /usr/local/bin/bundle:23:in `load'
  /usr/local/bin/bundle:23:in `<main>'

Environment

Bundler   1.10.6
Rubygems  2.4.8
Ruby      2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]
GEM_HOME  /usr/local/ruby/2.0.0
GEM_PATH  
Git       2.3.8 (Apple Git-58)

Bundler settings

gem.coc
  Set for the current user (/Users/niemda/.bundle/config): "true"
gem.mit
  Set for the current user (/Users/niemda/.bundle/config): "false"
path
  Set for your local app (/Users/niemda/git/sinatra-book/.bundle/config): "/usr/local"
disable_shared_gems
  Set for your local app (/Users/niemda/git/sinatra-book/.bundle/config): "1"

--- TEMPLATE END ----------------------------------------------------------------

Unfortunately, an unexpected error occurred, and Bundler cannot continue.

Hudson Continuous Integration

A section on Hudson would be great, though not sure if it should go in the "Development Techniques" chapter or "Deployment" chapter.

Cover Autotest

A section on autotest would be a good addition to the "Development Techniques" chapter

redundancy

Now that we have sinatra 1.1 and more people get aware of sinatra I can see a lot of redundancy between the sinatra readme and the sinatra book. Why not merge the two and keep the readme at a bare minimum?

Can't build book from rake

I'm unable to get the book to build on Linux (Chakra) or OSX (Mountain Lion). Here's the error on OSX (same on Linux, actually):

hinmn-air:sinatra-book hinmn$ bundle exec rake book:build
sh: /Users/hinmn/Development/BooksCode/SinatraBook/sinatra-book/vendor/wkhtmltopdf: cannot execute binary file
rake aborted!
command failed: "/Users/hinmn/Development/BooksCode/SinatraBook/sinatra-book/vendor/wkhtmltopdf" "--page-size" "Letter" "--margin-top" "0.75in" "--margin-right" "0.75in" "--margin-bottom" "0.75in" "--margin-left" "0.75in" "--encoding" "UTF-8" "--quiet" "-" "-"

Tasks: TOP => book:build
(See full trace by running task with --trace)

I looked through the previous issues but the other failed book builds seemed to be solved. Here's the command with --trace:
https://gist.github.com/c07cb6287f5e54c477a8

Rack-flash unreliable. Incompatible with Rack > 1.3.6

The book recommends gem 'rack-flash' for session-based notifications, but rack-flash doesn't work with up-do-date versions of rack. The sinatra-authentication gem also requires rack-flash.

solutions:

  1. Downgrade to a version of Rack pre 1.3.6
    Problem: It sets you up for more dependency problems.
  2. Use 'sinatra/flash'
    The author says the downside is that it does not work across different kinds of rack apps.
  3. Sinatra could include this functionality itself?
  4. tl;dr Maybe the best short-term solution for the book is just to post a warning about rack-flash, or recommend 'sinatra/flash' instead.

Getting to know Sinatra

quick introductory chapter for the basics of sinatra and links to the readme for more information where relevant.

Sinatra edge dependencies

I have a patch together for bundling edge sinatra and it's dependencies.

Before I finish it up and create a pull request I'd like to know what other Sinatra dependencies there will be come 1.1 and beyond; that we can anticipate.

So far I just have rack, but what about tilt? Will that be a dependency once it's unbundled from base? Are there any other dependencies I'm forgetting?

Contributing to sinatra-book and core sinatra

As discussed in #15 there should be some information regarding contributing to the book.

  • Create a section for book contribution
  • Outline forking, branching, and pull requesting
  • Document contrib/ folder for excess recipes
  • Link to contributing guidelines for book (in wiki)

Also need to update the core sinatra contirubtion guide:

  • Submitting a patch via pull request

This should round out the contributing guide.

File uploads

  • What's the form like
  • How do you handle a file object
  • What options do you have on that object

Add PATCH HTTP verb (Routing)

It's been several months or nearly a year since PATCH support was added.

I have been preferring PATCH over PUT since then.

We need to update the guide and examples.

Email with Sinatra

Email email email.

Sending:

  • mail
  • pony
  • resque_mailer

Receiving:

  • mailman

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.