sinatra / sinatra-book

Tutorial + Cookbook
http://sinatra-org-book.herokuapp.com/
675 stars 163 forks source link

Using rake install to build sinatra edge rather then a symbollic link #5

Closed zzak closed 14 years ago

zzak commented 14 years ago

I would suggest against using symlinks as they can cause headaches later on, and are error prone on windows machines.

Please see my commit here for patch: http://github.com/zacharyscott/sinatra-book/commit/7cf82764aeed0b984b36066f3a20f773e6ee9648

Any other thoughts on this are appreciated

cschneid commented 14 years ago

Is a sudo needed? How about rubygems? (I rarely work with edge anything, and normally I just vendor it anyway).

zzak commented 14 years ago

This is assuming rubygems and rake are both installed and running under RVM, hence no need for sudo.

rake install runs, the following task: desc 'Build and install as local gem' task :install => package('.gem') do sh "gem install #{package('.gem')}" end

However I think the user might need to rebuild the gemspec before running rake install.

rake build sinatra.gemspec

I think that should work, any thoughts?

cschneid commented 14 years ago

Another alternate method: just cloning into vendor/sinatra and requiring from there.

rkh commented 14 years ago

Or using bundler.

zzak commented 14 years ago

Yeh bundler is an option:

#Gemfile
gem "sinatra", :git =>"git://github.com/sinatra/sinatra.git"
zzak commented 14 years ago

I've updated the Introduction to include setting up Bundler with edge sinatra. I tried to smooth over the modularized example application, hope it's not too much for the Introduction.

Here's the commit: http://github.com/zacharyscott/sinatra-book/commit/b61691004d19c0bf1de5cdc2bcc833aa532d37c7

Here's an test application for the source code of the commit: http://github.com/zacharyscott/example-sinatra-edge-application

zzak commented 14 years ago

Please see #23 where I've done a bit of cleanup to this section.