<havenwood>
xibalba: it return -1, 0, or 1, but often it is used to get >, < , =>, =<, ==, and between? for free not to be called directly
tvw has quit []
h0rrorvacui has joined #ruby
<havenwood>
xibalba: are you trying to alphabetize?
<xibalba>
just going through the Pragmatic Programmers Book for Ruby seciton 5.3
tsykoduk is now known as zz_tsykoduk
saarinen has quit [Ping timeout: 265 seconds]
osvico has quit [Ping timeout: 264 seconds]
asteros has quit [Quit: asteros]
Nanuq has joined #ruby
robustus has quit [Ping timeout: 245 seconds]
InFlames has quit [Ping timeout: 245 seconds]
pdimitrov has quit [Ping timeout: 264 seconds]
pr0ggie has quit [Ping timeout: 264 seconds]
rickruby has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
robustus has joined #ruby
mikeric has quit []
asteros has joined #ruby
mr`spock has joined #ruby
sevenseacat has joined #ruby
cgore has joined #ruby
mjs2600 has quit [Remote host closed the connection]
vlad_starkov has quit [Read error: Connection reset by peer]
<Kamuela>
I don't understand. Why do people think of Ruby as "more difficult" than PHP? I honestly haven't ever messed with PHP, but I can't imagine there to be anything that fundamentally makes PHP easier to get into, work with, etc than Ruby and a framework like Rails
<sevenseacat>
PHP has a lot lower barrier to entry.
<Kamuela>
sevenseacat, in what way? It was simpler to install rails with a built-in server than it would have been to install LAMP, imo
<sevenseacat>
well no
<sevenseacat>
php is a one-click installer
ValicekB has quit [Read error: Operation timed out]
nwertman has joined #ruby
<shevy>
php is a zero-brain installer
tkuchiki has joined #ruby
<shevy>
though, I concur with the statement that PHP has a low barrier to entry
bricker has quit [Quit: leaving]
<shevy>
Kamuela ruby as a language can be rather complex initially. try to explain to a newcomer what is yield, a block, a lambda
gadgetoid has joined #ruby
<Kamuela>
shevy, i still have no idea what a lambda is lol
<shevy>
Kamuela rails is also not that simple. you need to understand that MVC pattern
<Kamuela>
but to be fair, i've never looked into it
<shevy>
with PHP you are ready to go to build websites in .php
<shevy>
with pure ruby, you have ... .cgi
capicue has quit [Quit: Leaving...]
asteros has quit [Ping timeout: 264 seconds]
<sevenseacat>
also, you cant compare a framework like rails, with straight php
<Kamuela>
shevy, i can sorta see that. but at the same time, i think a lot of this assumes you have a particular path of web development... html, then css, then maybe some javascript, and now you need to learn to work with some kind of db logic
tylersmith has quit [Read error: Connection reset by peer]
<Kamuela>
whereas when i was like screw it i barely know anything, how-to full-stack, rails was right there ready to take me from the ground up
<shevy>
the web indeed requires quite a bit of knowledge these days
<shevy>
I liked the 1997ies more :(
i_s has quit [Remote host closed the connection]
tylersmith has joined #ruby
<sevenseacat>
rails doesnt abstract the need to know html, css, javascript, and db logic
<shevy>
Kamuela ok but people should also understand ruby if they use rails
<sevenseacat>
you still need to know all of those things
i_s has joined #ruby
<sevenseacat>
you just dont get the option to learn them one at a time
<shevy>
Kamuela so with PHP the barrier at the entry level is lower. of course ruby is the more elegant language
i_s has quit [Read error: Connection reset by peer]
<plotter>
yeah the best idea to explain yield to someone is that dolphin method
<sevenseacat>
why am i getting sucked into these stupid arguments with Kamuela again
<shevy>
the what?
i_s has joined #ruby
<shevy>
is a dolphin in ruby like a monad in haskell?
<plotter>
where the dolphin swims in and out of the block with yield
<shevy>
lol wtf
<plotter>
lol
i_s has quit [Read error: Connection reset by peer]
<plotter>
let me find it one sec
asteros has joined #ruby
<shevy>
so Kamuela, now you get it... yield is like a swimming dolphin
i_s has joined #ruby
elben has quit [Quit: elben]
<shevy>
apparently it has an affinity for blocks
i_s has quit [Read error: Connection reset by peer]
pragmatism has quit [Remote host closed the connection]
<Reach>
I'm kind of slowly going through rubymonk but I want something more
dreamchaser has joined #ruby
dreamchaser has quit [Changing host]
dreamchaser has joined #ruby
<banister>
Reach codeschool is awesome
i_s has joined #ruby
simoz has quit [Ping timeout: 240 seconds]
simoz has joined #ruby
axl_ has quit [Client Quit]
<Reach>
well I'm doing a math degree and want to learn how to program for when I graduate and start searching for a job. I thought ruby looks cool, but I have no real experience making complicated software.
<Reach>
usually just ~100 lines of code to do a computation or something
amacgregor has joined #ruby
jrhe_ has quit [Quit: jrhe_]
amacgregor__ has joined #ruby
lukec has quit [Quit: lukec]
zjdriver has quit [Quit: Leaving]
benwoody has quit [Quit: benwoody]
amacgregor_ has quit [Ping timeout: 246 seconds]
vpretzel has quit [Quit: Adios!]
Apane has joined #ruby
dfish has quit [Ping timeout: 245 seconds]
justsee has joined #ruby
amacgregor has quit [Ping timeout: 246 seconds]
zz_CripperZ is now known as CripperZ
iliketurtles has joined #ruby
ValicekB has quit [Ping timeout: 245 seconds]
<Kamuela>
shevy, no but it sounds worth a good viewing
i_s has quit [Ping timeout: 245 seconds]
vpretzel has joined #ruby
<shevy>
Kamuela it is the horror episode, the dolphins fight against the people of springfield in order to rule over them
phinfone_ has quit [Quit: exitiing]
<shevy>
it totally changed the image I had of dolphins after Flipper
raphaelivan1 has quit [Quit: Leaving.]
zeade has quit [Quit: Leaving.]
marr has quit [Ping timeout: 245 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
aryaching_ has quit [Ping timeout: 245 seconds]
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
araujo has quit [Ping timeout: 265 seconds]
araujo has joined #ruby
vlad_starkov has joined #ruby
jonathanwallace has joined #ruby
CripperZ is now known as N00D
vlad_starkov has quit [Read error: Connection reset by peer]
xbshift has quit [Quit: xbshift]
s2013 has joined #ruby
newUser1234 has joined #ruby
Davey has joined #ruby
Mars` has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
CaptainJet has quit []
mj12albert has joined #ruby
xbshift has joined #ruby
nanoyak has quit [Ping timeout: 240 seconds]
daxroc has quit [Quit: Leaving.]
Voodoofish430 has quit [Quit: Leaving.]
simoz has quit [Ping timeout: 265 seconds]
nobitanobi has joined #ruby
xbshift has quit [Ping timeout: 252 seconds]
maroloccio has joined #ruby
simoz has joined #ruby
Hanmac has joined #ruby
fennec has joined #ruby
<fennec>
hi
aspires has quit [Quit: sudo making a sandwich]
g0bl1n has joined #ruby
psyl0n has quit [Remote host closed the connection]
<bnagy>
you can just generally google printf, ruby's impl is pretty standard
xybre has quit [Read error: Operation timed out]
Xuerian has quit [Read error: Operation timed out]
the_mentat has quit [Read error: Operation timed out]
onewheelskyward has quit [Read error: Operation timed out]
forced_request has joined #ruby
machuga has quit [Read error: Operation timed out]
EHLOVader has quit [Read error: Operation timed out]
philtr has quit [Read error: Operation timed out]
i_s has quit [Remote host closed the connection]
robonerd has quit [Read error: Connection reset by peer]
xcess_denied has joined #ruby
<delinquentme>
and what about only running a particular part of the ruby script ONLY when the script is called directly ... IE not from an include
<delinquentme>
so I want say .. the main loop of a ruby script ... to not run when I simply include that script
xybre has joined #ruby
robonerd has joined #ruby
philtr has joined #ruby
fuhgeddaboudit has joined #ruby
Xuerian has joined #ruby
machuga has joined #ruby
<rjhunter>
delinquentme: the idiom is testing `__FILE__ == $0`, although there are some pitfalls to it
EHLOVader has joined #ruby
onewheelskyward has joined #ruby
cafhacker has joined #ruby
<delinquentme>
rjhunter, are they easily explained?
the_mentat has joined #ruby
cafhacker has quit [Client Quit]
dnyy has quit []
<rjhunter>
delinquentme: ehh, i'm just curmudgeonly. obviousness and testability are the big ones. just personal taste more than anything. ignore me ;-)
yfeldblum has joined #ruby
macmartine has joined #ruby
capicue has quit [Quit: Leaving...]
squidBits has joined #ruby
Kiba has joined #ruby
<Kiba>
hi
yfeldblum has quit [Remote host closed the connection]
<Kiba>
I want to know how long a file is in term of line number. Any way I can do that?
amacgregor has joined #ruby
ehaliewicz has joined #ruby
yfeldblum has joined #ruby
kobain has quit [Ping timeout: 252 seconds]
<rjhunter>
kiba: sure there is. you don't even need ruby to do it -- plain Unix command line tools have a line counter built in. what have you tried so far?
tonni has joined #ruby
<squidBits>
wc -l
deryl has joined #ruby
hololeap has quit [Ping timeout: 240 seconds]
deryl is now known as ddd
zeade has joined #ruby
araujo has quit [Quit: Leaving]
mary5030 has joined #ruby
tonni_ has quit [Ping timeout: 252 seconds]
MattStratton has joined #ruby
k-man has left #ruby ["WeeChat 0.4.2"]
paul_k has quit [Remote host closed the connection]
h0rrorvacui has quit [Quit: Leaving]
iliketurtles has joined #ruby
lfox has quit [Quit: ZZZzzz…]
havenwood has quit [Remote host closed the connection]
axl_ has joined #ruby
sgnl has joined #ruby
havenwood has joined #ruby
simoz2 has joined #ruby
weems has joined #ruby
nobitanobi has joined #ruby
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
simoz has quit [Ping timeout: 265 seconds]
weems has quit [Client Quit]
weems has joined #ruby
weems has joined #ruby
weems has quit [Changing host]
rezzack has quit [Ping timeout: 248 seconds]
daxroc has joined #ruby
ddd has quit [Quit: Leaving]
jeremywrowe has quit [Ping timeout: 246 seconds]
dcope has quit [Quit: leaving]
macmartine has quit [Read error: Connection reset by peer]
zz_jrhorn424 is now known as jrhorn424
ddd has joined #ruby
vlad_starkov has joined #ruby
macmartine has joined #ruby
daxroc has quit [Ping timeout: 272 seconds]
vlad_starkov has quit [Read error: Connection reset by peer]
* Kiba
is doing research on the life cycle of gems using survival analysis
dallasm has joined #ruby
<jrobeson>
yeboot, this is what folks use to a) get a modern version of ruby on a system that doesn't provide a modern ruby or b) manage different ruby based libraries/applications that each depend on different rubies
<havenwood>
kiba: I mean if it isn't massively huge, you can just: File.readlines('filename').size
macmartine has quit [Read error: Connection reset by peer]
<havenwood>
heck, even if it is massive :P just wont be as fast as a parallelized wc
<Kiba>
havenwood: it's going to be massively huge..60K lines
<sgnl>
I'm working on an assignment, basically rebuild the .reverse method. I got that part down but I can't figure out to how recreate the .reverse! version. Any articles or Doc that would lead me to find the answer would be appreciated.
<Kiba>
work in progress essay of course
<Kiba>
this is my first statistical analysis project
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
funburn has quit [Read error: Connection reset by peer]
simoz2 has quit [Ping timeout: 265 seconds]
Apane has quit [Ping timeout: 248 seconds]
<havenwood>
kiba: Using File#readline on my machine seems to take about 5ms per 10,000 lines parsed to readline array and counted.
<havenwood>
^ just for some point of reference
funburn has joined #ruby
<Kiba>
havenwood: I just did File#each_line and count
fijimunkii has quit [Ping timeout: 246 seconds]
<jrobeson>
kiba, your site gave me inspiration.. thanks
<Kiba>
that essay?
<Kiba>
or the whole site?
<jrobeson>
no.. that's cool tho :)
<havenwood>
kiba: Yeah, should be plenty fast. I doubt that part will need optimization. The network call stuff you may want to thread or do concurrently in some fashion.
<Kiba>
how does it inspires you?
<jrobeson>
i mean the essay and statistics is cool, but how you laid out your project and random ideas
<jrobeson>
that is the part that inspired me.. seeing somebody organize topics i'm also interested in.. and how they chose to categorize it
<Kiba>
random ideas as in notes and thoughts page?
ddd has quit [Quit: Leaving]
<jrobeson>
yep
ddd has joined #ruby
phansch has joined #ruby
lukec has quit [Quit: lukec]
simoz has joined #ruby
<Kiba>
jrobeson: well, my focus right now is the survival analysis project
io_syl has quit [Ping timeout: 272 seconds]
<Kiba>
which by the way took about 15 hours last week
<TaxmanBD>
is my included method wrong, I tried putting a planet in it returned that its not in the array
rickruby has quit [Remote host closed the connection]
<mrfoto>
i was just about to ask you why do you even use it
Xeago has joined #ruby
bradhe has quit [Ping timeout: 246 seconds]
<TaxmanBD>
yes, I just started ruby
<mrfoto>
`solarPlanets.include? planet` is much more readable
<TaxmanBD>
ok thanks, but why doesn't this work though
<mrfoto>
because you have 'e' instead of e
<tobiasvl>
'e'
<shaileshg__>
Hi, I am going through some code and it says that if you have a class (say, Person) and you further do Class.new Person do; end, you are creating a subclass Person of parent class Person
<TaxmanBD>
ah ok
<mrfoto>
so you are asking array if it includes string 'e' instead of var e
<TaxmanBD>
I see, silly me
<shaileshg__>
What is don't understand is how you can create a subclass of a class with the same Name
lsmola has quit [Ping timeout: 272 seconds]
<shaileshg__>
*name
jprovazn has quit [Ping timeout: 272 seconds]
vlad_starkov has quit [Remote host closed the connection]
ldnunes has joined #ruby
<mrfoto>
TaxmanBD: but dont use abstraction methods this simple, when ruby implementation would be much cleaner and understandable
Hanmac has quit [Ping timeout: 245 seconds]
<shaileshg__>
mrfoto: any suggestion to my question pls
<mrfoto>
shaileshg__: where are you reading that?
Xeago_ has quit [Ping timeout: 252 seconds]
<TaxmanBD>
mrfoto, thank you for the help cheers
<shaileshg__>
mrfoto: Dave Thomas' lecture on ruby metaprogramming, episode 5
tonni has quit [Remote host closed the connection]
beermouse has joined #ruby
nisstyre has quit [Read error: Operation timed out]
<shaileshg__>
sharing a gist for you
neonlex has joined #ruby
Hanmac has joined #ruby
<shevy>
shaileshg__ that is not possible
<workmad3>
shaileshg__: 'Class.new(Person)' creates an anonymous class which is a subclass of Person
<shaileshg__>
workmad3: how? can you please explain why it will create anonymous class which is a subclass of person
<workmad3>
shaileshg__: because 'Class.new' creates an anonymous, unnamed class
jrhe has joined #ruby
Xeago has quit [Remote host closed the connection]
<shaileshg__>
ohk.. and why subclass of person
<shaileshg__>
*Person
<workmad3>
shaileshg__: because you passed in 'Person' as the superclass
<apeiros>
workmad3: I like how rails does that all the time.
<shevy>
what have you done to the real one
<shevy>
let's wait how work transforms you
<workmad3>
apeiros: 'like' as in "I 'like' the way decaf coffee tastes like shit"?
Advocation has joined #ruby
<Hanmac>
asigning a anoymous class to a constant does do magic ,P
<workmad3>
apeiros: I especially 'like' explaining to people that no, an association doesn't give you back an Array, it's really something like a HasManyAssociationProxy
<shaileshg__>
Hanmac: yes, that case i know.. i was unable to understand this case where you don't assign it to a constant
<shaileshg__>
i guess class Person; end also does something similar in the background? Person = Class.new; end
aagdbl has quit [Client Quit]
<Hanmac>
shaileshg__:
<Hanmac>
>> c = Class.new; n = c.name; Person = c; [n,c.name]
<workmad3>
Hanmac: hmm, rules for constant initialization seem to be different from local variable initialization
jhaals_ has joined #ruby
<workmad3>
Person = Class.new(Person) gives an uninitialized constant error, while a = Class.new(a) gives a 'superclass must be of type Class (NilClass given)'
<Hanmac>
for some magic, a anon class does "know" when its a asigned to a constant *yeah finally i have a name* ;P
sayan has quit [Ping timeout: 245 seconds]
lsmola has joined #ruby
ayaz has quit [Ping timeout: 272 seconds]
<workmad3>
Hanmac: some part of constant initialization will do something like 'lhs.name = const_name if lhs.is_a?(Class) && lhs.name.nil?' I suspect :)
jhaals has quit [Ping timeout: 245 seconds]
<Hanmac>
yeah ... but its still funky magic ;P
<workmad3>
Hanmac: and as it seems like constant initialization is run after the rhs is evaluated, rather than in the case of local vars where the local is initialized before the rhs is evaluated...
TigerWolf has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<workmad3>
oh, and that should have been 'rhs' where I put 'lhs' previously :)
<workmad3>
Hanmac: it's only magic if you can't see how its done ;) otherwise it's just funky :)
Guest56227 has quit [Ping timeout: 248 seconds]
brandon has joined #ruby
DouweM has quit [Ping timeout: 246 seconds]
<Hanmac>
its still cool, like the case when regex literals can create local variables
brandon is now known as Guest34176
ua_ has joined #ruby
benlieb has quit [Quit: benlieb]
zz_jrhorn424 is now known as jrhorn424
TaxmanBD has quit [Ping timeout: 245 seconds]
ua has quit [Ping timeout: 264 seconds]
jbpros has joined #ruby
rickruby has joined #ruby
TaxmanBD has joined #ruby
bigkevmcd has quit [Remote host closed the connection]
jprovazn has joined #ruby
cina has quit [Ping timeout: 272 seconds]
sayan has joined #ruby
kaldrenon has joined #ruby
bigkevmcd has joined #ruby
inad922 has joined #ruby
<inad922>
hello
nomenkun has joined #ruby
<inad922>
What does the ":" prefix mean in ruby?
<apeiros>
inad922: you mean in e.g. :foo ?
<tobiasvl>
symbol
<apeiros>
it's part of the rest and means it is a Symbol literal
Davey_ has joined #ruby
kevinykchan has joined #ruby
lsmola has quit [Quit: Leaving]
<apeiros>
like in "foo" the " belong to the String and mean it's a String literal
eka has joined #ruby
<inad922>
apeiros: What's the difference between a symbol and a variable? Symbols have no value?
Davey has quit [Ping timeout: 252 seconds]
<apeiros>
inad922: a Symbol is an Object, like a String
lsmola has joined #ruby
<apeiros>
a variable is a variable. different concepts.
<tobiasvl>
inad922: a symbol IS a value
<tobiasvl>
variable = :symbol
<apeiros>
Symbols are to be compared with other objects like Strings, Integers, Arrays etc. (you don't ask "what's the difference between a String and a variable?" either)
vlad_sta_ has joined #ruby
<Hanmac>
symbols are like fixed strings, working similar to enums in other languages, use String when the content is important, use Symbol when the meaning is important (or something like that)
<inad922>
tobiasvl: So it's a constructor syntactic sugar for a special class?
timonv has quit [Read error: Connection reset by peer]
<apeiros>
inad922: it's a *literal*
<apeiros>
that's what that word means.
<apeiros>
like 12 is a literal, or "foobar" is a literal.
<tobiasvl>
inad922: "this is a string literal" vs :"this is a symbol literal"
<tobiasvl>
or :this_is_a_symbol_literal
timonv has joined #ruby
<apeiros>
literal means the value is written directly in the code, it is not the result of a method call or otherwise constructed.
<robertjpayne>
Is it possible to catch missing methods on the class level?
<apeiros>
robertjpayne: yes
<robertjpayne>
apeiros: is it the same method_missing? just self.method_missing?
<workmad3>
robertjpayne: bingo :)
vlad_starkov has quit [Ping timeout: 245 seconds]
zipper has joined #ruby
ewnd9 has joined #ruby
<robertjpayne>
Will it fire in a parent class? Having trouble getting it to work =\
<inad922>
tobiasvl: So from the document you linked I see that Symbols are just syntactic sugar for globally defined immutable strings.
<apeiros>
robertjpayne: it's subject to all the normal method inheritance mechanics as any other method.
* apeiros
gives up telling inad922 that Symbols are *not* Strings
<Hanmac>
hihi good that i didnt show the new one the hybird of symbol and string ... the frozen string literals ;P
<apeiros>
inad922: Symbols are as much "syntactic sugar for globally defined immutable Strings" as Integers are "syntactic sugar for globally defined immutable Strings"
hogeo has joined #ruby
<apeiros>
(which means they're not)
<Grundell>
so i have this text that i want to fetch... http://data.riksdagen.se/dokument/H00310/ do i use regex in order to take out the data or do i do something else ?
<inad922>
apeiros: They are strings. Even the explanation page says that. They are just immutable and global(aka pointing to the same memory address)
<apeiros>
inad922: NO.
<apeiros>
a symbol has a string representation.
<apeiros>
just as an integer does.
<apeiros>
but neither is a symbol a string, nor is an integer a string.
<workmad3>
Hanmac: one minor difference... you can dup a frozen string to get an unfrozen string :)
* apeiros
off for lunch
tonni has quit [Remote host closed the connection]
tonni has joined #ruby
<inad922>
apeiros: I really don't see any difference in usage from the observation I've made based on the page.
<Hanmac>
workmad3: yeah right, i should make a compare table about "string <-> fstring <-> symbol" whats the difference and what they have common
<apeiros>
inad922: do you consider integers to be globally defined immutable strings?
<apeiros>
if not: why not? apply same reasoning to symbols.
<apeiros>
I'm done here.
jb41 has joined #ruby
<robertjpayne>
gah programmer error :P
<workmad3>
Hanmac: well, a frozen string is still just a string, but with .freeze called on it
<workmad3>
Hanmac: in the same way that random_thing.freeze is still a random thing, just frozen ;)
<Hanmac>
workmad3: no i mean the fstring literals ... they share object ids with other fstring literals with the same content
<workmad3>
Hanmac: or does the interpreter intern frozens string literals?
<workmad3>
*frozen
vlad_sta_ has quit [Remote host closed the connection]
hogeo_ has joined #ruby
hogeo has quit [Read error: Connection reset by peer]
tonni has quit [Read error: Connection reset by peer]
<Hanmac>
>> a = "fstring"f; b = "fstring"f; a.object_id == b.object_id
zoee has quit [Quit: This computer has gone to sleep]
<inad922>
tobiasvl: I see. I come from the python word so for me it's natural to interpret it this way. I understand that the class of the symbol is different but based on the use cases I classify it in the way I already mentioned.
<Hanmac>
workmad3: Flonum is also the reason why compiled gems from 1.9 does not work with 2.0+
amacgregor has quit [Ping timeout: 246 seconds]
<workmad3>
:)
TaxmanBD has quit [Ping timeout: 245 seconds]
<tobiasvl>
inad922: okay, i don't know if python has symbols or not, but as you can see from that wikipedia article they're far from a ruby-specific type.
aagdbl has joined #ruby
andrewh has joined #ruby
<inad922>
tobiasvl: Yes, but what do you use them for? I mean other than keys in hashes and maybe storing values that need to be accessed on a global level?
<inad922>
+ don't change
postmodern has quit [Quit: Leaving]
blackmesa has quit [Ping timeout: 240 seconds]
ValicekB has joined #ruby
bradhe has quit [Ping timeout: 248 seconds]
<Hanmac>
inad922: its also because of the memory and the access ... a million times the same string takes a million times the same size in memory ... an million times the same symbol only takes the size of one
<andrewh>
Who knows what the Data class is there for? It appers to be just a thin wrapper around Object.
<Hanmac>
andrewh its a failsafe for objects from combiled bindings when you try to bind an C(++) object against a ruby class that does not exist ... (then it gets the DATA class) ... that that i have seen
stetho has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jeremywrowe has joined #ruby
neonlex has quit [Ping timeout: 246 seconds]
zipper is now known as rusty
rusty is now known as rusty_
cina has quit [Ping timeout: 240 seconds]
beermouse has quit [Quit: beermouse]
cibs has joined #ruby
amritanshu_RnD has quit [Quit: Leaving]
Hanmac1 has joined #ruby
Guest34176 has quit [Ping timeout: 272 seconds]
funburn has quit [Quit: funburn]
noop has joined #ruby
Hanmac has quit [Ping timeout: 246 seconds]
tommyvyo has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kaspergrubbe has joined #ruby
brtdv has quit []
mercwithamouth has joined #ruby
DaniG2k has joined #ruby
sichardrtallman has joined #ruby
<andrewh>
Hanmac1 / Hanmac: cheers :)
Grundell has quit [Read error: Connection reset by peer]
zoee has joined #ruby
aagdbl has quit [Quit: Leaving.]
guest544 has joined #ruby
drumusician has quit [Ping timeout: 245 seconds]
drumusician has joined #ruby
TaxmanBD has joined #ruby
Hanmac has joined #ruby
N00D is now known as zz_N00D
zarubin has joined #ruby
guest544 has quit [Remote host closed the connection]
Hanmac1 has quit [Ping timeout: 246 seconds]
amacgregor has joined #ruby
aagdbl has joined #ruby
amacgregor_ has quit [Ping timeout: 245 seconds]
brtdv has joined #ruby
brandon has joined #ruby
brandon is now known as Guest6648
amacgregor has quit [Ping timeout: 246 seconds]
popl has quit [Quit: And then there are people who prefer to look their fate in the eye.]
axilla has joined #ruby
beermouse has joined #ruby
timonv has quit [Remote host closed the connection]
sichardrtallman has quit [Quit: leaving]
beermouse_ has joined #ruby
beermouse has quit [Ping timeout: 240 seconds]
beermouse_ is now known as beermouse
barratt has joined #ruby
beermouse has quit [Client Quit]
<shevy>
when you use .add_dependency
<shevy>
in .gemspec
<shevy>
you only specify external dependencies right?
<shevy>
not things like 'fileutils' or 'pp'
beermouse has joined #ruby
Soda has joined #ruby
jbpros has quit [Quit: jbpros]
Ox6abe has joined #ruby
mojjojo has joined #ruby
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby
daxroc has joined #ruby
bradhe has joined #ruby
danshultz has joined #ruby
beermouse has quit [Quit: beermouse]
jalcine has quit [Excess Flood]
newUser1234 has joined #ruby
ewnd9 has quit [Ping timeout: 252 seconds]
atrocita_ has quit [Remote host closed the connection]
mojjojo has quit [Client Quit]
lkba has joined #ruby
havenwood has quit [Ping timeout: 252 seconds]
beermouse has joined #ruby
LiquidInsect has quit [Ping timeout: 264 seconds]
bradhe has quit [Ping timeout: 248 seconds]
daxroc has quit [Ping timeout: 264 seconds]
Liothen has quit [Ping timeout: 252 seconds]
mojjojo has joined #ruby
LiquidInsect has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
tonni has joined #ruby
TaxmanBD has quit [Ping timeout: 245 seconds]
newUser1234 has quit [Ping timeout: 272 seconds]
MattStratton has joined #ruby
rickruby has quit [Remote host closed the connection]
Bry8Star{T2 has quit [Ping timeout: 240 seconds]
Ox6abe has quit [Remote host closed the connection]
Bry8Star{T2 has joined #ruby
hogeo_ has quit [Remote host closed the connection]
emocakes has joined #ruby
akonny has quit [Quit: akonny]
ValicekB has quit [Ping timeout: 248 seconds]
rdark has quit [Ping timeout: 272 seconds]
weszlem has quit []
Asher1 has quit [Quit: Leaving.]
lemonsparrow has joined #ruby
rdark has joined #ruby
funburn has joined #ruby
polaco_zZz is now known as polaco
Hanmac1 has joined #ruby
jalcine has joined #ruby
timonv has joined #ruby
cina has joined #ruby
Hanmac has quit [Ping timeout: 245 seconds]
mklappstuhl has quit [Remote host closed the connection]
xk_id has joined #ruby
tvw has joined #ruby
xcess_denied has quit [Quit: Leaving...]
Grundell has joined #ruby
aagdbl has quit [Quit: Leaving.]
fedalto has joined #ruby
TaxmanBD has joined #ruby
fedalto has quit [Client Quit]
cina has quit [Ping timeout: 264 seconds]
dhruvasagar has quit [Read error: Operation timed out]
<Grundell>
So i have a bunch of files that looks like this one http://data.riksdagen.se/dokument/H00312/text i want to make them indaxeble and searchable... my idea is to use som type of regex in order to get the information that i want out... is anyone able to tell me where to start ?
zarubin has quit [Ping timeout: 252 seconds]
dhruvasagar has joined #ruby
coderhs has joined #ruby
sandeepk has quit [Quit: Leaving...]
flops has joined #ruby
drumusician has quit [Ping timeout: 272 seconds]
dhruvasagar has quit [Ping timeout: 264 seconds]
funburn has quit [Quit: funburn]
ValicekB has joined #ruby
danshultz has quit [Read error: Connection reset by peer]
nateberkopec has joined #ruby
danshultz has joined #ruby
weszlem has joined #ruby
pskosinski has joined #ruby
jeremywrowe has quit [Ping timeout: 265 seconds]
jeremywrowe has joined #ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Asher has joined #ruby
jibi has quit [Quit: Reconnecting]
jrhe has quit [Quit: jrhe]
jibi has joined #ruby
ValicekB has quit [Ping timeout: 252 seconds]
<Grundell>
anyone onlie?
supergeek has joined #ruby
Astralum has quit [Read error: Connection timed out]
konrads has joined #ruby
<tobiasvl>
Grundell: what info are you trying to get out?
<tobiasvl>
what have you thought up so far?
<tobiasvl>
it's hard to help you when all you have is the input :)
<konrads>
Hello. I am writing a client program using eventmachine and I need to maintain state - know where the program is in terms of progressing with the messages
n1x has quit [Ping timeout: 265 seconds]
<konrads>
e.g. has it logged on, does it need to retry login, etc
MattStratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Grundell>
Give me a sec... ill show a rubular of what im trying to get...
<Grundell>
tobiasvl: I've written what i want to capture within <this> ..... </this> so you'll understand
rdark has quit [Ping timeout: 245 seconds]
Hanmac1 is now known as Hanmac
bradhe has joined #ruby
jeremywrowe has quit [Ping timeout: 245 seconds]
<Grundell>
I assume that i should like take out parts and make chop it up to smaller reg exes... since the original file is huge... but by starting with this I can understand better how i match the patterns when it comes to larger text masses...
rdark has joined #ruby
<Grundell>
text bodies**
mklappstuhl has joined #ruby
ValicekB has joined #ruby
konrads has quit [Ping timeout: 272 seconds]
jeremywrowe has joined #ruby
<tobiasvl>
well, some of these are easy. if <prep> is always the first line, just take that. <ID> is just /\((\d{4}\/\d{2}:\d{2})\)/
<tobiasvl>
but how will you match on the names in <who>?
<tobiasvl>
what separates them?
<tobiasvl>
you need to think about your body of text and classify the things you want to extract
osvico has joined #ruby
<Grundell>
Well for example with the <who> its a line Break
<Grundell>
and it comes after the date, before the department that is within () always...
bradhe has quit [Ping timeout: 265 seconds]
<tobiasvl>
great! then work with that
<Grundell>
Yeah, but how do i do to capture something that is after this but before that in regex ?=
mojjojo has quit [Quit: mojjojo]
Bry8Star{T2_ has joined #ruby
godd2 has joined #ruby
mklappstuhl has quit [Ping timeout: 264 seconds]
joonty_ has joined #ruby
mojjojo has joined #ruby
daxroc has joined #ruby
obs has quit [Remote host closed the connection]
<godd2>
I know that 3.method(:+).call(2) is the same as 3 + 2, but what is the same as class MyClass < ParentClass ? Anyone know where I can find out what's -actually- happening in the syntactic sugar of subclassing?
jibi has quit [Quit: .]
Bry8Star{T2 has quit [Ping timeout: 240 seconds]
joonty has quit [Ping timeout: 272 seconds]
<apeiros>
godd2: those two are not the same. 3.method(:+).call(2) does a lot more than plain 3 + 2
akonny has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
<Hanmac>
godd2: MyClass = Class.new(ParentClass)
<apeiros>
godd2: an alternative way to write class MyClass < ParentClass is MyClass = Class.new(ParentClass), but that too does different things
Xeago has joined #ruby
skaflem has joined #ruby
<godd2>
noted
<godd2>
and thank you for that alternative form
zz_N00D is now known as CripperZ
<godd2>
Is there a way to trick MRI into letting me subclass Class?
<apeiros>
probably not
Soda has quit [Remote host closed the connection]
CripperZ is now known as N00D
pixelgremlins has joined #ruby
<Hanmac>
apeiros: what do you think of this?
<Hanmac>
>> class Bla < Module; end; b= Bla.new; Object.new.extend(b)
<hololeap>
Grundell: is that the actual input you will be working with? why is the <prep> element closed with </prep-name> and why is <ID> closed with <ID> (and not </ID>)?
robbyoconnor has quit [Ping timeout: 264 seconds]
zodiak has quit [Ping timeout: 272 seconds]
nvrch has quit [Read error: Operation timed out]
<godd2>
haha, I thought "TypeError: can't make subclass of Class" was grumpy enough, but trying to redefine Class::new(super_class) makes IRB crash on site
relix has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
relix has joined #ruby
Squarepy has joined #ruby
jmimi has joined #ruby
benet has quit [Remote host closed the connection]
pixelgremlins has joined #ruby
konrads1 has joined #ruby
timonv has quit [Remote host closed the connection]
konrads1 has left #ruby [#ruby]
mengu has quit [Remote host closed the connection]
timonv has joined #ruby
joonty_ is now known as joonty
ayaz has joined #ruby
ayaz has quit [Changing host]
ayaz has joined #ruby
fijimunkii has joined #ruby
Advocation has quit [Quit: Advocation]
konrads has quit [Ping timeout: 272 seconds]
kristofers has joined #ruby
timonv has quit [Ping timeout: 252 seconds]
JonahR has quit [Quit: jonahR]
Apane has joined #ruby
kreantos has joined #ruby
salmonax has joined #ruby
krawchyk has joined #ruby
elux has joined #ruby
Astralum has joined #ruby
cafhacker has joined #ruby
weszlem has quit []
weszlem has joined #ruby
_maes_ has joined #ruby
inad922 has joined #ruby
jtzero has joined #ruby
jtzero has left #ruby [#ruby]
fuhgeddaboudit has joined #ruby
mercwithamouth has quit [Ping timeout: 245 seconds]
mikecmpbll has joined #ruby
finnomenon has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
mercwithamouth has joined #ruby
kcombs has joined #ruby
dhruvasagar has joined #ruby
robbyoconnor has quit [Write error: Connection reset by peer]
bklane has joined #ruby
jrhe has quit [Quit: jrhe]
s2013 has joined #ruby
MrPot4to has joined #ruby
MrPotato has joined #ruby
blaskovicz has joined #ruby
<blaskovicz>
so with ruby, i can define a class, instantiate an object of that class, and then define a mixin and the class that was instantiated will hav eit?
kindjal has quit [Quit: Computer has gone to sleep.]
s2013 has quit [Remote host closed the connection]
aloshkarev has joined #ruby
mengu has quit [Read error: No route to host]
mengu has joined #ruby
Vivekananda has joined #ruby
tannerburson has joined #ruby
yfeldblum has quit [Ping timeout: 245 seconds]
h_kon has quit [Remote host closed the connection]
Snugug has joined #ruby
h_kon has joined #ruby
aloshkarev has quit [Client Quit]
jlebrech has joined #ruby
<Snugug>
Hey, I'm trying to write a custom test runner following the instructions http://endofline.wordpress.com/2008/02/11/a-custom-testrunner-to-scratch-an-itch/ (can't find anything newer online and it's really bugging me) and when I try and run it, I'm getting `uninitialized constant Test::Unit::AutoRunner::RUNNERS (NameError)`. Can anyone help me out? I'm on Ruby ruby 2.0.0p247
Kilo`byte has quit [Ping timeout: 272 seconds]
Gwyxx has joined #ruby
vlad_starkov has joined #ruby
DoNcK1 has joined #ruby
h_kon has quit [Ping timeout: 245 seconds]
daxroc has joined #ruby
sandeepk has joined #ruby
DoNcK has quit [Ping timeout: 245 seconds]
hiroyuki has joined #ruby
hiroyuki has quit [Remote host closed the connection]
sbos99 has quit [Quit: Leaving]
sevenseacat has quit [Remote host closed the connection]
Kilo`byte has joined #ruby
camilasan has quit [Remote host closed the connection]
baordog has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
h_kon has joined #ruby
jacobsmith has joined #ruby
daxroc has quit [Ping timeout: 246 seconds]
camilasan has joined #ruby
camilasan has quit [Read error: Connection reset by peer]
evenix has joined #ruby
tonni has quit [Remote host closed the connection]
tonni has joined #ruby
interactionjaxsn has joined #ruby
hopkin has joined #ruby
camilasan has joined #ruby
camilasan has quit [Read error: No route to host]
jacobsmith has quit [Quit: leaving]
freezey has joined #ruby
danshultz has quit [Remote host closed the connection]
Thanatermesis has quit [Quit: ɯlɐɔ uı ʞɹoʍ oʇ ƃuıoƃ]
lukec has joined #ruby
danielcharles has joined #ruby
danshultz has joined #ruby
Hanmac1 has joined #ruby
Thanatermesis has joined #ruby
s2013 has joined #ruby
danshult_ has joined #ruby
pothibo has joined #ruby
kindjal has joined #ruby
johnnyfuchs has joined #ruby
danshultz has quit [Read error: Connection reset by peer]
iamjarvo has joined #ruby
shredding has quit [Quit: shredding]
iamjarvo has quit [Remote host closed the connection]
tonni has quit [Ping timeout: 252 seconds]
Hanmac has quit [Ping timeout: 265 seconds]
camilasan has joined #ruby
iamjarvo has joined #ruby
h_kon has quit [Remote host closed the connection]
jacobsmith has joined #ruby
jacobsmith has left #ruby [#ruby]
jerius has joined #ruby
newbiehacker has joined #ruby
claymore has quit [Quit: Leaving]
msuszczy has joined #ruby
newUser1234 has joined #ruby
Ox6abe has joined #ruby
h_kon has joined #ruby
fmcgeough has joined #ruby
kcantwel has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
konrads has joined #ruby
newUser1234 has joined #ruby
w4pm has quit [Ping timeout: 248 seconds]
w4pm has joined #ruby
sriehl has joined #ruby
krawchyk has quit []
g0bl1n has joined #ruby
g0bl1n has joined #ruby
ValicekB has quit []
claymore has joined #ruby
cafhacker has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
h_kon has quit [Ping timeout: 246 seconds]
MetaCosm has joined #ruby
jelle has joined #ruby
jelle has quit [Client Quit]
rusty_ has quit [Quit: Lost terminal]
DouweM has joined #ruby
newUser1234 has quit [Ping timeout: 272 seconds]
aagdbl has joined #ruby
jerius has quit [Quit: Computer has gone to sleep.]
Advocation has joined #ruby
timonv has joined #ruby
DoNcK1 has quit [Ping timeout: 245 seconds]
amund_ has joined #ruby
newUser1234 has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
MrPot4to has quit [Remote host closed the connection]
MrPotato has quit [Read error: Connection reset by peer]
kindjal has quit [Quit: Computer has gone to sleep.]
vlad_starkov has quit [Remote host closed the connection]
Ox6abe has quit [Remote host closed the connection]
sandeepk has quit [Read error: Connection reset by peer]
macmartine has quit [Remote host closed the connection]
sambao21 has quit [Ping timeout: 264 seconds]
rdark has quit [Ping timeout: 246 seconds]
corehook has joined #ruby
<_br_>
Snugug: Not very familiar with the libs use use, but the error seems to indicate that you might be missing some libs, or maybe the libs changed and the example code you are using is out of date.
corehook has left #ruby [#ruby]
Ox6abe has joined #ruby
sambao21 has joined #ruby
Macaveli has quit [Read error: Connection reset by peer]
lfox has joined #ruby
Macaveli has joined #ruby
wildroman has quit []
<Snugug>
_br_: The example code is most definitely out of date, from 2008, but there doesn't seem to be better documentation anywhere for creating a custom task runner for unit testing.
<Snugug>
And it fails to tell us what version of Ruby it's using (the site)
DoNcK has joined #ruby
wallerdev has joined #ruby
Mattx has quit [Read error: Connection reset by peer]
bradhe has joined #ruby
noop has quit [Ping timeout: 245 seconds]
jerius has joined #ruby
Squarepy has quit [Ping timeout: 246 seconds]
jkamenik has quit [Ping timeout: 240 seconds]
<_br_>
Snugug: well its its from 2008 probably 1.8 MRI
<Snugug>
Yah :\
mmitchell has quit [Remote host closed the connection]
<_br_>
Snugug: Ok, that means then that you are using the lib maybe wrong since the example is out of date.
mmitchell has joined #ruby
Macaveli has quit [Read error: Connection reset by peer]
_maes_ has quit [Read error: Connection reset by peer]
asobrasil has joined #ruby
<_br_>
Snugug: You might need to crawl around in the source to understand how to update the example you have
lfox has quit [Ping timeout: 248 seconds]
Macaveli has joined #ruby
CaptainJet has joined #ruby
Kilo`byte has quit [Ping timeout: 272 seconds]
<Snugug>
Yah, thanks
deception has joined #ruby
corehook has joined #ruby
bradhe has quit [Ping timeout: 272 seconds]
corehook has quit [Max SendQ exceeded]
ckinni has joined #ruby
i_s has quit [Remote host closed the connection]
corehook has joined #ruby
corehook has quit [Max SendQ exceeded]
sayan has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby
i_s has joined #ruby
corehook has joined #ruby
corehook has quit [Max SendQ exceeded]
kindjal has joined #ruby
corehook has joined #ruby
corehook has quit [Max SendQ exceeded]
Davey has quit [Read error: Connection reset by peer]
Kilo`byte has joined #ruby
corehook has joined #ruby
thesheff17 has joined #ruby
ananthakumaran has joined #ruby
Soda has quit [Read error: Connection reset by peer]
aagdbl has quit [Quit: Leaving.]
axilla has quit [Ping timeout: 264 seconds]
awarner_ has joined #ruby
ValicekB has joined #ruby
corehook has quit [Client Quit]
lukec has quit [Quit: lukec]
matled- has joined #ruby
awarner has quit [Read error: Operation timed out]
i_s has quit [Remote host closed the connection]
patronus_ has joined #ruby
jerius has quit [Quit: Computer has gone to sleep.]
TheHodge_ has joined #ruby
artm has joined #ruby
Davey has joined #ruby
ffranz has joined #ruby
enebo has joined #ruby
sguselnikov has joined #ruby
ce_afk is now known as cescalante
amoli has quit [Ping timeout: 272 seconds]
wuest_ has joined #ruby
kaichanvong___ has joined #ruby
shaman42_ has joined #ruby
parus_ has joined #ruby
kpmjf has joined #ruby
Weazy_ has joined #ruby
Skelz0r_ has joined #ruby
Jb___ has joined #ruby
Jamo_ has joined #ruby
rtl_ has joined #ruby
Rydekull_ has joined #ruby
zaycheno1 has joined #ruby
bnagy_ has joined #ruby
Sourcele1s_ has joined #ruby
peteyg__ has joined #ruby
monomyth_ has joined #ruby
kristofers has joined #ruby
NexSeven has joined #ruby
Sp4rKy_ has joined #ruby
XenoWolf_ has joined #ruby
ReinH_ has joined #ruby
shredding has joined #ruby
axl_ has joined #ruby
thelorax123 has quit [Remote host closed the connection]
jacobsmith has left #ruby [#ruby]
ringaroses has joined #ruby
jacobsmith has joined #ruby
thelorax123 has joined #ruby
Mattx has joined #ruby
Astralum has quit [Ping timeout: 252 seconds]
bretolius has joined #ruby
Tobarja_yikes has joined #ruby
erichmenge_ has joined #ruby
erichmenge_ has quit [Changing host]
erichmenge_ has joined #ruby
Azure|dc has joined #ruby
stetho has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
crus has quit [Read error: Connection reset by peer]
mklappst_ has quit [Remote host closed the connection]
tkuchiki_ has joined #ruby
macmartine has quit [Read error: Connection reset by peer]
pskosinski_ is now known as pskosinski
<brahman_work>
Hi, I would like to capture multiple regx matches in a similar way to perl ($name,$version) =~ /^(.*)?_(.*)?_.*\.deb$/ in ruby I have: (name,version) = pkg.match(/^(.*)?_(.*)?_.*\.deb$/) this doesn't work
nwertman has joined #ruby
macmartine has joined #ruby
beermouse has joined #ruby
<DaniG2k>
brahman_work: whats an example string you want to match?
tkuchiki has quit [Ping timeout: 245 seconds]
tonni has joined #ruby
tonni has quit [Remote host closed the connection]
tonni has joined #ruby
<brahman_work>
Hi so I want to capture the package name and version from packagename_0.1_.deb
<DaniG2k>
brahman_work: the one you wrote will match something_something_.deb
<DaniG2k>
brahman_work: that works in ruby
<DaniG2k>
brahman_work: works fine
<brahman_work>
DaniG2k: the regex works fine. I want to capture in 1 go the match data.
<brahman_work>
assign it to 2 diff variables.
wr0ngway has joined #ruby
<brahman_work>
in perl I would do this: ($name,$version) =~ /^(.?_(.?_.*\.deb$/
<brahman_work>
Hanmac: Thanks for this. Are you namiung the captures in your example?
<Hanmac>
brahman_work: yeah, i named them because like this they create the variables in the end
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<brahman_work>
Thanks man.
<DaniG2k>
brahman_work: you dont really need assignment...you can just do something like match = pkg.match(/^(.*)?_(.+)?\.(?:.+).*\.deb$/) and then access its elements with match[1] or match[2]
stetho has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Apane has quit [Ping timeout: 252 seconds]
Reach has joined #ruby
fschuindt has quit [Quit: Computer has gone to sleep.]
Squarepy has joined #ruby
wald0 has joined #ruby
Squarepy_ has quit [Read error: Connection reset by peer]
zeade has quit [Quit: Leaving.]
<wald0>
im checking a video about tmux + vim + ruby, but i see syntax like "describe" and "subject" which i have not readed yet about, is this ruby-on-rails specific topic or it is really ruby syntax ?
apeiros has joined #ruby
bklane_ has joined #ruby
<Mon_Ouie>
It's probably valid Ruby syntax (can't be sure without seeing the code), those would just be method calls
<Mon_Ouie>
RSpec, which is just a library, uses such syntax
bondar has quit [Ping timeout: 272 seconds]
mikecmpbll has joined #ruby
sandeepk has quit [Read error: Connection reset by peer]
bklane has quit [Read error: Connection reset by peer]
mikepack has quit []
<wald0>
in fact it doesn't seems to work on my "pry"
cescalante is now known as ce_afk
<Mon_Ouie>
Well, the methods do have to be defined before they can be called
mmitchell has quit [Remote host closed the connection]
sambao21 has quit [Ping timeout: 272 seconds]
mikepack has joined #ruby
maletor has joined #ruby
sriehl has quit [Quit: Leaving...]
Squarepy has quit [Read error: Connection reset by peer]
rudisimo has joined #ruby
sambao21 has joined #ruby
d45h has quit []
timonv has quit [Remote host closed the connection]
weszlem has quit []
camilasan has quit []
theRoUS has quit [Ping timeout: 264 seconds]
yfeldblum has joined #ruby
<Hanmac>
Mon_Ouie: hm i wanted to write an helper for classes/modules that when you define an specific method it automatic includes a specific module into the class ... like :<=> => Comparable, :each => Enumerable ... but the problem that are the only modules i know where that makes sense ,P
nomenkun has quit [Ping timeout: 246 seconds]
d45h has joined #ruby
bean has quit [Remote host closed the connection]
jrhorn424 is now known as zz_jrhorn424
bean has joined #ruby
wallerdev has joined #ruby
yacks has joined #ruby
lukec has joined #ruby
mklappstuhl has joined #ruby
saarinen has joined #ruby
mikesplain1 has joined #ruby
akonny has joined #ruby
TaxmanBD has joined #ruby
cascalheira has joined #ruby
coderhs has joined #ruby
zz_tsykoduk is now known as tsykoduk
mikesplain has quit [Ping timeout: 245 seconds]
lethjakm1 has quit [Ping timeout: 264 seconds]
<olivier_bK>
i have a littel problem i try to remove " and ' and ; of that => "'lioplaza';"
<olivier_bK>
i cant find the good regex
dallasm has quit []
<olivier_bK>
grrr...
RichardBaker has joined #ruby
<apeiros>
olivier_bK: you're aware that that string does not contain any " ?
<apeiros>
also, please show what you've tried so far
Ripp__ has joined #ruby
saarinen has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Read error: Operation timed out]
cina has joined #ruby
saarinen has joined #ruby
DoNcK has quit [Read error: Connection reset by peer]
pskosinski has quit [Quit: Til rivido Idisti!]
DoNcK has joined #ruby
stetho has joined #ruby
<olivier_bK>
@to.scan(([^']+)'/)
<Mon_Ouie>
Also see String#delete, rather than using a Regexp (although the syntax would still be very similar)
<apeiros>
Aloysius1: um, to clarify on what havenwood says: you don't need a Gemfile. but if you want one, that's what it should be like.
<Aloysius1>
I guess since I'm using just net/smtp, I was wondering if that was part of the default packages. (I guess not, since I needed to require it.)
<apeiros>
Aloysius1: the *only* thing you don't need to require is stuff in ruby core.
<Aloysius1>
apeiros: Thanks. I don't think I need one. I had just "source https:/blah" and it looked weird.
<Aloysius1>
like, what am I sourcing here?
<Eightamrock>
you can just require net/smtp in your code and list it as a dependency in gemspec
<havenwood>
Aloysius1: Yeah, stdlib doesn't need to be in Gemfile or .gemspec file, just `require` it once.
<havenwood>
oh, smtp
<havenwood>
still stdlib
pwh has quit []
<Aloysius1>
So... I don't need a Gemspec either? (I did another gem a few months ago and the Gemfile only had testing stuff in it, which I don't think I needed, either.)
shaunbaker has quit [Ping timeout: 252 seconds]
cescalante is now known as ce_afk
<havenwood>
Aloysius1: Might be good to look at what bundler generates for a gem scaffolding: bundle gem your_geme_name_here
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Aloysius1>
(And it had no gemspec.)
io_syl has joined #ruby
<Aloysius1>
havenwood: Thanks, yeah...clarification is helpfu.
<Eightamrock>
In order to put it on rubygems.org it needs a spec
<Eightamrock>
otherwise not
<Eightamrock>
I think**
<apeiros>
making stuff a gem is useful even without releasing it to rubygems.org
d45h has quit []
pragmatism has joined #ruby
<apeiros>
we have a couple of non-public gems at work
aspires has quit [Quit: sudo making a sandwich]
<havenwood>
Aloysius1: You *need* a gem_name.gemspec to distribute via RubyGems. I'd recommend a Gemfile that simply points to your gem_name.gemspec.
yfeldblum has joined #ruby
<Eightamrock>
truth, apeiros
<apeiros>
havenwood: why'd you want a Gemfile for/in a gem?
io_syl has quit [Read error: Connection reset by peer]
mojjojo has quit [Quit: mojjojo]
Czupa has quit [Remote host closed the connection]
<havenwood>
apeiros: Mostly as a convenience to devs. When someone forks or clones, they just `bundle` for development dependences.
jacobsmith has quit [Ping timeout: 272 seconds]
<apeiros>
havenwood: that's what gemspec's add_development_dependency is there for, no?
<havenwood>
Then a Rakefile, so you can run the test suite.
<havenwood>
apeiros: Yeah, bundle triggers those to install.
inad922 has quit [Quit: ChatZilla 0.9.90.1 [Firefox 25.0.1/20131112160018]]
<havenwood>
apeiros: So i clone, then `bundle` and `rake` to run the tests. What would your workflow be for that?
sambao21 has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
duggiefresh has joined #ruby
Grundell has quit [Remote host closed the connection]
<havenwood>
apeiros: You install deps by pointing `gem` to the .gemspec? What is the command for that, i'm not familiar?
cina has quit [Remote host closed the connection]
<apeiros>
rm -f *.gem && gem build *.gemspec && gem install *.gem # builds and installs the gem and dependencies
<apeiros>
then run the tests
<havenwood>
I did see the new `gem install -g Gemfile` which is pretty sweet.
TaxmanBD has quit [Ping timeout: 245 seconds]
Xeago_ has joined #ruby
fmcgeough has quit [Read error: Operation timed out]
khushildep has quit [Ping timeout: 264 seconds]
thelorax123 has quit [Remote host closed the connection]
<havenwood>
apeiros: ah, gotcha, kk
<apeiros>
I'm too lazy to add a `rake install` :)
banister has joined #ruby
<Aloysius1>
I think one of y'all here referred to the "version.rb" practice as a "cargo cult". Am I recalling correctly?
<apeiros>
(yes, I'm a horrible person)
<apeiros>
Aloysius1: well, downside is that there's no clean rule
<havenwood>
apeiros: I'm so lazy i have bundler generate a Rakefile and Gemfile for me, though i do edit a line in the Rakefile so tests are wired up.
luke_ has joined #ruby
luke_ has quit [Client Quit]
<apeiros>
havenwood: I'm so lazy I wrote a gem to generate gem skeletons for me
<havenwood>
apeiros: Yeah, i've been meaning to be that lazy, but been too lazy.
thelorax123 has joined #ruby
sheepman has joined #ruby
<Aloysius1>
apeiros: Clean rule for...? I've noticed that in my case, I forget to update the version number, 'cause it's all tucked away in that file.
<Aloysius1>
(Also, I'm lazy.)
<havenwood>
apeiros: i'm about tired or repeating myself setting up gems, time to automate
<apeiros>
Aloysius1: version.rb stuff
w4pm has quit [Ping timeout: 252 seconds]
<apeiros>
Aloysius1: I like it, but the practical purpose of it is severely limited
zxq9 has joined #ruby
Xeago has quit [Ping timeout: 245 seconds]
deception has quit [Remote host closed the connection]
<apeiros>
due to there not being a clear rule. it might be Foo::VERSION, it might be Foo::Version, it might be Foo::VERSION::STRING etc.
wedgeV has quit [Quit: wedgeV]
<sheepman>
hi all, im using httpclient to interact with an API however I'm noticing a lot of "CLOSE_WAIT" conditions a long time after the web request has been sent. Is there anyway of dealing with these properly? Or should I just let the server kill them off?
Ripp__ has quit []
<apeiros>
then the version itself might be any format
<havenwood>
Aloysius1: So i follow the convention of lib/gem_name/version.rb, then i release my gems with the gem-release gem command: gem bump --tag --release
w4pm has joined #ruby
<apeiros>
personally I use the pattern of Foo::Version, where Foo::Version is a Gem::Version instance
Bry8Star{T2_ has quit [Ping timeout: 240 seconds]
<havenwood>
Aloysius1: Which bumps the minor version of the version, tags the release, pushes it, and releases the gem.
pwh has joined #ruby
duggiefresh has quit [Read error: Connection reset by peer]
<Aloysius1>
apeiros: Ahhh. Got it. Wow, you really ARE lazy. I can only aspire to be that lazy, which is part of the problem.
duggiefresh has joined #ruby
<Aloysius1>
Heh.
<havenwood>
apeiros: I do Foo::VERSION.
<apeiros>
havenwood: heathen!
nathancahill has quit [Quit: nathancahill]
cina has joined #ruby
barratt has quit [Ping timeout: 246 seconds]
<Aloysius1>
(I've always wanted to get that question in a job interview: "What are you strengths and weaknesses?" "Well, I'm lazy and easily bored. And, I'm lazy and easily bored."
<havenwood>
YELLING_SNAKES_FTW
<Aloysius1>
lol
matchaw_ has joined #ruby
<Aloysius1>
I guess you can't have sHOUTINGcAMELS.
iamjarvo has joined #ruby
lukec has joined #ruby
theRoUS has quit [Ping timeout: 248 seconds]
<apeiros>
Aloysius1: the proper quote would be "I'm lazy, hubristic and impatient" (twice)
xcess_denied has quit [Read error: Connection reset by peer]
manoj_ has joined #ruby
nathancahill has joined #ruby
<Aloysius1>
apeiros: I don't know that quote.
<apeiros>
sHOUTING_sNAKE_cAMELS
<apeiros>
Aloysius1: google larry wall, qualities of a programmer
<havenwood>
hobbitses
matchaw has quit [Ping timeout: 252 seconds]
<apeiros>
and if you don't know larry wall, google him too :-)
bradhe has quit [Remote host closed the connection]
<Hanmac>
imo i would prefer is ? methods return only true and false ... it would make much more sense
momomomomo has joined #ruby
Thanatermesis has left #ruby ["ɯlɐɔ uı ʞɹoʍ oʇ ƃuıoƃ"]
SJr has quit [Max SendQ exceeded]
KevinSjoberg has quit [Ping timeout: 264 seconds]
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dayepa has joined #ruby
manoj_ has joined #ruby
xcess_denied has quit [Read error: Connection reset by peer]
closures999 has quit [Client Quit]
falten has quit [Ping timeout: 264 seconds]
SJr has joined #ruby
dettoaltrimenti has joined #ruby
mojjojo has quit [Quit: mojjojo]
jacobsmith has joined #ruby
ph8 has joined #ruby
timmow has joined #ruby
<Hanmac>
havenwood: what do you think about that Enumerable#to_a should make the array of the currect size before assigning objects to it? https://bugs.ruby-lang.org/issues/9118
falten has joined #ruby
SJr has quit [Excess Flood]
bahar has quit [Ping timeout: 246 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
moneydouble has joined #ruby
bahar has joined #ruby
KevinSjoberg has joined #ruby
zxq9 has joined #ruby
SJr has joined #ruby
Reach has joined #ruby
<havenwood>
Hanmac: pretty interesting, hrm
kindjal has joined #ruby
paul_k has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
<Hanmac>
#size maybe not the right method, but there are other interesting ways
ananthakumaran has quit [Quit: Leaving.]
nonamehero has joined #ruby
Apane has joined #ruby
mojjojo has joined #ruby
Elhu has joined #ruby
reset has joined #ruby
echevemaster has joined #ruby
candelabra has joined #ruby
jerius has joined #ruby
jerius has quit [Client Quit]
bricker has joined #ruby
timonv has joined #ruby
decoponio has quit [Quit: Leaving...]
carraroj has joined #ruby
SJr has quit [Max SendQ exceeded]
asteros has joined #ruby
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 264 seconds]
SJr has joined #ruby
ckinni has joined #ruby
DonRichie has quit [Quit: Verlassend]
cafhacker has joined #ruby
jerius has joined #ruby
jerius has quit [Client Quit]
typicalbender has joined #ruby
nvrch has quit [Ping timeout: 248 seconds]
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fuhgeddaboudit has quit [Ping timeout: 264 seconds]
ce_afk is now known as cescalante
<candelabra>
Hanmac, I'm more wondering just about the use of &&
beermouse has joined #ruby
jbpros has joined #ruby
mikesplain2 has quit [Ping timeout: 272 seconds]
<Hanmac>
candelabra: i think thats the better code: each_with_object({}){|c,hash| hash[c.respond_to?(:name) ? c.name : c['name']] = c }
postmodern has joined #ruby
mikesplain3 has quit [Read error: Connection reset by peer]
cascalheira has quit [Quit: Leaving...]
pel_daniel has quit [Quit: Leaving.]
scientes has quit [Ping timeout: 264 seconds]
Monie has joined #ruby
phinfonet has joined #ruby
zxq9 has quit [Remote host closed the connection]
bricker has quit [Ping timeout: 252 seconds]
Ox6abe has joined #ruby
freezey has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
bricker has joined #ruby
sergicles has quit [Ping timeout: 272 seconds]
Drakevr has quit [Ping timeout: 260 seconds]
claymore has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
barratt has joined #ruby
el_cristobal has joined #ruby
<joshu>
hi i'm using nokogiri to parse the anchor tags of an html file (local) with over 3000 links and outputting the links in CSV format. I can't explain why the script finishes successfully but the CSV only has < 400 lines when it should be over 3000. Here's my script https://gist.github.com/anonymous/0f5648bfe6c8ecd93ce0
cafhacker has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xcv has quit [Remote host closed the connection]
sambao21 has quit [Client Quit]
edwardly has joined #ruby
xcv has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
<joshu>
it seems as if nokogiri isn't loading the complete html file
ua_ has quit [Quit: Leaving]
ua has joined #ruby
danshult_ has joined #ruby
sambao21 has joined #ruby
yokel has joined #ruby
tonni has quit [Remote host closed the connection]
<jkamenik>
joshu: you may want to use the SAX parser
tonni has joined #ruby
moneydouble has joined #ruby
<joshu>
jkamenik is there something wrong in my code or is the issue with nokogiri handling such a large file?
Ox6abe has quit [Remote host closed the connection]
carraroj has joined #ruby
xcv has quit [Ping timeout: 240 seconds]
mjs2600 has quit [Remote host closed the connection]
<jkamenik>
the code looks fine
magoo has joined #ruby
zxq9 has joined #ruby
carraroj has quit [Client Quit]
danshultz has quit [Ping timeout: 245 seconds]
danielcharles has joined #ruby
reset has quit [Quit: Leaving...]
<jkamenik>
But if you aren't seeing the whole file it could be a memory issue
<jkamenik>
or it could be a malformed html page issue
krz has quit [Ping timeout: 240 seconds]
xk_id has joined #ruby
Drakevr has joined #ruby
<jkamenik>
but in general, if you are scanning an XML document for then use SAX
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
smathieu has joined #ruby
carraroj has joined #ruby
mikecmpbll has quit [Quit: Computer has gone to sleep.]
pothibo has joined #ruby
phus1on has joined #ruby
<joshu>
jkamenik this is an html document generated by safari…it's safari bookmarks export file
tonni has quit [Ping timeout: 246 seconds]
jalcine has joined #ruby
johhny111 has quit [Remote host closed the connection]
pwh has quit []
kirun has joined #ruby
ssvo has quit [Ping timeout: 252 seconds]
w4pm has quit [Ping timeout: 272 seconds]
jbpros has quit [Quit: jbpros]
Nenor has joined #ruby
mikesplain has joined #ruby
deviantlinux has joined #ruby
w4pm has joined #ruby
<deviantlinux>
I can't figure out how to get "log_dir" to output. I keep getting test2.rb:83: undefined local variable or method `log_dir' for main:Object (NameError) --- http://pastebin.com/796tisB0
mjs2600 has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
timonv has quit [Remote host closed the connection]
timonv has joined #ruby
nobitanobi has joined #ruby
mjs2600 has quit [Remote host closed the connection]
blaskovicz has quit [Quit: Leaving.]
diegoviola has joined #ruby
ssvo has joined #ruby
newbiehacker has quit [Ping timeout: 252 seconds]
Drakevr has quit [Ping timeout: 260 seconds]
Drakevr has joined #ruby
zz_jrhorn424 is now known as jrhorn424
kreantos has joined #ruby
aMoniker has joined #ruby
<aMoniker>
What's the best way of checking that an environment variable is set before trying to access it?
<jacobsmith>
deviantlinux: make log_dir an instance varaible (@log_dir)
jhamon has joined #ruby
mikepack has quit [Remote host closed the connection]
<jacobsmith>
aMoniker: have you looked at the gem dotenv? I think it has something in there for that
<deviantlinux>
jacobsmith: that did not work, same ish error.
subbyyy has joined #ruby
<jacobsmith>
deviantlinux: hmm...gimme a sec to test it on my machine
asteros has quit [Quit: asteros]
<aMoniker>
jacobsmith: What type of variable is ENV? I'm wondering if there's a general way of checking the existence of a key in a hashmap/array
<aMoniker>
or whatever data structure ENV is
Advocation has joined #ruby
lkba has quit [Ping timeout: 240 seconds]
d45h has joined #ruby
<dkastner>
aMoniker: ENV is a plain ol' hash
<jacobsmith>
deviantlinux: did you change both inside the loop and in your puts statement?
<deviantlinux>
jacobsmith: puts "Dir is #{@log_dir}"
<deviantlinux>
jacobsmith: when I do that it seems to work
<deviantlinux>
thanks!
<aMoniker>
dkastner: ok cool, so how do I check for the existence of a key in a hash?
`MArceLL` has quit [Ping timeout: 246 seconds]
<jacobsmith>
jacobsmith: no problem! (when you created it without the @, it only existed within the loop, not outside of it)
<jacobsmith>
oops, deviantlinux, not jacobsmith, haha
mjs2600 has joined #ruby
<dkastner>
aMoniker: `ENV.keys.include?('FOO')` or you can just check that ENV['FOO'] is not nil
<sparrovv>
oMnokier: ENV.key? 'KEY'
<dkastner>
sparrovv aMoniker: yeah that too
cek has quit [Quit: жопа диридай диридиридай]
<aMoniker>
so I could do: if ENV.key? && ENV['key']
geggam_ has quit [Quit: Leaving]
<aMoniker>
to test that the key exists and it contains a truthy value?
jhamon has quit [Ping timeout: 246 seconds]
<bricker>
What is the standard error to raise to say, "You need to override this method in your subclass"? Like in Java you just add @Override, and it's enforced. I see Rails using `NotImplementedError`, but that always seemed like the wrong error to me.
<sparrovv>
aMoniker: kinda, you have to ask for the key `if ENV.key?('key') && ENV['key']`
<bricker>
I know I can make my own error, just wondering if something already exists
<aMoniker>
sparrovv: oh oops, that makes sense, thanks
<sparrovv>
aMoniker: np
<dkastner>
aMoniker: beware that ENV values will always be strings, so if ENV['FOO'] is set to 'false' a check of its truthiness will always be true
brahman_work has quit [Read error: Connection reset by peer]
brahman_work has joined #ruby
allanm has quit [Ping timeout: 252 seconds]
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
jmeeuwen has quit [Ping timeout: 252 seconds]
krnflake has quit [Ping timeout: 252 seconds]
jerius has quit [Quit: Computer has gone to sleep.]
jhamon has quit [Quit: jhamon]
yekta has joined #ruby
MrZYX|off is now known as MrZYX
tessi has joined #ruby
<joshu>
so I'm still trying to understand my problem with nokogiri. I don't understand if I'm encountering a memory issue as the file is not fully loaded, what does the SAX parser do differently? never used nokogiri before, so I'd like to understand what's worng.
ldnunes has quit [Quit: Leaving]
krnflake has joined #ruby
phrozen77 has joined #ruby
Tarential has quit [Excess Flood]
mikepack has quit [Ping timeout: 246 seconds]
Tarential has joined #ruby
<shaileshg__>
apeiros: got some links.. thanks btw :)
tiglog has quit [Quit: Leaving]
petey has quit [Remote host closed the connection]
jhaals has joined #ruby
<nobitanobi>
joshu, explain further
freezey has joined #ruby
Elhu has joined #ruby
<joshu>
nobitanobi i'm using nokogiri to parse the anchor tags of an html file (local) with over 3000 links and outputting the links in CSV format. I can't explain why the script finishes successfully but the CSV only has < 400 lines when it should be over 3000. Here's my script https://gist.github.com/anonymous/0f5648bfe6c8ecd93ce0
<joshu>
[20:19:49] <joshu> it seems as if nokogiri isn't loading the complete html file
Ripp__ has quit []
RichardBaker has joined #ruby
sparrovv has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
randomnick_ has quit [Read error: Connection reset by peer]
<nobitanobi>
have you tried to getting those <a>, put them in an array (@my_array) and do puts @my_array.size?
axilla has joined #ruby
<nobitanobi>
just to make sure you are actually getting all the <a> that you think are over 3000 ?
<joshu>
nobitanobi right I haven't done that but I have compared the output of "doc" with my html file and can confirm that all anchor tags are not loaded.
<nobitanobi>
can you show the HTML? so I can try in my machine?
mklappstuhl has quit [Remote host closed the connection]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Advocation has joined #ruby
`MArceLL` has joined #ruby
rezzack has joined #ruby
Ox6abe has quit [Ping timeout: 245 seconds]
Tearan has joined #ruby
<joshu>
the html is valid. it has been generated by Safari with the export bookmarks feature. I can't show the HTML but as a test I've deleted some anchor tag entries and when I ran my script it would process the same amount of tags, but obviously different ones. In other words the HTML file is fine. The problem is with nokogiri loading all of it. jkamenik suggested SAX, so I'm googling that and trying to understand the problem
<joshu>
nobitanobi sorry can't share the html
benwoody has quit [Quit: benwoody]
petey has joined #ruby
mojjojo has joined #ruby
<nobitanobi>
joshu, I work with Nokogiri in a daily basis. Huge HTML/XML files, and I haven't had these kind of problems
<nobitanobi>
But, go ahead and try SAX. I hope that helps :)
jacobsmith has quit [Ping timeout: 248 seconds]
reset has joined #ruby
<joshu>
nobitanobi do you see anything wrong in my code?
Ripp__ has joined #ruby
IceDragon has quit [Ping timeout: 246 seconds]
benlieb has quit [Quit: benlieb]
<joshu>
nobitanobi stupid question but can it have something to do with the doctype, e.g. "<!DOCTYPE NETSCAPE-Bookmark-file-1>"
IceDragon has joined #ruby
<nobitanobi>
no questions are stupid man!
Kamuela has quit [Quit: Leaving]
<nobitanobi>
joshu, I don't think so. But you might want to change it and see.
sriehl has joined #ruby
nisstyre has joined #ruby
<nobitanobi>
I am gonna try your code. one min
benwoody has joined #ruby
cody-- has quit [Quit: derp]
<joshu>
nobitanobi do you use Mac and can try exporting your own bookmarks from Safari?
<nobitanobi>
I use Ubuntu :/
reset has quit [Ping timeout: 240 seconds]
<nobitanobi>
joshu, are you sure all your links have 'content' and 'href' ?
jonathanwallace has quit [Ping timeout: 265 seconds]
<nobitanobi>
I believe your code looks ok.
<nobitanobi>
if you could share the HTML, I could try to help you further
<joshu>
yeah all links have two two attributes. Even when I run just doc = Nokogiri::HTML(open("#{dir}/bookmarks.html"))
<joshu>
puts doc
<joshu>
"doc" is not the complete file before I even parse it.
theRoUS has quit [Ping timeout: 272 seconds]
<nobitanobi>
what do you mean
<nobitanobi>
is not the complete file?
pwh has quit []
fmcgeough has quit [Ping timeout: 272 seconds]
freakazoid0223 has quit [Quit: Leaving]
Ox6abe has joined #ruby
freakazoid0223 has joined #ruby
kristofers has quit [Remote host closed the connection]
jerius has joined #ruby
<nobitanobi>
joshu, try to minimize the problem you are facing. Reduce the size of the HTML to say, 50 anchors. See if you get them all.
<joshu>
nobitanobi ok let me try now
<nobitanobi>
I am pretty confident the problem is not Nokogiri, but the HTML is not well formed
banister has joined #ruby
<nobitanobi>
I have to go. good luck
asteros has joined #ruby
`MArceLL` has quit [Ping timeout: 246 seconds]
<s2013>
i have a string ["start", "end", "close"] i want to turn this into an array of start, end, close, how would i do it?
`MArceLL` has joined #ruby
<s2013>
i tried using regular expression but it doesnt work
<s2013>
only selects the first character
banister has quit [Client Quit]
jonahR has joined #ruby
<s2013>
[^\"\[\]] <-- regex i tried
mikepack has joined #ruby
banister has joined #ruby
<apeiros>
s2013: why do you have that kind of string?
<apeiros>
did you generate it?
fmcgeough has joined #ruby
<s2013>
no i didnt. its in the db
i_s has quit [Remote host closed the connection]
<s2013>
its an array saved as a string
<s2013>
now i need to convert it to an array, modify it and save it back
<apeiros>
the easy solution is to use LiteralParser (doesn't use eval) or to use eval (bad idea IMO)
kreantos has quit [Remote host closed the connection]
<moneydouble>
s2013: where would I start to learn ruby and rails? any good tutorials/guides/books?
dhruvasa1ar has quit [Quit: leaving]
Tuxist has joined #ruby
<s2013>
yeah. learn basics of ruby first beofre jumping into rails
<s2013>
for ruby a good book is well grounded rubyist
<s2013>
and for rails, best one is michael hartl rails tutorial (its free online, just google it)
<s2013>
you can also do the free codeacademy ruby tutorial. they arent half bad
smathieu has quit [Ping timeout: 252 seconds]
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<moneydouble>
Ruby and ror seems to be pretty good honestly, but I'm trying to figure out the use cases. I'm building a fairly large web application.. One part of it is db intentive
<moneydouble>
* intensive
<moneydouble>
and the other is basically outputting data from the db.
mojjojo has quit [Quit: mojjojo]
<moneydouble>
I've been building it in django but trying to find a use case for ruby / ror :P
<s2013>
youll be fine.. but if you are good with django, just stick with it
`MArceLL` has joined #ruby
sheepman has joined #ruby
momomomomo has quit [Quit: momomomomo]
<moneydouble>
s2013: yeah well I am for the most part, but I do have to create an API so im curious if I should do that in ruby with ror :P
<moneydouble>
it'll be separate from my application anyway.
<Hanmac>
just keep in mind that ruby is not rails, you can do so much more with ruby than only rails ;P
<moneydouble>
yeah
timonv has quit [Ping timeout: 272 seconds]
<moneydouble>
well that applies to most languages except php :P
<s2013>
rails has some good api building gems. look into rabl
<Hanmac>
hm you are right with 1.9+ it would work too
Elhu has quit [Quit: Computer has gone to sleep.]
smathieu has joined #ruby
lkba has joined #ruby
rismoney has joined #ruby
jhamon has quit [Quit: jhamon]
mikecmpbll has joined #ruby
s_kilk has joined #ruby
<rismoney>
if i have an array of hash, how do i return just the key not the value... ie foo=[{"PC-FAKE01"=>"foo"},{"PC-FAKE02"=> "bar"}] - I'd like to return an array of PC-FAKE01,PC-FAKE02
<Hanmac>
rismoney: foo.flat_map(&:keys)
<failshell>
what
<failshell>
's the best way to fix that dreaded net/http SSL issue with invalid certs?
<rismoney>
1.8.7...
<failshell>
in 2.0
<rismoney>
woops
timonv has joined #ruby
<Hanmac>
rismoney: 1.8.7 died
* IceDragon
chokes
<IceDragon>
1.8.x !
<bnagy>
failshell: with google
<bnagy>
there are lots of variables, and about three main approaches I've seen online
<bnagy>
of which not all work for every case
Advocation has joined #ruby
<rismoney>
i did a foo.map(&:keys) and it looks right
<joshu>
nobitanobi yeah in the console I can see that SAX is working and finding all the anchor links. Just need to fix exporting to csv
<s2013>
only thing from c++ i remember is cout << "hello world\n";
<Morrolan>
Hanmac: Ever thought about producing crossword puzzles for programmers? :P
mansi has quit [Ping timeout: 272 seconds]
<bnagy>
apeiros: cause it builds objects?
<Hanmac>
Morrolan: hm not yet, but i think my "macro_attr" macros are the nicest & evilest code i made, ... depending on the point of view ;P
<Morrolan>
Right after you wrote them: Nicest. Two months later: Most evil? :P
Liquid-- has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
moneydouble has quit [Quit: Leaving.]
BraddPitt has joined #ruby
vlad_starkov has joined #ruby
<Hanmac>
something like that ... this macros are for creating C methods including its bodies from less parameters as possible
<bnagy>
apeiros: it's just slightly more work to execute code
moneydouble has joined #ruby
<Morrolan>
Heh, I see.
<apeiros>
bnagy: that's quite different from what eval does
<apeiros>
JSON.parse doesn't let you execute random code
Rumsteak has joined #ruby
newUser1234 has joined #ruby
jhamon has quit [Quit: jhamon]
Rumsteak has left #ruby [#ruby]
<bnagy>
whatever you say
<bnagy>
you should hook up with the rails guys
agent_white has joined #ruby
<apeiros>
bnagy: dude
Advocation has quit [Quit: Advocation]
<apeiros>
please refer to an actual exploit based solely on JSON input
timonv_ has joined #ruby
timonv has quit [Remote host closed the connection]
jerius has quit [Quit: Computer has gone to sleep.]
<Hanmac>
Morrolan: depending on the lib, the created c methods are doing more then just converting, they are also capably to catch exceptions and convert them into the correct ruby versions ... and all for macro_attr is the name of the Attribute and its type
<apeiros>
rails did a bit more than just parse json
parduse has quit []
newUser1234 has quit [Read error: Connection reset by peer]
newUser1_ has joined #ruby
<Morrolan>
Hanmac: Huh, nice.
vlad_starkov has quit [Remote host closed the connection]
<k776>
Hello. Does anyone know of a good list (csv file that can be parsed or a service with a ruby api) of countries, their major cities/regions, and which timezone those cities are, and their currencies (currency symbol and code (e.g. USD$))?
<bean>
thats an awfully specific list.
cburyta__ has quit [Remote host closed the connection]
magoo has quit [Quit: WeeChat 0.4.2]
pragmatism has quit [Remote host closed the connection]
magoo has joined #ruby
<apeiros>
k776: if freebase still is a thing… I think something like that was their aim
<Morrolan>
k776: If your list isn't too big, and you don't need to refresh this information (which, come to think of it, really shouldn't be the case), then you could scrape Wikipedia.
<Morrolan>
They have these nice, uniform information tables.
<k776>
bean: That looks good for a list of countries, but doesn't get me cities or their timezones unfortunately
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cburyta has joined #ruby
<bean>
*shrug* one could combine several lists pretty easily
magoo has quit [Client Quit]
Elhu has quit [Client Quit]
timonv_ has quit [Remote host closed the connection]
jerius has joined #ruby
nomenkun_ has joined #ruby
<s2013>
carmen gem
mjs2600 has quit [Remote host closed the connection]
<s2013>
look into that k776
<bean>
as in "where int he world is carmen sandiego?
<apeiros>
bnagy: ok, 10min - I think your blanket statement of "parsing json is as bad as eval" was talking out of your ass. and no, rails' param input handling does not fit the bill of that blanket statement.
<ebobby>
it would be awesome if I could use ruby @ work
<apeiros>
as said, rails param input handling is not just json.
<bnagy>
that's nothing to do with rails
moneydouble has quit [Quit: Leaving.]
<bnagy>
you have to actually click the link
benwoody has quit [Quit: benwoody]
<bnagy>
that will screw just about any orm
<apeiros>
oh, that's actually a new one…
cburyta has joined #ruby
<bnagy>
btu they fixed it
<bnagy>
so you win this round
<bnagy>
but there will be MOAR
<apeiros>
bnagy: anyway, category of "broken input handling". but I really wish people weren't as stupid to pack non-standard stuff in standard-sounding-methods.
jbpros has quit [Quit: jbpros]
momomomomo has joined #ruby
jbueza has joined #ruby
pwh has joined #ruby
<apeiros>
parse_with_extras if you want to do additional and dangerous shit.
<bnagy>
well I really wish people weren't stupid enough to unserialize untrusted data
<bnagy>
especially as objects
<bnagy>
like, serialise DATA not OBJECTS
<Morrolan>
Hard, in a language where most things are objects. ;D
<bnagy>
really not hard
<bnagy>
CSV is uderrated
<apeiros>
I have a more differentiated view. but since I want to go to sleep…
<bnagy>
ok I don't really mean that, but I kind of do
<bnagy>
object serialisation is not always bad, just untrusted object deserialisation
<apeiros>
bnagy: deserializing the ~10 types that exist in JSON is just about as dangerous as plainly reading input.
Kilo`byte has quit [Ping timeout: 272 seconds]
shevy has quit [Ping timeout: 245 seconds]
<apeiros>
assuming you have a sane parser
<bnagy>
that view ignores all implementat...yes
<apeiros>
which seems a harder issue than could be expected
fmcgeough has quit [Quit: fmcgeough]
Tuxist has quit [Read error: Connection reset by peer]
kaldreno_ has quit [Remote host closed the connection]
h0rrorvacui has joined #ruby
<bnagy>
security advice includes the real world in its scope
<apeiros>
as everbody seems to think it was an awesome idea to pack nonstandard stuff into the "default" method (for the lack of a better term - I'd consider JSON.parse the default method to parse JSON)
kaldrenon has joined #ruby
jhamon has joined #ruby
<apeiros>
anyway, bedtime now
<apeiros>
gn8
<bnagy>
o/
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
nanoyak has quit [Read error: Operation timed out]
sergicles has joined #ruby
asteros has quit [Remote host closed the connection]
<k776>
s2013: The 'countries' gem (https://github.com/hexorx/countries) utilises the currencies gem you linked to earlier (by the same developer). They work together to provide a nice list. rgeo doesn't really seem fit for getting the timezones though so still need to find a resource for those.
mjs2600 has quit [Remote host closed the connection]
ckinni has joined #ruby
jacobsmith has joined #ruby
drumusician has quit [Ping timeout: 246 seconds]
BrenoPerucchi has joined #ruby
TaxmanBD has quit [Ping timeout: 264 seconds]
kitak_ has joined #ruby
jerius has quit [Ping timeout: 248 seconds]
tigersharktopus has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
blaskovicz has joined #ruby
TaxmanBD has joined #ruby
Soda has joined #ruby
mikecmpbll has joined #ruby
brtdv has quit []
Grantlyk has quit []
iamjarvo has quit [Read error: Operation timed out]
kitak has quit [Ping timeout: 246 seconds]
pragmatism has joined #ruby
w4pm has quit [Ping timeout: 272 seconds]
<BrenoPerucchi>
How I could use this array = [:updated_at, :state] to use with except (hash) hash = {:state => "a", :updated_at => "1").except(array modify)
<nobitanobi>
Do you guys know if when launching a Bash script (CasperJS) from Ruby and getting the output, there might be a limit on the amount that can be read? - I am doing this
<nobitanobi>
Well,, I have a pipe, and I do: @output = pipe_cmd_in.read;
<nobitanobi>
I have noticed that if @output is really long (100.000 characters) - it just won't read it (it times out at 2 minutes...)
<nobitanobi>
@output is an stringified JSON
fgo has joined #ruby
tkuchiki has joined #ruby
jerius has joined #ruby
cnrk has quit [Quit: cnrk]
zz_michael_mbp is now known as michael_mbp
yekta has quit [Quit: yekta]
phus1on has quit [Quit: .]
DonRichie has quit [Quit: Verlassend]
fijimunkii has joined #ruby
cnrk has joined #ruby
Kilo`byte has joined #ruby
jerius has quit [Client Quit]
<SirFunk>
is there a way if i have an array of arrays like [[1,2],[3,4],[5,6]] that i could get every combination of first and second elements.. eg [[1,2],[1,4],[1,6],[3,2],[3,4]...] ?
coderhs has quit [Ping timeout: 265 seconds]
mikecmpbll has quit [Quit: Computer has gone to sleep.]
vlad_starkov has quit [Read error: Connection reset by peer]