Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching for the entry-point #11

Open
agis opened this issue Jun 8, 2012 · 2 comments
Open

Searching for the entry-point #11

agis opened this issue Jun 8, 2012 · 2 comments

Comments

@agis
Copy link

agis commented Jun 8, 2012

As I'm new to Sinatra (and ruby generally) I'm searching for an entry point to start reading through the source, something like we did with the Rack project (we started reading run and use first).

The other issues that are opened till now seems a little advanced to me, so I'm wondering if there's a simpler way to start.

EDIT: As I see 95% of Sinatra is mainly in sinatra/lib/base.rb.

I've also noted that this file is kinda large (~1600 loc).. so I was wondering: Why didn't they broke up the code into smaller pieces (eg. separate files)? Wouldn't it make the code easier to maintain?

Isn't Sinatra considered to be a "monolithic" app, which is not a good thing?

@codereading/readers

@ericgj
Copy link
Member

ericgj commented Jun 12, 2012

One place to start might be to look at what happens when you define a route, e.g. get '/foo' do ... end .

Or another place would be to follow the path of a request as it comes in and gets dispatched to a route.

It's a good question about why the code is all in one file, I'd like to know myself.

@gwynforthewyn
Copy link

Sinatra isn't monolithic. Reading through base.rb: it uses one file, but inside that file is a bunch of Modules and within the Modules there're a bunch of classes. Physically, sure, it's one big file. But logically it's a bunch of separate namespaces and whatnot.

I'm going through issue 2 as best I can: seeing what happens when the simple.rb example is executed. If you'd like, I'd love a few more pairs of eyes over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants