apeiros changed the topic of #ruby-lang to: Ruby 2.2.1; 2.1.5; 2.0.0-p643: https://ruby-lang.org || Paste code on https://gist.github.com
rbowlby has joined #ruby-lang
j4cknewt has quit [Ping timeout: 250 seconds]
centrx has joined #ruby-lang
mberk has joined #ruby-lang
chadwtaylor has joined #ruby-lang
mberk has quit [Ping timeout: 252 seconds]
wallerdev has joined #ruby-lang
ghostpl_ has joined #ruby-lang
ghostpl_ has quit [Ping timeout: 256 seconds]
nathanstitt has quit [Quit: I growing sleepy]
rbowlby has quit [Remote host closed the connection]
hahuang62 has quit [Ping timeout: 252 seconds]
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chadwtaylor has quit [Remote host closed the connection]
chadwtaylor has joined #ruby-lang
joaomdmoura has joined #ruby-lang
gwendall has quit [Remote host closed the connection]
charliesome has joined #ruby-lang
joaomdmoura has quit [Ping timeout: 272 seconds]
Rayford has joined #ruby-lang
chadwtaylor has quit [Remote host closed the connection]
znz_jp has quit [Quit: kill -QUIT $$]
ledestin has joined #ruby-lang
znz_jp has joined #ruby-lang
marr has quit []
duderonomy has joined #ruby-lang
enebo has quit [Quit: enebo]
iamninja has quit [Read error: Connection reset by peer]
iamninja has joined #ruby-lang
x-light has joined #ruby-lang
sankaber has joined #ruby-lang
x-light has left #ruby-lang [#ruby-lang]
mberk has joined #ruby-lang
malconis_ has joined #ruby-lang
malconis has quit [Ping timeout: 264 seconds]
centrx has quit [Quit: Shutting down, Please wait...]
mberk has quit [Ping timeout: 252 seconds]
Rayford has quit [Quit: Rayford]
erichmenge has joined #ruby-lang
matp has quit [Remote host closed the connection]
matp has joined #ruby-lang
arBmind1 has quit [Quit: Leaving.]
sondr3 has joined #ruby-lang
ghostpl_ has joined #ruby-lang
bruno- has quit [Ping timeout: 256 seconds]
SuMo_D has quit [Remote host closed the connection]
SuMo_D has joined #ruby-lang
ghostpl_ has quit [Ping timeout: 264 seconds]
SuMo_D has quit [Ping timeout: 265 seconds]
slawrence00 has joined #ruby-lang
cpjk has joined #ruby-lang
cpjk has left #ruby-lang ["WeeChat 1.1.1"]
mberk has joined #ruby-lang
amystephe has quit [Quit: amystephe]
hahuang62 has joined #ruby-lang
NinjaKrill has joined #ruby-lang
<NinjaKrill> Hello, is anyone here familar with the Shoes GUI toolkit and who could help out a complete beginner to both Ruby and Shoes write a simple program which downloads a file? ;0
cpjk has joined #ruby-lang
nathanstitt has joined #ruby-lang
cpjk has quit [Quit: WeeChat 1.1.1]
t0rrieri has quit [Quit: Be back later ...]
charliesome has quit [Quit: zzz]
ttilley has joined #ruby-lang
ttilley has quit [Changing host]
ttilley has joined #ruby-lang
stef204 has quit [Read error: Connection reset by peer]
<NinjaKrill> ...anyone? ;(
NinjaKrill has quit [Read error: Connection reset by peer]
<havenwood> Ninj, err left already?
pwnz0r has joined #ruby-lang
cpjk has joined #ruby-lang
fn_great has joined #ruby-lang
pwnz0r has quit [Remote host closed the connection]
gwendall has joined #ruby-lang
rbowlby has joined #ruby-lang
gwendall has quit [Ping timeout: 272 seconds]
Caius has quit [Ping timeout: 276 seconds]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Caius has joined #ruby-lang
fujimura has joined #ruby-lang
LMity has joined #ruby-lang
mberk has quit [Remote host closed the connection]
martinbmadsen has joined #ruby-lang
LMity has quit [Ping timeout: 245 seconds]
ghostpl_ has joined #ruby-lang
ghostpl_ has quit [Ping timeout: 244 seconds]
nedp has joined #ruby-lang
martinbmadsen has quit [Ping timeout: 240 seconds]
alakra has joined #ruby-lang
martinbmadsen has joined #ruby-lang
amystephen has joined #ruby-lang
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rbowlby has quit [Remote host closed the connection]
martinbmadsen has quit [Ping timeout: 245 seconds]
martinbmadsen has joined #ruby-lang
fujimura has quit [Remote host closed the connection]
nathanstitt has quit [Quit: I growing sleepy]
mberk has joined #ruby-lang
gix has quit [Ping timeout: 250 seconds]
sc00t has joined #ruby-lang
gix has joined #ruby-lang
sc00t has quit [Ping timeout: 252 seconds]
ss^13 has joined #ruby-lang
gwendall has joined #ruby-lang
gwendall has quit [Ping timeout: 272 seconds]
gwendall has joined #ruby-lang
ghostpl_ has joined #ruby-lang
fn_great has quit [Quit: Leaving]
ghostpl_ has quit [Ping timeout: 264 seconds]
sondr3 has quit [Quit: Ich bin ein sleep.]
malconis_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ss^13 has quit [Quit: Leaving]
vipaca has joined #ruby-lang
fragamus has joined #ruby-lang
cpjk has quit [Quit: WeeChat 1.1.1]
cpjk has joined #ruby-lang
ascarter has joined #ruby-lang
cpjk has quit [Quit: WeeChat 1.1.1]
ascarter has quit [Quit: Textual IRC Client: www.textualapp.com]
smoitra has joined #ruby-lang
fragamus has quit [Quit: Computer has gone to sleep.]
kyb3r_ has joined #ruby-lang
itstooloud has joined #ruby-lang
rbowlby has joined #ruby-lang
<itstooloud> hello ?
itstooloud has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0a2/20150303004530]]
j4cknewt has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
kyb3r_ has joined #ruby-lang
fade2000 has joined #ruby-lang
nedp has quit [Remote host closed the connection]
<fade2000> How would you go about quantifying the specificity of a method's signature?
bruno- has joined #ruby-lang
bruno- has quit [Ping timeout: 255 seconds]
ghostpl_ has joined #ruby-lang
stardiviner has quit [Ping timeout: 240 seconds]
mberk has quit [Remote host closed the connection]
fusillicode has joined #ruby-lang
rippa has joined #ruby-lang
lapide_viridi has joined #ruby-lang
ghostpl_ has quit [Ping timeout: 255 seconds]
fusillicode has quit [Ping timeout: 244 seconds]
piotrj has joined #ruby-lang
stardiviner has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
martinbmadsen has quit [Ping timeout: 245 seconds]
fusillicode has joined #ruby-lang
sc00t has joined #ruby-lang
piotrj has quit [Remote host closed the connection]
j4cknewt has quit [Remote host closed the connection]
vipaca has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
j4cknewt has joined #ruby-lang
amclain has quit [Quit: Leaving]
djinni` has quit [Ping timeout: 245 seconds]
djinni` has joined #ruby-lang
Mateusz_ has joined #ruby-lang
mberk has joined #ruby-lang
mberk has quit [Ping timeout: 264 seconds]
martinbmadsen has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
martinbmadsen has quit [Ping timeout: 245 seconds]
stardiviner has quit [Ping timeout: 252 seconds]
rbowlby has quit []
cornerma1 has joined #ruby-lang
cornerman has quit [Ping timeout: 244 seconds]
cornerma1 is now known as cornerman
stardiviner has joined #ruby-lang
arquebus has joined #ruby-lang
kyb3r_ has quit [Quit: Leaving]
mrod has quit [Quit: Page closed]
ghostpl_ has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
ghostpl_ has quit [Ping timeout: 250 seconds]
j4cknewt has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
relix has joined #ruby-lang
arquebus has left #ruby-lang [#ruby-lang]
micmus has joined #ruby-lang
bruno- has joined #ruby-lang
stardiviner has quit [Ping timeout: 250 seconds]
bruno- has quit [Ping timeout: 244 seconds]
<Mateusz_> What is the proper method of storing variable, gem specific data? I was using module variables (@some_data) in GemName:Configuration module but for some reason this variable randomly turns into null. I am not usre is it because I have bug somewhere or is it because I ma using simply wrong method to store data.
hahuang65 has joined #ruby-lang
sarkyniin has joined #ruby-lang
<apeiros_> Mateusz_: variables don't spontaneously change their value, no. so you have a bug.
<apeiros_> note that @ivar are instance variables, not module variables.
sarkyniin has quit [Ping timeout: 244 seconds]
<Mateusz_> apeiros_: So to store data specific to module I should rather use @@something?
mberk has joined #ruby-lang
<apeiros_> Mateusz_: I am not sure how you jump to that conclusion, I didn't say that. no, @ivars are fine.
stardiviner has joined #ruby-lang
<Mateusz_> OK, thanks.
sarkyniin has joined #ruby-lang
LMity has joined #ruby-lang
mberk has quit [Ping timeout: 245 seconds]
sarkyniin has quit [Ping timeout: 240 seconds]
sarkyniin has joined #ruby-lang
LMity has quit [Ping timeout: 265 seconds]
lapide_viridi has quit [Quit: Leaving]
apt-get_ has joined #ruby-lang
pwnz0r has joined #ruby-lang
sarkyniin has quit [Ping timeout: 240 seconds]
arBmind has joined #ruby-lang
kirin` has joined #ruby-lang
pwnz0r has quit [Remote host closed the connection]
pwnz0r has joined #ruby-lang
kirin` has quit [Read error: Connection reset by peer]
martinbmadsen has joined #ruby-lang
pwnz0r has quit [Ping timeout: 245 seconds]
oliver___ has joined #ruby-lang
martinbmadsen has quit [Ping timeout: 264 seconds]
bruno- has joined #ruby-lang
gwendall has quit [Remote host closed the connection]
gwendall has joined #ruby-lang
ZeroPivot has quit [Read error: Connection reset by peer]
bruno- has quit [Ping timeout: 250 seconds]
Forgetful_Lion has joined #ruby-lang
gwendall has quit [Ping timeout: 272 seconds]
fusillicode has quit [Ping timeout: 245 seconds]
gwendall has joined #ruby-lang
charliesome has joined #ruby-lang
ghostpl_ has joined #ruby-lang
smoitra has quit [Remote host closed the connection]
ghostpl_ has quit [Ping timeout: 240 seconds]
lapide_viridi has joined #ruby-lang
oliver___ has quit []
ledestin has quit [Read error: Connection reset by peer]
apt-get_ has quit [Ping timeout: 246 seconds]
apt-get_ has joined #ruby-lang
ledestin has joined #ruby-lang
sc00t has quit [Ping timeout: 252 seconds]
bougyman has quit [Ping timeout: 264 seconds]
sc00t has joined #ruby-lang
apt-get_ has quit [Ping timeout: 264 seconds]
postmodern has quit [Quit: Leaving]
ur5us has quit [Remote host closed the connection]
mberk has joined #ruby-lang
Iskarlar has joined #ruby-lang
mberk has quit [Ping timeout: 252 seconds]
sarkyniin has joined #ruby-lang
arBmind has quit [Ping timeout: 272 seconds]
Mateusz_ has quit [Quit: Page closed]
Iskarlar has quit [Read error: Connection reset by peer]
Iskarlar has joined #ruby-lang
Iskarlar has quit [Client Quit]
charliesome has quit [Quit: zzz]
leat has joined #ruby-lang
Iskarlar has joined #ruby-lang
martinbmadsen has joined #ruby-lang
charliesome has joined #ruby-lang
martinbmadsen has quit [Ping timeout: 245 seconds]
bougyman has joined #ruby-lang
bougyman is now known as Guest31039
j4cknewt has joined #ruby-lang
Guest31039 has quit [Ping timeout: 256 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ghostpl_ has joined #ruby-lang
stef204 has joined #ruby-lang
stef204 has quit [Client Quit]
stef204 has joined #ruby-lang
ghostpl_ has quit [Ping timeout: 256 seconds]
gwendall has quit [Remote host closed the connection]
gwendall has joined #ruby-lang
gwendall has quit [Remote host closed the connection]
sc00t has quit [Ping timeout: 252 seconds]
charliesome has quit [Quit: zzz]
shinnya has quit [Ping timeout: 252 seconds]
sarkyniin has quit [Ping timeout: 265 seconds]
j4cknewt has quit [Remote host closed the connection]
enebo has joined #ruby-lang
SylarRuby has joined #ruby-lang
chinmay_dd has joined #ruby-lang
sc00t has joined #ruby-lang
enebo has quit [Client Quit]
centrx has joined #ruby-lang
strixd has joined #ruby-lang
Forgetful_Lion has quit [Remote host closed the connection]
micmus has quit [Ping timeout: 252 seconds]
bougyman has joined #ruby-lang
bougyman is now known as Guest78204
Guest78204 has quit [Changing host]
Guest78204 has joined #ruby-lang
micmus has joined #ruby-lang
chinmay_dd has quit [Quit: Leaving]
relix has joined #ruby-lang
gwendall has joined #ruby-lang
gwendall has quit [Ping timeout: 272 seconds]
bruno- has joined #ruby-lang
Blaguvest has joined #ruby-lang
martinbmadsen has joined #ruby-lang
nathanstitt has joined #ruby-lang
enebo has joined #ruby-lang
martinbmadsen has quit [Ping timeout: 246 seconds]
fusillicode has joined #ruby-lang
fusillicode has quit [Ping timeout: 252 seconds]
Guest78204 is now known as bougyman
Blaguvest has quit []
ghostpl_ has joined #ruby-lang
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fusillicode has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
fusillicode has quit [Ping timeout: 256 seconds]
bruno- has quit [Ping timeout: 264 seconds]
Asher has joined #ruby-lang
gwendall has joined #ruby-lang
fusillicode has joined #ruby-lang
Asher has quit [Quit: Leaving.]
gwendall has quit [Ping timeout: 272 seconds]
Asher has joined #ruby-lang
linc01n has quit [Ping timeout: 265 seconds]
linc01n has joined #ruby-lang
Mon_Ouie has quit [Read error: Connection reset by peer]
Miphix has quit [Read error: Connection reset by peer]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sarkyniin has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
ur5us has joined #ruby-lang
iamninja has quit [Quit: rizonIRPG]
ur5us has quit [Ping timeout: 245 seconds]
martinbmadsen has joined #ruby-lang
centrx has quit [Quit: Shutting down, Please wait...]
martinbmadsen has quit [Ping timeout: 244 seconds]
sc00t has quit [Ping timeout: 256 seconds]
LMity has joined #ruby-lang
LMity has quit [Ping timeout: 252 seconds]
SuMo_D has joined #ruby-lang
mberk has joined #ruby-lang
banister has joined #ruby-lang
bruno- has joined #ruby-lang
SuMo_D has quit [Remote host closed the connection]
Mon_Ouie has quit [Ping timeout: 245 seconds]
nathanstitt has joined #ruby-lang
sankaber has joined #ruby-lang
micmus has quit [Ping timeout: 245 seconds]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amclain has joined #ruby-lang
havenwood has joined #ruby-lang
sc00t has joined #ruby-lang
micmus has joined #ruby-lang
gwendall has joined #ruby-lang
gwendall_ has joined #ruby-lang
gwendall has quit [Ping timeout: 272 seconds]
banister has joined #ruby-lang
fusillicode has quit [Ping timeout: 246 seconds]
imperator has joined #ruby-lang
<imperator> greetings programs
fragamus has joined #ruby-lang
bruno- has quit [Ping timeout: 246 seconds]
SuMo_D has joined #ruby-lang
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<imperator> fragamus - "we strawberry" ?
bruno- has joined #ruby-lang
SuMo_D_ has joined #ruby-lang
SuMo_D has quit [Ping timeout: 256 seconds]
bruno- has quit [Ping timeout: 246 seconds]
arBmind has joined #ruby-lang
slawrence00 has joined #ruby-lang
SuMo_D_ has quit [Ping timeout: 264 seconds]
fade2000 has left #ruby-lang ["WeeChat 1.2-dev"]
futilegames has quit [Quit: futilegames]
sondr3 has joined #ruby-lang
Mateusz_ has joined #ruby-lang
cpjk has joined #ruby-lang
fragamus has quit [Quit: Computer has gone to sleep.]
kaip has joined #ruby-lang
mberk has quit [Remote host closed the connection]
martinbmadsen has joined #ruby-lang
martinbmadsen has quit [Ping timeout: 246 seconds]
piotrj has joined #ruby-lang
|jemc| has joined #ruby-lang
j4cknewt has joined #ruby-lang
fusillicode has joined #ruby-lang
|jemc| has quit [Client Quit]
wallerdev has joined #ruby-lang
imperator has quit [Quit: Leaving]
leat has quit [Ping timeout: 264 seconds]
fusillicode has quit [Ping timeout: 256 seconds]
leat has joined #ruby-lang
LordNelthon has joined #ruby-lang
womble has quit [Ping timeout: 256 seconds]
ravins has joined #ruby-lang
apt-get_ has joined #ruby-lang
piotrj has quit [Remote host closed the connection]
<ravins> HI I'm new to Ruby, I want to learn by creating TODO app in ruby, but I'm not getting about running ruby on browser
<ravins> there are lot of confusion for me with web servers :(
<ravins> please help me
piotrj has joined #ruby-lang
piotrj has quit [Read error: Connection reset by peer]
sarkyniin has quit [Ping timeout: 250 seconds]
|jemc| has joined #ruby-lang
<LordNelthon> ravins: Are you using rails or just ruby code?
apt-get_ has quit [Ping timeout: 240 seconds]
fusillicode has joined #ruby-lang
womble has joined #ruby-lang
fragamus has joined #ruby-lang
gwendall_ has quit []
<apeiros_> ravins: ruby doesn't run on the browser, only javascript does. what you do is you run ruby on the server side and generate html/css/js with it and send that to the browser.
vlad_starkov has joined #ruby-lang
fusillicode has quit [Ping timeout: 250 seconds]
the_real_intinig has joined #ruby-lang
womble has quit [Ping timeout: 256 seconds]
<jhass> apeiros_: doesn't want opal prove otherwise? :P
fujimura has joined #ruby-lang
fujimura has quit [Remote host closed the connection]
<apeiros_> depends - is opal a compiler (transpiler?) or a VM?
<apeiros_> iirc it compiles ruby to js
<apeiros_> and then it'd still only be js…
<ravins> @LordNelthon I'm using ruby code
<ravins> I think I should start with Ruby first
<ravins> then move to Rails frameworks
<ravins> right?
womble has joined #ruby-lang
<ravins> I've done php and I can see output on browser just by starting xampp
<havenwood> ravins: Ruby is a great language. You may or may not want to use Rails. It depends on what you're making.
<ravins> but with Ruby I'm not getting it run to see
<apeiros_> ravins: what are you doing to get ruby to run?
<ravins> havenwood I like to start with something like TODO
<ravins> with mysql as backend
cpjk has quit [Quit: WeeChat 1.1.1]
<ravins> there is lots of confusion like for web server there are unicorn, thin, passenger etc..
<ravins> totally blank :(
cpjk has joined #ruby-lang
<LordNelthon> ravins: when you start xampp it starts apache that is the webserver that runs the php.
<havenwood> ravins: Those are all Rack web servers. Puma, Unicorn, Passenger and Thin are all very nice. (Nicer than Webrick, which is the basic default.)
<ravins> so you means apache/ngnix not help to run ruby code
<havenwood> ravins: So any Rack app can use any one of those web servers, just swap one out and another in.
<havenwood> ravins: It is popular to use nginx or apache as a reverse proxy to your Rack web server. But it isn't necessary. It helps with load balancing and serving static files quickly.
<jhass> apeiros_: afaik it's a transpiler but also has a runtime, basically an always included js file for the stdlib
<ravins> sorry by not getting "Rack app"? you means "Ruby app"
<apeiros_> jhass: so still js :)
<havenwood> ravins: Rails is one of many Rack adapters. Rack is a RubyGem. You can install it like: gem install rack
<apeiros_> ravins: rack is a piece of ruby code which sits between the webserver and the ruby webapp
<ravins> ok
<havenwood> ravins: Here's an example of a simpe Hello World app in a number of Rack adapters: https://github.com/luislavena/bench-micro
<apeiros_> it standardizes the interface
<jhass> apeiros_: yeah, I'm just teasing^^
<apeiros_> ravins: given that you use xampp, I assume you're familiar with apache?
<havenwood> ravins: So: Rack Adapter -> Rack & Rack Middleware -> Rack Webserver
<apeiros_> ravins: if so, then probably the easiest is to install passenger and use it with your apache
fragamus has quit [Quit: Computer has gone to sleep.]
<havenwood> arBmind: Rack adapters include Rails, Sinatra, Lotus, Roda, etc. Rack is Rack. Middleware is optional. You already listed a bunch of the popular Rack web servers (except Puma).
<ravins> not much familar with apache :)
<apeiros_> --> gem install passenger; passenger-install-apache2-module
<havenwood> ravins: You can write a plain Rack app, but if you try you'll find it's a bit tedious. Hence the many Rack adapters to give you some sugar.
<ravins> I would like to use ngnix some of my friend tell me about this
<ravins> havewood ok
<ravins> havewood: ok
<apeiros_> ok, lets start with the easiest then
futilegames has joined #ruby-lang
<apeiros_> install rack: gem install rack
<havenwood> Rack it up!
<ravins> I've ruby installed on my ubuntu, so this not means I already have rack
<apeiros_> no
<ravins> ok
<apeiros_> rack is a gem. gems are ruby libraries and/or executables
<apeiros_> hence: `gem install rack`
<LordNelthon> ravins: to develop a web app in ruby i recommend rails, but you need to know about MVC. Do you know laravel or symphony or code igniter? if you know any of the frameworks i mentioned you know the essencial to use rails framework. and then people already gave you the details about web servers for rack. but its up to you to use or not the rails.
[H]unt3r has joined #ruby-lang
<ravins> apeiros_: ok
<apeiros_> then open a file: demo_app.ru. put this into it: `run proc { |env| [200, {"Content-Type" => "text/html"}, ["Hello World"]] } `
<apeiros_> and then you do `rackup demo_app.ru`
<ravins> LordNelthon: I've done codeigniter before
<apeiros_> after that, visit http://127.0.0.1:9292
Iskarlar has joined #ruby-lang
<havenwood> ravins: the `rackup` executable is part of the Rack gem you installed
Iskarlar has quit [Read error: Connection reset by peer]
<apeiros_> that's your minimal ruby+rack app
<LordNelthon> ravins: you can think about ruby = ubuntu and gems = ubuntu packages. gem command is like apt-get or aptitude, with it you install "addons" called gems that extends ruby.
<apeiros_> whoops, should have been text/plain, not text/html. but luckily browser are used to get lied to.
|jemc| has left #ruby-lang ["WeeChat 1.1.1"]
<ravins> apeiros_: ok
Iskarlar has joined #ruby-lang
<apeiros_> ravins: got it to work?
<ravins> yes
<LordNelthon> ravins: if you want to develop with controllers, models and views (MVC) check rails. but for now to learn the language use the ruby + rack
ledestin has joined #ruby-lang
<ravins> wooooo, apeiros_ thanks
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ravins> so here I've create a simple server
<ravins> without using puma, thin etc..
<ravins> right ?
<apeiros_> rackup will use whatever is there for the webserver
<apeiros_> worst case it uses webrick which is in stdlib (stdlib is installed along with ruby itself)
<havenwood> ravins: A nice little Rack app. It's probably being served up by WEBrick. Check the output when it launched.
<ravins> LordNelthon: yes, I'm looking into ruby
<apeiros_> if you do `gem install puma`, then rackup will start the app using puma.
<havenwood> ravins: ^
<ravins> yes it say webrick in console
<havenwood> ravins: It's just as easy with Puma. But faster and more reliable.
Iskarlar_ has joined #ruby-lang
<ravins> LordNelthon: I'm following "programming Ruby" by Dave Thomas
<apeiros_> havenwood: depends. with puma you have to remember to write your app thread-safe.
<apeiros_> and with unicorn, you have to remember to write it fork-safe.
<havenwood> apeiros_: So use Roda. :)
[H]unt3r has quit [Read error: Connection reset by peer]
<havenwood> Freeze ALL THE THINGS! \o/
[H]unt3r has joined #ruby-lang
<apeiros_> havenwood: that magically makes all your app level code thread-/fork-safe? :)
<ravins> my friend told me to use thin with ngnix by proxing it, I'm trying to understanding what was He trying to say :)
Iskarlar has quit [Ping timeout: 256 seconds]
<havenwood> apeiros_: The Roda apps are meant to be frozen in production, so that helps a ton with thread safety. It also provides a thread safe cache to use. Of course you *can* do things..
<apeiros_> ravins: what you need to do for that: configure your nginx as a proxy. run `gem install thin`. and now `rackup demo_app.ru` will run your app with thin.
bruno- has joined #ruby-lang
<havenwood> apeiros_: I've been enjoying using it. It's extremely well-done in my opinion.
<apeiros_> havenwood: you can't possibly freeze all the things. unless you don't want to process any user input whatsoever…
<havenwood> apeiros_: Users... what a pain!
<havenwood> So much easier to write apps without users.
<apeiros_> havenwood: and their browsers! teh horror!
<havenwood> uhg
<havenwood> The humanity!
<apeiros_> so much easier to write m2m apps
<apeiros_> api-only
<havenwood> mmhmm
<ravins> Ok, now console says `Thin web server (v1.6.3 codename Protein Powder)`
fusillicode has joined #ruby-lang
Mateusz_ has quit [Quit: ChatZilla 0.9.91.1 [Firefox 36.0.1/20150306140238]]
<ravins> means now I'm running new web server instead of webrick
arBmind has quit [Ping timeout: 252 seconds]
<havenwood> ravins: Yup, that'll be able to handle a lot more requests at once.
<ravins> or need ngnix here
<havenwood> ravins: You *can* point Thin right at port 80 and not reverse proxy from nginx.
<apeiros_> ravins: webrick *is* a webserver
<havenwood> ravins: you just switched from one web server to another
<apeiros_> thin is also a webserver. so are puma, and unicorn, and nginx, and apache.
martinbmadsen has joined #ruby-lang
<apeiros_> webrick/thin/puma/unicorn are webservers written in ruby (and some of them with C extensions)
<ravins> but seems like there is not in-built module for ruby in nginx and apache, thats' why we have thin, puma unicorns
[H]unt3r has quit [Read error: Connection reset by peer]
<apeiros_> ravins: no, that's not the reason
[H]unt3r has joined #ruby-lang
<apeiros_> the equivalent to mod_php for apache is passenger
<ravins> sorry if my questions are wierd
<apeiros_> ie., apache does not have php built-in either. you need an extension - mod_php. same applies to ruby. the most prominent ruby module for apache and nginx is passenger.
<ravins> ok
<apeiros_> there are various reasons why people choose different setups
<ravins> ok
wallerdev has quit [Quit: wallerdev]
womble has quit [Ping timeout: 272 seconds]
<havenwood> ravins: For example, Unicorn chokes on slow clients. So it's popular to put Nginx in front of Unicorn as a buffering reverse proxy. Alternatively you could use Rainbows, which is a Rack web server that in certain configurations does load balancing and handles slow clients itself, just not as quickly as Nginx. For each there are reasons why you might set it up certain ways and they have different performance and
<havenwood> memory usage characteristics on top of other considerations.
<ravins> Ok
<ravins> so I can run my TODO app without Nginx or apache need
womble has joined #ruby-lang
<havenwood> ravins: yes
<ravins> I'm flying :)
<ravins> Thanks a lot you guys are super
<ravins> I'll avoid PHP :)
<havenwood> ravins: You're welcome, happy coding!
sondr3 has quit [Quit: Ich bin ein sleep.]
ruby-lang616 has joined #ruby-lang
ruby-lang616 has quit [Client Quit]
[H]unt3r has quit [Quit: Leaving]
itstooloud has joined #ruby-lang
piotrj has joined #ruby-lang
futilegames_ has joined #ruby-lang
futilegames has quit [Read error: Connection reset by peer]
futilegames_ is now known as futilegames
gwendall has joined #ruby-lang
arBmind has joined #ruby-lang
futilegames_ has joined #ruby-lang
futilegames has quit [Ping timeout: 255 seconds]
futilegames_ is now known as futilegames
dellavg_ has joined #ruby-lang
womble has quit [Ping timeout: 256 seconds]
vondruch has quit [Quit: Ex-Chat]
joaomdmoura has joined #ruby-lang
the_real_intinig has quit [Ping timeout: 244 seconds]
malconis has joined #ruby-lang
the_real_intinig has joined #ruby-lang
malconis has quit [Client Quit]
mathie has joined #ruby-lang
gwendall has quit [Remote host closed the connection]
cpjk has quit [Quit: WeeChat 1.1.1]
the_real_intinig has quit [Remote host closed the connection]
cpjk has joined #ruby-lang
mathie has quit [Client Quit]
mathie has joined #ruby-lang
vipaca has joined #ruby-lang
vipaca has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
apt-get_ has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
gwendall has joined #ruby-lang
iamninja has joined #ruby-lang
ravins has quit [Ping timeout: 246 seconds]
futilegames has quit [Quit: futilegames]
micmus has quit [Ping timeout: 245 seconds]
futilegames has joined #ruby-lang
ur5us has joined #ruby-lang
ur5us_ has joined #ruby-lang
ur5us has quit [Read error: Connection reset by peer]
LordNelthon has left #ruby-lang [#ruby-lang]
nathanstitt has joined #ruby-lang
micmus has joined #ruby-lang
fusillicode has quit [Ping timeout: 265 seconds]
futilegames has quit [Quit: futilegames]
shinnya has joined #ruby-lang
j4cknewt has quit [Remote host closed the connection]
sondr3 has joined #ruby-lang
sondr3 has quit [Client Quit]
mberk has joined #ruby-lang
spetryk has joined #ruby-lang
mberk has quit [Ping timeout: 246 seconds]
enebo has quit [Quit: enebo]
leat has quit [Ping timeout: 272 seconds]
enebo has joined #ruby-lang
piotrj has quit [Read error: Connection reset by peer]
ur5us has joined #ruby-lang
vitkovsky has joined #ruby-lang
vitkovsky has quit [Remote host closed the connection]
vlad_starkov has quit []
lapide_viridi has quit [Quit: Leaving]
LBo has quit [Ping timeout: 246 seconds]
ur5us_ has quit [Ping timeout: 255 seconds]
cpjk has quit [Ping timeout: 256 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
j4cknewt has joined #ruby-lang
cpjk has joined #ruby-lang
LBo has joined #ruby-lang
piotrj has joined #ruby-lang
cornerma1 has joined #ruby-lang
j4cknewt has quit [Remote host closed the connection]
NoNMaDDeN has joined #ruby-lang
Iskarlar_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cornerman has quit [Ping timeout: 256 seconds]
cornerma1 is now known as cornerman
apt-get_ has quit [Ping timeout: 246 seconds]
apt-get_ has joined #ruby-lang
martinbmadsen has quit [Ping timeout: 245 seconds]
<itstooloud> can anyone help me with the ruby spaceship operator
<apeiros_> itstooloud: we will know when you ask a question
<itstooloud> i don't understand how it's used to sort arrays. i understand that it returns -1, 0, 1 but every time i see it implemented this way, the explanation attached to it is poor: def <=> (other_person) # to compare two people, use last names
<itstooloud> self.last_name <=> other_person.last_name
<itstooloud> end
<jhass> just an aside: probably wanted a sort_by there
<apeiros_> array sort compares two items per time to determine which one is ordered before the other. to do that, it uses <=>.
Iskarlar has joined #ruby-lang
<apeiros_> and `a <=> b` returning <0 means a < b, returning 0 means a == b, and returning >0 means a > b
<itstooloud> ok but i don't understand why it's necessary. ruby already knows the alphabet and that 1<2
<apeiros_> itstooloud: and how does it know the alphabet? i.e., how does it figure that 1 < 2?
<apeiros_> itstooloud: it uses <=> there too. and apart from that, not all arrays are made of strings or numbers. you can have an array of any kind of objects.
<itstooloud> because i can write 1<2 and it will return TRUE, or "a" < "b"
martinbmadsen has joined #ruby-lang
<apeiros_> itstooloud: but it does not use <. it uses <=>.
j4cknewt has joined #ruby-lang
<itstooloud> ok, in this example:
<itstooloud> array = [1, 2, 3]
<itstooloud> array.sort { |a, b| a <=> b }
<itstooloud> vs this
<itstooloud> array.sort { |a, b| b <=> a }
<itstooloud> the evaluated portion of the block is returning a -1, 0, or 1
<itstooloud> how is that telling the block which direction to sort in?
<apeiros_> as said before: if it returns -1, a is sorted first
<apeiros_> if it returns 1, b is sorted first
<apeiros_> s/first/before the other/
<apeiros_> if it returns 0, it doesn't matter which of a & b comes first because their ordering is equal
sc00t has quit [Read error: Connection reset by peer]
<apeiros_> and the rest is logic. with a = 1 and b = 2, a <=> b returns -1, therefore a is sorted before b
<apeiros_> and if you reverse the operation, namely doing b <=> a, it returns 1, therefore b is sorted before a, effectively reversing sort order
<itstooloud> thanks, yes, i've looked at the explanations and this is still confusing. that is, i know how to implement it based on the explanation but i don't know why it should work that way. for example, if you were to remove the evaluation and just put "-1" there instead of "a<=>b", what are you telling the interpreter?
sc00t has joined #ruby-lang
piotrj has quit [Remote host closed the connection]
<apeiros_> you are telling Array.sort that every `a` it compares to a `b` is smaller
<apeiros_> which can't possibly be and will therefore result in an unpredictable order
<apeiros_> itstooloud: you do realize that the block is called many times, right?
<apeiros_> in an array with N items, the block is evaluated N*log(N) on average
<itstooloud> i do now that you point it out but seriously i think that's where my confusion comes from
<itstooloud> |a,b| refers to each time the interpreter has to compare two elements
iliketur_ has joined #ruby-lang
<apeiros_> |a,b| is the arguments the block receives when it is called.
SylarRuby has quit [Remote host closed the connection]
<apeiros_> just like in `def compare(a,b) … end` a and b are arguments the method `compare` receives when it is called.
<apeiros_> itstooloud: maybe you should go ahead and write an Array#sort yourself.
<apeiros_> see how sorting an array works.
<itstooloud> thanks, i'm going to keep reading with this in mind
<itstooloud> i will do that
<apeiros_> when you've done that, abstract the comparison of the elements
<apeiros_> so that you can sort arbitrary objects, not only ones you know about
vipaca has joined #ruby-lang
spetryk has quit [Quit: Be back later ...]
enebo has quit [Quit: enebo]
vipaca has quit [Client Quit]
fusillicode has joined #ruby-lang
lapide_viridi has joined #ruby-lang
apt-get_ has quit [Ping timeout: 240 seconds]
LMity has joined #ruby-lang
iliketurtles has joined #ruby-lang
iliketur_ has quit [Ping timeout: 265 seconds]
vipaca has joined #ruby-lang
vipaca has quit [Read error: Connection reset by peer]
kaip has quit [Quit: kaip]
ItSANgo has quit [Quit: Leaving...]
kaip has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
LMity has quit [Ping timeout: 245 seconds]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
joaomdmoura has quit [Remote host closed the connection]
banister has joined #ruby-lang
cpjk has quit [Ping timeout: 265 seconds]
riotjon__ has joined #ruby-lang
dellavg_ has quit [Ping timeout: 264 seconds]
riotjone_ has quit [Ping timeout: 246 seconds]
intinig has joined #ruby-lang
iliketur_ has joined #ruby-lang
j4cknewt has quit [Remote host closed the connection]
iliketurtles has quit [Ping timeout: 246 seconds]
sondr3 has joined #ruby-lang
iliketur_ has quit [Client Quit]
fusillicode1 has joined #ruby-lang
lapide_viridi has quit [Quit: Leaving]
fusillicode has quit [Ping timeout: 255 seconds]
eyvyayn has joined #ruby-lang
nathanstitt has joined #ruby-lang
sankaber has joined #ruby-lang
eyvyayn has left #ruby-lang ["Goodbye!"]
j4cknewt has joined #ruby-lang
itstooloud has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0a2/20150303004530]]
e_v_n has joined #ruby-lang
sondr3 has quit [Quit: Whelp.]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
j4cknewt has quit [Remote host closed the connection]
marr has joined #ruby-lang
Mirimal has joined #ruby-lang
j4cknewt has joined #ruby-lang
<Mirimal> Good eveninig here! I how funny question. By using Enumerator#peek it's possible to get next object in enumerator, but is it possile to get curent one?
<Mirimal> I have*
banister has quit [Ping timeout: 245 seconds]
spetryk has joined #ruby-lang
<jhass> Mirimal: got some code that motivated that question?
<jhass> I'd be curious what you would need that for
<Mirimal> Sure. Just let me paste it to gist.
Mirimal has quit [Quit: Page closed]
gwendall has quit [Remote host closed the connection]
<apeiros_> peek is technically the current
<apeiros_> >> [1,2,3].each.peek
<eval-in_> apeiros_ => 1 (https://eval.in/300507)
<havenwood> >> 1.upto(3).peek
<eval-in_> havenwood => 1 (https://eval.in/300508)
<jhass> they left sadly
<apeiros_> next gives you the current + moves the enumerator
<apeiros_> oh, dear. didn't even check due to the gist announcement
<jhass> yeah, it's weird
* apeiros_ needs a smarter irc client
<apeiros_> maybe accident
nedp has joined #ruby-lang
<jhass> weechat \o/
<jhass> smart filter is amazing
mberk has joined #ruby-lang
gwendall has joined #ruby-lang
e_v_n has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
LesZedCB has joined #ruby-lang
<LesZedCB> Hi all. I've got a question about strings and symbols.
<havenwood> LesZedCB: hi
<LesZedCB> i'm curious is anybody knows if/why symbols will still be a distinct citizen from strings now that a couple things are true:
<LesZedCB> first, that symbols are garbage collected
<havenwood> LesZedCB: There are Strings, frozen Strings, mortal Symbols and immortal Symbols.
<LesZedCB> and secondly that "string".freeze.object_id == "string".freeze.object_id
mberk has quit [Remote host closed the connection]
<LesZedCB> huh and I guess the distinction with immortal symbols is that they aren't garbage collected?
<LesZedCB> and frozen strings are still garbage collected?
<apeiros_> I think only to_sym'ed symbols get collected, no?
<havenwood> LesZedCB: Immortal Symbols are created at the implementation level. They're not GCed. You can create mortal Symbols. Yeah, immortal Symbols aren't GCed.
<LesZedCB> so can you create immortal symbols?
<apeiros_> afair literal symbols in your code are immortal too
<havenwood> apeiros_: I thought not.
<apeiros_> I may be wrong, though. haven't taken a close look yet.
<apeiros_> havenwood: why gc them? literals are comparatively rare anyway.
<LesZedCB> ok cool. Yeah, I was just wondering if there was a reason for even making symbols still a distinct object type
<apeiros_> also they're guaranteed to be a closed set. they don't grow arbitrarily
banister has joined #ruby-lang
<apeiros_> LesZedCB: symbols should still compare faster than strings, given that it is an identity check always
<LesZedCB> but if they are garbage collected, how can you guarantee that?
<apeiros_> how does that influence that guarantee?
<apeiros_> you can't compare a gc'ed symbol with an un-gc'ed
<apeiros_> otherwise you'd have a zombie symbol :)
<LesZedCB> sure, so maybe i'm confused about the semantics of an identity check
<LesZedCB> identity != object_id?
<apeiros_> identity check means same object
<apeiros_> and yes, same object has same object_id
<LesZedCB> so, then object_id would be the same?
<apeiros_> yes
<LesZedCB> ok, so if they are garbage collected, can you still guarantee they would have the same object_id after it has been reinstantiated?
<apeiros_> show me a case where that does not hold true
<apeiros_> they don't need the same object_id
<apeiros_> after reinstantiation, that is
<darix> LesZedCB: they wont get GC-ed if they are still in use. so if you create :foo and compare it later in your code. it will be the same object. it just might not have the same objectid that the gc-ed :foo had
<LesZedCB> but if they don't need the same object_id, then what do they compare?
<apeiros_> LesZedCB: again, show me a concrete example
<LesZedCB> ok, so lets say I have a rails app running with some method that has a param that only gets used once a year
<LesZedCB> presumably the param symbol would get GC'd in that time
<LesZedCB> oooh
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<LesZedCB> duh
<apeiros_> :)
<darix> LesZedCB: but if you assign the params[:key] = value
j4cknewt has quit [Remote host closed the connection]
<darix> then you implicitely created :key again
<LesZedCB> right, then it has been reallocated
* apeiros_ heard the penny fall
<LesZedCB> lol
sankaber has joined #ruby-lang
<apeiros_> you can't compare to the gc'ed anyway. and the new one necessarily has the same id as "the other" new one.
<LesZedCB> haha, well, thanks for working that one through with me. a little embarassing
<apeiros_> or short: even with GC'ed symbols, it's still guaranteed that at any point during the runtime, there are no two different symbol objects with the same string value.
<havenwood> apeiros_: yeah, you're correct of course
<LesZedCB> right of course
<havenwood> makes sense
<apeiros_> I do seem to remember a case where string comparison is faster than symbol comparison. can't summon up anymore why that's the case.
piotrj has joined #ruby-lang
<LesZedCB> and presumably, if a symbol is garbage collected, then any references to the symbol are also GC'd?
<apeiros_> wrong way round
<apeiros_> when can you gc an object?
<LesZedCB> lol, when there are no references.
<LesZedCB> wow, i should just stop asking questions :)
<apeiros_> ;-)
<apeiros_> IMO better ask a stupid question and be smarter after it than stay stupid
<LesZedCB> haha thanks I think? :P
toretore has quit [Quit: This computer has gone to sleep]
<apeiros_> sorry. I didn't mean to imply you were stupid.
<LesZedCB> no worries, i got what you meant!
<apeiros_> s/stupid/ignorant about the thing in question/
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<LesZedCB> so then, getting back to my original curiosity, is it actually faster in the long termto have distinct objects for string and symbol?
<apeiros_> I'm not sure. as said, symbol comparison should in most cases be faster than string comparison.
<LesZedCB> because when a symbol is created, it would have to be in the symbol table in the first place
gwendall has quit [Remote host closed the connection]
Musashi007 has joined #ruby-lang
<LesZedCB> and therefore looked up in the symbol table
<apeiros_> the other costs - I'm not sure about. I'd guess creating a symbol is slightly more expensive.
gwendall has joined #ruby-lang
<LesZedCB> right, which I guess would make sense
<apeiros_> also, frozen strings iirc only share object_id when they're literals
<apeiros_> but there too - I might be wrong about it. I haven't taken a deep look into those newer details of ruby.
lytol has joined #ruby-lang
<LesZedCB> gets.freeze.to_s == gets.freeze.to_s with the same input evals to true
<darix> LesZedCB: the more interesting question
<apeiros_> but in my current work, I dropped symbols almost completely. I only use symbols for internal ids. like named params, send, attr* stuff.
<darix> >> "foo".freeze.object_id == "foo".freeze.object_id
<eval-in_> darix => true (https://eval.in/300509)
stef204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<darix> >> "foo".object_id == "foo".object_id
<eval-in_> darix => false (https://eval.in/300510)
<apeiros_> more important:
<apeiros_> >> "foo".freeze.object_id == ("f"+"oo").freeze.object_id
<eval-in_> apeiros_ => false (https://eval.in/300511)
<apeiros_> as said, deduplication only happens for literals.
<LesZedCB> aperios_: my example used input from the command line, no literals and still eval'd to true
<apeiros_> LesZedCB: pro-tip: use tab completion for nicks
<LesZedCB> apeiros_: oooh
<LesZedCB> thanks
piotrj has quit []
<LesZedCB> i'm newish to irc
<apeiros_> but it's cute that you even typed my tail ;-)
gwendall has quit [Ping timeout: 272 seconds]
<darix> *cuts apeiros' tail off*
<apeiros_> darix: sadly irc doesn't allow multiple clients to log into the same nick
<apeiros_> (yes, I know, bouncer… one day…)
<darix> strictly speaking neither does jabber
<darix> apeiros: naw use irssi+tmux :p
<apeiros_> not an option. the other client is not accessible from outside.
<apeiros_> and I'd like to keep it that way :)
arBmind1 has joined #ruby-lang
<apeiros_> since it came up in pm: I don't allow SSHing into my home computers
ghostpl_ has quit [Remote host closed the connection]
arBmind has quit [Ping timeout: 246 seconds]
<LesZedCB> so my thought is that could symbols be effectively dropped as a language feature by just making syntax like :symbol be semantically the same as "symbol".freeze
<darix> LesZedCB: "foo".to_sym
<LesZedCB> String#to_sym returns self?
<darix> >> "foo".to_sym
<eval-in_> darix => :foo (https://eval.in/300512)