emmesswhy has quit [Quit: This computer has gone to sleep]
Pupeno has quit [Remote host closed the connection]
Neomex_ has quit [Read error: Connection reset by peer]
josephndenton has quit [Ping timeout: 256 seconds]
Spami has quit [Quit: This computer has gone to sleep]
VBlizzard has joined #ruby
blizzy has quit [Disconnected by services]
VBlizzard is now known as blizzy
dfinninger has quit [Ping timeout: 245 seconds]
lest has quit [Ping timeout: 250 seconds]
emmesswhy has joined #ruby
tamal has joined #ruby
ajacmac has quit [Ping timeout: 250 seconds]
felltir has quit [Remote host closed the connection]
Pupeno has joined #ruby
ixti has quit [Ping timeout: 240 seconds]
tamal has quit [Client Quit]
DadoCe has joined #ruby
AmirolAhmad has joined #ruby
AmirolAhmad has quit [Client Quit]
devoldmx has quit [Remote host closed the connection]
<wasamasa>
gr33n7007h: what the hell was that
ixti has joined #ruby
<gr33n7007h>
wasamasa, just a bit of fun bot, pulling random quotes from /usr/share/calendar/calendar.computer on every ping request
krisquigley has joined #ruby
krisquigley has quit [Client Quit]
devoldmx has joined #ruby
jenrzzz has joined #ruby
jottr has quit [Ping timeout: 255 seconds]
jottr has joined #ruby
wallerdev has joined #ruby
towski_ has joined #ruby
josephndenton has joined #ruby
fandi has joined #ruby
ohaibbq has joined #ruby
ebbflowgo has quit [Quit: ebbflowgo]
startupality has quit [Quit: startupality]
carvantes has quit [Quit: WeeChat 0.3.7]
msmith_ has joined #ruby
jefus__ is now known as jefus
doritostains has quit [Quit: WeeChat 1.0.1]
msmith_ has quit [Ping timeout: 240 seconds]
bkok has quit [Ping timeout: 246 seconds]
valeriansaliou has joined #ruby
cmarques has quit [Remote host closed the connection]
soupson has joined #ruby
soupson has left #ruby [#ruby]
emmesswhy has quit [Quit: Leaving]
Nameo0 has joined #ruby
mgberlin has joined #ruby
valeriansaliou has quit [Ping timeout: 265 seconds]
<shevy>
hehe
sondr3 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mgberlin has quit [Remote host closed the connection]
Takle has joined #ruby
<Nameo0>
Happy 2015! I was wondering how you could go about checking if a certain element exists in certain path while scrapping a website? I am using Nokogiri and Mechanize and this website does not Id or name the elements. So the only way to identify specific elemtns is using .xpath.
dc_ has quit [Remote host closed the connection]
skinux has joined #ruby
<pontiki>
ddd: my javascript console is in the chrome dev tools
<skinux>
Can anyone direct me to the best tutorial (or some kind of free course) for moving from php to ruby?
<ddd>
pontiki, ah
<ddd>
i've heard of people asking that. moving from php to ruby but found nothing except to just learn ruby itself
charliesome has joined #ruby
<pontiki>
ddd: node.js does have a REPL
eka has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Takle has quit [Ping timeout: 245 seconds]
<ddd>
skinux, check out http://iwanttolearnruby.com - Collection of Ruby tutorials, excercises, puzzles, screencasts, blogs, podcasts, conference recordings, and other resources to help you learn Ruby.
<ddd>
pontiki, will look for it. much obliged
mercwithamouth has joined #ruby
blizzy has quit [Ping timeout: 245 seconds]
Sawbones has quit [Remote host closed the connection]
<skinux>
I either want to learn Python or Ruby. Seems like to use Python I have to learn dJango or something, which was a difficult task when I was last trying.
jefus_ has joined #ruby
<pontiki>
ddd, you just run node without and files
<pontiki>
s/and/any/
jefus has quit [Ping timeout: 245 seconds]
<ddd>
ah no separate 'irb' command. got it. i've yet to get node on here. when i do i'll try that out. didn't know it did that
<Bish>
>"test
tlarevo has quit [Remote host closed the connection]
tlarevo has joined #ruby
<Bish>
"test" =~ /test/ => 0
<Bish>
am i fukin missing something?
jherbst has joined #ruby
<shevy>
missing where
<Bish>
shouldn't that be true!?
<Bish>
im using that all the time, and it fucks me up right now
<shevy>
should =~ yield true?
jottr has quit [Ping timeout: 250 seconds]
<Bish>
should helping me cryptic?
<Bish>
be*
<shevy>
it is a simple question
<shevy>
you claimed that it should be true
<shevy>
"test" =~ /e/ # => 1
<shevy>
I claim that it returns a number on a match
<Bish>
oh i see.. i didn't know that, wow
<shevy>
it will be nil if it won't match so you can use it in an if-condition still
<shevy>
if "abc" =~ /z/
<shevy>
won't be evaluated, returns nil, so the if clause will not be entered
<shevy>
if "abc" =~ /a/
<shevy>
now it works
<shevy>
\o/
<Bish>
but if my match is at offset 0, it doesn't go into the if body
<Bish>
oh it does, nevermind
jack_rabbit has joined #ruby
<shevy>
well here you have to remember that nil and false in ruby will be considered false
mary5030 has joined #ruby
soupson has joined #ruby
<Bish>
okay, thank you
<shevy>
so true, 0,1,2, "3" and so forth should be truthy
<robinboening>
I installed ruby 2.2.0 via rvm on my machine (OSX 10.10) and tried to install sqlite3 then. Unfortunately that ended up with an error while compiling some c extensions. The error is exactly the same as you can see in this gist: https://gist.github.com/zzak/695d1e25ec13d62ca671
<robinboening>
Does anyone have an idea how to fix that?
sevvie has quit [Read error: Connection reset by peer]
<centrx>
chipotle, Javascript is historically a front-end language, used entirely in the browser even
leafybasil has joined #ruby
<centrx>
chipotle, Things like Angular and Ember provide a good way of keeping state between the backend and the frontend but they are still primarily front-end
<centrx>
chipotle, That is, in the views
<chipotle>
so what is the point of adding angularjs on top of straight js?
msmith__ has quit [Remote host closed the connection]
uber_hulk has joined #ruby
<centrx>
chipotle, It makes it easy to make UIs and manage UIs that have multiple pages
ballpointcarrot has quit [Ping timeout: 252 seconds]
iamninja has quit [Remote host closed the connection]
<centrx>
chipotle, jQuery is the basic Javascript framework, that's one thing you should learn
iamninja has joined #ruby
<centrx>
chipotle, Javascript itself is almost a very rudimentary language
<chipotle>
and how is jquery different than angular?
<chipotle>
what do you mean by rudimentary?
<centrx>
chipotle, It doesn't have advanced things like map for example
<centrx>
chipotle, and technically it isn't even object-oriented
<chipotle>
is jquery basic because i'ts simple?
lxsameer has joined #ruby
lxsameer has joined #ruby
<centrx>
chipotle, jQuery has a lot of things like a convenience library
<centrx>
chipotle, It also has things for dealing with the DOM, using CSS Selectors
Azure has quit [Quit: My MBP went to sleep.]
<centrx>
chipotle, So it improves JavaScript greatly, like say ActiveSupport (part of Rails) does with Ruby
timonv_ has joined #ruby
<centrx>
chipotle, And then it has specific things to deal with UI issues like HTMl/CSS Selectors
<centrx>
chipotle, as well as a lot of plugins use jQuery, like jQuery charts
leafybasil has quit [Ping timeout: 265 seconds]
<chipotle>
ok
<chipotle>
so i guess i should learn js, then jquery, then maybe angular?
Ankhers has joined #ruby
<centrx>
chipotle, sure yes, JS and jQuery are more fundamental
<centrx>
chipotle, angular might change and not be a standard framework anymore
<centrx>
chipotle, they also have a new release coming out so it might all change in which case less helpful to learn the old version
<centrx>
chipotle, where JavaScript and jQuery are much more core knowledge
<centrx>
chipotle, but you might decide to learn angular or ember or backbone or some other thing
pwnz0r has joined #ruby
<chipotle>
centrx: why would it change?
<chipotle>
doesn't google own it?
<chipotle>
ok
<chipotle>
i will stick to learning js
<chipotle>
what is the best way to learn js?
<centrx>
I have no clue, try #javascript
<centrx>
chipotle, Douglas Crockford is a big JavaScript guy so anything from him is good, but it might be too advanced for an intro
baweaver has quit [Remote host closed the connection]
baweaver has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Menorah has quit [Quit: This computer has gone to sleep]
cmarques has joined #ruby
nonnatus has joined #ruby
icebourg has quit []
ddd has joined #ruby
Dopagod has joined #ruby
Cache_Money has quit [Quit: Cache_Money]
Cache_Money has joined #ruby
govg has joined #ruby
lektrik has joined #ruby
ValicekB has joined #ruby
chipotle_ has quit [Ping timeout: 244 seconds]
chipotle has joined #ruby
baweaver has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 245 seconds]
koderok has joined #ruby
koderok has quit [Client Quit]
josephndenton has joined #ruby
magic__ has joined #ruby
towski_ has quit [Remote host closed the connection]
centrx has quit [Quit: Science is organized knowledge, wisdom is organized life.]
cesarstafe has joined #ruby
jenrzzz has joined #ruby
josephndenton has quit [Ping timeout: 255 seconds]
duncannz has joined #ruby
_Andres has joined #ruby
oo_ has joined #ruby
bronson has joined #ruby
mferrier has quit [Remote host closed the connection]
uber_hulk has quit [Read error: Connection reset by peer]
jaequery has joined #ruby
amclain has quit [Quit: Leaving]
uber_hulk has joined #ruby
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oo_ has quit [Ping timeout: 250 seconds]
PanzerModern has joined #ruby
bronson has quit [Ping timeout: 250 seconds]
claptor has quit [Quit: this channel is bakas]
anarang has joined #ruby
ta_ has joined #ruby
<pontiki>
o/
<ddd>
\o
uber_hul1 has joined #ruby
uber_hulk has quit [Read error: Connection reset by peer]
valeriansaliou has joined #ruby
<pontiki>
i successfully fought the urge to completely rewrite one of services for the client i'm working for
ta_ has quit [Ping timeout: 244 seconds]
timonv_ has quit [Remote host closed the connection]
msmith_ has joined #ruby
chipotle has quit [Ping timeout: 244 seconds]
valeriansaliou has quit [Ping timeout: 245 seconds]
Channel6 has quit [Quit: Leaving]
phil101_ has quit [Ping timeout: 250 seconds]
chipotle has joined #ruby
silkfox has joined #ruby
Musashi007 has joined #ruby
psy has joined #ruby
msmith_ has quit [Ping timeout: 245 seconds]
bousquet has quit []
TomyWork has joined #ruby
Takle has joined #ruby
sandelius has joined #ruby
phil101 has joined #ruby
<sandelius>
Is it appropriate to built a large scale app with Sinatra?
charliesome has joined #ruby
valeriansaliou has joined #ruby
_ixti_ has joined #ruby
cmarques has quit [Remote host closed the connection]
Dopagod has quit [Read error: Connection reset by peer]
tobago has joined #ruby
yfeldblum has joined #ruby
<pontiki>
define "large scale" ?
silkfox has quit [Ping timeout: 244 seconds]
<sandelius>
Large codebase, many many page views
ixti has quit [Ping timeout: 245 seconds]
<sandelius>
most of the endpoint will be an API that serves JSON
<pontiki>
what about database stuff? model / business logic? service objects? and so on?
<sandelius>
Yeah I would put in ActiveRecord or Sequel
oo_ has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pontiki>
if you end up doing everything that Rails would have given you, would it be worth it?
rbrs has joined #ruby
<sandelius>
pontiki here's a quote I found: "There are a lot of other commenters who say that it quickly becomes Rails, and while that's true, I think it's OK, because it becomes Rails tailored for you"
<pontiki>
that's basically the question, isn't it
<pontiki>
you will have learned a lot along the way
<pontiki>
if i weren't using Rails, i wouldn't bother with AR
yfeldblum has quit [Ping timeout: 240 seconds]
Cache_Money has quit [Quit: Cache_Money]
LouisRoR has quit [Ping timeout: 256 seconds]
mercwithamouth has quit [Ping timeout: 245 seconds]
<sandelius>
pontiki I actually like AR, it makes me productive
<pontiki>
I like it as well
davedev2_ has quit [Remote host closed the connection]
oo_ has quit [Ping timeout: 256 seconds]
nicolastarzia has joined #ruby
<pontiki>
the question of "appropriate" has to be determined by you
<pontiki>
that's all
<pontiki>
if this were something i was working on for a client, with other people, rails is probably the way we'd go
<pontiki>
because the people i work with are all more capable and productive in that realm
psy has quit [Ping timeout: 240 seconds]
<sandelius>
pontiki yeah I know. Since our application we're about to build will mostly be an API for a angular frontend I really don't want to bake in entire rails. But I'm a bit worried the rest of the developers will be able to manage a large sinatra app. It requires a lot more thinking but in the end (if you get it right) I think it would be great and performant.
<pontiki>
but if it's not for a specific client, and i'm doing it solo, i'd at least give Sinatra, LotusRB, Cuba, and several alternatives a look. even think about doing it in Rack
zorak8 has joined #ruby
<pontiki>
you don't have to bake in the entire rails stack
<sandelius>
no I know but there
<pontiki>
you can exclude huge swaths of it, in fact
<sandelius>
Yeah but when I've done that, why use Rails then?
<sandelius>
The client is us
<pontiki>
because what's left is still easy to work with, and more familiar to everyone else
nicolastarzia has quit [Ping timeout: 240 seconds]
Cache_Money has joined #ruby
<Nilium>
Hm, my INI parser can read a 27kb INI file in a little under 2ms.. that seems bad.
<sandelius>
pontiki I know you're right but Sinatra makes it so fast and pretty :)
<pontiki>
i'm NOT saying do it in Rails
<Nilium>
Not counting reading the INI file into memory
<pontiki>
i'm also not saying don't do it in Rails
<pontiki>
just be clear on your overall desired outcomes for the project
<sandelius>
pontiki get that and I appreciate to discuss both for and against
<pontiki>
Sinatra is decidedly *un*pretty when you have create many many routes for resources
terlar has quit [Quit: WeeChat 1.0.1]
<sandelius>
pontiki well I would split it into severeal "routes" files and reopen the app class and define them there
<Nilium>
I view Sinatra as a thing you build tiny little test projects in and nothing else
<pontiki>
doesn't make it prettier
<Nilium>
I honestly can't imagine trying to write anything extensive using it
noop has joined #ruby
uber_hul1 is now known as uber_hulk
Cache_Money has quit [Client Quit]
Musashi007 has quit [Quit: Musashi007]
terlar has joined #ruby
arup_r has quit [Remote host closed the connection]
Lingo__ has joined #ruby
Lingo__ has quit [Client Quit]
<pontiki>
sandelius: another consideration is whether you're app should be monolithic, or broken into microservices
<pontiki>
sinatra is quite helpful with microservices
livathinos has joined #ruby
cesarstafe has quit [Ping timeout: 240 seconds]
<pontiki>
but going the microservice route introduces complications as well
kamilc__ has joined #ruby
silkfox has joined #ruby
gr33n7007h has joined #ruby
LouisRoR has joined #ruby
psy has joined #ruby
StoneCypher has quit [Ping timeout: 272 seconds]
hamakn has joined #ruby
timonv_ has joined #ruby
silkfox has quit [Ping timeout: 265 seconds]
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kevr_ has quit [Changing host]
kevr_ has joined #ruby
kevr_ is now known as kevr
sandelius has joined #ruby
ta_ has joined #ruby
startupality has joined #ruby
timonv_ has quit [Ping timeout: 256 seconds]
Musashi007 has joined #ruby
jack_rabbit has quit [Ping timeout: 264 seconds]
ianfleeton has joined #ruby
ta_ has quit [Ping timeout: 244 seconds]
arup_r has joined #ruby
livathinos has quit [Read error: Connection reset by peer]
livathinos has joined #ruby
silkfox has joined #ruby
yeticry has quit [Ping timeout: 244 seconds]
codecop has joined #ruby
codecop_ has joined #ruby
yeticry has joined #ruby
gusto has quit [Ping timeout: 265 seconds]
SixiS has joined #ruby
gusto has joined #ruby
jaequery has joined #ruby
ohaibbq has quit [Quit: Leaving...]
LouisRoR has quit [Ping timeout: 245 seconds]
LouisRoR has joined #ruby
yfeldblum has joined #ruby
jack_rabbit has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
Axy has joined #ruby
Mia has quit [Read error: Connection reset by peer]
timonv_ has joined #ruby
j0n3 has joined #ruby
j0n3 has quit [Read error: Connection reset by peer]
oo_ has joined #ruby
codecop_ has quit [Quit: Išeinu]
valeriansaliou has quit [Quit: Be back later ...]
pwnz0r has quit [Remote host closed the connection]
decoponio has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
pwnz0r has joined #ruby
silkfox has quit [Ping timeout: 265 seconds]
Techguy305 has joined #ruby
oo_ has quit [Ping timeout: 264 seconds]
jack_rabbit has quit [Ping timeout: 245 seconds]
pwnz0r has quit [Ping timeout: 256 seconds]
haxr has joined #ruby
Flcn__ has joined #ruby
lkba has quit [Ping timeout: 255 seconds]
Musashi007 has quit [Quit: Musashi007]
Nameo0 has quit [Ping timeout: 240 seconds]
valeriansaliou has joined #ruby
lkba has joined #ruby
felltir has joined #ruby
Musashi007 has joined #ruby
gigetoo has joined #ruby
zorak8 has quit [Ping timeout: 250 seconds]
chipotle has quit [Quit: cheerio]
valeriansaliou has quit [Ping timeout: 240 seconds]
arup_r has quit []
bronson has joined #ruby
_ixti_ has quit [Ping timeout: 256 seconds]
bMalum has joined #ruby
siso has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
Musashi007 has quit [Quit: Musashi007]
haxr has quit [Ping timeout: 255 seconds]
valeriansaliou has joined #ruby
Musashi007 has joined #ruby
noname001 has joined #ruby
oo_ has joined #ruby
devoldmx_ has quit [Remote host closed the connection]
Sawbones has joined #ruby
timonv_ has quit [Read error: Connection reset by peer]
oo_ has quit [Ping timeout: 240 seconds]
Ilyas has joined #ruby
ta_ has joined #ruby
iamninja has quit [Remote host closed the connection]
psy has quit [Read error: No route to host]
msmith_ has joined #ruby
fandi has quit [Quit: Leaving]
iamninja has joined #ruby
psy has joined #ruby
ta_ has quit [Ping timeout: 244 seconds]
msmith_ has quit [Ping timeout: 240 seconds]
Techguy305 has quit [Ping timeout: 240 seconds]
abdulsattar has joined #ruby
leafybasil has joined #ruby
Musashi007 has quit [Quit: Musashi007]
yfeldblum has joined #ruby
kiyote23 has joined #ruby
valeriansaliou has quit [Quit: Be back later ...]
mengu has quit [Remote host closed the connection]
iamninja has quit [Quit: ZZZzzz…]
yfeldblum has quit [Ping timeout: 250 seconds]
ARCADIVS has quit [Quit: ARCADIVS]
kiyote23 has quit [Ping timeout: 244 seconds]
nicolastarzia has joined #ruby
yeticry has quit [Ping timeout: 240 seconds]
timonv_ has joined #ruby
duncannz has quit [Ping timeout: 250 seconds]
kp666 has quit [Read error: Connection reset by peer]
marr has joined #ruby
jenrzzz has joined #ruby
yeticry has joined #ruby
duncannz has joined #ruby
Cust0sLim3n has quit [Read error: Connection timed out]
Cust0sLim3n has joined #ruby
nicolastarzia has quit [Ping timeout: 265 seconds]
silkfox has joined #ruby
valeriansaliou has joined #ruby
gccostabr has joined #ruby
yeticry has quit [Ping timeout: 264 seconds]
yeticry has joined #ruby
silkfox has quit [Ping timeout: 244 seconds]
siso has quit [Ping timeout: 272 seconds]
gccostabr has quit [Ping timeout: 245 seconds]
gccostabr has joined #ruby
yeticry has quit [Remote host closed the connection]
valeriansaliou has quit [Quit: Be back later ...]
Flcn__ has quit [Quit: Be back later ...]
yeticry has joined #ruby
abdulsattar has quit [Quit: Leaving.]
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby
siso has joined #ruby
Sawbones has quit [Remote host closed the connection]
yeticry has quit [Ping timeout: 244 seconds]
Sawbones has joined #ruby
banister has quit [Ping timeout: 240 seconds]
Criztian has joined #ruby
Criztian has quit [Remote host closed the connection]
Criztian has joined #ruby
lemur has quit [Remote host closed the connection]
lemur has joined #ruby
DaniG2k has joined #ruby
banister has joined #ruby
ta_ has joined #ruby
yeticry has joined #ruby
rbrs has quit [Quit: Leaving]
lemur has quit [Ping timeout: 244 seconds]
jefus_ has joined #ruby
ta_ has quit [Ping timeout: 255 seconds]
yeticry has quit [Ping timeout: 240 seconds]
yeticry has joined #ruby
jefus has quit [Ping timeout: 255 seconds]
rbrs has joined #ruby
sevvie has joined #ruby
ianfleeton has quit [Remote host closed the connection]
felltir has quit []
Yzguy has joined #ruby
Sawbones has quit [Remote host closed the connection]
duncannz has quit [Remote host closed the connection]
yeticry has quit [Remote host closed the connection]
yeticry has joined #ruby
gregf__ has quit [Quit: Lost terminal]
oo_ has joined #ruby
sevvie has quit [Ping timeout: 244 seconds]
bronson has joined #ruby
yeticry has quit [Remote host closed the connection]
oo_ has quit [Ping timeout: 255 seconds]
Flcn__ has joined #ruby
lkba_ has joined #ruby
bronson has quit [Ping timeout: 250 seconds]
sevvie has joined #ruby
Yzguy has quit [Quit: I'm sleeping, go away.]
lkba has quit [Ping timeout: 250 seconds]
yeticry has joined #ruby
andikr has joined #ruby
yfeldblum has joined #ruby
ddd has quit [Ping timeout: 245 seconds]
gregf_ has joined #ruby
davedev24_ has joined #ruby
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has quit [Ping timeout: 265 seconds]
ptrrr has joined #ruby
Flcn__ has quit [Ping timeout: 256 seconds]
fantazo has joined #ruby
mengu has joined #ruby
wald0 has joined #ruby
<wald0>
im not very familiarized with C yet, and I use a lot of regex like gsub, what there's good solutions in C for do regex/substitutions?
<wald0>
for example, how i can use strcmp with regex ?
<wald0>
or how i can remove the trailing slash from "/usr/local/share:/usr/local/share/:/usr/share/" ?
zorak8 has joined #ruby
m8 has joined #ruby
Lingo__ has joined #ruby
andikr has quit [Remote host closed the connection]
sandelius has joined #ruby
blueOxigen has joined #ruby
bluOxigen has quit [Ping timeout: 255 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<felltir>
not convinced godd2, what if that options hash is used elsewhere?
<felltir>
you're altering it
<godd2>
I'm only alterive values if the key doesnt have one yet
fandi has joined #ruby
<felltir>
yeah, but still
sevvie has joined #ruby
<felltir>
what if those options are used for two methods, with different defaults on each?
<godd2>
I'm not sure what you're implying is wrong with my code
<godd2>
I mean, if there is something wrong/bad I'd like to know
<felltir>
so imagine that two methods use the same options hash, which is empty
<felltir>
in the first, it's empty, so your code alters it
<felltir>
in the second, it's no longer empty, so the default values are not applied
<godd2>
opts is local to the method call
ItSANgo has quit [Read error: Connection reset by peer]
silkfox has quit [Ping timeout: 256 seconds]
<felltir>
unless a hash is passed in
<felltir>
in which case it's that object
<godd2>
ah I see
Heskie has joined #ruby
ItSANgo has joined #ruby
<godd2>
okay lemme go think about it
<waxjar>
Hash#merge, ftw!
<felltir>
do you want me to make up an example to help?
nonnatus_ has quit [Read error: Connection reset by peer]
krz has quit [Ping timeout: 240 seconds]
cescalante_ has quit [Ping timeout: 240 seconds]
nonnatus_ has joined #ruby
<felltir>
yeah, this is why merge is good here :)
<felltir>
because it's not merge!
<godd2>
ah you're right
<godd2>
thank you :_
<godd2>
:) *
cescalante has joined #ruby
<felltir>
I've been bitten before :) no problem
<droidburgundy>
yeah I am reading about merge
<droidburgundy>
learning ruby as i go here
<godd2>
I have some production code to change...
TrOuBleStArTeR_ has joined #ruby
krz has joined #ruby
rbrs has quit [Quit: rbrs]
giuseppesolinas has joined #ruby
TrOuBleStArTeR_ has quit [Client Quit]
<godd2>
man, no wonder keyword args are better
<felltir>
yeeeep
<felltir>
I was so happy when they came in
<godd2>
the easier alternative is opts = opts.dup but of course, that has its clear drawbacks
sevvie has quit [Read error: Connection reset by peer]
<felltir>
heh, yeah
<felltir>
Merge is just that but easier
<godd2>
well actually, would it be so bad?
<godd2>
merge makes a new hash anyway
josephndenton has joined #ruby
<felltir>
yeah
DLSteve has joined #ruby
<felltir>
it's no worse than merge
<felltir>
just more verbose
TrOuBleStArTeR has quit [Ping timeout: 240 seconds]
<droidburgundy>
why would anyone stay with 1.8.7
<godd2>
yea that's true. If I want to be more declarative, then merge is better
<droidburgundy>
is updating and managung rvm that much trouble?
<felltir>
they really like production security issues?
<droidburgundy>
its eol though
haxrr has joined #ruby
<droidburgundy>
lol
<felltir>
they hate utf-8?
<felltir>
idk :p
<godd2>
they love hashrockets
<waxjar>
the switch between 1.8.7 and 1.9 was quite big i believe. other than that, no idea.
<felltir>
we still have hashrockets!
haxr has quit [Ping timeout: 244 seconds]
<waxjar>
laziness
<godd2>
1.9 really was a 2.0 kind of change in a lot of ways
<godd2>
all except for the name
<felltir>
yup
sevvie has joined #ruby
josephndenton has quit [Ping timeout: 255 seconds]
yfeldblum has joined #ruby
bronson has joined #ruby
lxsameer has quit [Quit: Leaving]
icbm has joined #ruby
mercwithamouth has quit [Ping timeout: 265 seconds]
Heskie_ has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
yfeldblum has quit [Ping timeout: 265 seconds]
Heskie has quit [Ping timeout: 250 seconds]
Heskie_ is now known as Heskie
Hanmac has quit [Ping timeout: 265 seconds]
wald0 has joined #ruby
pyr0commie has joined #ruby
TrOuBleStArTeR_ has joined #ruby
TrOuBleStArTeR_ is now known as TrOuBleStArTeR
TrOuBleStArTeR has quit [Client Quit]
AlSquire has joined #ruby
shredding has quit [Quit: shredding]
shredding has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
Flcn__ has quit [Quit: Be back later ...]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
Hanmac has joined #ruby
hamakn has quit [Remote host closed the connection]
silkfox has joined #ruby
doev has quit [Quit: Verlassend]
rurban has joined #ruby
rurban has left #ruby [#ruby]
Heskie has quit []
apurcell has joined #ruby
jherbst has quit [Read error: Connection reset by peer]
Heskie has joined #ruby
uber_hulk has quit [Quit: leaving]
s7ry93r has joined #ruby
tkuchiki has joined #ruby
egtann has quit []
apurcell has quit [Ping timeout: 245 seconds]
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
ta_ has joined #ruby
josephndenton has joined #ruby
shredding has quit [Quit: shredding]
tkuchiki has quit [Ping timeout: 240 seconds]
shredding has joined #ruby
ta_ has quit [Ping timeout: 265 seconds]
freerobby has quit [Quit: Leaving.]
St_Marx has quit [Ping timeout: 250 seconds]
kostitas has joined #ruby
freerobby has joined #ruby
shredding has quit [Client Quit]
j2p2 has joined #ruby
nrsk has joined #ruby
nrsk has quit [Client Quit]
TrOuBleStArTeR has joined #ruby
shredding has joined #ruby
doodlehaus has joined #ruby
d10n-work has joined #ruby
codecop has quit [Remote host closed the connection]
apurcell has joined #ruby
bMalum has joined #ruby
iamjarvo has joined #ruby
silkfox has quit [Ping timeout: 255 seconds]
Heskie has quit []
St_Marx has joined #ruby
sambao21 has joined #ruby
Altonymous has joined #ruby
Nameo0 has joined #ruby
msmith_ has joined #ruby
apurcell has quit [Ping timeout: 255 seconds]
iamjarvo has quit [Client Quit]
<Altonymous>
All I have a key/value list of ~6MM items, using redis.. In some cases I’m doing a multi-get lookup on this set for about 250k keys. (I batch them in 1k batches) This is becoming a real performance issue. Does anyone have a good pattern for how I might make this more performant? The keys are random strings and the value is which group that string belongs in.
rbennacer has joined #ruby
yfeldblum has joined #ruby
msmith_ has quit [Ping timeout: 245 seconds]
Sawbones has joined #ruby
Asher has joined #ruby
Heskie has joined #ruby
blizzy has joined #ruby
iamjarvo has joined #ruby
iamjarvo has quit [Client Quit]
<IceDragon>
Altonymous: sounds to me thats a redis question, not much of a ruby question
giuseppesolinas has joined #ruby
silkfox has joined #ruby
slawrence00 has joined #ruby
yfeldblum has quit [Ping timeout: 264 seconds]
yalue has joined #ruby
Sawbones has quit [Ping timeout: 250 seconds]
sinkensabe has quit [Remote host closed the connection]
devoldmx has joined #ruby
MarcWeber has joined #ruby
Nameo0 has quit [Ping timeout: 256 seconds]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
Xeago has quit [Remote host closed the connection]
Altonymous has quit [Quit: Altonymous]
diegoviola has joined #ruby
blackmesa has joined #ruby
Xeago has joined #ruby
nicolastarzia has joined #ruby
rbennacer has quit [Remote host closed the connection]
Menorah has joined #ruby
Pupeno has quit [Ping timeout: 255 seconds]
snath has quit [Ping timeout: 272 seconds]
shredding has quit [Quit: shredding]
rbennacer has joined #ruby
oleo has quit [Ping timeout: 250 seconds]
oleo has joined #ruby
nicolastarzia has quit [Ping timeout: 245 seconds]
j2p2 has quit [Ping timeout: 240 seconds]
crueber has joined #ruby
sinkensabe has joined #ruby
behrz has joined #ruby
mikedugan is now known as mikedugan_unzipd
silkfox has quit [Ping timeout: 256 seconds]
j2p2 has joined #ruby
mikedugan_unzipd is now known as mikedugan
silkfox has joined #ruby
revoohc has joined #ruby
felltir has quit []
sevvie has quit [Read error: Connection reset by peer]
kirun has joined #ruby
gr33n7007h has quit [Ping timeout: 264 seconds]
Altonymous has joined #ruby
<Altonymous>
IceDragon: I asked in redis, but I think this is more of a logic puzzle then a specific technology.
gr33n7007h has joined #ruby
sevvie has joined #ruby
<bradland>
your solution will be a combination of Redis optimization and systems architecture
<IceDragon>
first up, you need to get the database access times and then ruby's conversion times before you can be sure its one or the others fault
<Altonymous>
I can switch to any tech needed.
paulfm has joined #ruby
<bradland>
IceDragon is right. Before you can optimize, you should fully understand what is slow. Time for some profiling.
greenbagels has quit [Ping timeout: 272 seconds]
<Altonymous>
I understand what is slow.
_5kg has quit [Ping timeout: 244 seconds]
hydrozen has joined #ruby
Fire-Dragon-DoL has joined #ruby
<Altonymous>
It’s an issue on the querying of redis.
fantazo has quit [Quit: Verlassend]
<Altonymous>
I don’t think there’s anymore optimizations to be done, aside from sharding the data out to multiple servers
bMalum has quit [Quit: bMalum]
leafybasil has quit [Remote host closed the connection]
<Altonymous>
I’m trying to look for a different storage pattern to see if I can query the data more effeciently before I throw more hardware at it
motti74 has joined #ruby
leafybasil has joined #ruby
Flcn__ has joined #ruby
nonnatus_ has quit [Read error: Connection reset by peer]
nonnatus_ has joined #ruby
<motti74>
hello
giuseppesolinas has joined #ruby
<Altonymous>
The strings are random and I have no control over them. When a new string comes in that doesn’t match a key in redis we iterate over ~500 regex expressions to find a group for it. Once a group is found it is put into redis with the string as the key and the group # as the value.
<shevy>
this is starting to sound like a nightmare
Flcn__ has quit [Ping timeout: 244 seconds]
gsd has joined #ruby
m8 has quit [Ping timeout: 244 seconds]
sinkensabe has quit [Remote host closed the connection]
<Altonymous>
It most definitely is..
m8 has joined #ruby
ta_ has joined #ruby
silkfox has quit [Ping timeout: 244 seconds]
mrmargolis has joined #ruby
omosoj has joined #ruby
<bradland>
when you say you’re using regexp to find a group, is that data part of the string that comes in?
<omosoj>
hey guys, i'm having trouble installing ruby 2.1.3 with rvm
<bradland>
that’s probably an obvious question, but i want to make sure
<Altonymous>
i use the string that is sent in and iterate over a group of approx ~500 regexs When there is a match I stop iterating and use the details for that regex as the value in the key/value pair I insert into redis. The regexs are stored in a postgresql table with the regex and meta data about that “group”
hydrozen has quit [Quit: Computer has gone to sleep.]
<shevy>
omosoj looks as if it tries to use a binary
<shevy>
does not rvm normally compile from source?
<bradland>
what percentage of the total op time is spent on that portion of the work?
bMalum has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
<bradland>
omosoj: i’d start with `rvm get stable`. it might just be an out of date URL.
<shevy>
omosoj don't really know but I think the binary part is weird, even more so as I would assume that you would not have to download rubygems, if you use an up-to-date source ruby
<shevy>
rubygems comes bundled with source ruby tarball archives
<omosoj>
bradland, what affect does the --without-binary have?
<bradland>
Altonymous: the reason i ask is that regex is slow compared to operations like a hash lookup or straight comparisons
<Altonymous>
The regex only happens when I can’t find the key in redis
<bradland>
omosoj: that will cause rvm to skip the checks for binary versions of the ruby and rubygems applications. which means they’ll compile on your machine.
Zai00 has quit [Quit: Zai00]
<bradland>
Altonymous: ok, so that’s not really in the problem domain you’re trying to solve.
weems|mac has joined #ruby
<Altonymous>
That is not where the time is spent, the time is in the redis query to look for the keys that match the lists of strings I’m given. I use mget to retrieve them from redis.
Flcn__ has joined #ruby
<Altonymous>
Right I was just giving the overall design
DaniG2k has quit [Ping timeout: 250 seconds]
giuseppesolinas has joined #ruby
<bradland>
ok, cool
<omosoj>
bradlands, hm, what affect does that have? (sorry i don't know very much)
<Altonymous>
To help paint a clearer picture of what is going on
<Altonymous>
The problem is there are 6MM keys in redis ..
<bradland>
yeah, that’s a sizable data set
<Altonymous>
I get anywhere from 0 to ~250k keys in a request
nunayerBeezwax has joined #ruby
<electrical>
Altonymous: you could try to use the scripting inside redis to have some work in redis done. might be faster.
<bradland>
but key lookups is what redis does
<Altonymous>
that I need to lookup in redis
<bradland>
so, if you’re hitting a performance ceiling, you either need to look at a way to change your key structure so that you can group more easily
<bradland>
or you need to start scaling out
kapil__ has quit [Quit: Connection closed for inactivity]
<Altonymous>
Yeah and that’s what I’m racking my brain on.. how to better build out he key structure.
<bradland>
omosoj: when software is “compiled”, the source code is downloaded and “built” from the source files.
<Altonymous>
build out the*
<bradland>
the end result is a “binary” (multiple binaries and libraries, actually)
apurcell has joined #ruby
Flcn___ has joined #ruby
<bradland>
for common architectures (operating system and processor types), rvm will try to download a pre-compiled set of software, so you don’t have to wait on compilation
mostlybadfly has quit []
<Altonymous>
I have a feeling scaling out is the next step, but it would be helpful if I could make sure before asking for more funding...
Flcn__ has quit [Read error: Connection reset by peer]
<bradland>
rvm keeps a list of locations for these binaries
mostlybadfly has joined #ruby
<bradland>
so the very first thing you should do is run `rvm get stable`, which will update rvm to the latest version
<bradland>
this will have the most up to date list of binary locations and build strategies
<omosoj>
bradland, ah, i think i understand.
athan has joined #ruby
<bradland>
Altonymous: unfortunately, i don’t know a whole lot about redis. can you have multiple keys for a single data node?
<omosoj>
i get an error when i do rvm get stable. lol. gpg error :(
<Altonymous>
bradland: no problem. Not sure I follow your question.
karmatr0n has joined #ruby
sevvie has quit [Read error: Connection reset by peer]
<athan>
Hey folks, does ruby have a module system? I see that gems are a thing, and we can load them with `require "foo"`, but how would one organize an application internally with gems / modules? I see some examples where files themselves are imported, but is there something more semantic and clean for this? I'm trying to load some rails code btw - I'm not sure if there's a standard "boostrapping" system for ruby / module delcaration system that'
<athan>
s sound.
Zai00 has joined #ruby
Cust0sLim3n has quit [Read error: Connection timed out]
<bradland>
Altonymous: well, what i’m thinking is that if you have grouping strategies, you could create keys based on those groups, then query based on the group instead of just a set of unique keys.
<bradland>
the goal being to reduce the set of keys you have to query for.
charliesome has quit [Quit: zzz]
apurcell has quit [Ping timeout: 244 seconds]
Cust0sLim3n has joined #ruby
amil has joined #ruby
<Altonymous>
Well the one thought I had was to make a set of more generic regex’s that could narrow down the sets.. but I don’t think it’s going to buy me much other than more complexity
yfeldblum has joined #ruby
ponga has joined #ruby
<Altonymous>
I’ve tried thinking about a way to flip the dataset and query by group and then get a list of all “strings” that belong in that have been found for that group..
bronson has joined #ruby
<Altonymous>
But the list of “strings” per group can be over 1MM
dkb20k has quit [Remote host closed the connection]
dr_bob has left #ruby [#ruby]
<bradland>
yikes
<bradland>
time to scale it out
<Altonymous>
So I’d have Group X with 1MM keys.. that I would have to iterate over looking for a match
kamilc__ has quit [Ping timeout: 256 seconds]
<nunayerBeezwax>
after adding an api wrapper gem to a non-rails ruby project i receive this error "undefined method `logger' for Rails:Module (NoMethodError)" which is generated by the line from the gem "self.logger ||= configuration.logger || (defined?(Rails) ? Rails.logger : Logger.new(STDOUT))" help?
<bradland>
omosoj: you’re probably going to need to reinstall rvm
<Altonymous>
I tried switching to memcached so I could take advantage of the LRU feature it has by default, since I can’t enable that on our redis instance.. but I got a crazy # of timeouts.. so I had to switch back to redis.
<omosoj>
bradland, is that easy? i mean, what happens to all the ruby versions?
DaniG2k has joined #ruby
<omosoj>
bradland, okay, think rvm update is working now
krz has quit [Quit: WeeChat 1.0.1]
yfeldblum has quit [Ping timeout: 255 seconds]
boulder-ruby has joined #ruby
<IceDragon>
nunayerBeezwax: defined?(Rails) will return true if you have anything that defined a Rails constant (whether it was a class, or module)
ule has joined #ruby
<IceDragon>
nunayerBeezwax: Are you using active_support or something from the actionpack?
<bradland>
Altonymous: redis sounds like it’s probably the right tool for the job. you’re just hitting the upper boundary of your current architecture’s performance.
bronson has quit [Ping timeout: 245 seconds]
<bradland>
athan: depends on what you mean by “module” system. gems are packaged code.
DaniG2k has quit [Client Quit]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
StoneCypher has joined #ruby
DaniG2k has joined #ruby
<athan>
bradland: I want to say something that references code
sinkensabe has joined #ruby
<bradland>
when you install them, they’re unpacked to a location specified by the rubygems system. they’re available for use in your application because rubygems/bundler alters the load path.
ule has left #ruby [#ruby]
karmatr0n has quit [Remote host closed the connection]
Sawbones has joined #ruby
<athan>
bradland: Okay, that makes sense. Internally though, we just import arbitrary files, kinda like PHP?
noname001 has quit [Ping timeout: 245 seconds]
Flcn___ has quit [Ping timeout: 240 seconds]
<bradland>
ok, so `require` is what you want
<bradland>
what is “requireable” depends on your load path
Heskie has quit [Read error: Connection reset by peer]
<athan>
ahh! I see!
<athan>
is `.` in the load path by default?
<bradland>
not any more
<bradland>
it used to be, but it’s a security issue
<bradland>
there is require_relative though
<omosoj>
hey bradland, looks like it's working. thanks for the help :)
<athan>
ahh shoot, so you have to manually add files to the gemfile or something to make them requireable?
Heskie has joined #ruby
ta_ has joined #ruby
<bradland>
well, Gemfile is part of bundler
<athan>
wow, thanks for the info bradland, that helps a lot
<bradland>
i know, this gets to be kind of all over the place
<bradland>
but
renderful has joined #ruby
<bradland>
at the heart of it all is the load path. you can inspect the load path by looking at the variable $LOAD_PATH
<athan>
it's not as bad as Yii on php :P
<athan>
ahh! Awesome!
<bradland>
Gemfile is part of bundler
<bradland>
the docs for bundler are pretty accessible
<bradland>
so, at the base you have the LOAD_PATH, which is a list of directories where ruby will attempt to file files specified in `require ‘filename’`
<athan>
oh woah, okay, where rubygems is a package organization methodology?
StoneCypher has quit [Ping timeout: 245 seconds]
Pupeno has joined #ruby
Pupeno has joined #ruby
<bradland>
rubygems downloads and upacks code to GEM_HOME, and if implemented in your application, makes everything installed there available to require
Sawbones has quit [Ping timeout: 240 seconds]
<athan>
ahh okay that makes sense, and bundler makes those packages locally available to your project?
<athan>
with `bundle install`?
<bradland>
bundler allows you to specify a list of gems required for your application, and provides a toolset for installing and locking versions of gems
<athan>
ahh perfect
<bradland>
right
<bradland>
bundler is a lot more than that though
<bradland>
for example, when it comes time to deploy your application, bundler has tools for installing the bundle to specific locations (for server deployments)
tadasp has joined #ruby
<bradland>
it’s all very flexible, but there are some conventions
<athan>
ahh that's nice!
sevvie has joined #ruby
<athan>
we can't make executables with ruby, can we?
<athan>
standalone ones?
<bradland>
short answer: ruby is interpreted, so you need the ruby interpreter.
<bradland>
just like PHP
Yzguy has joined #ruby
<ponga>
someone said 'just like PHP' ?
<bradland>
but there is a project whose aim is to make standalone ruby executables
<bradland>
hahaha :)
* ponga
glares
renderful has quit [Ping timeout: 265 seconds]
<athan>
that makes sense, I wouldn't doubt some nutty people to compile it thought
<bradland>
i would definitely not start with that though
<bradland>
i’d start with a ruby interpreter installed by a ruby manager
<athan>
I won't lol
<bradland>
ruby developers are very tool oriented
<bradland>
it’s common to install many different versions of ruby
<athan>
Command-line tool?
<ponga>
i use RVM
<bradland>
yeah, command line tools for managing all sorts of things
<athan>
ahh yeah, I've got rbenv on my rig right now
kasperti_ has joined #ruby
<ponga>
i don't hate it
<bradland>
ok, yeah. rbenv is one of the ruby managers
<athan>
lol
vin` has joined #ruby
<bradland>
there are three mainstream ones: chruby, rbenv, and rvm
<athan>
I want to port it to the fish shell =\
<bradland>
studying a ruby manager is a great way to understand how ruby and rubygems work
<ponga>
i only used rvm, is rbenv that good so it seems that pretty much everyone in this channel uses rbenv or source
<ponga>
at least to me
<bradland>
chruby has become very popular
<ponga>
like, everyone is using rbenv here
<bradland>
i use rvm
mary5030 has joined #ruby
<bradland>
but i’m ambivalent
<ponga>
about rvm?
<bradland>
about ruby managers in general
<diegoviola>
RubySpec is dead?
SixiS has quit [Quit: SixiS]
ajacmac has joined #ruby
ta_ has quit [Ping timeout: 244 seconds]
boulder-ruby has quit [Quit: boulder-ruby]
<ponga>
bradland: are you one of the folks who believe everything is better when done manually
<IceDragon>
diegoviola: yep
<IceDragon>
diegoviola: would you like the new article?
<IceDragon>
*news
<diegoviola>
already have it
<diegoviola>
ty
<IceDragon>
k
<bradland>
ponga: sorry, no. i mean that I don’t have a strong preference for any one ruby manager, but I do think using a ruby manager is a good idea.
<ponga>
ah hah
blackmesa has quit [Ping timeout: 245 seconds]
GaryOak_ has joined #ruby
* athan
grows a computer organ
* IceDragon
gawks @ athan
alecs has joined #ruby
<athan>
X_X
<diegoviola>
what does the end of RubySpec means for the community
<IceDragon>
no more up to date ruby-specing? /bent the words
<bradland>
RubySpec is open source.
<IceDragon>
what bradland said, some brave soul will take up the torch and carry it on
<bradland>
or they won't
<diegoviola>
bradland: yes, someone can just fork it and keep improving it
boulder-ruby has joined #ruby
Milos has joined #ruby
<bradland>
the maintainer’s complaint is that MRI doesn’t use it to his satisfaction, so the question isn’t what does the end of RubySpec mean, the question is, how does the lack of an accessible Ruby specification affect the Ruby community.
<bradland>
Ruby has an ISO spec, btw.
<bradland>
Apparently it costs $$ to access it and it’s not up to date.
<IceDragon>
you could always get the drafts for free
_5kg has joined #ruby
<IceDragon>
or just look at mruby for an idea, since its based off the ISO spec
giuseppesolinas has joined #ruby
shellfu has joined #ruby
apurcell has joined #ruby
<bradland>
If you use MRI, the events surrounding RubySpec don’t mean much for you. If you use an alternate Ruby implementation, it means that the maintainers have lost a significant contributor to the process of identifying and documenting the canonical Ruby(MRI) implementation specification.
omosoj has quit [Quit: leaving]
<bradland>
upon which they build their language.
<bradland>
but as you’ll probably read, some other implementations are able to run the MRI test suite against their own code base.
<bradland>
JRuby does this.
aclearman037 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fivetwentysix has joined #ruby
fivetwentysix has quit [Client Quit]
<brixen>
raise your hand if you have implemented Ruby and used MRI's tests
<ponga>
when would you want to use Jruby over MRI
<ponga>
im really asking this
apurcell has quit [Ping timeout: 240 seconds]
<brixen>
ponga: you should try it
<brixen>
direct experience is worth far more than 874 opinions
<ponga>
does Jruby mean ruby is compiled not interpreted like java
<ponga>
ok
aef_ has quit [Remote host closed the connection]
aef has joined #ruby
<bradland>
to be clear, my comments are not intended to diminish the herculean effort required to maintain RubySpec or the contribution that it has provided.
_Andres has quit [Ping timeout: 264 seconds]
hydrozen has joined #ruby
<ponga>
brixen: so for Jruby i just write in ruby ? not like i have to use java methods and syntax inside ruby?
DaniG2k has quit [Quit: leaving]
<IceDragon>
ponga: you can import java stuff in your ruby code :3
aclearman037 has joined #ruby
msmith_ has joined #ruby
_Andres has joined #ruby
tus has joined #ruby
<bradland>
ponga: You can just write ruby, or you can import java libs. However, you’ll have to use the Java libs’ interfaces, which are often quite different from Ruby libs.
<ponga>
ok
<bradland>
`rvm install jruby`
<bradland>
give it a whirl
snath has joined #ruby
<ponga>
im reading my java book again at the moment
<ponga>
and apparently i still don't like java
Flcn___ has joined #ruby
msmith_ has quit [Ping timeout: 240 seconds]
basichash has joined #ruby
blackmesa has joined #ruby
sinkensabe has quit [Remote host closed the connection]
Flcn___ has quit [Ping timeout: 245 seconds]
msmith_ has joined #ruby
psy has quit [Remote host closed the connection]
haxrr has quit [Ping timeout: 244 seconds]
<bradland>
i’m not crazy about the way most java apps are structured, but jruby is a ruby interpreter, so you needn’t touch any java to use it.
<bradland>
it “just works™”
<shevy>
needs java
<brixen>
until you get a backtrace ;)
<bradland>
hahaha
<brixen>
you never get those in Ruby though, amirite
<shevy>
there are no bugs here
<brixen>
ponga: please try Rubinius, too. easiest is to use chruby and ruby-install
<bradland>
i was going to say. can’t be much worse than digging through 25 lines of library calls until i get to my app.
<shevy>
athan cool you are a fish shell user
_Andres has quit [Read error: Connection reset by peer]
<shevy>
I always liked the colourized help in it
<shevy>
the only reason why I still use bash really is because I am too lazy to switch
<athan>
shevy: The incompatability with bash is the thorn in the heel, but I love it
<shevy>
hehe
<athan>
yeah haha
<athan>
it also has better typing
<athan>
like your $PATH variable is actually an array
<athan>
and commands are semicolon delimited (idk if bash does this actually)
silkfox has joined #ruby
<JimmyNeutron>
Anyone know of any free site that allows multiple people to work on a ruby source code file in real time and run it so everyone can see the output?
psy has joined #ruby
<ponga>
damn i need to install java to use jruby?
<ponga>
it says broken and asks me to install one
<ponga>
installed one, still saying broken
<bradland>
er, yeah. there’s that.
ta_ has joined #ruby
<ponga>
would i need to restart my mac for this
<JimmyNeutron>
Most site I see allows you to edit in real time w/ multiple people, but can't run it online so everyone can see the results.
<ponga>
i installed it right but still saying errors
Flcn___ has joined #ruby
<shevy>
ponga hehe
<shevy>
that is why I dont use java
<athan>
JimmyNeutron: Vnc? :s
shellfu is now known as shellfu_coffee
<shevy>
JimmyNeutron yeah there is some site
<shevy>
some guy pasted a link here like 8 days ago or so
<ponga>
shevy: so you don't use jruby?
<shevy>
I do not recall what pastie it was
<athan>
JimmyNeutron: I'm gonna make one soon, but on haskell :\
<JimmyNeutron>
athan, I'm trying to avoid VNC, RDP, etc..
<shevy>
ponga nope because of the java requirement
<bradland>
ponga: do you have JDK installed?
<ponga>
damn it it was jdk?
<ponga>
why would it then asked me to install JRE
<ponga>
not JDK
<shevy>
yeah the larger part
<bradland>
JimmyNeutron: I don’t know if any collaborative editing service that allows you to eval.
<shevy>
the smaller one is for users but you are becoming a big developer ponga so get the big download!
<bradland>
ponga: doh! sry, it probably only requires the JRE.
<bradland>
I have JDK because i do some minecraft stuff.
<shevy>
:D
<shevy>
gamer!
<ponga>
bradland: so i installed JRE fine but still saying same error
* ponga
still don't like java
<shevy>
haha
<JimmyNeutron>
Thanks everyone! Guess they have to just save the output and run it locally.
<bradland>
i don’t know what the requirement is for jruby JDK/JRE.
hellome has joined #ruby
<ponga>
shevy: my first programming exprience was java
<bradland>
JimmyNeutron: have you considered using something like a tmux shares session?
<ponga>
i don't like it
<shevy>
mine was BASIC
<shevy>
I actually liked BASIC
<ponga>
what?
<shevy>
:)
<ponga>
my dad's first was like BASIC
<shevy>
goto 40
<ponga>
how old are you ser
_Andres has joined #ruby
<shevy>
I can't say
<bradland>
what did you program BASIC on shevy?
<JimmyNeutron>
bradland, actually, that's not a bad idea...forgot all about tmux and screen
terlar has quit [Ping timeout: 244 seconds]
<JimmyNeutron>
bradland, Thanks!
<bradland>
i had a BASIC cartridge for my Atari 400.
<shevy>
ponga yeah, except for that initial startup time so I think for large programs jruby should be significantly faster all the time
Guest36266 has quit [Client Quit]
<ponga>
*uck
<athan>
shevy: Oh wow, okay yes this is impressive
<shevy>
like big fat ruby-gnome apps!
<shevy>
except that noone has written one yet hahaha!!!
<ponga>
I hate JAVA so much now
<shevy>
ponga well there iso ne good thing about jruby
<ponga>
i can't uninstall it smoothly?
<shevy>
ponga the idea of shoes GUI
<shevy>
this is java man; once you are in, you are in for life. like in the movie fightclub
<shevy>
you don't talk about it any longer
<bradland>
ponga: in a terminal: echo $JAVA_HOME
<ponga>
hey bradland
michaeldeol has quit [Client Quit]
<bradland>
heyo
wallerdev has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
<ponga>
i uninstalled java as website told but it stays in the system preference
<shevy>
ponga try out shoes if you get jruby to work though -> http://shoesrb.com/ I used it when it did not depend on java and _why was in charge, it was a GREAT idea
<ponga>
:( ugly
fantazo has joined #ruby
<ponga>
shevy: i know shoes you taught me
mengu has quit [Remote host closed the connection]
<bradland>
ponga: that’s just a preferences pane file in ~/Library/PreferencePanes
<bradland>
it’s not indicative of an actual install
<shevy>
it's kinda cool because the API is also a bit similar to prawn pdf generation
bricker has joined #ruby
<bradland>
just a lazy uninstall tool
<bradland>
which java
<bradland>
will tell you if there is a java executable on your PATH
<ponga>
i uninstalled it now, now installing JDK
yfeldblum has quit [Ping timeout: 255 seconds]
sinkensabe has joined #ruby
diegoviola has quit [Quit: WeeChat 1.0.1]
cndiv_ has joined #ruby
<ponga>
god damn it, no permission ?
<ponga>
i own this shit , listen to me mac!
GreatDanton has joined #ruby
nonnatus_ has quit [Read error: Connection reset by peer]
nonnatus_ has joined #ruby
valeriansaliou has quit [Quit: Be back later ...]
<shevy>
hehe
<ponga>
im starting to realise i should never get close to java again
<bradland>
erm
<bradland>
sounds to me more like an environment issue :P
<ponga>
bradland: which java still tells there is java in my mac
<ponga>
lol
<bradland>
environment issue :P
<bradland>
you probably installed java through some other means
bronson has joined #ruby
<ponga>
*uck java i didn't install any java after clean install
<arrubin>
sargas: But using a module in that manner is bizarre.
yfeldblum has joined #ruby
kh019267 has joined #ruby
<arrubin>
It is not clear why he did not just use a class.
kasperti_ has joined #ruby
Flcn___ has joined #ruby
sondr3 has joined #ruby
dopie has joined #ruby
<shevy>
sargas one reason for self.method is that should you ever need to move this to another class or module, or rename the class/module, then you dont have to do any additional work
<shevy>
so def self.foo will work in all modules and all classes when they are defined in them, def Foo.foo however had will only work for Foo
wallerdev has joined #ruby
brlkid has quit [Ping timeout: 250 seconds]
<arrubin>
It looks like classes are covered in the very next chapter.
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sargas>
so he is building up content just for teaching purposes
poetazus has quit [Remote host closed the connection]
<arrubin>
sargas: Yes, but he has 39 chapters of potentially bad Ruby code.
<havenwood>
sargas: And teaching Ruby like it's Python.
poetazus has joined #ruby
<sargas>
I'm wondering if he is using modules to later explain that classes are modules too
kiyote23 has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
poetazus has quit [Remote host closed the connection]
<sargas>
havenwood: exactly!!! He was the one that wrote Learn Python the Hard Way
<arrubin>
It seems like he just wants to use modules for organization and does not want to explain self.
iamjarvo has joined #ruby
<sargas>
at least for now...
<arrubin>
I do not like books that teach languages in a non-idiomatic fashion.
<arrubin>
Beginners do not know that they are not seeing idiomatic code.
<sargas>
well, now I have peace of conscience knowing I'm not the only one bugged by that syntax
<arrubin>
And more experienced people do not need to be shielded from concepts like classes.
<sargas>
yeah... so the author perhaps was right when he titled it "Learn Ruby the Hard Way" haha
<sargas>
he is truly making it harder in a few aspects
<GaryOak_>
"Learn ruby in a way that doesn't make sense"
<shevy>
sargas class and modules are very similar in ruby unfortunately
LouisRoR has joined #ruby
<sargas>
shevy: I though it was fortunately...
hashpuppy has joined #ruby
<shevy>
why
bMalum has quit [Quit: bMalum]
<shevy>
when you use a class, you are not able to do include
<shevy>
when you use a module, you can not use .new in the sense of instantiating that module as an object
<sargas>
shevy: for me, when I learned how classes worked, then was explained modules are basically classes too (then showed the differences) made a lot of sense to me
<sargas>
shevy: they aren't right? classes are basically modules that can have intances
<shevy>
well ok you can add the method new to a module
rpage has joined #ruby
<arrubin>
shevy: And Zed did!
felltir has joined #ruby
<shevy>
except that you can not use include with a class sargas
<sargas>
arrubin: exactly... I was so bugged by that
<arrubin>
But that is actually worse, since it does not behave like a typical Ruby object.
<sargas>
shevy: oh, just learned something new
valeriansaliou has joined #ruby
Flcn___ has quit [Ping timeout: 244 seconds]
<shevy>
so you always have to make a tradeoff
<sargas>
arrubin: the first half of the chapters were really nice... but now that it's getting deeper into the object model, it is getting uglier by the chapter
<shevy>
will your top namespace be a module? or a class?
<shevy>
class Foo; class Bar
<shevy>
in this case, you can do Foo.new just fine on the top namespace
blackmesa has quit [Ping timeout: 240 seconds]
timonv_ has quit [Read error: Connection reset by peer]
<shevy>
but then you can not include the Foo namespace
<shevy>
well actually come to think about it
<shevy>
you can store data in a module, in form of a constant
<shevy>
and you can add the method new, so actually that is quite close to how classes work :-)
<shevy>
sargas I think most people will use a module yes
<shevy>
sargas but some will use a toplevel class :-)
<TrOuBleStArTeR>
thx all
<wallerdev>
happy new year
<wallerdev>
:)
<shevy>
happy new waller
<felltir>
doesn't support sftp, though I think
kiyote23 has joined #ruby
<sargas>
wallerdev: likewise
razieliyo_ has joined #ruby
<ddd>
but adding that toplevel class is the non standard wheras using a module for namespacing is, correct?
ta_ has joined #ruby
<wallerdev>
new years resolution: start a new programming project :D
<wallerdev>
maybe a site that matches dogs that need walking based on location so people can walk multiple dogs at once to save time
razieliyo has quit [Ping timeout: 245 seconds]
<ddd>
hope your walkers are vetted. need experience ith handling multiple dogs or the dogs will rule the human and you'll end up losing dogs (if more than say 2 or 3 per walker)
<sargas>
ddd: that's what I usually practice, but according to shevy not everybody follows that
valeriansaliou has quit [Ping timeout: 244 seconds]
<ddd>
sargas: not everyone following means some break from 'standards'. you'll find that anywhere
<ddd>
its more of what is the convention
icebourg has quit [Ping timeout: 240 seconds]
<sargas>
ddd: true, it is just a convention, if you implement namespacing right, modules or classes are fine
Azure has joined #ruby
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sargas>
at least in the Ruby community you can do that without being crucified
St1gma has quit [Remote host closed the connection]
behrz has quit [Quit: Leaving]
ta_ has quit [Ping timeout: 264 seconds]
<arrubin>
sargas: His explanations seem entirely too brief for his target audience.
<ddd>
i was taught modules were for thinning multiple classes that all use the same behavior by pushing tht behavior into a module and using the module in those classes. wasnt for namespacing etc
St1gma has joined #ruby
<ddd>
since ruby only does single inheritance
<arrubin>
ddd: It can be used for either.
<sargas>
ddd: you're right
<arrubin>
s/It/They/
bronson has quit [Remote host closed the connection]
sondr3 has joined #ruby
michaeldeol has joined #ruby
it0a has joined #ruby
<arrubin>
They make a lot of sense in some cases. See the Math module.
silkfox has quit [Ping timeout: 265 seconds]
jack_rabbit has joined #ruby
icebourg has joined #ruby
blackoperat has joined #ruby
bMalum has quit [Quit: bMalum]
JDiggity has quit [Quit: Leaving]
Akuma has joined #ruby
apurcell has joined #ruby
retornam has quit [Ping timeout: 250 seconds]
sinkensabe has quit [Remote host closed the connection]
sandelius has joined #ruby
retornam has joined #ruby
pwnz0r has joined #ruby
gfawcettpq has quit [Ping timeout: 245 seconds]
<TrOuBleStArTeR>
what's the basic to "call" a class in a main program ?
karmatr0n has joined #ruby
<TrOuBleStArTeR>
i'm writing an ftp program
Sawbones has quit [Remote host closed the connection]
<TrOuBleStArTeR>
i use the net/ftp
apurcell has quit [Ping timeout: 256 seconds]
<TrOuBleStArTeR>
what i must use in my main program to make it works ?
behrz has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<felltir>
require 'net/ftp'
<felltir>
ftp = Net::FTP.new('example.com')
<felltir>
then follow the docs
<TrOuBleStArTeR>
thx felltir
<felltir>
np :)
sevvie has quit [Read error: Connection reset by peer]
<TrOuBleStArTeR>
:P
<felltir>
(as I noted before, this is not going to work for SFTP)
<TrOuBleStArTeR>
ok, specific class ?
<felltir>
not sure what you mean
djbkd has quit [Remote host closed the connection]
<felltir>
and what happens with just Net::FTP.new('ftp.free.fr') ?
phil101 has quit [Client Quit]
<TrOuBleStArTeR>
no error
<TrOuBleStArTeR>
but empty line
doodlehaus has quit [Ping timeout: 240 seconds]
<felltir>
so ftp.list said nothing?
<TrOuBleStArTeR>
yes you're correct
<felltir>
change it to "puts ftp.list"
behrz has joined #ruby
<TrOuBleStArTeR>
works ...
<TrOuBleStArTeR>
lol
gsd has joined #ruby
mikecmpbll has joined #ruby
rpage has quit [Quit: Leaving]
behrz has quit [Client Quit]
<felltir>
:D
<felltir>
hooray!
<TrOuBleStArTeR>
lol
<felltir>
glad to help
<TrOuBleStArTeR>
ftp.list just retunr anything
<TrOuBleStArTeR>
but i was going good
<TrOuBleStArTeR>
if i understand
<felltir>
yeah
<TrOuBleStArTeR>
so "puts" let me see the results
<felltir>
yes :)
tvw has joined #ruby
Takle_ has quit [Remote host closed the connection]
<TrOuBleStArTeR>
ok thx felltir
kiyote23 has joined #ruby
behrz has joined #ruby
yfeldblum has joined #ruby
mikecmpbll has quit [Client Quit]
<TrOuBleStArTeR>
i will still to not reproduce these kind of errors
<TrOuBleStArTeR>
:)
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<felltir>
good luck!
<TrOuBleStArTeR>
thx
PanzerModern has quit [Remote host closed the connection]
michaeldeol has joined #ruby
<bradland>
funny Net::SSH story.
yfeldblum has quit [Ping timeout: 264 seconds]
<bradland>
once upon a time I was automating some tasks to run against some AdTran media gateway devices, and I decided I’d use Ruby after lots of hair pulling with expect.
kiyote23 has quit [Ping timeout: 265 seconds]
wallerdev has joined #ruby
<bradland>
so I stub out some basic structure of my automator, and I run it against a single device.
<bradland>
all of the sudden, the AdTran just disappears. i can’t see it at its network address at all.
<bradland>
i futz around a little bit, and all of the sudden it reappears. so i try again.
<bradland>
bewm. gone again.
silkfox has joined #ruby
<bradland>
so i call the site where the device is located and have them attach to the serial port.
<bradland>
turns out, every time I hit the device with Ruby’s Net::SSH lib, the AdTran would crash, core dump, and reboot.
<bradland>
quality hardware.
rpag has joined #ruby
leafybas_ has joined #ruby
leafybas_ has quit [Remote host closed the connection]
BTRE has quit [Quit: Leaving]
anarang has joined #ruby
icebourg has joined #ruby
wald0 has quit [Quit: Lost terminal]
icebourg_ has quit [Ping timeout: 255 seconds]
russt has joined #ruby
fivetwentysix has joined #ruby
iamjarvo has joined #ruby
BTRE has joined #ruby
sleepee has joined #ruby
leafybasil has quit [Ping timeout: 244 seconds]
silkfox has quit [Ping timeout: 265 seconds]
sargas has quit [Quit: Leaving]
msmith_ has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 245 seconds]
valeriansaliou has joined #ruby
mattwildig has quit [Remote host closed the connection]
Flcn___ has joined #ruby
icebourg has quit [Ping timeout: 245 seconds]
valeriansaliou has quit [Client Quit]
felltir has quit []
fryguy9 has joined #ruby
icebourg has joined #ruby
nicolastarzia has joined #ruby
Cust0sLim3n has quit [Read error: Connection timed out]
behrz has quit [Remote host closed the connection]
Cust0sLim3n has joined #ruby
sondr3 has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Flcn___ has quit [Ping timeout: 256 seconds]
jaequery has joined #ruby
wallerdev has quit [Ping timeout: 244 seconds]
tlarevo has quit [Ping timeout: 245 seconds]
antgel has quit [Ping timeout: 244 seconds]
nicolastarzia has quit [Ping timeout: 250 seconds]
tlarevo has joined #ruby
behrz has joined #ruby
Axy is now known as Mia
jaequery has quit [Client Quit]
reset has joined #ruby
tjbiddle has joined #ruby
arup_r has joined #ruby
wallerdev has joined #ruby
jaequery has joined #ruby
noop has quit [Ping timeout: 264 seconds]
Sawbones has joined #ruby
behrz has quit [Remote host closed the connection]
kostitas has quit [Read error: Connection reset by peer]
dain has joined #ruby
bronson has joined #ruby
Takle has joined #ruby
hrs has joined #ruby
dts|pokeball has quit [Ping timeout: 244 seconds]
behrz has joined #ruby
tyfighter has joined #ruby
dts|pokeball has joined #ruby
behrz has quit [Client Quit]
Sawbones has quit [Read error: No route to host]
Sawbones has joined #ruby
Fauch has joined #ruby
<Fauch>
ok
byprdct has joined #ruby
<bradland>
roger
siso has joined #ruby
bronson has quit [Ping timeout: 255 seconds]
Sawbones has quit [Client Quit]
tkuchiki has joined #ruby
Akuma has quit [Quit: So long sukkas!]
arup_r has quit [Quit: Leaving.]
timonv_ has joined #ruby
tlarevo has quit [Remote host closed the connection]
behrz has joined #ruby
dkb20k has quit [Ping timeout: 265 seconds]
tlarevo has joined #ruby
behrz has quit [Remote host closed the connection]
cpt_yossarian has quit [Ping timeout: 245 seconds]
tkuchiki has joined #ruby
deryl has joined #ruby
jobewan has quit [Quit: Leaving]
duncannz has joined #ruby
ddd is now known as Guest21792
codecop has joined #ruby
deryl is now known as ddd
kh019267 has quit [Read error: Connection reset by peer]
davedev24_ has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
davedev24_ has joined #ruby
valeriansaliou has joined #ruby
Guest21792 has quit [Ping timeout: 240 seconds]
gr33n7007h has quit [Ping timeout: 240 seconds]
lemur has joined #ruby
Fauch1602 has joined #ruby
tkuchiki has quit [Ping timeout: 240 seconds]
cpt_yossarian has joined #ruby
hephaestus_rg has joined #ruby
ta_ has joined #ruby
msmith_ has joined #ruby
Xeago has quit [Remote host closed the connection]
<basichash>
How do I add an hour to Time.now?
dh64 has joined #ruby
<basichash>
e.g. I want to find the time five hours from now, something like Time.now.hours("+5")
<arrubin>
basichash: Time.now + seconds
<felltir>
2.2.0 :001 > Time.now
<felltir>
=> 2015-01-02 21:07:38 +0000
<felltir>
2.2.0 :002 > Time.now + (60 * 60)
<felltir>
=> 2015-01-02 22:07:39 +0000
<eam>
basichash: this is actually a super complicated question. If you want a super simple answer, just add the number of seconds
<eam>
but that will not be correct around a number of corner cases
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<arrubin>
When would it not be correct?
<basichash>
heh, i thought ruby would be able to handle this easily?
valeriansaliou has quit [Ping timeout: 265 seconds]
<eam>
leap seconds
<eam>
basichash: *nothing* handles time easily
bweston92 has joined #ruby
<bweston92>
I have 2 services one written in Ruby and one written in PHP with Laravel. My Laravel application handles authentication and customers data-storage. My Ruby application requires and authentication token (the user would get this after logging into the Laravel app) this token is then sent with all requests to the Laravel application to obtain data. U
<bweston92>
nfortunately I've got a Ruby worker also that needs to talk to the Laravel API and get customer information at any given point. What is the best way to give this service a "master" token for the worker? Would I just make a authentication token and give it admin rights, does anyone have any resources on this?
<eam>
unless you can disregard corner cases in which case it's pretty easy in ruby
mferrier has quit [Ping timeout: 256 seconds]
<arrubin>
It is unlikely that he is doing anything where leap seconds matter.
<eam>
arrubin: thus "if you want a super simple answer"
<arrubin>
I assumed that there were more "corner cases".
<felltir>
DST
<eam>
DST isn't a corner case here
<bradland>
DST is a localization issue
riceandbeans has quit [Quit: leaving]
<eam>
yeah
<arrubin>
Time.now already includes timezone.
<arrubin>
Should not be an issue.
jottr has joined #ruby
<GaryOak_>
bweston92: just treat the ruby worker like a user and have them call the login system, or hard code a key
ta_ has quit [Ping timeout: 265 seconds]
<bradland>
basichash: if you’re doing science, worry about leap seconds. otherwise, add seconds.
<basichash>
ok thanks
fantazo has quit [Quit: Verlassend]
<eam>
basichash: if you're using rails, Fixnum gets methods to convert numbers to for example 1.days
<bweston92>
GaryOak_ you think that would be ok to give them a super user as such?
nunayerBeezwax has joined #ruby
<bradland>
bweston92: in a general sense, you want to adhere to the principle of least priviledge.
<GaryOak_>
You can setup a worker user type and give them just the privs it needs
<bradland>
so if the app is making requests on the behalf of an identity that exists in the provider API, you should impersonate that identity, not give “super user” access
jobewan has joined #ruby
<bweston92>
bradland: Ok, so just certain permissions to certain scopes?
<bradland>
ideally, it would adhere to the scope defined by the permissions of the user
<basichash>
eam: perfect, exactly what i was looking for
<bradland>
so, if you have a user in the Laravel app, you have some kind of authorization definition, right?
<bradland>
when that user transitions to the Ruby app, you want to preserve that identity, so you can use the same authorization definition
lemur has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 255 seconds]
<bweston92>
I do that using headers and then Ruby gets that header and obtains the token and sends it to the Laravel app when it needs the data
<bradland>
this is based on the assumption that the Ruby app is acting as an agent for users
<bweston92>
The worker is like a totally separate process
lemur has joined #ruby
blizzy has quit [Ping timeout: 240 seconds]
<bradland>
the process architecture is separate from the security architecture
<bradland>
you can pass information around between processes
Flcn___ has joined #ruby
<bradland>
what you want to do is look at what the Ruby app is doing
<bradland>
is it acting as an agent for users?
<bweston92>
Slightly, it is getting information about "orders" for example at certain stages
Sid05 has joined #ruby
<bradland>
ah, ok.
<bweston92>
It's also got to pass FCA approval in the UK
leafybasil has joined #ruby
<bradland>
i re-read your second message.
yalue has quit [Quit: return 0;]
Azure has quit [Quit: My MBP went to sleep.]
<bradland>
doe sthe Ruby “worker” interact with users?
GaryOak_ has quit [Ping timeout: 245 seconds]
<bradland>
or is it simply doing some work and storing the results back in the Laravel app?
lemur has quit [Ping timeout: 244 seconds]
<bradland>
i don’t understand why the user gets access to the token
GaryOak_ has joined #ruby
<bradland>
is why i’m asking
dkb20k has joined #ruby
Flcn___ has quit [Ping timeout: 245 seconds]
<bradland>
where possible, you want to centralize your authorization defonition, so that have a single source of truth for who can access what
aclearma_ has joined #ruby
zorak8 has joined #ruby
Musashi007 has joined #ruby
chrishough has joined #ruby
aclearman037 has quit [Ping timeout: 240 seconds]
<bweston92>
bradland: The Ruby application when used by HTTP (a RESTful API) allows users to set-up reminders for there customers (The user sends authentication token for this so we can get their firm details). The Ruby worker runs through each of these daily, whilst going through each reminder set up it needs to get the customers for each user that meet a cer
<bweston92>
tain criteria (that was set by the user)
<bweston92>
their customers*
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
itadder has quit [Ping timeout: 244 seconds]
blizzy has joined #ruby
djbkd has joined #ruby
dkb20k has quit [Ping timeout: 265 seconds]
<bradland>
sry, i’m really struggling to get a complete picture of what’s going on there (because I’m a slow learner). maybe someone else has done something similar and can offer advice.
paulfm_ has joined #ruby
paulfm has quit [Ping timeout: 255 seconds]
riceandbeans has joined #ruby
riceandbeans has joined #ruby
tjbiddle has joined #ruby
thumpba has joined #ruby
allcentury has quit [Ping timeout: 245 seconds]
bronson has joined #ruby
<bweston92>
bradland its ok I think I'm just trying to be to complicated :)
hashpuppy has quit [Ping timeout: 244 seconds]
carvantes has joined #ruby
it0a has quit [Ping timeout: 255 seconds]
Xeago has joined #ruby
Yzguy has quit [Quit: I'm sleeping, go away.]
rbennacer has quit []
Xeago has quit [Remote host closed the connection]
narph has quit [Quit: Connection closed for inactivity]
bronson has quit [Ping timeout: 255 seconds]
blackoperat has quit [Remote host closed the connection]
icebourg has quit [Ping timeout: 240 seconds]
aston_ has joined #ruby
rbennacer has quit [Remote host closed the connection]
Musashi007 has quit [Quit: Musashi007]
<aston_>
Hello everybody.
josephndenton has quit [Ping timeout: 256 seconds]
icebourg has joined #ruby
rbennacer has joined #ruby
davedev2_ has joined #ruby
ta_ has joined #ruby
davedev24_ has quit [Ping timeout: 255 seconds]
Musashi007 has joined #ruby
nfk has joined #ruby
<mozzarella>
guys, I do "format.js { render('_post', post: post) }"
Musashi007 has quit [Client Quit]
econerd4ever has joined #ruby
<mozzarella>
but it says ActionView::Template::Error (undefined local variable or method `post' for #<#<Class:0x007f738056d718>:0x007f738090da08>):
<mozzarella>
what am I doing wrong
<aston_>
I am brand new to programming and have decided to pick up Ruby as my first language. My programming goals are, most importantly, to create a 2d rpg similar to the old Final Fantasy games, and eventually learning web development skills as well with Rails. I just downloaded Ruby 1.9.3 and Rails 4.2.0 along with the Dev Kit. When I installed the devkit in the command prompt, Everything installed properly but then I get an error.
<cazrin>
mozzarella: is there a variable called "post" within scope of of your controller action?
jordanm has joined #ruby
bMalum has joined #ruby
<mozzarella>
cazrin: yes
<cazrin>
are you sure? :D
<aston_>
"ERROR: While generating documentation for actionpack - 4.2.0
<mozzarella>
and the error comes from the template, not from the controller
<aston_>
Has Rails successfully installed, or is this going to be a problem?
<cazrin>
ah yeah good point
<terrellt>
aston_: Rails is great for web development, ruby may not be the best place to start if you want to make a 2d RPG.
<cazrin>
is there a partial that isn't being passed a local variable?
dotix has quit [Read error: Connection reset by peer]
decoponio has quit [Quit: Leaving...]
<jordanm>
I am a bit confused by the behavior of reduce. when I use mystr.split(//).reduce do .... it starts with the second element, but mystr.split.reduce("") do ... iterates over the entire array. what is happening with the first example?
<aston_>
terrellt: What would you recommend instead? I want to make indie games, so I don't think that I need the highest performance languages like C++
Heskie has quit []
<cazrin>
mozzarella: what terrellt said ^ if you're rendering a partial then you'll need to pass it local variables
ta_ has quit [Ping timeout: 244 seconds]
<alecs>
Hello! Is there any Gem that i could use to check if my app is upgradable from ruby 1.9.3 to ruby 2.0 ? or 2.2 ?
<mozzarella>
terrellt: thank you, though I think it used to work…
<mozzarella>
I think it works inside views
<aston_>
What programming language would be best for an newbie who plans on creating a 2d rpg game AND getting into web development down the road? Or would I need to learn 2 different languages?
<jordanm>
alecs: just run the test suite with the different ruby versions?
Heskie has joined #ruby
<shevy>
aston_ probably javascript
<cazrin>
aston_: you should take a look at Unity (www.unity3d.com)
bMalum has quit [Client Quit]
fivetwentysix has quit [Quit: fivetwentysix]
Musashi007 has joined #ruby
<shevy>
unity requires a windows machine or?
<alecs>
jordanm: thanks, but unfortunately no test suite :|
<cazrin>
aston_: JavaScript is probably the only thing that crosses the boundary of both, and you can make some good stuff with Phaser (phaser.io), but they are two very different skill sets IMO
<terrellt>
cazrin: There are various better solutions - usually written in C, C++, C#, Java (? I think)
wolf4ood has joined #ruby
<cazrin>
shevy: pretty sure there's a Mac client
<jordanm>
alecs: sounds like it wasn't designed to be changed :)
<jordanm>
there is no linux client for the web player
<jordanm>
the non-web unity engine works on linux, with some bugs
davedev2_ has quit [Ping timeout: 245 seconds]
<aston_>
cazrin: I actually have Unity installed and I planned on learning C# (I bought a book on both C++ and C#), but I've seen theen been told that I should use a more beginner friendly language, so I haven't gotten too far.
<jordanm>
rust is an example of a modern game that uses it
<shevy>
well if you know C# then using a simpler language is always easily possible anyway
<GaryOak_>
aston_: you could try javascript with unity
<sweeper>
kerbal space program \o
<terrellt>
I think you can do JS with Unity.
<cazrin>
it's TypeScript, which is effectively JS
<terrellt>
I've heard you have to drop down into C# or whatever fairly often though.
<shevy>
aston_ and after you know both C# and JS, come to ruby ;)
<aston_>
Yeah, I believe it is called UnityScript
<zenspider>
ruby does 2d games quite well with gosu. I'm not fond of the latest version because it doesn't just work out of the box on gem install, but it is still really easy to get up and running on
<zenspider>
aston_: ^^
yfeldblum has quit [Ping timeout: 264 seconds]
<jordanm>
I came at a bad time. games are much more interesting than my dull question :)
<zenspider>
(older gosu gems would install and immediately run, which was nice when doing demos to newbs)
Yzguy has joined #ruby
Heskie has quit [Read error: Connection reset by peer]
tyfighter has quit [Quit: tyfighter]
<cazrin>
aston_: if you have experience in neither subject (games or web), at this point I would just focus on one and worry about the other one later. Experience in one of them is going to help you down the road if you decide to switch anyway. Don't try and do both at the same time
<aston_>
zenspider: See, this is why I am hesitating on what language to start with. I get one person saying Ruby and another person saying Javascript, then another person saying I should just learn C++ for games and then PHP for web..
<zenspider>
jordanm: `ri Enumerable.reduce`
Heskie has joined #ruby
<zenspider>
aston_: you'll ALWAYS get different answers to any such question
russt has quit [Quit: russt]
<sweeper>
aston_: if you want to do web, just don't use vanilla rails as it tends to induce bad OO habits :v
nunayerBeezwax has quit [Remote host closed the connection]
timonv^ has quit [Remote host closed the connection]
Vile` has quit [Ping timeout: 240 seconds]
<shevy>
well
<GaryOak_>
haha here we go!!!
<terrellt>
aston_: It's subject specific. If you want web, there's recommendations, 2d games, that's a vastly different subject space.
<sweeper>
2000 line models, hurra
<zenspider>
"best" is a bullshit subjective thing and everyone has an opinion
<terrellt>
sweeper: I don't think 2000 line models are a recommendation. ;)
claw_ has joined #ruby
davedev24_ has joined #ruby
<shevy>
aston_ pick any really :) - you can transition from javascript into ruby or back quite easily; C# I found harder because it did not seem to be that much fun, that is why I think you should start with C#, you can pickup both JS and ruby easily lateron
<aston_>
sweeper: Well, I intend to learn web as a way to make money on the side when I get off work or something, or possibly even get a job doing it so I don't have to work at McDonalds lol.
<sweeper>
terrellt: no, but I have a strong suspicion that rails somehow makes people do that
russt has joined #ruby
<terrellt>
sweeper: Programming makes people do that. OO's hard.
<aston_>
But gamedev is why I gained an interest in programming in the first place.
<zenspider>
rails doesn't induce 2000 line models any more than any other framework / language. you can write shit in anything.
claw has quit [Ping timeout: 245 seconds]
<jordanm>
zenspider: "Nothing known about Enumerable" - i guess I don't have the docs installed
<shevy>
aston_ I don't think anyone here has recommended php yet hehe
<jordanm>
it really isn't clear which package in debian would contain them either
<zenspider>
jordanm: you should fix that. ri is fantastic.
<sweeper>
I dunno man, I just feel that way. don't harsh on my feels
<zenspider>
assuming you used rvm, there's some command to do it
timonv_ has joined #ruby
<terrellt>
Only people in #php will recommend PHP, and even then...
<aston_>
shevy: No, but my friend has.
<GaryOak_>
aston_: my friend who doesn't know anything about making games or programming started using gamemaker and built something awesome
<shevy>
aston_ but he knows php? and if so, does he know python or ruby?
<zenspider>
jordanm: to answer your q, the basic API is:
<terrellt>
aston_: I was a PHP programmer for a long time. The point at which you feel like an above average PHP programmer, you're leagues below a competent any-other-language web developer. That's been my experience at least.
<jordanm>
is foo.split(//), foo.split("") or some other way the "preferred" method?
<shevy>
aston_ nope, no idea about Chileans; but I assumed he did not know python or ruby. I used php years ago, I abandoned it in favour of ruby. But I would also recommend python. So both python and ruby would be fine, you should be able to do everything that php does in either of these two languages, but both have a much better design than php really
<sweeper>
TrOuBleStArTeR: ARGV provides an array of arguments, but if you want more complicated things, there are frameworks available
<aston_>
Thank you all for the help. Now I'm stuck between Ruby and Javascript. I want whichever is going to set me up to do both game dev and web (which I believe is both). Hmm....Well, I like the Ruby logo and I want to put a Ruby sticker on my brand new laptop, so I guess I should learn Ruby! ^_^
<zenspider>
terrellt: were you the speaker at rubyconf with the big one?
<terrellt>
TrOuBleStArTeR: Look into docopts, it's glorious.
<aston_>
terrellt: Whatttt??? How do I get one??
<terrellt>
zenspider: Nah.
<zenspider>
kk
<terrellt>
aston_: Find a 3d printer!
<felltir>
terrellt: that's pretty cool
Heskie has joined #ruby
thumpba has quit [Remote host closed the connection]
<aston_>
terrellt: I've never used one of those. Now I have to find the nearest one!
<shevy>
terrellt what is that material? paper?
pwnz0r has joined #ruby
<TrOuBleStArTeR>
terrellt it's ruby too ?
<terrellt>
Nah, plastic.
<terrellt>
Printed from a makerbot.
drjfreez1 has left #ruby [#ruby]
<TrOuBleStArTeR>
okkk
<terrellt>
I work at a University Library - we have...four now
<terrellt>
3D printers, two are makerbots
davedev2_ has joined #ruby
testcore has joined #ruby
rbennacer has joined #ruby
davedev2_ has quit [Read error: Connection reset by peer]
duncannz has quit [Ping timeout: 240 seconds]
<bradland>
aston_: keep in mind that you’re going to be learning two things at once: a programming language, and how to program.
malcolmva has quit [Ping timeout: 250 seconds]
davedev2_ has joined #ruby
<bradland>
much of what you learn about how to program will be transferrable to other areas, but it takes time.
davedev24_ has quit [Ping timeout: 245 seconds]
Xeago has joined #ruby
Azure has joined #ruby
lxsameer has quit [Quit: Leaving]
anarang has quit [Quit: Leaving]
omosoj has quit [Ping timeout: 256 seconds]
last_staff has joined #ruby
<aston_>
bradland: Yeah, that is why I thought that a high level language would be my best bet. I can learn the logic behind coding and then switch syntax semi easily when I need to move to a more efficient language. I don't want to start with C++ right away because it would just make the learning that much harder, plus I probably don't need that kind of performance for a turn based 2d rpg.
Xeago has quit [Remote host closed the connection]
<aston_>
One last question to push me over to the Ruby side so that I can get started. I may have already asked a question similar to this, but I didn't get the kind of answer I was looking for.
<terrellt>
You'll learn what makes a good program with ruby, which is great. We also have the best testing toolsets, so that's pretty awesome.
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<aston_>
With Ruby (and Gosu or any other frames), can I make a small/medium sized 2d turn based rpg?
<bradland>
Gosu is literally a 2D game development library. So yes, that is its express purpose.
aclearma_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<cazrin>
aston_: you can probably make a 2D turn-based RPG yeah, but please don't start there :) make some basics like snake/pong etc. first to get a handle on the framework
<aston_>
I understand that it may have some hiccups, but it would be doable, right? I mean, I'm sure that Ruby can't be that slow that a game like that would lag hardcore.
<bradland>
heh
<bradland>
lag
<bradland>
in 2D games, you don’t typically see lag.
<aston_>
cazrin: Ok, that was my plan anyway. I am going to work my way up from Pong until I feel comfortable starting my rpg.
<bradland>
you should get used to deconstructing generalizations like “lag” as well
<bradland>
lag can mean many different things
<bradland>
rendering frame rate drops
<aston_>
bradland: I know, but I hear that it is slow and framerates may drop. I'm just making sure that it won't be super bad.
<bradland>
network latency issues
<bradland>
framerates in 2D games aren’t really an issue
Musashi007 has quit [Quit: Musashi007]
<bradland>
on modern hardware anyway
<bradland>
modern *desktop* hardware
<aston_>
bradland: I'm sorry. Like I said, I am a complete beginner. I have done some research, but that is about it.
<cazrin>
aston_: I still think you might be better served with JS rather than Ruby, but getting started is better than doing nothing at all (www.phaser.io is essentially like Gosu but for JS - though better IMO)
athan has quit [Remote host closed the connection]
<bradland>
i’m kind of with cazrin
<bradland>
the problem with developing a gosu game is that very few people will be able to enjoy it
apurcell has joined #ruby
<bradland>
because they’d have to install ruby
shredding has quit [Quit: shredding]
<bradland>
applications you develop in JS run in a web browser, which is kind of the ultimate distribution platform
<sweeper>
yea. JS has definitely attracted a lot of "low barrier to entry" projects
<bradland>
web browsers are everywhere
PinkAstronaut has quit [Read error: Connection reset by peer]
<aston_>
cazrin: bradland But I really want to put a Ruby sticker on my laptoppppp :( And I can't do that if I don't know Ruby!
rbennacer has quit [Remote host closed the connection]
<cazrin>
if that's your goal then I can't help you :P
revoohc has quit [Quit: revoohc]
diegoviola has joined #ruby
<bradland>
pretty solid felltir
<aston_>
JS isn't strictly for web dev then?
<felltir>
nope
<aston_>
(Pardon my ignorance)
<felltir>
it's a really flexible language :)
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<bradland>
what do you define as “web dev”
<felltir>
it works in browsers yes, but with things like Node.js, it's viable serverside too.
<bradland>
because lots of games are deliverd through web browsers
<aston_>
Designing and coding websites
<felltir>
if you want a browser based game, javascript is a good idea.
keen__________22 has quit [Read error: Connection reset by peer]
<bradland>
that’s it’s most common use case, for sure, but I would argue that Javascript is one of the most diverse (in terms of usage) languages in use right now
__main__ has joined #ruby
apurcell has quit [Ping timeout: 240 seconds]
<bradland>
the upside of a browser based game is that you can upload the files to a web server and anyone can see/play your game
<bradland>
the upside of develping a game in ruby is that you get to program in ruby instead of javascript :)
yfeldblum has joined #ruby
keen__________22 has joined #ruby
<aston_>
*sigh* I was kind of hoping that you Rubyists would sway me to use Ruby, not JavaScript... (/.\)
<bradland>
it depends on what you want
iamjarvo has joined #ruby
malcolmva has joined #ruby
<bradland>
never trust someone who will blindly steer you one direction
<aston_>
A Ruby sticker. :)
<bradland>
gosu is a good option
<bradland>
but you should understand the pros and cons
<aston_>
Is deployment the only big con to Ruby?
<felltir>
aston_: for a ruby sticker, try doing something more simple than a game, like a basic gem :)
<aston_>
As well as JS being slightly faster.
<felltir>
just to get to grips with the language
<bradland>
eh
<bradland>
the whole “faster” thing is a red herring
<bradland>
your 2D RPG isn’t going to suffer performance issues under ruby or javascript
<aston_>
felltir: Ahhh, good idea! Maybe I can just print "Hello World" and slap a Ruby sticker on my laptop to show the world that I have mastered that language!
weems|mac has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<bradland>
there you go
<bradland>
you’ll be as good as me at that point lol
cazrin has quit [Remote host closed the connection]
<felltir>
pro rubyist right here
<bradland>
puts includes newline, print doesn't
Flcn___ has joined #ruby
<bradland>
>> puts “hello world"
<aston_>
Ok, so puts is Java's println and print is Java's print?
<bradland>
dunno much about Java, but sure! :)
karmatr0n has joined #ruby
rbennacer has joined #ruby
<aston_>
lol
<felltir>
(yes)
snath has quit [Ping timeout: 240 seconds]
<aston_>
Does anybody have a project that they would let a newbie like myself hop on? I need to be adopted.
<aston_>
I think I'm going to choose Ruby first, and then JavaScript. I'm going to need to learn both anyways, once I get into web dev at least.
<felltir>
is that the goal?
Spami has quit [Quit: This computer has gone to sleep]
<shevy>
aston_ I think most projects require a bit of knowledge first
<felltir>
http://tryruby.org/ is okay to get started, if you're ok with a heavy dose of whimsy
<shevy>
aston_ my first project was an IRC bot in ruby. you could try to start it by aligning input (what is said in a channel) to a reaction of the bot (what the bot may say)
<aston_>
The goal is just making games for fun. Not selling them or anything (unless I find out that I am really good at making them..). Web is just a side option for me so that I can maybe get a job in the computer field, or at least make a few extra bucks deving sites for people
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Flcn___ has quit [Ping timeout: 245 seconds]
josephndenton has joined #ruby
rbennacer has quit [Ping timeout: 265 seconds]
test__ has joined #ruby
test__ has quit [Client Quit]
test__ has joined #ruby
test__ has left #ruby [#ruby]
silkfox has joined #ruby
<bradland>
aston_: do you program in Java?
<aston_>
bradland: I have a little, yes. By a little I mean I have used cases and nested cases to create a short and simple text adventure.
<aston_>
I started off with Java (and own Headfirst Java), but have been hopping languages ever since because I'm scared that I will not choose a language that will suit my needs.
<shevy>
it is empty. fill it with data
<bradland>
aston_: cool. just curious if you had any background.
bluOxigen has quit [Ping timeout: 256 seconds]
bronson has joined #ruby
<TrOuBleStArTeR>
shevy where it's explain ?
<aston_>
bradland: A little. I've messed around with a few languages, but I feel like Ruby is the most fun so far. Either Ruby or Python. Most people seem to use Python so I want to use Ruby lol
<aston_>
Plus the little logo is cooler. :p
<bradland>
TrOuBleStArTeR: Hash is a core Ruby class. It’s documented on the ruby-doc.org site as well, under Core
snath has joined #ruby
cjm_ has joined #ruby
<TrOuBleStArTeR>
bradland ok thx
<TrOuBleStArTeR>
thx shevy
<felltir>
aston_: I've pinged you some more stuff
paulfm_ has quit [Quit: Goodbye]
sevenseacat has joined #ruby
djbkd has quit [Remote host closed the connection]
claymore has quit [Quit: Leaving]
weems|mac has joined #ruby
bronson has quit [Ping timeout: 245 seconds]
<cjm_>
Hi Folks, I'm getting abused by Ruby! I know just enough about it to get in trouble, which I have. I need to run "bundle install --path vendor/bundle --without development,test" and I must do it as root, which upsets bundler, but I have no choice. I am getting a complaint: "The path `.../vendor/gems/cache_digests-0.1.0` does not exist. Wasn't yum install rubygems supposed to do that?
sinkensabe has quit [Remote host closed the connection]
Xeago has joined #ruby
silkfox has quit [Ping timeout: 244 seconds]
tekk has joined #ruby
sinkensabe has joined #ruby
msgodf has joined #ruby
TrOuBleStArTeR has quit [Quit: Going offline, see ya! (www.adiirc.com)]
davedev2_ has quit [Ping timeout: 244 seconds]
jefus_ has joined #ruby
josephndenton has quit [Ping timeout: 245 seconds]
pwnz0r has quit [Remote host closed the connection]
Spami has joined #ruby
<zenspider>
cjm_: #bundler ?
silkfox has joined #ruby
sinkensabe has quit [Remote host closed the connection]
<cjm_>
zenspider, I'm not sure what you want to know...
Xeago has quit [Remote host closed the connection]
jefus has quit [Ping timeout: 244 seconds]
<zenspider>
cjm_: as in, this question might be better suited for #bundler
<cjm_>
zenspider, Oh, ... Well I like to start with the top dog. (-:
<cjm_>
zenspider, Thanks.
<Yzguy>
Hello
davedev24_ has joined #ruby
<bradland>
Yzguy, hi. Have a question or just stopping by?
<Yzguy>
eh, I was gonna ask for a tall order but I guess I'll keep it to myself
<felltir>
ahah
<felltir>
ask away
<Yzguy>
I'm starting to get into ruby, so as a little project i was going to rewrite this python project I did
<Yzguy>
and I want to do it in an OOP fashion rather than procedural
djbkd has joined #ruby
<Yzguy>
I unfortunately struggle with breaking out of the procedural mindset
<cjm_>
Hi Folks, Can anybody tell me anything about "cache_digest", like who creates it and who uses it?
<bradland>
Yzguy: that’s a nice simple little script you could rebuild in Ruby
<shevy>
Yzguy well, a simple way is this: you can keep on thinking procedural, but also think of attaching the procedural code onto classes that govern the behaviour. For instance: User.login
<bradland>
It’d be a good one to refactor to an OOP app too because it’s so simple.
mrmargolis has joined #ruby
<shevy>
Yzguy in the worst case, you could put all procedural code into one huge class too :)
<bradland>
Ruby script OOP patterns range from really simple, to modular and sophisticated.
<zenspider>
Yzguy: then start with procedural... it'll still work... you can move in babysteps to OO
sinkensabe has joined #ruby
<Yzguy>
I guess that would be good.
<bradland>
Start by wrapping the entire thing in a class with a single method named run
lemur has joined #ruby
<bradland>
Then at the bottom of the script, call that method to run the app.
<bradland>
From there, you just start refactoring
<Yzguy>
hmm, I like that workflow.
<Yzguy>
okay, I shall give it a try!
<Yzguy>
thanks
charliesome has joined #ruby
<jordanm>
it seems odd that in ruby it's idiomatic to not use "return", but it's the opposite in perl
valeriansaliou has joined #ruby
siso has joined #ruby
timonv_ has quit [Remote host closed the connection]
<shevy>
jordanm nono, you can use return
<zenspider>
shevy: he said idiomatic and he's right
<shevy>
jordanm the problem is; when it is not required, people like to omit stuff
<zenspider>
jordanm: ruby gets more readable the smaller the code goes. perl is the opposite. :)
startupality has joined #ruby
<shevy>
zenspider I use return a lot
<cjm_>
felltir, Man, I don't understand how that applies... Apparently there is suppose to be something in "cache_digests", but I don't know what, not why it is not there... Seems like I have not properly installed something, but what?
<eam>
zenspider: no way
mbug has joined #ruby
<zenspider>
shevy: yes. and you don't write idiomatic ruby.
<eam>
IMO it's the opposite, the larger the program is the more I'd rather it be written in perl vs ruby
<shevy>
zenspider yes and I don't care about what you say, please don't interrupt
TheRinger has quit [Read error: Connection reset by peer]
TheRinger has joined #ruby
<zenspider>
shevy: interrupt? we're in a public channel and we're having a public discussion. shove it.
<eam>
it's the small trivial bits of syntax where ruby is more clear
<bradland>
Yzguy: here’s a simple stub script for you with my general starting point for scripts:
<shevy>
zenspider yeah and I was talking to him not to you
<zenspider>
writing non-idiomatic ruby isn't a bad thing... it's just non-idiomatic
<jordanm>
sorry, I didn't intend to start a flame war
<shevy>
jordanm no it's fine, it's a difference of opinion
<eam>
shevy: because of ruby's over-use of global constructs like monkeypatching objects
<arrubin>
eam: You mean trivial bits like parameter handling?
<Yzguy>
perfect, thank you! bradland
<shevy>
eam you mean when others can change core classes and such?
<zenspider>
eam: haha. really? You think once it hits a size threshold it would be better in perl not ruby?
sevvie has quit [Read error: Connection reset by peer]
<eam>
zenspider: yeah
<zenspider>
eam: got any examples?
<eam>
well not anything public, most of what I've done in perl is closed source but I've worked on large projects
<zenspider>
jordanm: ignore him. it's not even opinion. the idioms are known. published even. he's just got a bug up his ass for some reason.
<eam>
the thing is for a large program what's most important is the architecture
<shevy>
eam I think that problem can be solved eventually, not sure whether through refinements or something else, I would assume that it was acknowledged when ruby core thinks about it
<eam>
and encapsulation
<eam>
ruby has a lot of practices that involve global state changes
<eam>
(like adding a method to a class)
<zenspider>
eam: sure. but why do you think that perl supports architecture and encapsulation better than a pure OO approach?
<jordanm>
eam: you can do that in python too
<zenspider>
(where I mean, everything is an object, all objects have classes, everything is a message send, etc)
<eam>
zenspider: I think it's less a matter of what can be done and more a matter of what is convention
<shevy>
jordanm take writing styles like: "def foo bar" versus "def foo(bar)" people who prefer the first variant often dislike having to type the two () characters
studiotate has quit [Quit: Computer has gone to sleep.]
<eam>
jordanm: sure, and you can do it in perl
<eam>
it's just that people don't
gregf has joined #ruby
<zenspider>
eam: interesting... I haven't written any perl professionally for ... ~15 years or so. I don't know what current practices look like.
ebanoid has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
startupality_ has joined #ruby
valeriansaliou has quit [Ping timeout: 265 seconds]
felltir has quit []
<eam>
there's not a whole lot of difference imo
s7ry93r has quit [Ping timeout: 264 seconds]
<eam>
other than perl having a lot of scary syntax and weird old behaviors
<zenspider>
eam: what's the current "OO Way™" in perl these days? it isn't just plain blessed hashes like it used to be, is it?
studiotate has joined #ruby
thumpba has joined #ruby
<eam>
zenspider: to be honest it's been a few years for me too, but Moose is what folks are using I think
<arrubin>
zenspider: Moose.
startupality has quit [Ping timeout: 264 seconds]
startupality_ is now known as startupality
weems|mac has quit [Quit: bai]
sevvie has joined #ruby
aston_ has quit [Quit: Page closed]
<eam>
the last perl project I worked on was a packaging system that had to support a range of about two decades of perl/unix versions on multiple platforms so we mostly did things the old way, and it was pretty much fine