<  February 2017   >
Su Mo Tu We Th Fr Sa  
          1  2  3  4  
 5  6  7  8  9 10 11  
12 13 14 15 16 17 18  
19 20 21 22 23 24 25  
26 27 28
01:31 IRCFrEAK joined
02:05 IRCFrEAK left
03:16 noan joined
03:17 <noan> Hey folks, request["Foo"]... since it says... some_param.... does that refer to say... get params, or headers?
03:19 <noan> oh it's a wrapper to the Rack::Request isn't it?
04:38 madgoat joined
04:38 madgoat left
06:45 djellemah_ joined
06:49 aidalgol joined
09:22 blackmes1 joined
09:53 blackmes1 joined
12:49 blackmes1 joined
15:09 <flips> Confusing: In app.rb I have: Dir[File.join(File.dirname(__FILE__),'lib','*.rb')].each { |lib| load lib } ... If I start the app by "ruby app.rb", it loads lib/routes.rb as I expected. But if I start the app using "ruby config.ru", the routes defined in lib/routes.rb are now known ...
15:11 <Rennex> now?
15:12 <Rennex> flips: what's in your config.ru?
15:12 <Rennex> flips: also you're not supposed to run "ruby config.ru", but rackup
15:15 <Rennex> and i wouldn't use File.join, just Dir["#{__dir__}/lib/*.rb"]
15:15 <flips> rackup command has same result (was wondering about the ruby config.ru syntax, stated in the Learning Sinatra book, Packt publishing) I've got this in config.ru: require File.join(File.dirname(__FILE__), 'app.rb')
15:16 <Rennex> check this out https://github.com/rack/rack/wiki/(tutorial)-rackup-howto
15:17 <Rennex> you need to "run" something in config.ru
15:17 <Rennex> in the case of a classic sinatra app, it would be "run Sinatra::Application"
15:17 <Rennex> or with the modular style, run Yourappname
15:17 <flips> yes, it run with: Todo .start!
15:18 <flips> no ... oh
15:19 <flips> This book doesn't seem very precise ... Might the author have chose the File.join to make it work with windows backslash paths?
15:20 <Rennex> probably. but i think it's misguided, since in windows, ruby will automatically convert slashes to backslashes when opening files :)
15:21 <Rennex> but yeah i think that .start! only works right when starting it without rackup
15:22 <Rennex> often you'll see something like "MyApp.start! if $0 == __FILE__" - that way it's only called if that .rb file was run directly and not required from some other file
15:22 <flips> This is the full config.ru as listed in the book: http://pastebin.com/0qQPPvXR
15:23 <Rennex> that doesn't look like a config.ru to me at all :/
15:24 <flips> Realized the book got a 1 star rating on O'Reilly.com after I had bought it ;)
15:25 <Rennex> x)
15:26 <flips> Trying to remember where I stored everything I did when I earlier setup some blog stuff (not prod) based on the O'Reilly Sinatra Up and Running book ...
15:36 <flips> Should "require sinatra", "require bundler/setup" and "Bundler.require" be moved to app.rb?
16:01 <flips> Trying to figure out how I should do this: http://pastebin.com/DffesLSi ...
17:09 djellemah joined
17:23 <flips> Trying to figure out how to specify bind for run Sinatra::Application in config.ru, instead of having to do rackup -o every time
17:26 <flips> oh, #\ -o <ipv4 addr> as first line seems to work
17:37 <flips> Rennex: Not sure how to add the if $0 == __FILE__ check without getting into errors like: `to_app': missing run or map statement ... Just using run Sinatra::Application now
17:56 <flips> Hm, seems the book's example uses 32 byte MD5 hash for password. I assume there's a better/other recommended alternative these days?
20:22 mwlang joined
20:27 <flips> Sinatra is nice! :) (Kinda re-learning stuff now) This book suggests Sequel, many others recommend ActiveRecord, it seems
21:16 <flips> I assume Digest::SHA256.hexdigest is better than Md5.hexdigest ...
21:20 mwlang joined