petey has quit [Remote host closed the connection]
petey has joined #ruby
__arnold has joined #ruby
invinceable has joined #ruby
alexju has joined #ruby
ctp has joined #ruby
danno1 has quit [Ping timeout: 240 seconds]
r0nin has quit [Remote host closed the connection]
petey has quit [Ping timeout: 265 seconds]
roolo has quit [Quit: Leaving...]
senayar_ has quit [Remote host closed the connection]
senayar has joined #ruby
spicerack has joined #ruby
yekta has quit [Quit: yekta]
patrick99e99 has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
atmatt has joined #ruby
jle` has quit [Ping timeout: 265 seconds]
<patrick99e99>
hey everyone. I am trying to setup rspec in a pure ruby project.. Two questions: 1) My rake file has the default task => :spec, but it doesn't seem to be loading my spec/spec_helper.rb file-- I am having to manually require it. Is that the usua convention? 2) my spec_helper is doing Dir.glob('spec/**/*.rb') { |f| require f }, and my spec file gets loaded, but the output is 0 specs, when I have do have specs in there..
bradhe has quit [Remote host closed the connection]
atmatt has quit [Ping timeout: 240 seconds]
<patrick99e99>
hmm nevermind, I seem to have gotten #2 resolved.
__arnold has left #ruby [#ruby]
<patrick99e99>
one thing that is annoying me, is both my Rakefile and spec_helper seem to need: $:.push(File.expand_path('.'))
jamto11 has quit [Remote host closed the connection]
jamto11 has joined #ruby
jamto11 has quit [Remote host closed the connection]
yasushi has joined #ruby
Vovko has joined #ruby
atmatt has joined #ruby
cashnguns has joined #ruby
kennym has quit [Quit: Leaving.]
yasushi has quit [Remote host closed the connection]
danno1 has joined #ruby
kennym has joined #ruby
scarolan_ has joined #ruby
hotchkiss87 has joined #ruby
Vovko has quit [Remote host closed the connection]
scarolan has quit [Ping timeout: 240 seconds]
lyanchih_ has joined #ruby
agarie_ has joined #ruby
chipotle_ has quit [Quit: cya]
scarolan_ has quit [Ping timeout: 240 seconds]
agarie has quit [Ping timeout: 265 seconds]
thomasxie has joined #ruby
Nahra has joined #ruby
kobain has quit []
mikepack has joined #ruby
Hanmac1 has joined #ruby
Hanmac has quit [Ping timeout: 265 seconds]
bradhe has joined #ruby
scarolan has joined #ruby
bradhe has quit [Read error: Connection reset by peer]
jsilver-ipod has joined #ruby
bradhe has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
jsilver-ipod has quit [Client Quit]
jsilver-ipod has joined #ruby
Vovko has joined #ruby
AussieDownUnder has joined #ruby
yubrew has joined #ruby
radic has quit [Ping timeout: 240 seconds]
radic has joined #ruby
jsilver-ipod has quit [Remote host closed the connection]
bradhe has quit [Ping timeout: 246 seconds]
senayar_ has joined #ruby
scarolan has quit [Ping timeout: 240 seconds]
agent_white has joined #ruby
justyb has joined #ruby
justyb has left #ruby [#ruby]
yubrew has quit [Ping timeout: 240 seconds]
hiall has joined #ruby
cj3kim has joined #ruby
senayar has quit [Ping timeout: 240 seconds]
fgo has joined #ruby
weems has quit [Read error: Connection reset by peer]
weems has joined #ruby
weems has quit [Changing host]
weems has joined #ruby
fgo_ has joined #ruby
tfittsy has quit [Remote host closed the connection]
inkblots has quit [Remote host closed the connection]
tfitts has joined #ruby
kennym has quit [Quit: Leaving.]
fgo has quit [Ping timeout: 240 seconds]
chipotle has joined #ruby
snuffeluffegus has quit [Quit: Leaving]
fgo_ has quit [Ping timeout: 240 seconds]
tectonic has quit []
teddyp1cker has joined #ruby
kayloos has joined #ruby
godd2 has joined #ruby
prionic has joined #ruby
<godd2>
hello, all
invinceable has quit [Ping timeout: 268 seconds]
teddyp1cker has quit [Ping timeout: 252 seconds]
<benzrf>
hej da
snuffeluffegus has joined #ruby
snuffeluffegus has quit [Remote host closed the connection]
funburn has joined #ruby
snuffeluffegus has joined #ruby
scarolan has joined #ruby
Guest93085 has quit [Changing host]
Guest93085 has joined #ruby
Guest93085 is now known as digifiv5e
cashnguns has quit [Quit: I'm just an old fashioned cowboy]
dseitz has joined #ruby
sailias has quit [Ping timeout: 246 seconds]
mr_red has quit [Ping timeout: 246 seconds]
Talorc has quit [Quit: Leaving]
Nahra has quit [Quit: Lost terminal]
kayloos has quit []
mr_red has joined #ruby
timonv has joined #ruby
Lewix has joined #ruby
dik_dak_ has joined #ruby
dik_dak has quit [Read error: Operation timed out]
Nahra has joined #ruby
timonv has quit [Ping timeout: 246 seconds]
larsam has joined #ruby
prionic has left #ruby ["Leaving"]
mostlybadfly has quit [Quit: Connection closed for inactivity]
<patrick99e99>
so why is it that in a ruby file, if I do require 'path/to/file', I get 'cannot load such file' ... And I have to do $:.push Dir.pwd
<browndawg>
patrick99e99: try require_relative
<patrick99e99>
or $:push File.expand_path('.')
<patrick99e99>
or I guess I can use require_relative './path/to/file'
<patrick99e99>
But--- I just don't understand why it doesn't work out of the box?
s2013_ has joined #ruby
petey has joined #ruby
fgo has quit [Ping timeout: 240 seconds]
meatherly has joined #ruby
cj3kim has quit [Read error: Connection reset by peer]
s2013 has quit [Ping timeout: 240 seconds]
dapz has joined #ruby
patrick99e99 has quit [Ping timeout: 240 seconds]
Squarepy has quit [Ping timeout: 268 seconds]
patrick99e99 has joined #ruby
enali has joined #ruby
petey has quit [Ping timeout: 240 seconds]
browndawg has quit [Ping timeout: 265 seconds]
SCommette has quit [Quit: SCommette]
agent_white has quit [Read error: Connection reset by peer]
<enali>
how to use ri to get ruby stdlib help
<enali>
'ri Socket#accept', I run it ,get 'no matches found'
<enali>
why?
thomasxie has quit [Ping timeout: 240 seconds]
baroquebobcat has joined #ruby
agarie_ has quit [Quit: Leaving...]
agent_white has joined #ruby
danno1 has quit [Ping timeout: 240 seconds]
coder_neo has joined #ruby
rahult is now known as rahult_
alexju has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
rahult_ is now known as rahult
AussieDownUnder has quit [Quit: Leaving]
baroquebobcat has joined #ruby
enali has quit [Quit: leaving]
nateberkopec has joined #ruby
SteveBenner09 has joined #ruby
baroquebobcat has quit [Client Quit]
<benzrf>
o son of a fuck stick
<benzrf>
>:{
<benzrf>
mrb_state is not easily serializable, it contains funcs
<benzrf>
D=
<benzrf>
hmmm i can just write up a special case for that field :u
enali_ has joined #ruby
speakingcode has joined #ruby
thomasxie has joined #ruby
rjhunter has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
pfg has quit [Remote host closed the connection]
sepp2k has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
pfg has joined #ruby
<enali_>
ruby 2.1.1, use rvm install
likemike has quit [Ping timeout: 265 seconds]
nateberkopec has quit [Quit: Leaving...]
pfg has quit [Client Quit]
pfg has joined #ruby
browndawg has joined #ruby
wjlafrance has joined #ruby
macscam1 has joined #ruby
<macscam1>
im wondering whether it is easier to parse xml or json streams ... im making my first api app and it has both options
Deele has quit [Ping timeout: 240 seconds]
<SteveBenner09>
answer: yaml
<SteveBenner09>
aheuheu
likemike has joined #ruby
<gizmore>
macscam1: json > xml
<macscam1>
SteveBenner09 I dont understand
<gizmore>
if you want to troll you should ask if soap is cool
<macscam1>
why
<gizmore>
soap is even worse than xml
bradhe has joined #ruby
LexicalScope` has joined #ruby
<SteveBenner09>
macscam1: what do you not understand?
<SteveBenner09>
Linus Torvalds supposedly said "XML is the single worst protocol ever created."
<SteveBenner09>
I"m inclined to agree
<gizmore>
hmmm in terms of streams yml is indeed way better
LexicalScope has quit [Read error: Connection reset by peer]
<macscam1>
SteveBenner09 what yaml had to do with it ... but sounds like it sucks
<gizmore>
as yml can be indeed parsed as stream, whereas json can only parsed as a whole?
<SteveBenner09>
macscam1: what do you base that opinion off of
<macscam1>
SteveBenner09 your seeming sarcasm
<SteveBenner09>
ultimately doesn't it depend on your technology stack
<SteveBenner09>
macscam1: sarcasm is inferred; if you aren't interested in technology enough to even google the thing, how can I help you... The humor is derived from the suggestion of an option you hadn't considered; hey, perhaps it's better!
yubrew has joined #ruby
<SteveBenner09>
fate rewards the curious
<macscam1>
oh ok thanks gizmore for explaining that difference
<gizmore>
macscam1: i didn´t explain anything, i was asking a question as well
<SteveBenner09>
lol
<gizmore>
but to answer your question:
<gizmore>
json is better than xml in my opinion
<gizmore>
it has easier specifications, and is good enough for everything i have needed
<gizmore>
it is more slim and widely supported
<SteveBenner09>
again, it edpends on the technology: XML is becoming outdated, so really the only reason you'd use it is your tech stack relied on certain software which was XML based such as Java net tools
<SteveBenner09>
JSON is superior all things given
<macscam1>
SteveBenner09 I googled yaml and read a little about it. it doesnt strike me as obviously inferior so i wasnt able to be sure if you were being sarcastic. i am a beginner
enali_ has quit [Quit: leaving]
agent_white has quit [Read error: Connection reset by peer]
<gizmore>
does yml allow arrays? like foo: [1,2,3] ?
<macscam1>
SteveBenner09 thanks i didnt know that about xml
hotchkiss87 has quit [Ping timeout: 268 seconds]
bradhe has quit [Ping timeout: 265 seconds]
<macscam1>
this is again a beginner question but should i parse json using ruby or javascript
<SteveBenner09>
macscam1: no sarcasm intended, sorry if I made myself to seem an ass. If you're really that new to data serialization formats, then its harder for someone like me, who doesn't know anything about your experience, toolset, or problem, to assist :)
<macscam1>
SteveBenner09 actually yeah this is my first time trying to make anything using them. but its all good
<gizmore>
macscam1: usually you parse json into objects where you use them, javascript runs inside the browser and ruby on the server
danno1 has joined #ruby
yubrew has quit [Ping timeout: 268 seconds]
<macscam1>
gizmore oh thanks im glad i understand that now
<gizmore>
there is no way to parse the json on the ruby server and parse it into js objects and magically make js know the objects ... you would need to turn that into json then and make js parse it :P
<SteveBenner09>
yeah way too big a question
<SteveBenner09>
If you don't have programming experience in either Ruby OR Javascript, I suggest learning both, starting with Ruby
Cache_Money has quit [Ping timeout: 245 seconds]
<SteveBenner09>
Ruby is easier to parse JSON with because you have a lot of packages called 'gems' which ease the pain and allow you to translate into other languages like YAML that are more human-readable
<SteveBenner09>
<- opinion
braincrash has quit [Quit: bye bye]
<SteveBenner09>
^
rahult is now known as rahult_
<macscam1>
ok i have been learning ruby .... but im bored of going through textbooks, now trying to challenge myself to building something .... thats why i ask these questions and its really helpful to get answers here insteading of browsing documentation which is hard for a beginner
agent_white has joined #ruby
<SteveBenner09>
gizmore, that is a confusing response IMO
<macscam1>
SteveBenner09 ok so is it true though that one cannot send parsed json objects from ruby to javascript?
<SteveBenner09>
macscam1: if you want to build something, my personal approach is to look for problems in the real world and try to replicate or improve them, such as plugins, tiny webapps, Euler problems, etc.
<macscam1>
SteveBenner09 Im just tring to make a simple web app using APIs
<gizmore>
sounds like what SteveBenner09 suggested :)
<SteveBenner09>
macscam1: you'd have to dig deeper into your concept of 'send to' because there is no such thing as message passing between languages, only between software processes, e.g. programs running on some machine
<SteveBenner09>
specify your context more
<SteveBenner09>
Ruby, for instance, has gems which allow you to write Javascript code within a Ruby script and evaluate it via a Ruby engine
braincrash has joined #ruby
<SteveBenner09>
You can also parse, that is to convert the actual data, of a Javascript file into Ruby
<SteveBenner09>
in Javascript you have packages which let you code in Ruby, within a JS file, and evaluate with a JS engine
<macscam1>
SteveBenner09 I want to do data requests via API and parse the json to pass the data to a map API to display
<SteveBenner09>
the point is, if you're running a webapp, there is either a Ruby or Javascript engine interpreting and evaluating the code, behind the software technology
<gizmore>
usually both?
jle` has joined #ruby
<mr_snowf1ake>
gizmore, i think he's talking specifically about the parsing?
mikecmpbll has quit [Quit: i've nodded off.]
<SteveBenner09>
gizmore: haha hopefully at some point
<gizmore>
imo the traditional way is to write the server stuff in plain ruby and later add some javascript to add easier usage, like adding search to select lists
<gizmore>
that would be a traditional website which would even work without javascript
<SteveBenner09>
macscam1: look; you're stating that you have a problem to solve, but asking how to do it in a ruby forum, while indicating you are "on-the-fence" about your underlying software stack. Are you intending to program using mostly ruby tools, or javascript, to develop the server software and/or logic of your webapp?
<SteveBenner09>
there are zillions of solutions - your coding experience usually dictates the first choice as to dev tools
<SteveBenner09>
if your'e at square one I HIGHLY recommend Ruby
<macscam1>
SteveBenner09 I was just seeing if there was a general best practice for that, but thanks, i will
lewellyn has joined #ruby
<gizmore>
best practice is: also works without javascript :P
Es0teric_ has joined #ruby
Es0teric has quit [Ping timeout: 240 seconds]
<mr_snowf1ake>
macscaml, Ruby is a really versatile, so in general, any "best practice" will also work with Ruby :)
Es0teric_ has quit [Max SendQ exceeded]
<mr_snowf1ake>
(except for anything low level i suppose)
<mr_snowf1ake>
(and the math and science libraries are kind of lacking >:( )
<SteveBenner09>
if you google 'fastest webapp development' or something along those lines, honestly don't know what, eventually it leads to ruby dev tools
Es0teric has joined #ruby
Cache_Money has joined #ruby
<SteveBenner09>
the fact is javascript is more complicated ergo more difficult to create a webapp in, all things considered <- opinion
coder_neo has quit [Ping timeout: 240 seconds]
<popl>
You don't need to blatantly state that you are speaking your opinion. That's what you've been doing. :P
<mr_snowf1ake>
actually, on that note, does anyone know of a solid ruby statistics package?
<gizmore>
if you would want to create a pure js webapp you maybe even want todo it in pure node.js
hiall has quit [Quit: hiall]
abdulsattar has joined #ruby
<gizmore>
although node.js probably has less libs and tools?
fgo has joined #ruby
<SteveBenner09>
if you're going even more than 50% JS for your tookit, NPM is going to be involved haha
<SteveBenner09>
well it's my way of trying to be humble
sparrovv has joined #ruby
<SteveBenner09>
some people get incensed at opinions
<SteveBenner09>
its a subjective topic, ruby vs JS
<mr_snowf1ake>
gizmore: monkeypatching is cool, but isn't it something you have to be pretty careful with? maybe the addition of a disclaimer would be welcome :)
<gizmore>
yes, and maybe a sentence about alias and super
<gizmore>
thanks
fgo has quit [Ping timeout: 240 seconds]
<gizmore>
monkeypatching is the only way when your upstream is ignored >:-| (kidding)
<mr_snowf1ake>
yup :) also, dynamic typing and duck typing
<mr_snowf1ake>
XD
<gizmore>
duck typing is allowing to change type anytime?
<gizmore>
duck typing is a form of dynamic typing?
<gizmore>
and duck typing is a form of dynamic typing?*
crazymykl has quit [Remote host closed the connection]
<mr_snowf1ake>
you know interfaces in java?
sputnik13 has joined #ruby
<benzrf>
duck typing means that whether the type of something is OK for what youre trying to do is checked at runtime
crazymykl has joined #ruby
<centrx>
duck typing means if it acts like a duck (responds_to?(:method)) then it must be a duck (duck.send(:duckmethod))
<benzrf>
when you try to do it
abdulsattar has quit [Read error: Operation timed out]
<benzrf>
instead of at compile time
<mr_snowf1ake>
benzrf: good explanation.
<benzrf>
so if you write 'n + 1'
sparrovv has quit [Ping timeout: 252 seconds]
<mr_snowf1ake>
lol i always have trouble explaining it.
<SteveBenner09>
java interface? I call oxymoron
<benzrf>
in java, for example
<benzrf>
it'd be checked at compile time whether it's a number
<benzrf>
in ruby, which uses duck typing
<benzrf>
it only checks whether n is a number /when that code is run/
<benzrf>
or rather, whether it has a + method
meatherly has quit [Remote host closed the connection]
<mr_snowf1ake>
yes, checking whether it has a specific method is key
teddyp1cker has joined #ruby
<benzrf>
>> n = "foo"; if false; n.uwefhouhefiush; end;
<gizmore>
i am waiting for someone to say wtf to my global_orm_mapper extension :P
<SteveBenner09>
(the -d flag gives you a descriptino of each gem)
<SteveBenner09>
lolwut
<mr_snowf1ake>
nmatrix and sciruby look promising
<mr_snowf1ake>
but not quite mature enough
<SteveBenner09>
gizmore: I like tenacity
<crome>
I never really liked the 'if it acts like a duck then it must be a duck' thing. its more like 'if it quacks like a duck then I don't really care what it is, I just want it to quack'
<mr_snowf1ake>
crome: touche
<SteveBenner09>
crome: for reals yo.
<SteveBenner09>
yeah, the fist time I actually INTERNALIZED the whole 'typing' concept was in class when I created a
<SteveBenner09>
20 questions game in Ruby
<SteveBenner09>
from original python code
<SteveBenner09>
I had a great instructor...
<arubin>
I have been reading Eloquent Ruby recently and it helped to clarify my thinking on duck typing.
mostlybadfly has joined #ruby
<gizmore>
ruby-toolbox is a collection of codesnippets that are not gemmified yet?
* mr_snowf1ake
has a java background so i liken it to java interfaces without having to define interfaces :P
<arubin>
It helped me to better understand why I dislike when one of my coworkers feels the need to check types in Perl.
<mr_snowf1ake>
gizmore: no, these are a bunch of gems
<mr_snowf1ake>
you can see how popular and active they are
<SteveBenner09>
I fell in love with Ruby when I found out that I could use metaprogramming to hand off the processing of a node to a procedure, and implement each context differently based upon the class, esentially figuring out the concept of 'closures' for the first time :P
<mr_snowf1ake>
gizmore: best. site. ever.
<SteveBenner09>
&block ftw
<gizmore>
ah okay ... but also include other sources than github i guess :P
agent_white has quit [Read error: Connection reset by peer]
<crome>
arubin: type checking is probably the most obvious smell in dynamic languages
<SteveBenner09>
gizmore: no, i'ts a community-based portal for analyzing and amassing statistics about gems, and organizing those for consumption
likable-lovable- has joined #ruby
<SteveBenner09>
by users liek yourself
<gizmore>
SteveBenner09: can it count my usage of a gem when i use "foo" in a Gemfile?
blom_ has joined #ruby
<gizmore>
or install a gem globally via gem install?
<mr_snowf1ake>
gizmore: whenever you're in doubt about anything, just put down your stuff, sit down, and go to ruby-toolbox.com
<mr_snowf1ake>
gizmore: the gems include install instructions
SCommette has quit [Quit: SCommette]
<SteveBenner09>
gizmore: well think about what you're saying... a website aggregating data has to sustain a connection to the client/user... pretty invasively to collect data, or else you are visiting a site and triggering some code on the webpage
cj3kim has quit [Read error: Connection reset by peer]
<SteveBenner09>
but of course you can't know for sure unless you follow what goes on under the hood of rubygems, which downloads content for you automatically
cj3kim has joined #ruby
<SteveBenner09>
so every time you install a gem from the source 'rubyems.org' yeah, it's sending data somewhere... follows that this site will read from that I suppose
agent_white has joined #ruby
jsilver-ipod has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
<mr_snowf1ake>
SteveBenner09: i never really thought about it before, but perhaps does it directly look at the number of downloads on the github page?
atmatt has quit [Quit: Leaving.]
<gizmore>
which numbers are probably way off installation count
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<mr_snowf1ake>
gizmore: there is no feasible way of getting that data anyway
<SteveBenner09>
I dunno, google that shit lol
<SteveBenner09>
honesty that will get you a quicker answer :P
<mr_snowf1ake>
haha ya
<mr_snowf1ake>
meh
<mr_snowf1ake>
too lazy.
<SteveBenner09>
lol
<mr_snowf1ake>
i switched to ruby BECAUSE i was so lazy. want the language to do everything for me lol
<SteveBenner09>
well son I'm too lazy to make a 'et me google that for you' page in mock
<SteveBenner09>
in jest*
<gizmore>
SteveBenner09: there is a gem for it 'lmgify-rails'
<mr_snowf1ake>
excellent. guess you came to ruby for the same reason :P
<SteveBenner09>
hey Larry Wall said it best
tectonic has quit []
goodzoho has joined #ruby
<SteveBenner09>
gizmore: no clue, too lazy to type `gem search -r lmgify-rails` honestly
jsilver-ipod has quit [Remote host closed the connection]
cj3kim_ has joined #ruby
abdulsattar has joined #ruby
<gizmore>
now i soon get too lazy to respond with lame jokes
<mr_snowf1ake>
sounds about right.
thesheff17 has quit [Ping timeout: 240 seconds]
crystal77 has joined #ruby
rabeldable has quit [Quit: Leaving.]
<gizmore>
once i wanted to monkeypatch Thread.new but somehow i couldn´t get it working... however inheriting from Thread worked... any idea why?
<gizmore>
oh... there is a source toggle! nice and thank you very much. i appreciate that. (i often seem to ask annoying and unusual dumb stuff)
baroquebobcat has quit [Quit: baroquebobcat]
yubrew has quit [Ping timeout: 265 seconds]
<mr_snowf1ake>
yeah, source toggle is really cool :) and don't worry about it... we've all been there. though don't forget that you'll find most of the answers in much more comprehensive terms if you do a quick google search
yacks has joined #ruby
baroquebobcat has joined #ruby
<gizmore>
some stuff is really hard to google, or you just don´t even know what you really want though :)
teddyp1cker has joined #ruby
<gizmore>
The sourcecode of Thread#initialize explains why it did not work :P
<mr_snowf1ake>
cool
Astralum has joined #ruby
baroquebobcat has quit [Client Quit]
<gizmore>
also i did not repsect ther params.... i wonder if it would, in theory, work if i alias initialize and respect the parameters
IcyDragon has quit [Remote host closed the connection]
bahar has quit [Ping timeout: 268 seconds]
Solnse has quit [Quit: Leaving.]
bahar has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
<benzrf>
how does i join two enums
crystal77 has quit [Quit: Computer has gone to sleep.]
Atw has joined #ruby
browndawg has quit [Ping timeout: 265 seconds]
<arubin>
gizmore: If you are patching a class, super is not what you want. It is common, I believe, to first alias the original method.
<arubin>
gizmore: Then you can call the original method through the alias.
<gizmore>
arubin: jup, my question is if this also works with #initialize
<gizmore>
benzrf: the new Enum class from ActiveRecord?
<benzrf>
n-no?
<gizmore>
so exact classname is Enumerator?
<benzrf>
yea
agent_white has joined #ruby
Lewix has quit [Remote host closed the connection]
felipecvo has joined #ruby
<gizmore>
benzrf: not sure, but i think maybe you can write a wrapper that applies the same block to all the enumerators you provide
cj3kim_ has quit [Read error: Connection reset by peer]
nanoyak has joined #ruby
cj3kim has joined #ruby
browndawg has joined #ruby
<gizmore>
stroke that... i don´t know enumerators well yet :/
Es0teric has quit [Quit: Computer has gone to sleep.]
<centrx>
benzrf, You could make another enumerator that enumerators through one and then the other
kiki_lamb has quit [Remote host closed the connection]
fflush_ has quit [Ping timeout: 265 seconds]
Hien_ has quit [Ping timeout: 265 seconds]
Astralum has quit [Ping timeout: 265 seconds]
rcs has quit [Ping timeout: 265 seconds]
Kruppe has joined #ruby
kirun has joined #ruby
Hien has joined #ruby
gischy has quit [Changing host]
gischy has joined #ruby
nifty has joined #ruby
wmoxam has joined #ruby
davidcelis has joined #ruby
nifty has quit [Changing host]
wmoxam has quit [Changing host]
davidcel- is now known as davidcelis
crazysim_ is now known as crazysim
davidcelis has quit [Changing host]
Hien has quit [Changing host]
MindfulMonk has joined #ruby
rcs has joined #ruby
mist has quit [Remote host closed the connection]
Klumben has joined #ruby
mist__ has joined #ruby
blom_ has quit [Ping timeout: 240 seconds]
xiphias has quit [Ping timeout: 265 seconds]
xiphias has joined #ruby
alex88 has joined #ruby
gancl_ has joined #ruby
Norrin has joined #ruby
popl has quit [Quit: Touch the frog.]
Merks has quit []
Brando753 has quit [Ping timeout: 255 seconds]
popl has joined #ruby
popl has quit [Changing host]
popl has joined #ruby
dzhulk has joined #ruby
wuest_ is now known as wuest
nari has joined #ruby
mikecmpbll has joined #ruby
chipotle has quit [Quit: cya]
bradhe has joined #ruby
polysign has joined #ruby
felipecvo has joined #ruby
prc has quit [Ping timeout: 240 seconds]
yubrew has joined #ruby
lolmaus_ has quit [Read error: Operation timed out]
lolmaus has joined #ruby
matcouto has joined #ruby
bradhe has quit [Ping timeout: 268 seconds]
snuffeluffegus has quit [Quit: Leaving]
nhhagen has joined #ruby
ixti has joined #ruby
felipecvo has quit [Ping timeout: 240 seconds]
zigomir has quit [Read error: Connection reset by peer]
Sammael has quit [Ping timeout: 265 seconds]
decoponio has quit [Read error: Connection reset by peer]
aob has quit [Ping timeout: 265 seconds]
Klumben has quit [Ping timeout: 265 seconds]
SegFaultAX has quit [Ping timeout: 265 seconds]
ConstantineXVI has quit [Ping timeout: 265 seconds]
RealMarc is now known as Marc
maroloccio has quit [Ping timeout: 265 seconds]
MindfulMonk has quit [Ping timeout: 265 seconds]
crome has quit [Ping timeout: 265 seconds]
tommyblu` has quit [Ping timeout: 265 seconds]
Patteh has quit [Ping timeout: 265 seconds]
artgoeshere has quit [Ping timeout: 265 seconds]
fella5s has quit [Read error: Connection reset by peer]
aetaric has quit [Ping timeout: 265 seconds]
lotherk has quit [Ping timeout: 265 seconds]
willb1 has quit [Ping timeout: 265 seconds]
Klumben has joined #ruby
lfox has joined #ruby
lfox has quit [Ping timeout: 265 seconds]
Paradox has quit [Ping timeout: 265 seconds]
DarkFoxDK has quit [Ping timeout: 265 seconds]
miah has quit [Ping timeout: 265 seconds]
wmoxam has quit [Ping timeout: 265 seconds]
jso has quit [Ping timeout: 265 seconds]
thelamest has quit [Ping timeout: 265 seconds]
amundj has quit [Ping timeout: 265 seconds]
Kabaka_ has quit [Ping timeout: 265 seconds]
eregon has quit [Quit: No Ping reply in 180 seconds.]
ezrios has quit [Ping timeout: 265 seconds]
bauruine has quit [Ping timeout: 265 seconds]
rhys has quit [Quit: No Ping reply in 180 seconds.]
Nowaker has quit [Ping timeout: 265 seconds]
artgoeshere has joined #ruby
hoelzro has quit [Ping timeout: 265 seconds]
dmarr has quit [Ping timeout: 265 seconds]
dapz_ has quit [Ping timeout: 265 seconds]
_whitelogger_ has joined #ruby
petems has joined #ruby
drago777 has joined #ruby
bricker`LA has joined #ruby
tchebb has joined #ruby
petey has quit [Ping timeout: 268 seconds]
jfisk87 has joined #ruby
RaptorJesus has joined #ruby
tvw has quit []
vlad_starkov has joined #ruby
tvw has joined #ruby
aob has joined #ruby
Kovensky has joined #ruby
kiki_lamb has joined #ruby
banister has joined #ruby
nuba has joined #ruby
rhys has joined #ruby
mosez has joined #ruby
cschneid has joined #ruby
bmn has joined #ruby
willb1 has joined #ruby
gischy_ is now known as gischy
jabular has joined #ruby
Rydekull has joined #ruby
jonasac has joined #ruby
tvw has quit [Ping timeout: 240 seconds]
timonv has quit [Remote host closed the connection]
bauruine has joined #ruby
theRoUS has joined #ruby
holo has joined #ruby
Xeago_ has quit [Remote host closed the connection]
rcs has joined #ruby
Urocyon has joined #ruby
aef has joined #ruby
kennym has joined #ruby
Sthebig has joined #ruby
Doppp has joined #ruby
geggam has joined #ruby
senayar has joined #ruby
razibog has quit [Quit: Leaving.]
ValicekB has joined #ruby
rurban has joined #ruby
Hanmac1 has joined #ruby
ghr has joined #ruby
phansch has quit [Quit: WeeChat 0.4.2]
Nightmare has joined #ruby
DarkFoxDK has joined #ruby
dmarr has joined #ruby
psyprus has joined #ruby
aetaric has joined #ruby
apeiros has joined #ruby
TheLarkInn has joined #ruby
UForgotten has joined #ruby
PhilK has joined #ruby
mjmac has joined #ruby
awkisopen has joined #ruby
xiphias has joined #ruby
Rollabunna has joined #ruby
epochwolf has joined #ruby
kristiandelay has joined #ruby
Asher has joined #ruby
nifty has joined #ruby
kenichi has joined #ruby
vpretzel has joined #ruby
seich- has joined #ruby
pedrocr has joined #ruby
Kruppe has joined #ruby
joelteon has joined #ruby
lfox has joined #ruby
mbff_ has joined #ruby
badhatter has joined #ruby
teddyp1cker has joined #ruby
iceden|2 has joined #ruby
csq has joined #ruby
gizmore has joined #ruby
Hanmac has quit [Ping timeout: 240 seconds]
poguez_ has joined #ruby
dmarr has quit [Max SendQ exceeded]
epochwolf has quit [Changing host]
epochwolf has joined #ruby
Paradox has joined #ruby
phansch has joined #ruby
MindfulMonk has joined #ruby
ConstantineXVI has joined #ruby
Nightmare is now known as Guest88401
maxmanders_ is now known as maxmanders
Guest88401 has quit [Changing host]
Guest88401 has joined #ruby
dzhulk has quit [Quit: Leaving.]
carraroj has joined #ruby
senayar has quit [Ping timeout: 268 seconds]
dmarr has joined #ruby
Guest88401 is now known as Nightmare
tvw has joined #ruby
blom_ has joined #ruby
polysign has quit []
Sammael has joined #ruby
phansch has quit [Client Quit]
maroloccio has joined #ruby
phansch has joined #ruby
phansch has quit [Client Quit]
phansch has joined #ruby
Jetchisel has quit [Quit: "Unfortunately time is always against us" -- *Morpheus*]
tvw has quit [Ping timeout: 252 seconds]
razibog has joined #ruby
atmosx has joined #ruby
blom_ has quit [Ping timeout: 264 seconds]
rahult has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex88_ has joined #ruby
alex88 has quit [Ping timeout: 246 seconds]
tvw has joined #ruby
Kabaka_ has joined #ruby
bradhe has joined #ruby
<sobersabre>
/j #maven
yubrew has joined #ruby
alex88_ has quit [Quit: Leaving...]
mehlah has joined #ruby
dzhulk has joined #ruby
yfeldblum has quit [Remote host closed the connection]
bradhe has quit [Ping timeout: 268 seconds]
SHyx0rmZ has joined #ruby
yubrew has quit [Ping timeout: 240 seconds]
patrick99e99 has quit [Ping timeout: 240 seconds]
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
ikaros has joined #ruby
no0code has joined #ruby
no0code has quit [Client Quit]
sparrovv has quit [Remote host closed the connection]
chipotle has joined #ruby
VTLob has joined #ruby
gbt has quit [Quit: Leaving...]
senayar has joined #ruby
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
fgo has quit [Remote host closed the connection]
klaut has quit [Remote host closed the connection]
no0code has joined #ruby
nhhagen has quit []
no0code has quit [Client Quit]
SonicX has quit [Ping timeout: 240 seconds]
Hanmac has joined #ruby
sigurding has joined #ruby
Hanmac1 has quit [Ping timeout: 240 seconds]
patrick99e99 has joined #ruby
vasilakisFiL has joined #ruby
<vasilakisFiL>
hi, is there a difference between class variables and singleton instance variables ?
<crome_>
since classes are instances of the class Class, no
crome_ is now known as crome
no0code has joined #ruby
<vasilakisFiL>
ok thanx, I just defined a singelton instance variable @var and I couldn't access it using the @@var from the object.. so there is technically a difference but they both serve the same purpose
<crome>
but singleton is really a pattern (sort of), in ruby you can implement it in different ways
<vasilakisFiL>
no I meant the singleton (anonymous) class
lolmaus has quit [Quit: No Ping reply in 180 seconds.]
<crome>
ah, I see what you mean
lolmaus has joined #ruby
<vasilakisFiL>
the eigenclass
<crome>
no, a singleton instance is not the same as its parent clas
no0code has quit [Client Quit]
patrick99e99 has quit [Ping timeout: 240 seconds]
no0code has joined #ruby
<crome>
-parent
no0code has quit [Client Quit]
<crome>
the singleton instance does not share variables with its class
<crome>
(why would it)
blom_ has joined #ruby
jlast has joined #ruby
chipotle has quit [Quit: cya]
<apeiros>
uh
<apeiros>
crome, vasilakisFiL: instance variables (@var) in the class level behave differently than class variables (@@var)
<apeiros>
@@vars are shared across inheritance and instances
<crome>
yeah, its what I was getting at. I just wasnt exactly sure what he was trying to achieve
<apeiros>
@vars otoh always only belong to a single object - in case of "class instance variables", the object would be the class itself.
browndawg has joined #ruby
<apeiros>
@@class_vars should generally be avoided. if you want to use them, make sure you study and understand how they work.
davedev24 has joined #ruby
<vasilakisFiL>
yeah that's why I am searching for alternatives
fieldfirst has quit [Ping timeout: 268 seconds]
blom_ has quit [Ping timeout: 268 seconds]
bradhe has joined #ruby
Hanmac1 has joined #ruby
Hanmac has quit [Ping timeout: 240 seconds]
browndawg1 has joined #ruby
yubrew has joined #ruby
browndawg has quit [Ping timeout: 252 seconds]
hiall has joined #ruby
end_guy has quit [Remote host closed the connection]
<vasilakisFiL>
oops sorry the first attr_accessor is useless
<vasilakisFiL>
ok fixed
<apeiros>
TestClass.class_var_alternative and TestClass.new.class_var_alternative will not access the same variable
tvw has quit []
timonv has joined #ruby
yfeldblum has joined #ruby
ValicekB has quit [Ping timeout: 240 seconds]
toretore has quit [Quit: Leaving]
Lewix has joined #ruby
Jrz has joined #ruby
Jrz has quit [Max SendQ exceeded]
<vasilakisFiL>
ok the idea is to access it only from the metaclass (eigenclass singleton or metaclass ?).. that's why I removed the first attr_accessor
gbt has quit [Quit: Leaving...]
Jrz has joined #ruby
Jrz has quit [Max SendQ exceeded]
<vasilakisFiL>
apeiros do you have a better solution to share state ?
Xeago_ has joined #ruby
Jrz has joined #ruby
Jrz has quit [Max SendQ exceeded]
<jhass>
there are several solutions to share state, which one is the best depends on the use case
<certainty>
how about giving them access to an object that encapsulates that shared state and pass it to the constructor of the objects that shall share it?
felipecvo has joined #ruby
<certainty>
i'm all for explicitness
Jrz has joined #ruby
Jrz has quit [Max SendQ exceeded]
<certainty>
does that word exist?
Lewix has quit [Remote host closed the connection]
<jhass>
my spell checker says yes
<certainty>
alright
<jhass>
but this is english, making words up is alright, isn't it?
Jrz has joined #ruby
Jrz has quit [Max SendQ exceeded]
<certainty>
hehe i think so
<certainty>
also i can always say that i'm not a native speaker as an excuse
yfeldblum has quit [Ping timeout: 268 seconds]
<vasilakisFiL>
certainty the pattern you described seems interesting.. does it have a name or you just came up with it ?
sigurding has quit [Quit: sigurding]
felipecvo has quit [Ping timeout: 246 seconds]
mercwithamouth has quit [Ping timeout: 268 seconds]
lfox has quit [Ping timeout: 265 seconds]
UForgotten_ has joined #ruby
pedrocr_ has joined #ruby
dzhulk has quit [Ping timeout: 268 seconds]
dmarr has quit [Ping timeout: 265 seconds]
seich- has quit [Ping timeout: 265 seconds]
<apeiros>
vasilakisFiL: not sure what exactly you try to achieve - maybe this? http://pastie.org/8961139
csq has quit [Ping timeout: 265 seconds]
xiphias has quit [Ping timeout: 265 seconds]
MindfulMonk has quit [Ping timeout: 265 seconds]
aetaric has quit [Ping timeout: 265 seconds]
lfox has joined #ruby
nifty has quit [Ping timeout: 265 seconds]
psyprus has quit [Ping timeout: 265 seconds]
csq has joined #ruby
Kruppe has quit [Ping timeout: 265 seconds]
mbff_ has quit [Ping timeout: 265 seconds]
badhatter has quit [Ping timeout: 265 seconds]
awkisopen has quit [Ping timeout: 265 seconds]
DarkFoxDK has quit [Ping timeout: 265 seconds]
mbff has joined #ruby
ConstantineXVI has quit [Ping timeout: 265 seconds]
joelteon has quit [Ping timeout: 265 seconds]
UForgotten has quit [Ping timeout: 265 seconds]
Paradox has quit [Ping timeout: 265 seconds]
pedrocr has quit [Ping timeout: 265 seconds]
joelteon has joined #ruby
joelteon has quit [Changing host]
joelteon has joined #ruby
UForgotten_ is now known as UForgotten
dmarr has joined #ruby
epochwolf has quit [Ping timeout: 265 seconds]
mjmac has quit [Ping timeout: 265 seconds]
lfox has quit [Max SendQ exceeded]
sigurding has joined #ruby
thelamest has joined #ruby
awkisopen has joined #ruby
awkisopen has joined #ruby
Symbiosisz has joined #ruby
ValicekB has joined #ruby
<vasilakisFiL>
thanks apeiros
Shidash has joined #ruby
lfox has joined #ruby
Kruppe has joined #ruby
PhilK has quit [Ping timeout: 265 seconds]
badhatter has joined #ruby
awkisopen has quit [Excess Flood]
mbff is now known as Guest71049
dzhulk has joined #ruby
DarkFoxDK has joined #ruby
aetaric has joined #ruby
awkisopen has joined #ruby
awkisopen has joined #ruby
Paradox has joined #ruby
ConstantineXVI has joined #ruby
MindfulMonk has joined #ruby
seich- has joined #ruby
xiphias has joined #ruby
PhilK has joined #ruby
sdouglas has joined #ruby
mjmac has joined #ruby
psyprus has joined #ruby
ezrios has joined #ruby
nifty has joined #ruby
epochwolf has joined #ruby
<apeiros>
hm? I pasted one
<apeiros>
certainty's solution of passing the shared state in is IMO a nice one
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
Slavox is now known as Slavox|AFK
DaniG2k has joined #ruby
petey has joined #ruby
sdouglas has quit [Ping timeout: 246 seconds]
sambao21 has joined #ruby
mercwithamouth has joined #ruby
badhatter has quit [Remote host closed the connection]
noocode has joined #ruby
petey has quit [Ping timeout: 240 seconds]
klaut has joined #ruby
jwest has joined #ruby
vlad_sta_ has joined #ruby
jollyy has joined #ruby
caustic has quit []
shevy has joined #ruby
sepp2k has joined #ruby
<shevy>
test
vlad_starkov has quit [Ping timeout: 264 seconds]
Xeago has quit [Remote host closed the connection]
<popl>
shevy: Do you really need to type that every time you enter the channel?
<shevy>
popl nope
tesuji has joined #ruby
<certainty>
vasilakisFiL: i'm not aware of a name for that pattern. But it's used in other languages as well. That's where i know it from
tafryn has joined #ruby
nateberkopec has joined #ruby
ikaros has quit [Quit: Ex-Chat]
Jrz has joined #ruby
<popl>
shevy: not so bad, I guess. 9 times that I've seen since december of last year.
<popl>
I'm not here all the time, though.
<shevy>
well you said that I type that every time I enter the channel
<shevy>
so you must have a huge and accurate dataset, I can only assume
<popl>
No, I didn't.
<popl>
I asked if you had to do that. I never said that you *did* do that.
<popl>
Don't try to out-pedant me, young man…
<popl>
:)
timonv has quit [Remote host closed the connection]
blom_ has joined #ruby
Jrz has quit [Ping timeout: 240 seconds]
mengu has joined #ruby
claymore has quit [Read error: Operation timed out]
lyanchih__ has joined #ruby
browndawg1 has quit [Read error: Operation timed out]
browndawg has joined #ruby
Lewix has joined #ruby
diegoviola has joined #ruby
jollyy_ has joined #ruby
bradhe has joined #ruby
klaut has quit [Read error: Operation timed out]
jollyy has quit [Ping timeout: 264 seconds]
klaut has joined #ruby
jollyy_ is now known as jollyy
yubrew has joined #ruby
cover has joined #ruby
yasushi has joined #ruby
diegoviola has quit [Client Quit]
blom_ has quit [Ping timeout: 240 seconds]
newbie1r has joined #ruby
bradhe has quit [Ping timeout: 268 seconds]
Brando753 has joined #ruby
yubrew has quit [Ping timeout: 240 seconds]
jollyy has quit [Quit: jollyy]
benzrf|offline is now known as benzrf
jollyy has joined #ruby
fgo has joined #ruby
enebo has quit [Quit: enebo]
weeems is now known as weems
weems has quit [Changing host]
weems has joined #ruby
enebo has joined #ruby
thesheff17 has joined #ruby
claymore has joined #ruby
vlad_sta_ has quit [Remote host closed the connection]
fieldfirst has joined #ruby
enebo has quit [Quit: enebo]
Xeago has joined #ruby
jollyy has quit [Read error: Connection reset by peer]
kennym has quit [Quit: Leaving.]
lemonsparrow has joined #ruby
Gooder has joined #ruby
browndawg has quit [Read error: Connection timed out]
browndawg has joined #ruby
_lazarevsky has joined #ruby
<_lazarevsky>
hello all
<_lazarevsky>
greetings from sunny SA
<_lazarevsky>
I've got a question regard parsing string into Dates in ruby
danno1 has joined #ruby
<_lazarevsky>
I wanna check whether a stromg matches the following pattern m/d/Y
<_lazarevsky>
however, I dont wanna use Date.parse as it throws an error
<_lazarevsky>
and I dont wanna handle exceptions u se..
<_lazarevsky>
I was wondering if there's a cleaner solution
<_lazarevsky>
like a regex
<crome>
the force is stromg with this one
<_lazarevsky>
which would return true or false..
<_lazarevsky>
thanks in advance
<crome>
dates, regexes
<crome>
what could possibly go wrong
fgo has quit [Remote host closed the connection]
Gooder has quit [Remote host closed the connection]
<jhass>
_lazarevsky: look into strptime
<_lazarevsky>
jhass: it throws an exception..
<_lazarevsky>
checked it out before i turned to you guys
<crome>
_lazarevsky: but you know exactly what pattern you expect, right?
<jhass>
we don't see your screen, share your error and the code that produces it
<_lazarevsky>
crome yes I do
<_lazarevsky>
crome: m/d/Y
claymore has quit [Ping timeout: 240 seconds]
<_lazarevsky>
1/1/2014
<_lazarevsky>
12/12/2014
<crome>
if you dont have to validate arbitrary date format, you can really just use a regexp
<_lazarevsky>
jhass: [1] pry(main)> Date.strptime('12/32/2001', '%m/%d/%Y') ArgumentError: invalid date
seich- has quit [Ping timeout: 265 seconds]
mjmac has quit [Ping timeout: 265 seconds]
Kruppe has quit [Ping timeout: 265 seconds]
dmarr has quit [Ping timeout: 265 seconds]
ConstantineXVI has quit [Ping timeout: 265 seconds]
<jhass>
well, that's an invalid date
MindfulMonk has quit [Ping timeout: 265 seconds]
mjmac has joined #ruby
psyprus has quit [Ping timeout: 265 seconds]
aetaric has quit [Ping timeout: 265 seconds]
Kruppe has joined #ruby
seich- has joined #ruby
<jhass>
what do you expect?
<_lazarevsky>
crome: would you be so kind to provide me with the regex for it..?
<_lazarevsky>
jhass: well I expect no errors.. didnt you read my question?
psyprus has joined #ruby
<_lazarevsky>
jhass: [16:18] <_lazarevsky> however, I dont wanna use Date.parse as it throws an error [16:18] <_lazarevsky> and I dont wanna handle exceptions u se..
<crome>
_lazarevsky: the regexp not check things like month being > 12 of course
<crome>
does not*
<jhass>
"no errors" is what you expect to not happen. what do you expect as result
<crome>
jhass: false or nil probably
<_lazarevsky>
jhass: true/false
bogeyd6 has joined #ruby
<_lazarevsky>
agh.. ok.. so what would you do in my position
yfeldblum has joined #ruby
<_lazarevsky>
im rly very new to ruby and I've been thrown in the deep end
<jhass>
why should parsing a date return true or false?
<_lazarevsky>
I learn as I go
<_lazarevsky>
jhass: duuuude.. arent u listening to me..? I dont wanna parse..
<_lazarevsky>
jhass: agh nvm..
<crome>
_lazarevsky: to me it looks like you actually want to parse
<_lazarevsky>
crome: ok so instead of returning true or false I may aswell just return the parsed date or nil
<_lazarevsky>
thanks guys
hotchkiss87 has joined #ruby
<_lazarevsky>
in C# there's this nifty method called TryParse which returns an output parameter
<crome>
if you *really* dont want to use parse then you can use #scan on the input and then feed the numbers to Date.valid_date?
<_lazarevsky>
no need to handle anything
dmarr has joined #ruby
aetaric has joined #ruby
Kruppe is now known as Guest16035
yfeldblum has quit [Ping timeout: 240 seconds]
ConstantineXVI has joined #ruby
Es0teric has joined #ruby
shevy has quit [Remote host closed the connection]
<apeiros>
_lazarevsky: what jhass is telling you is that 2001-12-32 is not a date (since there's no 32nd day in december, but I guess you know that). so you can't get a *date* back. it seems to me you want *the components* back?
<_lazarevsky>
apeiros: no mate.. I wanted to write a function which, when given a string returns a bool
dkamioka has joined #ruby
<_lazarevsky>
however in the implementation I dont wanna handle exceptions..
<crome>
he reall just wants to know if the date is valid
<_lazarevsky>
was wondering if there's a built in method in ruby that does that
<_lazarevsky>
the way I did it is I'm using Date.strptime
<_lazarevsky>
and handle it with begin / rescue
<_lazarevsky>
and am returning the parsed date or nil..
<apeiros>
_lazarevsky: mate, then why didn't you tell us that in the first place?
<_lazarevsky>
which is fugly..
<apeiros>
_lazarevsky: mate, so you want write a date validation method
<apeiros>
?
<_lazarevsky>
apeiros: I dont think I could've been any clearer
<_lazarevsky>
apeiros: ya
claymore has joined #ruby
<apeiros>
_lazarevsky: it seems about 3 people in here think you should have been anyway
<apeiros>
_lazarevsky: or rather, that your "very clear" was foggy at best
<apeiros>
but mate, we'll help you, don't worry.
<_lazarevsky>
shaweeeet
<_lazarevsky>
thanks
<apeiros>
but mate, try to step your "very clear" one up next time, will you? ;-)
<_lazarevsky>
but how awesome it is.. ruby automagically does the conversion
<_lazarevsky>
man Im falling in luv with ruby
r0nin has joined #ruby
zigomir has joined #ruby
<_lazarevsky>
there are some serious ZEN moments here that I havent encountered in any other language
<_lazarevsky>
fucking kiff bru
zigomir_ has quit [Ping timeout: 240 seconds]
dkamioka has quit [Remote host closed the connection]
blom_ has joined #ruby
browndawg has joined #ruby
patrick99e99 has joined #ruby
r0nin has quit [Remote host closed the connection]
meatherly has joined #ruby
abdulsattar has joined #ruby
eka has joined #ruby
mehlah has quit [Quit: Leaving...]
patrick99e99 has quit [Ping timeout: 246 seconds]
Emmanuel_Chanel has quit [Quit: Leaving]
lukec has joined #ruby
razibog has quit [Ping timeout: 264 seconds]
lukec has quit [Client Quit]
lukec has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
cover_ has joined #ruby
meatherly has quit [Ping timeout: 240 seconds]
Emmanuel_Chanel has joined #ruby
sailias has quit [Ping timeout: 240 seconds]
mehlah has joined #ruby
mengu has quit []
pyrac has joined #ruby
Murci3lago has quit [Ping timeout: 252 seconds]
lkba has joined #ruby
cover has quit [Ping timeout: 246 seconds]
benzrf is now known as benzrf|offline
pyrac has quit [Client Quit]
lethjakman has joined #ruby
paisano has joined #ruby
dgaffney has joined #ruby
jlast has quit [Remote host closed the connection]
razibog has joined #ruby
razibog has quit [Client Quit]
Murci3lago has joined #ruby
holo has quit [Read error: Operation timed out]
razibog has joined #ruby
sepp2k has joined #ruby
blom_ has quit [Remote host closed the connection]
blom_ has joined #ruby
browndawg has quit [Read error: Connection timed out]
fgo has joined #ruby
Mongey_ has quit [Ping timeout: 240 seconds]
browndawg has joined #ruby
LiohAu has quit [Quit: LiohAu]
shevy has joined #ruby
<shevy>
I think I smoked my old hdd
rabeldable has joined #ruby
jollyy has joined #ruby
blom_ has quit [Ping timeout: 252 seconds]
fgo has quit [Ping timeout: 240 seconds]
lemonsparrow has quit [Quit: Page closed]
teddyp1cker has quit [Remote host closed the connection]
hiall has quit [Quit: hiall]
teddyp1cker has joined #ruby
gbt has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
petey has joined #ruby
danno1 has quit [Ping timeout: 240 seconds]
Hanmac has joined #ruby
DaniG2k has quit [Quit: leaving]
Xanokore has joined #ruby
gbt has quit [Client Quit]
Demonthus has joined #ruby
jjbohn has joined #ruby
Hanmac1 has quit [Ping timeout: 264 seconds]
Demonthus has quit [Quit: Leaving]
Demonthus has joined #ruby
popl has quit [Ping timeout: 264 seconds]
teddyp1cker has quit [Ping timeout: 252 seconds]
nfk has joined #ruby
petey has quit [Ping timeout: 240 seconds]
shevy has quit [Ping timeout: 268 seconds]
AlexRussia has joined #ruby
Solnse has joined #ruby
sambao21 has quit [Ping timeout: 240 seconds]
timonv has joined #ruby
sigurding has quit [Ping timeout: 264 seconds]
jjbohn has quit [Quit: Leaving...]
klaut has quit [Read error: Connection reset by peer]
klaut has joined #ruby
sambao21 has joined #ruby
arietis has joined #ruby
yasushi has quit [Remote host closed the connection]
prc has joined #ruby
mehlah has quit [Quit: Leaving...]
bradhe has joined #ruby
near77 has joined #ruby
<near77>
hi
timonv has quit [Ping timeout: 246 seconds]
<near77>
im using flask as an http api in python
<near77>
is there something similar for ruby?
<near77>
it must be fast since I might have hundreds of requests per second
pedrocr_ is now known as pedrocr
prc has left #ruby [#ruby]
Murci3lago has quit [Ping timeout: 252 seconds]
shevy has joined #ruby
Vovko has quit [Remote host closed the connection]
yubrew has joined #ruby
mrnugget has joined #ruby
<jhass>
near77: pure rack or sinatra a common choices
<jhass>
*are
Murci3lago has joined #ruby
<near77>
which is simpler? it shouldn't do much more than post requests with content that I store in a DB
bradhe has quit [Ping timeout: 240 seconds]
<jhass>
sinatra is an abstraction upon rack (like most web frameworks in ruby)
<jhass>
rack is basically just an interface to your application server
agjacome has joined #ruby
lw has joined #ruby
yubrew has quit [Ping timeout: 240 seconds]
spider-mario has quit [Read error: Connection reset by peer]
browndawg has quit [Read error: Operation timed out]
mikemar10 has joined #ruby
gbt has joined #ruby
s2013 has joined #ruby
browndawg has joined #ruby
jlast has joined #ruby
_lazarevsky has quit [Quit: Page closed]
gbt has quit [Client Quit]
RoryHughes_ is now known as RoryHughes
mehlah has joined #ruby
george2 has quit [Ping timeout: 268 seconds]
george2 has joined #ruby
jlast has quit [Ping timeout: 240 seconds]
<near77>
thanks jhass
<near77>
i think i have everything i need with sinatra
browndawg1 has joined #ruby
<near77>
but is it really fast?
<near77>
how can I tell?
<Xeago>
near77: define your speed requirements
<crome>
benchmark it
<near77>
mmm I have 11.000 servers
<crome>
it also depends on the web server
<near77>
Im going to make them contact the api in random
<Xeago>
if sinatra isn't fast enough, probably ruby isn't your language
<near77>
sending each package they have installed as a different call
<Xeago>
sinatra's overhead is nihil
kennym has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<near77>
maybe I should send all packages in a single call?
browndawg has quit [Ping timeout: 240 seconds]
<near77>
what would happen to sinatra
<near77>
if it had more calls than it could process
teddyp1cker has joined #ruby
<near77>
would it keep the rest on a buffer?
nateberkopec has quit [Quit: Leaving...]
<jhass>
that's more a question of the application server you use
mr_red has quit [Remote host closed the connection]
<jhass>
and of the reverse proxy you'll probably put in front
Vovko has joined #ruby
<near77>
I read about putting nginx on front
<near77>
why is it a good idea?
shevy has quit [Remote host closed the connection]
Vovko has quit [Remote host closed the connection]
<certainty>
because it can buffer requests and responses
Xanokore has quit [Quit: Leaving]
<jhass>
you can let it do several things. For webpages it can serve the static parts, which it can do much faster, you can use it as load balancer between multiple instances of your application, you can use it for virtual host management to direct domains /requests to different applications and as certainty says for buffering
paisano has quit [Ping timeout: 264 seconds]
browndawg1 has quit [Ping timeout: 240 seconds]
Astralum has joined #ruby
shevy has joined #ruby
Cache_Money has joined #ruby
<certainty>
near77: you have 11.000 servers?
<near77>
I see, thanks! this api is actually for yes
<near77>
the api is for post
<near77>
certainty: yes
<near77>
they are all ubuntu vms
<near77>
i need to send to the api the packages it has installed
<near77>
to check for cve's
<certainty>
wow big datacenter
Hanmac1 has joined #ruby
<certainty>
even with vms
Vovko has joined #ruby
vlad_starkov has joined #ruby
<certainty>
near77: how do you schedule the requests? Via cron or something that can be centrally controlled?
<certainty>
so you don't actually have control over how many clients you have per timeframe
<near77>
no, thats why I want it to be as fast as possible
<near77>
before starting with loadbalancing
vlad_sta_ has joined #ruby
io_syl has quit []
paisano has joined #ruby
meatherly has joined #ruby
patrick99e99 has joined #ruby
browndawg has quit [Client Quit]
<certainty>
near77: makes sense. If you sent one request per package you could utilize http caching much more effectively
browndawg has joined #ruby
<certainty>
you could send the package and the version
vlad_sta_ has quit [Remote host closed the connection]
Speed has quit [Ping timeout: 252 seconds]
grayWolf is now known as Speed
<certainty>
it would be GET requests then naturally
vlad_starkov has quit [Ping timeout: 268 seconds]
<near77>
you mean like api.com/ruby/1.8.0.7 ?
vlad_sta_ has joined #ruby
<jhass>
I'd also consider taking the connect to the database out of the request by pooling the posted data in memcached and having a background worker processing it or even just using sidekiq and doing nothing more than pushing a job to the queue that has the raw data as argument
io_syl has joined #ruby
<certainty>
near77: yeah
<near77>
that wouldn't be rest XD
<near77>
but its simpler
s2013 has joined #ruby
danno1 has joined #ruby
<jhass>
you don't have a resource here either
io_syl has quit [Client Quit]
blackmes1 has quit [Ping timeout: 268 seconds]
benzrf|offline is now known as benzrf
<jhass>
you don't list, create, update or destroy a package here (or an subset of that), you merely inform the version
<near77>
the thing is that I would have to do an GET for each package
timonv has joined #ruby
perldork has quit [Remote host closed the connection]
vlad_sta_ has quit [Remote host closed the connection]
Mon_Ouie has quit [Ping timeout: 240 seconds]
<near77>
after that I just diff the dpkg -l
<near77>
still the real traffic spike would be the first time
<near77>
I see
<near77>
and if there is a change I upload those packages
evenix has joined #ruby
meatherly has quit [Ping timeout: 240 seconds]
vlad_starkov has joined #ruby
perldork has joined #ruby
<certainty>
there are other possibilities. You could sent a digest of your package list along with the request. Then cache based on that digest header
<certainty>
send
<certainty>
order of packages would matter here
kennym has quit [Quit: Leaving.]
<certainty>
well but for a start i would probably aim for the simplest solution and get more creative once you hit a bottleneck
Lewix has joined #ruby
hiall has joined #ruby
<near77>
yeah, I would like to keep as much as possible on the client
<near77>
thanks a lot guys, one more thing
<near77>
I think that if I start a mysql connection in the code before the "gets" of sinatra it should stay all the time for all requests
<near77>
or would it spawn a different connection per request?
pskosinski has quit [Quit: Til rivido Idisti!]
<certainty>
ew mysql
<perldork>
by default mysql and mysql2 just start a single connection if i remember correctly when you connect with them - check the mysql or mysql2 gem docs to be sure
<certainty>
you expect many connects?
<certainty>
yeah better make sure it does :)
<perldork>
so your requests would use that one connection if you set the connection up outside of the routes
<near77>
yeah, I mean if 50 servers do a GET at the same time, to make sure there are not creating 50 mysql sessions and closing them, our users are limited also for the write connections
<near77>
I think I have to place the connection as a @con for example
lethjakman has quit [Ping timeout: 246 seconds]
fgo has joined #ruby
<near77>
although searching on stackoverflow points that its unnecessary
<near77>
well thanks again, im going to test it!
rvraghav93 has joined #ruby
werdnativ has joined #ruby
closer has quit [Ping timeout: 252 seconds]
Angelous- is now known as Angelous
lyanchih__ has quit [Quit: lyanchih__]
coderxin has quit [Remote host closed the connection]
lyanchih_ has joined #ruby
closer has joined #ruby
mr_red has joined #ruby
zarul has quit [Quit: Leaving]
havenwood has joined #ruby
coderxin has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
perldork has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 268 seconds]
arietis has quit [Quit: Computer has gone to sleep.]
Hanmac has joined #ruby
vlad_starkov has joined #ruby
coderxin_ has joined #ruby
coderxin has quit [Read error: No route to host]
Astralum has quit [Ping timeout: 240 seconds]
sparrovv has joined #ruby
NovapaX has joined #ruby
deadlock has quit [Ping timeout: 252 seconds]
Blaze_Boy has joined #ruby
dzhulk has quit [Read error: Operation timed out]
evenix has quit [Remote host closed the connection]
arietis has joined #ruby
Hanmac1 has quit [Ping timeout: 268 seconds]
fieldfirst has quit [Ping timeout: 264 seconds]
blom_ has joined #ruby
Olipro has joined #ruby
Nahra has quit [Quit: Lost terminal]
osvico has quit [Read error: Connection reset by peer]
osvico has joined #ruby
perldork has joined #ruby
bradhe has joined #ruby
scarolan_ has joined #ruby
blom_ has quit [Ping timeout: 264 seconds]
nateberkopec has joined #ruby
yubrew has joined #ruby
perldork has quit [Remote host closed the connection]
JJMalina has joined #ruby
nateberkopec has quit [Read error: No route to host]
Vovko has quit [Remote host closed the connection]
scarolan has quit [Ping timeout: 252 seconds]
bradhe has quit [Ping timeout: 252 seconds]
lolmaus has quit [Read error: Connection reset by peer]
atno has quit [Remote host closed the connection]
lolmaus has joined #ruby
phansch has joined #ruby
perldork has joined #ruby
maletor has joined #ruby
yubrew has quit [Ping timeout: 240 seconds]
thomasxie has quit [Remote host closed the connection]
jamto11 has joined #ruby
JJMalina has quit [Ping timeout: 240 seconds]
perldork has quit [Remote host closed the connection]
dzhulk has joined #ruby
alexju has joined #ruby
bluenemo has joined #ruby
The_Doctor is now known as Adran
atno has joined #ruby
m4n1f3st0 has joined #ruby
r0nin has joined #ruby
wallerdev has joined #ruby
mary5030 has joined #ruby
fieldfirst has joined #ruby
perldork has joined #ruby
sparrovv has quit [Remote host closed the connection]
jlast has joined #ruby
jidar has joined #ruby
Cache_Money has quit [Ping timeout: 246 seconds]
twiceaday has quit [Ping timeout: 246 seconds]
<jidar>
how do I change the makefile that is getting spitout by the install of gem install json-1.8.1, the makefile that is getting created has an option 'multiply_definedsuppress' that my compiler can't use, so I want to just try and remove it
twiceaday has joined #ruby
e4xit has quit [Ping timeout: 240 seconds]
Nahra has joined #ruby
Cache_Money has joined #ruby
pfg has joined #ruby
jlast has quit [Ping timeout: 240 seconds]
Blaze_Boy has quit [Quit: Returning to his Planet.]
Blaze_Boy has joined #ruby
tvw has joined #ruby
blom_ has joined #ruby
<shevy>
can't you just edit that file and remove this option?
perldork has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
mrnugget has quit [Quit: mrnugget]
MindfulMonk has joined #ruby
jamto11 has quit []
vlad_starkov has joined #ruby
diegoviola has joined #ruby
NovapaX has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tesuji has joined #ruby
abdulsattar has quit [Remote host closed the connection]
yokel_ has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
evenix has joined #ruby
Hanmac1 has joined #ruby
blackmes1 has joined #ruby
meatherly has joined #ruby
perldork has joined #ruby
<linduxed>
hey guys, using 2.1.0 i just had this crash when i ran the command "guard"
LadyRainicorn has quit [Ping timeout: 268 seconds]
teddyp1cker has quit [Read error: Connection timed out]
LadyRainicorn has joined #ruby
blackmes1 has quit [Quit: WeeChat 0.4.3]
bradhe has quit [Ping timeout: 252 seconds]
vasilakisFiL has left #ruby ["Konversation terminated!"]
teddyp1cker has joined #ruby
blom_ has quit [Remote host closed the connection]
blom_ has joined #ruby
Vovko has quit [Ping timeout: 264 seconds]
<benzrf>
hmmmm
<benzrf>
is there a way to tell if an object is a wrapper around an OS resource
<benzrf>
i.e. a file handle or socket
sparrovv has quit [Remote host closed the connection]
creede has quit [Ping timeout: 240 seconds]
blom_ has quit [Ping timeout: 240 seconds]
<jidar>
shevy: ahh, got it, let me try that
vlad_starkov has quit [Remote host closed the connection]
xbob has joined #ruby
<Fire-Dragon-DoL>
benzrf: oh looks like what I want it's not doable, unless I create method explicitly for Kernel
<Fire-Dragon-DoL>
oh ok
<Fire-Dragon-DoL>
I'll pass an object
benzrf is now known as benzrf|offline
wallerdev has quit [Quit: wallerdev]
sparrovv has joined #ruby
havenwood has joined #ruby
wallerdev has joined #ruby
workmad3 has joined #ruby
sdouglas has quit [Remote host closed the connection]
Cache_Money has quit [Ping timeout: 268 seconds]
Cache_Money has joined #ruby
senayar has quit [Remote host closed the connection]
<jidar>
shevy: success, after unpacking it, manually running make, building a new gem and then installing it the install worked fine. Now the next thing broke... *sigh*
<shevy>
\o/
YamakasY_ has quit [Remote host closed the connection]
claymore has quit [Quit: Leaving]
SHyx0rmZ has joined #ruby
skaflem has quit [Quit: Leaving]
<jidar>
shevy: multiply_definedsuppress appears to be the heart of the issue as another gem seems ot want to use it
* jidar
wonders why the compiler keeps thinking this is valid
<shevy>
sheap have you made sure that you have an array and not a string?
<sheap>
probbaly not
<shevy>
you can do conditional checks
<shevy>
if variable.is_a? String
<shevy>
# convert to array here
<shevy>
end
<shevy>
# continue
<sheap>
I dont just push to array?
<jhass>
estimated, projects = File.readlines("data.txt").select {|line| line.match /estimated CPU|project URL/ }.partition {|line| line.include? "estimated CPU" } will give you two arrays
<shevy>
push what
<shevy>
I thought you have a huge long string here
<shevy>
if you push a huge fat monster string into an array, you just end up having that mega ultra duper super long string in a single array entry at position [0]
<shevy>
yeah but what is it? I suppose it is a string with \n embedded
<sheap>
I suppose
<shevy>
just do puts variable.class, then you can be sure :P
<sheap>
*sigh*
<sheap>
haha
<sheap>
if someone does this ill order them a pizza :P
maximski has quit [Remote host closed the connection]
<shevy>
in ruby, the core operations are pretty much always the same
<jhass>
so where's my pizza?
<sheap>
jhass, it ain't finished
<shevy>
when jhass gives the example of File.readlines(), you'll end up with an Array. then you can do further method calls on that, like .select and so forth
twiceaday has quit [Ping timeout: 240 seconds]
yubrew has joined #ruby
rootshift has quit [Quit: My MacBook has decided to go to sleep. Zzzz..]
<jhass>
mr_blue: where's that string coming from? what are you really trying to do?
<mr_blue>
jhass: ok but how to get the correct value of 's' (e.g. 'this is a bar')
<ixti>
rack handles that correctly
<ixti>
for sure
<mr_blue>
jhass: come from a yaml file
<shevy>
sheap ruby gives simple operations to convert to string to hash to array and back again; you memorize these only once, then you remember them for the rest of your life
<mr_blue>
jhass: I'am stuck with this
p8952 has quit [Ping timeout: 240 seconds]
DouweM has quit [Read error: Connection reset by peer]
DouweM has joined #ruby
<jhass>
mr_blue: can influence the format? if so use placeholders: bar = "b"; "a %{baz}" % {baz: bar} #=> "a b"
Xeago has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<jhass>
File.readlines("data.txt") gives you an array of the lines in data.txt, select filters that array based on the outcome of the block, .partition creates an array of two arrays, first one containing those for which the block returns true, second one the rest. you can decompose an array during assignment a, b = ["a", "b"]
doodlehaus has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 264 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
teddyp1cker has quit [Read error: Connection timed out]
Xiti` has joined #ruby
Xiti` has quit [Read error: Connection reset by peer]
teddyp1cker has joined #ruby
vlad_starkov has quit [Ping timeout: 240 seconds]
<mr_blue>
jhass: I failed to put this format my yaml file
holo has joined #ruby
<jhass>
mr_blue: what error do you get?
<mr_blue>
jhass: mapping values are not allowed in this context
<jhass>
mr_blue: you don't, you just write the "a %{baz}" part (the string) into the file, you read that string into ruby (into a hash or a variable) and call String#% on that
<sheap>
oh
<sheap>
derp
bradhe has joined #ruby
<sheap>
my bad
<sheap>
jhass, forgot a |
<jhass>
;)
p8952 has joined #ruby
* pipework
jhassles shevy.
meatherly has joined #ruby
havenwood has joined #ruby
<hfp>
Hey guys! I find myself struggling to plans apps and as a result, I code a bunch of stuff, then it works, then I realise I have to redesign it to add a function that just occured to me because the whole app isn't coherent anymore. How do you do your prep work before coding anything? How can I avoid wasting so much time scraping my code? Is there a better way?
blom_ has quit [Remote host closed the connection]
holo has quit [Read error: Operation timed out]
<mr_blue>
jhass: ok I try
<pipework>
hfp: Writing tests that start with user stories that describe features for users and only implementing those?
jjbohn has quit [Quit: Leaving...]
blom_ has joined #ruby
zarul has quit [Remote host closed the connection]
rootshift has joined #ruby
Burgestrand has joined #ruby
<havenwood>
hfp: sometimes it can be useful to make it quickly then start over
sincereness has joined #ruby
<havenwood>
hfp: maybe try hammock driven development :)
bradhe has quit [Ping timeout: 264 seconds]
Vovko has quit [Remote host closed the connection]
sambao21 has joined #ruby
<hfp>
pipework: That's another question of mine: how do you write tests for an app that relies on live APIs? For example for most of yesterday, I was writing a Ruby script to poll my SickBeard install to display upcoming shows for the next week. I thought about writing tests but didn't know how because the API always returns different results based on the day (and time) it's queried
Tentra__ has joined #ruby
Tentra__ has quit [Client Quit]
<pipework>
hfp: You can keep a bunch of fixtures of the API calls and responses.
<mr_blue>
jhass: works great. Really thank you !
<pipework>
You can use a double server.
Tentra has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
Xeago has joined #ruby
AlexRussia has quit [Ping timeout: 268 seconds]
teddyp1cker has joined #ruby
<hfp>
havenwood: I didn't know about HDD, I'll watch the presentation
jjbohn has joined #ruby
blom_ has quit [Ping timeout: 268 seconds]
mr_blue has quit [Quit: leaving]
jkamenik1 has quit [Quit: Leaving.]
paisano has joined #ruby
teddyp1cker has quit [Ping timeout: 240 seconds]
hiall has quit [Quit: hiall]
aspires has quit []
<sincereness>
can someone look at this and tell me why im getting this problem http://imgur.com/dahAx0p
aspires has joined #ruby
<sheap>
now to get the array to output correctly
<sheap>
arhhg
Vovko has joined #ruby
<sincereness>
in the actual webpage im getting the array with all the info but in terminal all the excesue is stripted
<sincereness>
how to i get whats in terminal to display in webpage
tesuji has joined #ruby
<shevy>
wat
<sincereness>
to_html always throws an error
blom_ has joined #ruby
<shevy>
is this still the english language
doodlehaus has joined #ruby
einarj has joined #ruby
<jhass>
sincereness: look up the class of the array elements in page.links, look up the documentation for that class, find a method that returns what you need, call that method
<sheap>
jhass, your lines aren't outputting anything :P
<jhass>
sheap: they're not meant to output anything
<jhass>
they're meant to give you two arrays
<sheap>
jhass, errr
sparrovv has quit [Remote host closed the connection]
<sheap>
the two arrays are empty
<jhass>
can you put up the data for download?
lethjakman has quit [Ping timeout: 240 seconds]
phansch has quit [Quit: WeeChat 0.4.2]
<sheap>
jhass, gsvjusttesting.com/boinc/data.txt
rootshift has quit [Quit: My MacBook has decided to go to sleep. Zzzz..]
felipecvo has quit [Remote host closed the connection]
<jhass>
404
Thanatermesis has quit [Quit: ɯlɐɔ uı ʞɹoʍ oʇ ƃuıoƃ]
<Fire-Dragon-DoL>
Is possible to pass multiple arguments to a custom << operator?
<sheap>
one sec
<jhass>
Fire-Dragon-DoL: try it?
<Fire-Dragon-DoL>
I tried and it didn't work
<Fire-Dragon-DoL>
but maybe there is a secret way to do it °°
<hfp>
Fire-Dragon-DoL: do you mean chaining << operators?
<pipework>
Fire-Dragon-DoL: Show us what you mean by 'tried'
<Fire-Dragon-DoL>
pipework: yea it works, the downside it's that is horrible, I may prefer an "append" method at this point, lol
aspires has quit []
<pipework>
Fire-Dragon-DoL: It's not that it's horrible. It proves that you can pass multiple arguments.
sambao21 has joined #ruby
<pipework>
So from here it's on you.
<sheap>
jhass, aaaaaahhh alright
<sheap>
thanks
<sheap>
ill keep tinkering
blackmesa has joined #ruby
<Fire-Dragon-DoL>
pipework: oh yea I agree, I mean is horrible looking at it (syntactically speaking, at least from my point of view)
<pipework>
Fire-Dragon-DoL: I'm sure you can approach the problem with an alcoholic beverage and come out of it perfectly fine.
<pipework>
That's how I fix problems.
mostlybadfly has joined #ruby
sambao21 has quit [Client Quit]
<sheap>
jhass, ah
<sheap>
those danged $ sings
<Fire-Dragon-DoL>
pipework: that's the standard way to debug anything
<Fire-Dragon-DoL>
lol
<benzrf>
ok so
<benzrf>
i managed to find a process-freezer that seems to actually work
<benzrf>
im totally gonna figure out my image-based thing now
<benzrf>
:y
holo has joined #ruby
paisano has quit [Read error: Operation timed out]
Tentra has quit []
<pipework>
benzrf: I was thinking you meant a kitchen appliance.
<benzrf>
haha
unholycrab has quit [Changing host]
unholycrab has joined #ruby
Xiti has joined #ruby
rootshift has joined #ruby
razibog has quit [Quit: Leaving.]
blom_ has quit [Remote host closed the connection]
meatherly has quit [Ping timeout: 240 seconds]
blom_ has joined #ruby
quatron has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
jackneill has quit [Remote host closed the connection]
endash has quit [Ping timeout: 240 seconds]
Jetchisel has joined #ruby
blom_ has quit [Ping timeout: 240 seconds]
mikepack_ has quit [Remote host closed the connection]
doodlehaus has quit [Remote host closed the connection]
lukec has quit [Quit: lukec]
scarolan has quit [Ping timeout: 240 seconds]
arubincloud has quit []
markisonfire has joined #ruby
nisstyre_ has joined #ruby
naw has joined #ruby
<shevy>
hmmm
<shevy>
actually...
sheap has quit [Quit: Leaving]
<shevy>
can't ruby do everything that R language does too?
m4n1f3st0 has joined #ruby
mikepack_ has joined #ruby
<atmosx>
shevy: hmm, I think R is easier for statistics/math
<shevy>
well
<mr_snowf1ake>
shevy: R has a lot of packages with specialized tools for statistical analysis
<shevy>
the calculations one could do in ruby or?
<atmosx>
shevy: once you master it, it can create graphs on the fly etc. But yes, sure ruby/python can do everything R can.
DouweM has quit [Quit: Leaving...]
<atmosx>
shevy: you need probably to write some methods and handle the graph creation your self, but sure
<shevy>
yeah
<pipework>
shevy: You could probably achieve the same end results, yeah
<jhass>
shevy: C can do everything ruby can
<oz>
(just slower)
endash has joined #ruby
<shevy>
plot creation can probably be hard in ruby
naw_ has quit [Quit: Leaving.]
<shevy>
jhass at a much higher cost, so it is not comparable
<shevy>
look at this function in R:
carraroj has quit [Quit: Konversation terminated!]
<shevy>
q <- function() {
<shevy>
print("Bye there!")
<shevy>
quit("no")
<shevy>
}
<jhass>
so there might be things in R which you can only do at a much higher cost in ruby. Why are those comparable?
<mr_snowf1ake>
shevy: there are a lot of gems for visualization in ruby. it's more just the collection of statistical tools that are nice in R.
<shevy>
jhass I would not have to learn anything that is specialized to R, because ruby already offers it, at a much nicer and simpler syntax. In C, there is an added compilation cycle and on top of that there is memory/pointer management and me having to declare int long double
<pipework>
shevy: You could probably just learn math and have an edge on top of all those languages.
<atmosx>
anyone uses tmuxinator?
<shevy>
that won't help me in as much as I'd still need to apply math in one programming language at least
<pipework>
shevy: Ruby doesn't offer the same quality of libraries and tools that R does for statistics and other analysis.
<shevy>
or I do pen and paper calculations
<jhass>
shevy: that's not an inherent benefit of ruby, it's because you know ruby better than R. you would hear the same thing from a C programmer doing no ruby at all in his life about ruby
nf44 has joined #ruby
YamakasY_ has quit [Ping timeout: 268 seconds]
<nf44>
whats args[0] of method_missing
<pipework>
shevy: There are languages that are closer to math than they are to any other language though.
<shevy>
jhass nope, I am 1000% sure that ruby is the better programming language
<pipework>
Lol.
<jhass>
shevy: my point is that just because other tools exist that can technically do the same, there still can be a reason to have specialized tools
<fowl>
nf44, the first arg is the method name
mikepack_ has quit [Remote host closed the connection]
<shevy>
and I dare any C programmer be faster than a ruby programmer for the same achievable functionality
<nf44>
whats args[0] of method_missing(method, *args) I mean fowl
<mr_snowf1ake>
shevy: execution speed and programming time are two different things :)
<jhass>
shevy: learn to abstract from the current example already
<shevy>
mr_snowf1ake yeah, the first one will rarely be a bottleneck though unless it's highly complicated or requires a lot of calculations, like renderings
<jhass>
shevy: this could be python vs. ruby, vim vs emacs, C vs C++, milk vs. water
<shevy>
jhass not at all in any way. python vs. ruby is the same side of the medal, how is R vs. ruby anywhere comparable to that?
<pipework>
shevy: I bet an R programmer will be able to write something R is made to do faster than Ruby.
<mr_snowf1ake>
shevy: or with analysis of big data
<shevy>
I'd hope so pipework, otherwise why would one use R :)
arubin has joined #ruby
<pipework>
Even pythonists would be faster than rubyists here.
<shevy>
debatable!
<pipework>
The libraries and tooling just isn't as good in ruby.
<shevy>
we can challenge the pythonistas
<mr_snowf1ake>
i'd be up for it :P
<nf44>
fowl: do you have the book metaprogramming?
<shevy>
I'd give the pythonista a slight advantage, but not a large one
<pipework>
A major advantage.
<fowl>
nf44, i dont need a book on metaprogramming, i mastered it when i was 10
<pipework>
NumPy isn't terrible.
<mr_snowf1ake>
it's a definite problem though... we're really lacking in terms of scientific tools
jjbohn has quit [Quit: Leaving...]
<shevy>
you mean in ruby mr_snowf1ake? or in general for the scripting languages
<mr_snowf1ake>
ruby
<nf44>
fowl: good for you, Im asking because theres an error in the book that id like to verify
<mr_snowf1ake>
python has a really vibrant scientific community
<fowl>
nf44, paste it somewhere
<shevy>
hey fowl
<fowl>
hi shevy
<shevy>
mr_snowf1ake I just found a gem called math
<shevy>
mr_snowf1ake it is at version
<shevy>
0.0.1
binaryhat has joined #ruby
naw is now known as naw_
mikepack_ has joined #ruby
<pipework>
Ruby has a Math Library
<pipework>
s/L/l/
evenix has joined #ruby
<nf44>
p 80 of metaprogramming ruby why does he use args[0] instead of @id
<shevy>
it seems as if the killer applications in Ruby are missing
papercod1 has joined #ruby
<shevy>
just as pipework mentioned NumPy
<mr_snowf1ake>
shevy: depends on the area
<mr_snowf1ake>
shevy: that is most definitely true for math
<shevy>
non-web area :)
<pipework>
shevy: Ruby is the best web language.
<shevy>
we have PHP
<mr_snowf1ake>
it's also pretty good for sysadmin
<pipework>
It scales in the same way that PHP does not.
<mr_snowf1ake>
shevy: Ruby >>>>>>>>>>> PHP
bradhe has quit [Ping timeout: 240 seconds]
<Lewix>
pipework: not for concurrency
<pipework>
Lewix: Sure it is.
meatherly has joined #ruby
<centrx>
PHP is an abomination and a scourge on the face of the earth.
<Lewix>
There's better languages build for that
<pipework>
Like JRuby!
<mr_snowf1ake>
Ruby is a solid general purpose langauge though.
<fowl>
lol..
rahult is now known as rahult_
rahult_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mr_snowf1ake>
centrx: you're being too generous. if you can find stronger insults i encourage you to do so.
petey has joined #ruby
SCommette has joined #ruby
Blaze_Boy has left #ruby [#ruby]
<shevy>
:)
<fowl>
ruby is great until you experience type safety
spicerack has joined #ruby
<shevy>
I only wanted to trigger centrx's famous message
<shevy>
fowl has moved to nimrod
sheap has joined #ruby
<sheap>
so...arrays into hashes?
lethjakman has joined #ruby
<jhass>
is that a question?
<mr_snowf1ake>
fowl: that's an issue with all dynamically typed languages
* pipework
has experienced type safety and still loves rubby.
LadyRainicorn has joined #ruby
<mr_snowf1ake>
besides, without loose typing, how can we quack like ducks!? :D
YamakasY_ has joined #ruby
<bnagy>
ruby is strongly typed though
SCommette has quit [Client Quit]
<bnagy>
what I find funny though is all the dynamic typing paces where people are 'omg love type safety' and typesafe chans they are 'OMG Y U NO GENERIC'
<mr_snowf1ake>
bnagy: indeed you're right. sorry for the mishap
petey has quit [Ping timeout: 264 seconds]
<bnagy>
usually as soon as they hit some json or xml they want to parse
YamakasY has quit [Ping timeout: 240 seconds]
<fowl>
generics and type safety are mutually exclusive in 2014
DouweM has quit [Quit: Leaving...]
<fowl>
right bnagy
<bnagy>
well imho no
<bnagy>
but I can understand why you'd design a lang without them
<jhass>
sincereness: and that array is the source array
<LadyRainicorn>
wtf is with rhe variable names?
<LadyRainicorn>
the
<jhass>
yeah, use better variable names
<fowl>
sincereness, then, when you display it you want to do something with the data like <ul><li><%= @hh.join "</li><li>" %> </li></ul>
mr_red has quit [Ping timeout: 240 seconds]
lukec has joined #ruby
<sincereness>
kk hold on lol this is a lot at once
doodlehaus has joined #ruby
<schtinky>
Got a general-type question: I'm building a ruby app to spider a website and print out a sitemap...
rjhunter has joined #ruby
andrewlio has quit [Quit: Leaving.]
<schtinky>
I'm creating a class called PageNode which will have certain properties like url, hostname, images, links, etc
andrewlio has joined #ruby
andrewlio has quit [Client Quit]
<LadyRainicorn>
Do you know about Nokogiri?
razibog has quit [Client Quit]
<schtinky>
yes that's what I'm using
<schtinky>
is it "correct" to parse the site externally, then .initalize(url, hostname, images, links, cssfiles, etc) OR...
<LadyRainicorn>
Also Spidr looks neat.
<LadyRainicorn>
Have you seen that?
Musashi1 has joined #ruby
<schtinky>
.initalize(url) and let the class itself populate all the values (i.e. use nokogiri)
<LadyRainicorn>
You use .new to call
<schtinky>
so my question is nokogiri outside or inside the class?
enebo has joined #ruby
<LadyRainicorn>
Both would be fine
<LadyRainicorn>
But mean different things.
<bnagy>
I'd just Delegate to whatever the nokogiri object is
<bnagy>
it's less code, just for a start
<bnagy>
then you can build your spidering logic on top if you find you need extra stuff
TigerWolf has joined #ruby
<schtinky>
so there's really no preference for doing it either way? just pass url and let the class populate everything OR get all the info outside and pass the .initialize all the information?
<bnagy>
if you google for ruby DelegateClass you'll find a few good blog posts etc, but basically you end up with an object where if in doubt it just gives you the nokogiri method, and if you define extra stuff it gives you that
<bnagy>
well I have a very strong pref for the composition approach
<bnagy>
passing all the params is a lot of work and a lot of coupling
<schtinky>
meaning?
<schtinky>
ah meaning just the url, let the class do the work
<schtinky>
that's my instinct too
<jhass>
no, the nokogiri object once you have it
<bnagy>
hrm, I'd personally initialize with the url?
<bnagy>
cause that's the most public and versatile api imho
<bnagy>
btu definitely not .initalize(url, hostname, images, links, cssfiles, etc)
luckyruby has joined #ruby
<jhass>
well I guess it's whether if you consider the logic to obtain the data the class should hold part of the domain of the class or not
<jhass>
I tend to do not
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
<jhass>
and only have logic manipulating the data in the class that holds it
<bnagy>
yeah I guess I don't have a strong opinion there
<bnagy>
MyNode.new url // MyNode.new nokogiri_obj
shredding has quit [Quit: shredding]
whomp has joined #ruby
<whomp>
can i make macruby calls from within ruby?
<LadyRainicorn>
MacRuby is an implementation
<LadyRainicorn>
So no.
<LadyRainicorn>
Not generally.
dx7 has quit [Remote host closed the connection]
gstamp has joined #ruby
kaspergrubbe has joined #ruby
Burgestrand has quit [Quit: Burgestrand]
dx7 has joined #ruby
teddyp1cker has joined #ruby
omegahm has joined #ruby
shutch has quit []
FaresKAlaboud is now known as toTheMoon
einarj has quit [Remote host closed the connection]
nfk has quit [Quit: yawn]
DefV has quit [Read error: Connection reset by peer]
<benzrf>
hmmm
<benzrf>
how do i get a list of constants in a scope
<benzrf>
w8 nvm
kaspergrubbe has quit [Ping timeout: 246 seconds]
sheap has joined #ruby
<benzrf>
::x is the same as ::Object::x right?
<benzrf>
*for constants i mean
enebo has quit [Quit: enebo]
<centrx>
Is it possible to have a Signal handler confined to a class or method?
<sincereness>
all i want is the array elements to display like they are displayed in terminal
sputnik13 has quit [Ping timeout: 264 seconds]
<jhass>
sincereness: let me scroll up a bit and copy & paste
<jhass>
(23:26:22) fowl: sincereness, then, when you display it you want to do something with the data like <ul><li><%= @hh.join "</li><li>" %> </li></ul>
<sincereness>
and<%= @hnhh.first.href %> pretty muych gets exactly what i want but i want all links to display not just the first one
<jhass>
sincereness: and since your code is unchanged, you want to read everything before that again too
yubrew has joined #ruby
<sincereness>
naw the view code changed
<jhass>
still
codeitagile has quit [Quit: Leaving.]
xbshiftc has joined #ruby
Tentra has quit [Ping timeout: 240 seconds]
mr_red has joined #ruby
jjbohn has quit [Quit: Leaving...]
yubrew has quit [Ping timeout: 240 seconds]
<mr_snowf1ake>
sincereness: read the docs for Array.join. it will do what you're looking for. another way you could do it would be via an each loop (use a do instead... i'm just trying to compress)... <% @hnhh.each { |link| %><li><%=link%><% } %>
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bnagy>
map
<mr_snowf1ake>
sry, <%=link.href %>
hiall has joined #ruby
<bnagy>
eaches that don't actually do anything are gross :/
funburn has joined #ruby
<mr_snowf1ake>
bnagy, agreed. but if sincereness isn't comfortable with join, i'm skeptical he'd be comfortable with map
chipotle has joined #ruby
<bnagy>
if you can't get your head around map and each then you will never be able to write ruby, basically
<mr_snowf1ake>
good point. it is worth it to use it because he has to learn it at some point.
<benzrf>
maaan delimited continuations are pretty sweet
speakingcode has joined #ruby
SonicX_ has quit [Ping timeout: 268 seconds]
Xeago has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Quit: i've nodded off.]
Xeago has joined #ruby
Tentra has joined #ruby
<sincereness>
im learning atm though not writing enterprise level applications so if the source isnt perfect it really doesnt matter too much
<sincereness>
the people here have been tremendously helpful though
ce_afk is now known as cescalante
havenwood has quit [Remote host closed the connection]
<mr_snowf1ake>
sincereness: i do recommend taking a good look at the ruby docs though. they are really helpful and have good examples. plus, you can view the source.
no6 has quit [Ping timeout: 240 seconds]
SCommette has joined #ruby
<mr_snowf1ake>
(you can view the source from within the docs that is)
werdnativ has quit [Quit: werdnativ]
havenwood has joined #ruby
jollyy has joined #ruby
<sincereness>
thanks snowflake ill make sure to favorite now
r0nin has joined #ruby
nateberkopec has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
toTheMoon is now known as FaresKA
pietr0 has joined #ruby
<mr_snowf1ake>
sincereness: http://www.ruby-doc.org/core-2.0/Array.html#method-i-map :) also, take a look at the map! method. and the join method. one of the beauties of ruby is that there are a million ways to do any task so it's good to be familiar with a bunch and be able to use the appropriate one for the task at hand :)
chipotle has quit [Quit: cya]
bradhe has joined #ruby
nateberkopec has quit [Read error: No route to host]
<sincereness>
yea i was going to look at that in a minute (got distracted by reddit) but cause i need all my output on new lines
nateberkopec has joined #ruby
<sincereness>
im definately going to be reading that tonight though
nisstyre_ has quit [Quit: WeeChat 0.4.3]
nisstyre has quit [Quit: WeeChat 0.4.3]
<mr_snowf1ake>
cool
evenix has quit [Remote host closed the connection]
<mr_snowf1ake>
on that note... i didn't know that there was a repeated_permutation method in Array. o.o that's pretty cool
<sincereness>
thanks for the links tho it helps a lot
<mr_snowf1ake>
(and permutation)
<mr_snowf1ake>
sincereness: you're welcome
<sincereness>
also how do u get that red text to people
<sincereness>
i knew how to do it before but i forgot
<sincereness>
/msg does autocomplete the names
r0nin has quit [Ping timeout: 246 seconds]
mr_red has quit [Ping timeout: 268 seconds]
ktosiek has quit [Ping timeout: 268 seconds]
inkblots has joined #ruby
bradhe has quit [Ping timeout: 240 seconds]
<mr_snowf1ake>
that's handled on the client side
<mr_snowf1ake>
so
<mr_snowf1ake>
in your case, when i write sincereness, your irc client recognizes it and makes that message red
mikecmpbll has joined #ruby
<mr_snowf1ake>
if you typed in mr_snowf1ake, the message looks red to me.
<sincereness>
how come it wont autocomplete your name though
<sincereness>
i remeber it used to
nateberkopec has quit [Ping timeout: 240 seconds]
<mr_snowf1ake>
did it?
lkba has quit [Ping timeout: 246 seconds]
<sincereness>
yea but o well
<mr_snowf1ake>
it's supported in xchat apparently
<sincereness>
its not that important
Aquilo has quit []
Xeago has quit [Ping timeout: 246 seconds]
nateberkopec has joined #ruby
vlad_starkov has joined #ruby
jjbohn has joined #ruby
tectonic has joined #ruby
LadyRainicorn has quit [Read error: Connection reset by peer]
LadyRainicorn has joined #ruby
tacos1de has quit [Ping timeout: 265 seconds]
mikepack has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 240 seconds]
sdouglas has joined #ruby
tacos1de has joined #ruby
jjbohn has quit [Ping timeout: 240 seconds]
bradhe has joined #ruby
LadyRainicorn has quit [Ping timeout: 252 seconds]