<Caerus>
to me it seems that any 'region' has to be done by you, geocoding is probably just that
gizless has joined #ruby
gizmore|2 has quit [Ping timeout: 246 seconds]
<Caerus>
you could maybe use g maps api to say throw it a coordinate and then have it return the region based on distance using your lat,long as center?
rbennacer has joined #ruby
Coldblackice has joined #ruby
tildes_ has joined #ruby
gizmore has quit [Ping timeout: 260 seconds]
Eiam_ has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
go|dfish has joined #ruby
speakingcode has quit [Ping timeout: 250 seconds]
DotKite has quit [Remote host closed the connection]
<Caerus>
kareeoleez, do read up on getBounds() and anything related to it, from google maps API, to me it looks exactly like what you need.
<kareeoleez>
Caerus: geoJSON is the word
<kareeoleez>
Caerus: I think I got it
<kareeoleez>
actually coordinates define a region and it's a json string
g____ has quit [Ping timeout: 252 seconds]
<Caerus>
*it looks exactly like what i thought you needed
syndikate has joined #ruby
Devalo has quit [Remote host closed the connection]
<Caerus>
wrongfully assumed you didn't have the boundaries coords when you clearly stated you wanted to 'define' it.
smathy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
crayfishx has joined #ruby
jimmybomb1 has joined #ruby
jimmybomb has quit [Read error: Connection reset by peer]
rbennacer has quit [Ping timeout: 265 seconds]
toretore has joined #ruby
bronson has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
dionysus69 has joined #ruby
jimmybomb1 has quit [Client Quit]
Bugboy1028 has quit [Remote host closed the connection]
rbennacer has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
Bugboy1028 has joined #ruby
Bugboy1028 has quit [Remote host closed the connection]
<TheWhip>
sorry for posting it here, but some of you might have worked on sinatra so giving it a try.
<TheWhip>
hi, I am trying to integrate new_relic with my sinatra app. I require the newrelic_rpm gem, created the newrelic.yml file. In config.ru I put in "require 'newrelic_rpm'" and "NewRelic::Agent.after_fork(:force_reconnect => true)"
<TheWhip>
still not able to see anything on my newrelic dashboard
<TheWhip>
It's working fine for my rails apps
bronson has joined #ruby
skade has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
panpainter has quit [Remote host closed the connection]
panpainter has joined #ruby
CloCkWeRX has joined #ruby
aufi has quit [Ping timeout: 246 seconds]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
nerium has joined #ruby
marr has joined #ruby
klaas has quit [Remote host closed the connection]
aufi has joined #ruby
dede has left #ruby [#ruby]
madgen has quit [Ping timeout: 244 seconds]
lupine has joined #ruby
UKn0Me has quit [Quit: Gone shopping.]
UKn0Me has joined #ruby
mdw has joined #ruby
panpainter has quit [Remote host closed the connection]
<smathy>
kaleido, both do the same thing, which is to set nodes to server_ip.to_json and run a block and discard everything in it.
<smathy>
...unless `code` is scoped to outside that block, in which case it will be set to the hash of the last element of server_ip on exit.
rippa has joined #ruby
dn` has quit [Quit: dn`]
panpainter has quit [Remote host closed the connection]
hk238 has joined #ruby
sameerynho has quit [Ping timeout: 244 seconds]
<kaleido>
so code will only hold one name/address pairs? i need to end up with a hash that holds everything coming from the original hash
panpainter has joined #ruby
Snowy has quit [Remote host closed the connection]
<smathy>
kaleido, right, that's what I assumed you wanted, look at the docs for `Array#each`, it doesn't return what you think it does.
mikecmpbll has quit [Read error: Connection reset by peer]
the_drow has quit [Quit: This computer has gone to sleep]
panpainter has quit [Remote host closed the connection]
panpainter has joined #ruby
<shevy>
grilled-cheese did you try to re-do and generate the .gem itself?
mikecmpbll has joined #ruby
<grilled-cheese>
?
freerobby has quit [Quit: Leaving.]
<kaleido>
im working with Hash#each, does that make a difference?
apofis_ is now known as apofis
<grilled-cheese>
The bug isn't in the gem itself, but rather a native dependency that didn't take MinGW windows error codes into account
<grilled-cheese>
and of course there is no native binary
<smathy>
kaleido, unfortunately the docs for that don't talk about the return, but it's the same as Array#each's return. You can confirm this yourself in a quick console test.
<shevy>
I see
pawnbox has quit [Remote host closed the connection]
<kaleido>
smathy: indeed. gotta love irb :) thanks.
cjbottaro has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
drptbl_ has quit [Ping timeout: 246 seconds]
diegoaguilar has joined #ruby
Yxhuvud has joined #ruby
zacstewart has joined #ruby
idefine_ has joined #ruby
<smathy>
kaleido, there are other methods that do what you (probably) want. Take a look at map/collect
aufi has quit [Ping timeout: 252 seconds]
idefine has quit [Ping timeout: 244 seconds]
idefine has joined #ruby
RegulationD has joined #ruby
kies has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
idefine_ has quit [Ping timeout: 276 seconds]
pawnbox has joined #ruby
cjbottaro has joined #ruby
GinoMan2440 has quit [Read error: Connection reset by peer]
AnoHito_ has quit [Read error: Connection reset by peer]
Asher has quit [Read error: Connection reset by peer]
kareeoleez has joined #ruby
<soahccc>
I asked yesterday how I could optparse to just ignore invalid options (optimally based on a regex) and I got send a link http://stackoverflow.com/questions/3642331 but it's for python and I wasn't able to port that to rubys optparse. The closest I digged ended up in this method and I'm pretty certain that I don't want to monkey patch that one :S https://github.com/ruby/ruby/blob/trunk/lib/optparse.rb#L1549
AnoHito_ has joined #ruby
BSaboia has joined #ruby
houhoulis has quit [Read error: Connection reset by peer]
<guardian>
is Dir::Tmpname available in all ruby implementations?
d0lph1n98 has quit [Ping timeout: 276 seconds]
monoprotic has quit [Read error: Connection reset by peer]
houhoulis has joined #ruby
brendan- has quit [Ping timeout: 260 seconds]
chouhoul_ has joined #ruby
GinoMan2440 has joined #ruby
sarbs has quit [Read error: Connection reset by peer]
Asher has joined #ruby
NightMonkey has quit [Ping timeout: 244 seconds]
monoprotic has joined #ruby
neanderslob has quit [Quit: No Ping reply in 180 seconds.]
d0lph1n98 has joined #ruby
ReK2 has joined #ruby
shibly has joined #ruby
dionysus69 has joined #ruby
sarbs has joined #ruby
iamvery has quit [Ping timeout: 276 seconds]
Sharcho has left #ruby ["Leaving"]
freerobby has joined #ruby
iamvery has joined #ruby
__main__ has quit [Ping timeout: 260 seconds]
jwang has quit [Ping timeout: 276 seconds]
neanderslob has joined #ruby
shibly has quit [Quit: leaving]
davedev24 has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
<soahccc>
I have an idea for an hackish workaround. The problematic parameters are coordinates (e.g. -123) so I gsub them to say %123 run it through optparse and change that back to -123... :S
jwang has joined #ruby
<smathy>
guardian, no.
elifoster has joined #ruby
NightMonkey has joined #ruby
cjbottaro has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hays_ has joined #ruby
hays has quit [Ping timeout: 252 seconds]
__main__ has joined #ruby
bruno- has joined #ruby
cjbottaro has joined #ruby
apofis is now known as apofis_
ReK2GnULinuX has quit [Ping timeout: 260 seconds]
panpainter has quit [Remote host closed the connection]
fantazo has joined #ruby
panpainter has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 265 seconds]
hobodave has joined #ruby
<guardian>
what's my best bet to generate a temp filename inside a specific directory then?>
VeryBewitching has quit [Ping timeout: 260 seconds]
tk__ has quit [Quit: ばいばい]
synthroid has quit [Remote host closed the connection]
chouhoul_ has quit [Remote host closed the connection]
roelof has joined #ruby
crystal77 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
idefine has quit [Read error: Connection reset by peer]
<smathy>
guardian, for something that works in all ruby implementations? No idea.
northrup has joined #ruby
idefine has joined #ruby
brendan- has joined #ruby
<smathy>
Seriously roelof? You weren't spoon-fed in #RoR so you came here?
mustmodify has joined #ruby
roamingdog has joined #ruby
emilford has quit [Ping timeout: 260 seconds]
rodfersou|lunch has quit [Ping timeout: 252 seconds]
arup_r has joined #ruby
rodfersou|lunch has joined #ruby
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
edavis has quit [Remote host closed the connection]
The_Phoenix has joined #ruby
roelof has quit [Quit: Page closed]
The_Phoenix has quit [Max SendQ exceeded]
The_Phoenix has joined #ruby
The_Phoenix has quit [Max SendQ exceeded]
panpainter has quit [Remote host closed the connection]
panpainter has joined #ruby
n008f4g_ has quit [Ping timeout: 246 seconds]
houhoulis has quit [Remote host closed the connection]
CloCkWeRX has joined #ruby
Guest38 has joined #ruby
BrunoSaboia has joined #ruby
millerti has joined #ruby
GodFather has quit [Ping timeout: 276 seconds]
<guardian>
smathy: btw what makes you believe it's not part of all implementations? seems to be in the stdlib in fact
CloCkWeRX has quit [Remote host closed the connection]
diegoaguilar has quit [Remote host closed the connection]
duderonomy has quit [Ping timeout: 240 seconds]
moeabdol has joined #ruby
<smathy>
guardian, well for a start it wasn't around pre 1.9.3 (IIRC).
[Butch] has joined #ruby
whathappens has joined #ruby
citizentwo has joined #ruby
duderonomy has joined #ruby
mdw_ has quit [Quit: Sleeping Zzzzz]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rcvalle has joined #ruby
banister has joined #ruby
BSaboia has quit [Ping timeout: 265 seconds]
<benzrf>
smathy: abusing people for "wanting to be spoon fed" is srsly not constructive
hobodave has quit [Quit: Computer has gone to sleep.]
ferr has joined #ruby
<benzrf>
it doesnt accomplish anything positive besides making you feel self righteous
idefine has quit [Ping timeout: 246 seconds]
moeabdol has quit [Ping timeout: 265 seconds]
n008f4g_ has joined #ruby
idefine has joined #ruby
rodfersou|lunch is now known as rodfersou
agentmeerkat has joined #ruby
ferr has quit [Client Quit]
idefine has quit [Remote host closed the connection]
<smathy>
benzrf, you're welcome to your opinion, and also free to help people how you see fit, as am I.
carella_ has joined #ruby
jgt1 has quit [Ping timeout: 252 seconds]
tvon has joined #ruby
amclain has joined #ruby
agit0 has quit [Quit: zzzZZZ….]
Coldblackice has joined #ruby
akem has joined #ruby
tvw has quit [Remote host closed the connection]
carella has quit [Ping timeout: 260 seconds]
idefine has joined #ruby
mark_66 has quit [Quit: Leaving.]
idefine has quit [Remote host closed the connection]
idefine has joined #ruby
pietr0 has joined #ruby
minimalism has joined #ruby
d0lph1n98 has quit [Ping timeout: 246 seconds]
saneax is now known as saneax_AFK
ferr has joined #ruby
charliesome has joined #ruby
gdp has quit [Remote host closed the connection]
panpainter has quit []
hobodave has joined #ruby
cjbottaro has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
agentmee1kat has joined #ruby
crystal77 has joined #ruby
agentmee1kat has quit [Client Quit]
panpainter has joined #ruby
hobodave_ has joined #ruby
agentmeerkat has quit [Ping timeout: 240 seconds]
agentmeerkat has joined #ruby
Nightwolf_ has joined #ruby
the_drow has joined #ruby
jaruga___ has quit [Quit: jaruga___]
hobodave has quit [Ping timeout: 260 seconds]
houhoulis has joined #ruby
blackmes1 has joined #ruby
haylon has joined #ruby
synthroid has joined #ruby
evidex has quit [Remote host closed the connection]
bronson has joined #ruby
zeroDivisible has joined #ruby
rkazak has quit [Ping timeout: 250 seconds]
cjbottaro has joined #ruby
blackmes1 has quit [Ping timeout: 265 seconds]
Snowy has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
chouhoulis has quit [Remote host closed the connection]
Devalo has joined #ruby
the_drow has quit [Read error: Connection reset by peer]
yardenbar has quit [Ping timeout: 260 seconds]
nrd_pxs has joined #ruby
pawnbox has quit [Remote host closed the connection]
nofacade has quit [Ping timeout: 246 seconds]
Devalo has quit [Ping timeout: 250 seconds]
the_drow has joined #ruby
chouhoulis has joined #ruby
pawnbox has joined #ruby
rbennacer has quit [Remote host closed the connection]
chouhoul_ has joined #ruby
chouhoulis has quit [Read error: Connection reset by peer]
BrunoSaboia has quit [Quit: Leaving]
BSaboia has joined #ruby
sepp2k has quit [Ping timeout: 260 seconds]
jmarinelli has joined #ruby
roamingdog has quit [Remote host closed the connection]
<jmarinelli>
can ruby's enumerator module be considered within the functional paradigm?
orangey has joined #ruby
<orangey>
Hello all.
zacstewart has quit [Ping timeout: 250 seconds]
<orangey>
By way of disclaimer, I'm not very familiar with Ruby. I'm just trying to fix a little bug in discourse that I ran into. Currently, a JSON line attempts to open via GET, which doesn't work - it needs to be POST. This is the line: user_json = JSON.parse(open(user_json_url, 'Authorization' => "Bearer #{token}" ).read) . I've tried adding ".post" in every which place, but obvoiusly I have Ruby wrong..
kernerlke has joined #ruby
<orangey>
any thoughts as to how I might be able to move forward here?
skolman_ has joined #ruby
<orangey>
Needless to say I've filed bugs everywhere, but it seems so straightforward that I hope I can just figure it out and submit a pull.
moeabdol has joined #ruby
skolman_ has quit [Remote host closed the connection]
<jmarinelli>
orangey, open-uri only supports GET
the_drow has quit [Ping timeout: 260 seconds]
<orangey>
jmarinelli: damn.
<orangey>
jmarinelli: Any thoughts, then?
skolman_ has joined #ruby
Eiam_ has joined #ruby
<jmarinelli>
orangey look into HTTParty, or Net::HTTP if you don't want to add dependencies
<orangey>
OK
<havenwood>
orangey: You could use Net::HTTP from the stdlib but it's a bit unwieldy. I'd suggest HTTP.rb for a gem: https://github.com/httprb/http#readme
madgen has joined #ruby
sepp2k has joined #ruby
<havenwood>
orangey: gem install http
<orangey>
havenwood: Any experience with discourse?
mikecmpbll has quit [Ping timeout: 260 seconds]
<havenwood>
orangey: Yeah, why do you ask?
ramfjord has joined #ruby
panpainter has quit [Remote host closed the connection]
<orangey>
One of the things I'm having trouble with is that when I made edits inside the discourse docker, it doesn't 'update', so any edits I make to plugins need me to make them in git, and then './launcher rebuild app'
<orangey>
which is an expensive way to test small changes.
<orangey>
to add .post everywhere took me about an hour of rebuilding.
<orangey>
and I had to make forked repo of oauth2-basic
<havenwood>
orangey: That's Rails turf. The #rubyonrails channel is probably the best place to discuss.
<orangey>
havenwood: aha. OK.
the_drow has joined #ruby
<mustmodify>
I'm getting "undefined method 'sub' for #date" ... but I'm not using the method sub. It's in a case statement apparently. Anyone know what that method does to help me figure out what's going on?
agit0 has joined #ruby
the_drow has quit [Max SendQ exceeded]
<mustmodify>
ohhhh... got it.
the_drow has joined #ruby
the_drow has quit [Max SendQ exceeded]
nadir has joined #ruby
the_drow has joined #ruby
houhoulis has quit [Remote host closed the connection]
<havenwood>
jmarinelli: It does remind one of functional style doesn't it?
<wspider>
I try to install sass gem install sass ( or any other gem through ruby and it says ) ERROR: While executing gem ... (Errno::EINVAL) Invalid argument - sendto(2) for "0.2.4.1" port 53 , I wonder what would be the right approach
cjbottaro has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
skalfyfan has joined #ruby
<havenwood>
wspider: What version of RubyGems?: gem -v
flashpoint9 has quit [Remote host closed the connection]
cjbottaro has joined #ruby
fedexo has joined #ruby
<havenwood>
wspider: Behind a proxy?
flashpoint9 has joined #ruby
Don_John has joined #ruby
agit0 has quit [Ping timeout: 260 seconds]
<havenwood>
Stream.unfold/2**
weckl has quit [Remote host closed the connection]
Don_John has quit [Remote host closed the connection]
rbennacer has joined #ruby
wldcordeiro has quit [Ping timeout: 240 seconds]
jiblet has joined #ruby
tildes_ has joined #ruby
wldcordeiro has joined #ruby
Snowy has quit [Remote host closed the connection]
ta_ has quit [Read error: Connection reset by peer]
<orangey>
havenwood: #ROR doesn't seem to like the question there..
<orangey>
havenwood: Anyhow, I'll continue with the painful method for now until I figure it out.
<wspider>
havenwood: 2.5.1
<havenwood>
orangey: You're getting the runaround!
<orangey>
havenwood: OK, did some googling and I think I may have an answer..
<havenwood>
orangey: I think someone just didn't realize it was a Rails app. :)
panpainter has quit [Remote host closed the connection]
<orangey>
heh ; )
<wspider>
havenwood: oh, I am behind the school proxy, not sure if that could be it
ta_ has joined #ruby
<havenwood>
wspider: That's a fairly recent version. Hmm, "port 53"
<havenwood>
wspider: I suspect the proxy.
the_drow has quit [Ping timeout: 260 seconds]
the_drow has joined #ruby
<havenwood>
wspider: gem help install | grep proxy
gheegh has joined #ruby
skalfyfan has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
btiefert has joined #ruby
panpainter has joined #ruby
kernerlke has left #ruby [#ruby]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
robh71 has joined #ruby
<guardian>
can someone please give me a hand with rspec? I have code that does File.mv(foo, bar); File.rename(bar, baz)
<guardian>
under the hood, File.mv may call File.rename
Giorgio has joined #ruby
<guardian>
I'm only interested in testing File.rename(bar, baz) has been called once
<guardian>
which I try to express with expect(File).to have_received(:rename).with(anything, baz)
mikecmpbll has joined #ruby
Eiam_ has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
RegulationD has quit [Remote host closed the connection]
<guardian>
but then rspec still complains File.mv has called File.rename and that my argument constraints don't allow it
panpainter has quit [Ping timeout: 260 seconds]
<guardian>
any idea please?
freerobby has quit [Quit: Leaving.]
Cohedrin has joined #ruby
freerobby has joined #ruby
SilverKey has quit [Quit: Halted.]
the_drow has quit [Read error: Connection reset by peer]
bronson has joined #ruby
openstruct has joined #ruby
ss_much has joined #ruby
antgel has quit [Ping timeout: 265 seconds]
elaptics is now known as elaptics`away
akamal has joined #ruby
akamal_ has joined #ruby
fedexo has quit [Ping timeout: 276 seconds]
VeryBewitching has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
the_drow has joined #ruby
c_nick has joined #ruby
skalfyfan has joined #ruby
elaptics`away is now known as elaptics
lsmola has quit [Ping timeout: 244 seconds]
nadir has quit []
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fantazo has quit [Ping timeout: 244 seconds]
GinoMan2440_ has joined #ruby
arup_r has quit [Remote host closed the connection]
robh71 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<c_nick>
Hi.. i was trying to create a directory if its not existing FileUtils::mkdir_p '\\gerdata\test\quarter_2\april' but it kelt complaining \\gerdata\test already exists does it require all the directories to be absent or present ? like gerdata/test exists but others done will it work ?
ta_ has quit [Read error: Connection reset by peer]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<wspider>
havenwood: I will try again at home but a month ago or so I was able to use gem in the University without any problem
ravishankarjha has joined #ruby
tildes_ has quit [Ping timeout: 260 seconds]
hxegon is now known as hxegon_afk
janno has quit [Remote host closed the connection]
GinoMan2440 has quit [Ping timeout: 240 seconds]
<Fire-Dragon-DoL>
opinion request! NullObject patterh, NullObject#nil? true or false?
mustmodify has left #ruby [#ruby]
ta_ has joined #ruby
idefine has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
howard__ has joined #ruby
skalfyfan has quit [Ping timeout: 246 seconds]
<hanmac>
Fire-Dragon-DoL: i don't know your data structure but why not just return nil instead of such NullObject?
flashpoint9 has quit [Remote host closed the connection]
banister has joined #ruby
flashpoint9 has joined #ruby
hobodave_ has quit [Quit: Computer has gone to sleep.]
ravishankarjha has quit [Ping timeout: 240 seconds]
the_drow has quit [Read error: Connection reset by peer]
<Fire-Dragon-DoL>
hanmac: the purpose of the nullobject is to avoid too many `try` things, so it fits. We have nil, we are planning to introduce a nullobject to reduce all these checks
<Fire-Dragon-DoL>
hanmac: yes I said the `&` in the previous sentence
benlieb has joined #ruby
saneax_AFK is now known as saneax
<hanmac>
ok i thought you mean the older from with "obj & obj.method"
<Fire-Dragon-DoL>
hanmac: but you end up with stuff as ugly as client&.associated_contacts&.each which becomes a plain `safe_client.associated_contacts.each` with the null object
iaglium has quit [Remote host closed the connection]
<Fire-Dragon-DoL>
oh, no sorry for the misunderstanding
<hanmac>
hm but &. its still better than the other one because it got optimized by ruby
flashpoint9 has quit [Remote host closed the connection]
<ule>
Hey guys.. Can ask a haml question here?
mwlang has joined #ruby
<ule>
I'm trying to solve this problem: "undefined local variable or method 'foo' "
<ule>
I added this: - if foo.present?
the_drow has quit [Read error: Connection reset by peer]
wldcordeiro has quit [Ping timeout: 246 seconds]
<ule>
but didn't work.. so.. how can I set a default value or just verify if the variable exist on haml page?
the_drow has joined #ruby
ravishankarjha has joined #ruby
blandflakes has joined #ruby
crystal77 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
idefine has joined #ruby
flashpoint9 has joined #ruby
b|ackwolf has quit [Ping timeout: 276 seconds]
Moosashi has joined #ruby
devbug has joined #ruby
bronson has quit [Remote host closed the connection]
djbkd has joined #ruby
SilverKey has joined #ruby
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zacstewart has joined #ruby
the_drow has quit [Read error: Connection reset by peer]
madgen has quit [Ping timeout: 265 seconds]
zapata has quit [Quit: WeeChat 1.4]
idefine has quit [Ping timeout: 260 seconds]
zapata has joined #ruby
diegoaguilar has joined #ruby
diegoaguilar has quit [Max SendQ exceeded]
diegoaguilar has joined #ruby
apofis_ has quit [Ping timeout: 265 seconds]
jhack has quit [Quit: jhack]
panpainter has joined #ruby
dmr8 has quit [Quit: Leaving]
ta_ has quit [Read error: Connection reset by peer]
<havenwood>
ule: You have to define `foo` before calling it. It'll first look for a `foo` local variable, then for a `foo` method. You have neither defined in the current scope.
SilverKey has quit [Quit: Halted.]
elifoster has quit [Ping timeout: 276 seconds]
<ule>
the point is not if I'm defining or not
<ule>
I just want to have a default value just in case the variable doesn't exist
n008f4g_ has joined #ruby
<ule>
in php/twig/symfony I can just do foo|default('bar')
SilverKey has joined #ruby
ravishankarjha has quit []
chipotle has quit [Quit: cheerio]
<ule>
but anyways.. I just fixed my model to always pass the variable..
<apeiros>
that's the sensible way
<apeiros>
having to test for the existence of a local variable == you're doing it wrong.
patrick_star is now known as erlang_ebanat
<ule>
I see
<apeiros>
the way you would test it is via `defined? expression`
s00pcan has quit [Remote host closed the connection]
<ule>
apeiros: actually.. that makes tense
freerobby has joined #ruby
<ule>
yeah.. I was testint present? exist? empty?
<ule>
didn't test with defined?
<apeiros>
foo.present? means you call a method on foo. you can't call a method on foo if it doesn't exist
<ule>
exactly
<ule>
that's the point.. so.. what's the best way to see if foo exist?
<ule>
foo.nil?
<apeiros>
as said, the best is not having to test
apofis has joined #ruby
<apeiros>
and the only way to test for *existence* of a local variable is `defined?`
<ule>
ok
dikaio has joined #ruby
<apeiros>
oh actually in 2.3, you could also (ab)use Kernel#local_variables
ferr has joined #ruby
s00pcan has joined #ruby
alem0lars has joined #ruby
<ule>
so.. if anythingIwant.defined?
<apeiros>
dude
bluOxigen has joined #ruby
<apeiros>
skipped that "reading comprehension" part?
symm- has joined #ruby
<ule>
lol yeah.. I'll read that
<apeiros>
20:49 apeiros: the way you would test it is via `defined? expression`
nhhc has joined #ruby
Musashi007 has joined #ruby
nfk has joined #ruby
<ule>
- defined? ule
<ule>
worked
freerobby has quit [Ping timeout: 265 seconds]
<nfk>
i'm getting a really stupid error: bin/bundle:3:in `load': cannot load such file -- /usr/share/rubygems-integration/all/gems/bundler-1.7.4/bin/bundle (LoadError)
<hxegon_afk>
what are you trying to do ule?
<hxegon_afk>
err nfk, sorry.
<ule>
hxegon_afk: was trying to verify if a variable was defined from haml page
RubyRunner has joined #ruby
SCHAAP137 has quit [Quit: Leaving]
<nfk>
hxegon_afk, trying to run bin/bundle of a Rails project on Raspberry Pi
SCHAAP137 has joined #ruby
umdstu has quit [Quit: umdstu]
<nfk>
even weirder, if i omit bin/ in favour of just bundle it does work, after some raspberry delay
chipotle has joined #ruby
zacstewart has joined #ruby
whathapp_ has quit [Remote host closed the connection]
<ule>
ruby from raspberry? cool
<ule>
didn't know ruby is present on arm32 arquitecture
<nfk>
oh my god, if it hasn't gone wrong, this is redefining the meaning of slow
stannard has quit [Remote host closed the connection]
<nfk>
ule, why wouldn't it be?
mikecmpbll has joined #ruby
blaxter has joined #ruby
<nfk>
also, it's arm6fh or something for Raspberry Pi Model A/B whatever and some arm7 for Model 2/3
citizentwo has quit [Ping timeout: 276 seconds]
Lomex has joined #ruby
Devalo has joined #ruby
choke has joined #ruby
Moosashi has joined #ruby
d5sx43 has joined #ruby
futilegames has quit [Quit: futilegames]
citizentwo has joined #ruby
whathappens has joined #ruby
<nfk>
oh wow, i'm actually serving stuff!!!!!
nerium has quit [Quit: nerium]
swills has joined #ruby
roshanavand has quit [Quit: This computer has gone to sleep]
madgen has quit [Ping timeout: 260 seconds]
<nfk>
surprisingly in deployment mode nginx-unicorn is perhaps faster than webrick in development on a much, much more powerful rig
diegoaguilar has quit [Remote host closed the connection]
<nfk>
and there's still room for improvement
kirillow has joined #ruby
replay has joined #ruby
<kirillow>
i parsed the yaml in a textfile using yaml/psych. so theres a yaml object. now I want to return a specific entru. do i really have to dump the whole string and look manually???
<nfk>
it's well within acceptable performance levels, let's just hope it's like that also when someone connects from hundreds of km away
roshanavand has joined #ruby
GBrawl has quit [Ping timeout: 260 seconds]
blackmes1 has joined #ruby
futilegames has joined #ruby
tax has joined #ruby
last_staff has joined #ruby
<shevy>
hehe
<c_nick>
FileUtils vs Dir which one is better ?
<nfk>
FileUtils was *nix specific, wasn't it?
<shevy>
c_nick they do different tasks, but if you can, prefer Dir. FileUtils you have to require
jsaak has joined #ruby
<c_nick>
shevy: whats the difference
<shevy>
deleting a file can happen via File.delete() too for instance
<c_nick>
My purpose is to work with directories
<shevy>
.cp_r for instance, I don't think you have this in anywhere else but FileUtils
<nfk>
a quick grep shows that I'm using FileUtils.mv
<shevy>
FileUtils.mv() probably too
<nfk>
also, no require that I can see
<shevy>
hmmm are you sure you don't have to require it anymore? lemme try
RubyRunner has quit [Ping timeout: 250 seconds]
<c_nick>
nope if u r on Ruby 2.0.0 +
bronson has quit [Remote host closed the connection]
<nfk>
oh, that's because it's require 'fileutils' while the Module is FileUtils
Regulati_ has joined #ruby
<nfk>
and I grepped for File, natch'
<c_nick>
Fileutils.mkdir_p work for share drives ? //myshare
<c_nick>
it didnt seem to work
<shevy>
well you must use FileUtils not Fileutils
madgen has joined #ruby
<jiblet>
leave
jiblet has left #ruby [#ruby]
symm- has quit [Ping timeout: 260 seconds]
<nfk>
c_nick, it should not care for properly mounted POSIX paths
<shevy>
but otherwise, it will work, just like the unix command
<nfk>
as fo Windows, does it even work there? i thought it just invokes the command line stuff
<c_nick>
i am passing it //myshare/folder1/folder2/folder3 where folder3 is to be created..
<shevy>
it probably may work on windows too... I am not sure, have not used windows + ruby in years ... I remember it was confusing to work with these letter-drives c d e f...
<c_nick>
i think i need to gsub('/',"\\")
d5sx43 has quit [Quit: Leaving...]
<nfk>
i think you need to use a a real os but what do i know?
<c_nick>
lol windoze
RegulationD has quit [Ping timeout: 260 seconds]
<nfk>
c_nick, assuming you're on a real os (not windows) you can just mount that SMB share and then no proper tool will care that it's not a local media as it won't even know it
<nfk>
mount as in mount to be under some POSIX path
jenrzzz has joined #ruby
<c_nick>
hmm
<nfk>
i'm always amazed at how unwilling people can be to use the best solution
<smathy>
shadows, it's doing that because you have capturing parens in your regex.
<smathy>
...so each match contains multiple values, hence array of arrays.
SilverKey has quit [Quit: Halted.]
flashpoint9 has quit [Remote host closed the connection]
<shadows>
smathy: I was wondering, how to do sub-captures
<shadows>
I couldn't figure it out
ule has quit [Ping timeout: 250 seconds]
<smathy>
shadows, what's a *sub* capture?
ule has joined #ruby
tax has quit [Ping timeout: 252 seconds]
ule has quit [Changing host]
ule has joined #ruby
<smathy>
Wait a minute! If all you're interested in is the first element then you don't want .scan you just want .match
<shadows>
ha, well... without explaining in great length what I want to do, I'm trying to read the text output from a wireshark capture and take the three columns (byte offset, hex bytes, ascii representation) and then merge them to be one line of hex bytes followed by one line of ascii representation
FooMunki has joined #ruby
ramfjord has joined #ruby
speakingcode has joined #ruby
flashpoint9 has joined #ruby
hxegon_afk is now known as hxegon
_panpainter has joined #ruby
<shadows>
so "XXXX XX XX XX XX ....\nXXXX XX XX .." => ["XX XX XX XX XX XX", "......"]
mdw has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<shadows>
each one of these multi-line blocks is preceeded by "some label (NN bytes):\n"
panpainter has quit [Ping timeout: 240 seconds]
<shadows>
I want to keep that all together; I have to do it like this because none of the other wireshark exports have both the label and the byte output... XML has the label but no bytes, and C header output has the bytes but not the labels. headache time.
Devalo has quit [Remote host closed the connection]
<smathy>
shadows, right, but .scan(...)[0] is always just going to be the first match, ie. (essentially) the same as .match(...)
<shadows>
smathy: hmm
<shadows>
.match(...) doesn't give me the captures, I think
htmldrum has joined #ruby
<smathy>
It does, just in [1]... on.
<smathy>
[0] is the whole match.
sneakerhax has joined #ruby
flashpoint9 has quit [Ping timeout: 260 seconds]
<shadows>
ah
diegoaguilar has joined #ruby
<shadows>
will try
diegoviola has quit [Ping timeout: 244 seconds]
cdg has quit []
<smathy>
shadows, also in the .captures method of what's returned.
johnmilton has quit [Remote host closed the connection]
<smathy>
Ok, but you're not taking the [0] there right? You're grabbing the whole .scan
<shadows>
yeah
rodfersou has quit [Quit: leaving]
<smathy>
Right, because your regex only matches a single line of that input.
saneax is now known as saneax_AFK
<smathy>
...so that seems workable except you're capturing the ASCII too, did you want that?
<shadows>
I could re-implement it myself but yeah I'd like to unwind the ascii outputs
<smathy>
Ok cool, so you're golden then right? Well done.
<shadows>
no, that's the output I want ;) haven't got there yet
GinoMan2440_ has quit [Ping timeout: 244 seconds]
millerti has quit [Client Quit]
ta_ has joined #ruby
TheHodge has quit [Quit: Connection closed for inactivity]
skolman_ has joined #ruby
duncannz has joined #ruby
<shadows>
workflow-wise should I do this line-by-line with some temporaries or should I be grabbing each "Label (xx bytes):\n\h{4} (\s?\h\h)+ (.)+\n"... ?
n008f4g_ has quit [Ping timeout: 244 seconds]
rkazak has quit [Ping timeout: 260 seconds]
phpwebdev has joined #ruby
_panpainter has quit [Remote host closed the connection]
<shadows>
smathy: i.e. a regex to capture line 5 to line 10, line 11 to line 12; within each of those captures could I further have sub-captures that split up the label, the addr, hex, ascii ? or is that not how it works
<smathy>
It will be hard to do the whole lot in a single regex, I'd probably use the flip flop operator.
kirillow has joined #ruby
<shadows>
hmm
<shadows>
flip-flop?
panpainter has joined #ruby
<smathy>
Same as Perl's.
<smathy>
...except there's no implicit receiver for a regex.
<shadows>
looking now, thanks
<smathy>
...so `if line =~ /^your start/ .. line =~ /the end/`
n_blownapart has quit []
<shadows>
ah
<shadows>
that hurts the brain. awesome.
haylon has quit [Quit: WeeChat 1.4]
<smathy>
Yeah, only trick will be fiddling with the end marker, because it can be the same as the start marker for the next one.
<shadows>
yes
apofis has quit [Ping timeout: 260 seconds]
<shadows>
verifying that I haven't missed some nifty trick or thing that would make this easier hmm
ldnunes has quit [Quit: Leaving]
<shadows>
smathy: /end/ could have a negative look-ahead maybe
<shadows>
that's totally new to me and interesting
skolman_ has quit [Read error: Connection reset by peer]
<smathy>
shadows, that won't work for a block that's precisely divisible by 10.
Moosashi has joined #ruby
Nanuq has quit [Ping timeout: 268 seconds]
skolman_ has joined #ruby
skolman_ has quit [Read error: Connection reset by peer]
panpainter has quit [Ping timeout: 276 seconds]
<smathy>
...obviously you could also just do it line-by-line and have some logic to move to the next block when a new "header" is discovered, that might be easier in this case.
7GHAAZFU8 has joined #ruby
<smathy>
...same thing as flip flop, but with your own switch basically, like `within_block = false` that you switch yourself.
duncannz has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
citizentwo has joined #ruby
tax has joined #ruby
whathappens has joined #ruby
Nightwolf_ has quit [Quit: Page closed]
n_blownapart has joined #ruby
banister has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
rbennacer has quit [Ping timeout: 250 seconds]
diegoviola has joined #ruby
tvon has quit [Quit: System is sleeping...]
diegoviola has quit [Changing host]
diegoviola has joined #ruby
n_blownapart has quit [Client Quit]
dikaio has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zotherstupidguy has quit [Ping timeout: 260 seconds]
ta_ has joined #ruby
zotherstupidguy has joined #ruby
jmarinelli has quit [Ping timeout: 276 seconds]
cpruitt has joined #ruby
<shadows>
smathy: yeah... part of capturing undefined N lines of a group
<smathy>
Ok, just that you are capturing, so if you're not seeing that then maybe you've `?:`ed the wrong bits.
hobodave has joined #ruby
ChiefAlexander has quit [Quit: Leaving...]
whathappens has quit [Remote host closed the connection]
mdw has quit [Quit: Sleeping Zzzzz]
kareeoleez has joined #ruby
n_blownapart has joined #ruby
stannard has joined #ruby
tvon has joined #ruby
j2k has quit [Quit: bai]
stannard has quit [Remote host closed the connection]
j2k has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
swills has quit [Ping timeout: 250 seconds]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dikaio has joined #ruby
jmarinelli has joined #ruby
whathappens has joined #ruby
yfeldblum has joined #ruby
dikaio has quit [Client Quit]
dikaio has joined #ruby
Musashi007 has joined #ruby
madgen has quit [Ping timeout: 260 seconds]
GodFather has joined #ruby
FooMunki has joined #ruby
whathappens has quit [Remote host closed the connection]
n008f4g_ has joined #ruby
codecop has quit [Remote host closed the connection]
Leok12 has joined #ruby
whathappens has joined #ruby
ciacci1234 has joined #ruby
jmarinelli has quit [Ping timeout: 276 seconds]
pawnbox has joined #ruby
<Leok12>
Hello is there someway to call a method inside a string, but only on specific words, I want to use the cloroize gem and some words to have color
7GHAAZFU8 has quit [Read error: Connection reset by peer]
skolman has joined #ruby
kareeoleez has quit [Remote host closed the connection]
<smathy>
Leok12, so you mean color some of the words in a string?
skolman has quit [Read error: Connection reset by peer]