<jen_>
for this Google API, would they need this site doing the server call to have an SSL cert?
<nickjj>
what's the syntax to do something like: arr.collect(&:strip, &:downcase) ?
tkuchiki has quit [Ping timeout: 265 seconds]
<nickjj>
am i stuck having to chain .collect?
<jhass>
nickjj: no abbreviation possible, do arr.map {|item| item.strip.downcase }
sevvie has quit [Ping timeout: 264 seconds]
<nickjj>
jhass, ah good idea. thanks
tkuchiki has joined #ruby
Feyn has joined #ruby
lkba has quit [Read error: Connection reset by peer]
baweaver has quit [Remote host closed the connection]
a5i has quit [Quit: Connection closed for inactivity]
lkba has joined #ruby
meatherly has quit [Remote host closed the connection]
deric_skibotn has joined #ruby
red_horned_rihno has quit [Ping timeout: 264 seconds]
<jhass>
nickjj: that's the normal syntax &:foo is the shortcut ;)
<jhass>
jen_: this one is hard without knowing what you're actually doing
scripore has joined #ruby
<nickjj>
jhass, so then i could just use .collect still?
<nickjj>
with the non-shortcut variant
<havenwood>
nickjj: or `arr.map(&:strip).map(&:downcase)`, can fit two #map in a #collect :P
Motoservo has joined #ruby
<havenwood>
if you don't mind the performance hit
<jhass>
nickjj: collect and map are aliases
segmond has joined #ruby
<jhass>
havenwood: that's actually longer than writing it out :P
<nickjj>
the source code is identical?
tkuchiki has quit [Ping timeout: 256 seconds]
<jhass>
calling .collect or .map makes no difference
<havenwood>
aliases
<jhass>
it's the same method, just under different names
<havenwood>
nickjj: most folk use map
mjuszczak has joined #ruby
<nickjj>
ok, i thought it would have been marked as an alias in the docs
<nickjj>
unless i missed it somehow
<jhass>
I think it is?
mjuszczak has quit [Client Quit]
<jhass>
wow, not really
<jhass>
that's dumb
<nickjj>
yeah i was looking for a supplemental note
<jen_>
jhass and havenwood . This application is suppose to send gclid values back to Google via the Adwords API. Gclid values are passed back to our database after a successful transaction occurs.
freerobby has joined #ruby
<nickjj>
it's some blindingly massive yellow box that tells you it's an alias
Pupeno has quit [Remote host closed the connection]
djbkd has joined #ruby
<jhass>
jen_: well, you have a rather lowlevel issue, so the what isn't as interesting as the how actually
<havenwood>
nickjj: a diff of the source shows Array#map and Array#collect are indeed identical
<jen_>
The data is reporting back to us okay, but sending it out back to Google is where we are having issues.
rushed has quit [Quit: rushed]
Pupeno has joined #ruby
<jhass>
jen_: like, why it's connecting to localhost via https and why what ever is listening there returns an invalid cert
<nickjj>
map wins then, more commonly used and less characters
<jhass>
nickjj: totally ;D
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
the .collect'ors are insane people :P
<havenwood>
same with Enumerable#map and Enumerable#collect
<havenwood>
identical
<centrx>
also Set#map and Set#collect
<centrx>
identical
<havenwood>
map!
Hirzu has joined #ruby
<havenwood>
centrx: the non bang ones are Enumerable i think
tunaCanBruh has quit [Ping timeout: 255 seconds]
<havenwood>
ha, and Set#map! and Set#collect! explicitly state they're aliases in the docs
<jhass>
consistency ftw!
<jhass>
I think I'll sneak a deprecation warning for collect into one of my gems
w0rldmaker has quit [Ping timeout: 245 seconds]
<nickjj>
jhass, yeah or redefine it to do something else entirely
<blackmesa>
hi all. Is it possible to create string of this format include AASM
segmond has joined #ruby
<dopie>
can i rewrite the if satement like that?
oo_ has quit [Remote host closed the connection]
<jhass>
dopie: no. What do you think defined? does?
<jen_>
jhass: comment out everything in there?
w0rldmaker has quit [Ping timeout: 245 seconds]
<jen_>
notifier.rb
<jhass>
jen_: no, just change def send_mail? to always return false
<dopie>
check to see if an expression is defined or not
<jhass>
and what does defined mean to you?
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Senjai>
vhlfd: certainly not
<jen_>
so replace line 8 with return false ?
<Senjai>
:P
<dopie>
Check to see if the variable has something in it
<blackmesa>
sry. "A1A" to "D6F". all combinations to "D6F", which is the maximum. Ive used [*A..Z] before for generating an array of string "A" to "Z". I wonder if there something for similar
<dopie>
hsa a value
<jhass>
dopie: when wouldn't it?
<skaag>
what's a good way to measure how long an operation takes in ruby?
<skaag>
I need to measure it in milliseconds
<dopie>
it wouldnt when its nil or empty
<dopie>
no?
<jhass>
no
<jhass>
nil is a value and a variable that has nil assigned is defined
lordkryss has quit [Quit: Connection closed for inactivity]
<jhass>
what your definition of empty? is I don't know
sevvie has quit [Ping timeout: 265 seconds]
<jhass>
anyway, to suggest a better way to write this, we would need to know what the heck approved contains
<jhass>
jen_: to actually answer the question, since your Gemfile has no restrictions on that gem, just bundle update google-adwords-api
<jen_>
ok, changing to https
Jetchisel has joined #ruby
<dopie>
approved contains either true or false
<jen_>
do bundle update .....
odigity has quit [Ping timeout: 256 seconds]
<jhass>
dopie: no, the outer one, on which you're able to call each
commmmodo has joined #ruby
<jen_>
and then do bundle install again?
<havenwood>
jen_: That's update *all* gems possibly, while the command jhass said just updates the one. Doing `bundle update` basically nukes your Gemfile.lock.
Qladstone has quit [Ping timeout: 264 seconds]
<jen_>
i just did bundle update google-adwords-api
<havenwood>
jen_: then: bundle
<havenwood>
or `bundle install` if you like typing extra letters
<jhass>
uh, well, bundle update does install already ;)
bayed has quit [Quit: Connection closed for inactivity]
<havenwood>
jen_: no, fix the OpenSSL issues - don't http
<jhass>
jen_: no, that one is unrelated to the Gemfile
<Senjai>
dopie: That is painful :(
mudtose has joined #ruby
<dopie>
Senjai, I am sorry that is what im trying to improve
<dopie>
I am a novice rubyist and have to learn
<jen_>
so keep it https
<jen_>
do I need an SSL cert on the domain for this script
<Senjai>
dopie: For starters, you cannot render more than once per action
<Senjai>
unless your looking for the first receipt that is confirmed but not arpproved
<havenwood>
jen_: with RVM you can drop the `bundle exec` prefix from commands, it'll automatically prefix it when there's a Gemfile present
<Senjai>
but it doesnt mater because you dont change the state at all
<jhass>
jen_: well, it might indeed be better to hire a dev who's capable to debug this stuff on the actual environment :/
<Senjai>
dopie: You may also want to look at #rubyonrails
<jhass>
since guess this remote gets increasingly hard
<jhass>
*guessing
<jen_>
Senjai: was going to do this with me in 40 min.
yfeldblum has quit [Remote host closed the connection]
<havenwood>
jen_: What OS/distro are you on, I don't recall?
ghostpl_ has quit [Ping timeout: 250 seconds]
<jen_>
CentOS
<jhass>
dopie: is the methods intention really to ever only look at the first receipt?
Macaveli has quit [Ping timeout: 252 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
jen_: yum install ca-certificates
<jhass>
Senjai: there are ugly and return's in there
<jhass>
so it's a convoluted .first for the moment
<jen_>
from root havenwood
giuseppesolinas has joined #ruby
<havenwood>
jen_: ya
<havenwood>
jen_: escalate permissions however you prefer
<havenwood>
elevate*
<dopie>
jhass, no it looks at all receipts
<havenwood>
escalators or elevators?
<jhass>
dopie: no
<dopie>
err wait
<jhass>
dopie: that may be your intention, but it's not what it does
<dopie>
yes sorry
<dopie>
it looks at the first receipt and see's if its paid
<Senjai>
jhass: Yeah, I noticed after reading it the second time
<jhass>
and that's the intention still?
<jhass>
Senjai: why i hate and/or for control flow :P
<Qladston_>
hello
<Qladston_>
if I want to access and evaluate the individual characters of a string
<Senjai>
dopie: You dont understand the problem correctly. Say aloud, in words what the problem is, and then how you'll fix it
<Qladston_>
.split('') is the best way?
<Senjai>
you'll note your code does something incredibly more obtuse than the verbal solution
<havenwood>
jen_: Also confirm that your .gemrc has https not http: cat ~/.gemrc
<jhass>
Qladston_: .each_char/.chars
<havenwood>
no http!
<ponga>
uh oh
<ponga>
i was going to answer but jhass already did so
<ponga>
;)
<Qladston_>
does that do the same operation?
<ponga>
Qladston_: "Hello world".each_char do |c| your code with c end
<ponga>
i believe this is it
<jen_>
havenwood: gem: --no-ri --no-rdoc
nii236 has joined #ruby
w0rldmaker has quit [Ping timeout: 240 seconds]
<jhass>
Qladston_: .each_char takes a block and yield each character, without a block it returns an Enumerator. .chars returns an array of the characters
<havenwood>
Qladston_: #chars returns the same Array, but #each_char returns an Enumerator
tmtwd has joined #ruby
senayar has joined #ruby
rushed has quit [Quit: rushed]
skj3gg has joined #ruby
<jhass>
dopie: still waiting for clarification what the methods intention is :)
_maes_ has quit [Ping timeout: 246 seconds]
<havenwood>
jen_: these days `--no-ri --no-rdoc` is `--no-document`
<Qladston_>
hmm
<jen_>
so does this mean that file does not exist?
<havenwood>
jen_: but yeah, no problems there
zachrab has joined #ruby
odigity has joined #ruby
<havenwood>
jen_: it's fine, try installing a gem after the package install
segmond has joined #ruby
<Qladston_>
which is more efficient? if I don't need an array, only if it is a means to examine the characters by referencing to a hash
nii236 has quit [Client Quit]
<Qladston_>
the hash has keys which are characters in symbols
<ponga>
Qladston_: if not wanting seperate array i'd say each_char is good enough
Spooner_ has quit [Remote host closed the connection]
StoneCypher has quit [Read error: Connection reset by peer]
reinaldob has quit [Ping timeout: 244 seconds]
StoneCypher has joined #ruby
unreal_ has quit [Ping timeout: 265 seconds]
bim has quit [Remote host closed the connection]
Mon_Ouie has quit [Ping timeout: 265 seconds]
senayar has quit []
davejacobs has joined #ruby
Pupeno has quit [Ping timeout: 265 seconds]
mois3x has quit [Quit: mois3x]
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
MatthewsFace has joined #ruby
abuzze_ has joined #ruby
davejacobs has quit [Ping timeout: 252 seconds]
<a5i>
is JRuby Ruby syntax?
<a5i>
im kinda confused
<headius>
jruby is just ruby on the jvm
wallerdev has quit [Quit: wallerdev]
amclain has joined #ruby
abuzze has quit [Ping timeout: 250 seconds]
<a5i>
Oh Okay
thumpba__ has quit [Remote host closed the connection]
<jhass>
Ruby the language has several implementations (=programs that interpret and execute it), most popular MRI (aka CRuby, aka the main one), JRuby and Rubinius
sevenseacat has joined #ruby
<a5i>
JRuby seems to be the fastest
segmond has quit [Ping timeout: 256 seconds]
phutchins has quit [Ping timeout: 244 seconds]
jaequery has joined #ruby
jaequery has quit [Max SendQ exceeded]
<headius>
we've worked hard to make it so
<vhlfd>
;p
esasse has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<vhlfd>
I wonder if there's pyruby.
jaequery has joined #ruby
<jhass>
vhlfd: topaz
<miah>
there are 2 pyrubies
<a5i>
LOL?
<vhlfd>
Oh dear.
<headius>
topaz is out there but no longer developed
<throstur>
I have a ruby script that works on linux, but when I run it on windows I can't find my device (it's on wifi)... what does windows do that could be blocking it?
n80 has quit [Quit: n80]
<jhass>
and that's all I can find, miah got any link?
freerobby has joined #ruby
<jhass>
throstur: more details!
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<throstur>
jhass: erm... ruby gem lifx-console doesn't detect a device when run on Windows 7 Ruby 2.1.5, works Arch Linux Ruby 2.2
jherbst has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shtirlic has joined #ruby
Biohazard has joined #ruby
Biohazard is now known as Guest3892
tunaCanBruh has quit [Ping timeout: 245 seconds]
<a5i>
Ermegaherd
zacstewart has quit [Remote host closed the connection]
Guest23651 has quit [Ping timeout: 252 seconds]
<jhass>
a5i: btw, random benchmarks are usually useless, you can benchmark specific alternative for a specific usecase, but not general "X is better than Y"
tacotaco_ has joined #ruby
hmnhf has joined #ruby
omosoj has quit [Ping timeout: 246 seconds]
n80 has joined #ruby
<a5i>
jhass ?
<a5i>
not really compiling u
<shevy>
I would compile jhass any minute
GnuYawk has quit [Quit: WeeChat 1.0]
<jhass>
shevy: I do not compile well without package managers
GnuYawk has joined #ruby
segmond has quit [Ping timeout: 264 seconds]
<shevy>
haha
omosoj has joined #ruby
jonr22 has quit [Remote host closed the connection]
<jhass>
a5i: like in the json example you linked, that info is not relevant unless you know that your specific application needs fast json handling (note I'm not even saying any JSON handling at all, but whether you need fast one) and it does not say whether the fast alternative fits well into all other aspects you need
<jhass>
a5i: there's nothing general we can learn from it
<a5i>
what about plain text jhass ?
fryguy9 has joined #ruby
<jhass>
it's only helpful when we have a specific usecase and put different factors against each other
<throstur>
jhass: playing with sockets in ruby seems to work on windows, I wonder why it won't find the device
symbol_ has joined #ruby
<jhass>
throstur: not saying sockets don't work, I'd worry the specific opts used are supported/have any effect or even the same effect
<throstur>
jhass: does it help if you see the packet from the light bulb?
zachrab has quit [Read error: Connection reset by peer]
<jhass>
shevy: so "foo\u00adbar" says display "foobar" when in the sameline, "foo-\nbar" if you have to break the word
<jhass>
throstur: so looks like the script is sending it out, might be a stupid windows firewall thing that filters it out? dunno
<jhass>
or that hides the reply to the broadcast
ParmesanCaesar has quit [Ping timeout: 250 seconds]
zachrab has joined #ruby
<jhass>
throstur: not sure, I don't work with windows after all
justin_pdx has quit [Quit: justin_pdx]
freerobby has quit [Quit: Leaving.]
fabrice31 has joined #ruby
zachrab_ has joined #ruby
zachrab has quit [Read error: Connection reset by peer]
<throstur>
jhass: I'm getting a lot of packets to/from microsoft
<throstur>
jhass: any idea how to filter them?
<jhass>
depends
<jhass>
microsoft is no protocol
zachrab_ has quit [Remote host closed the connection]
<jhass>
nor an ip nor a port
nettoweb has joined #ruby
<jhass>
so what kind of packets?
<throstur>
some kind of ndm-requester packets
swgillespie has joined #ruby
<jhass>
a bit vague
zachrab has joined #ruby
<jhass>
ndmp seems to be a valid protocol
justin_pdx has joined #ruby
zachrab has quit [Remote host closed the connection]
<throstur>
jhass: what info can I give you
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
screenshot of the packet if everything else fails
<jhass>
but maybe you can just filter on a common destination ip or port?
zachrab has joined #ruby
fabrice31 has quit [Ping timeout: 246 seconds]
tgunr has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
segmond has joined #ruby
ParmesanCaesar has joined #ruby
<jhass>
udp destination port is udp.dstport, destination ip is ip.dst, you can filter out specific values with simple != 12456 stuff
joshbamboo1 has quit [Quit: Leaving]
<throstur>
jhass: looks like windows machine sends packet to 1.255 but doesn't get a reply
<throstur>
when I send from linux 192.168.1.255 answers
wldcordeiro has quit [Ping timeout: 256 seconds]
<jhass>
yeah, so the question is whether it doesn't get an answer or it just doesn't see it (some firewall filters it out)
willharrison has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zachrab has quit [Ping timeout: 246 seconds]
<jhass>
or rather whether it actually leaves the machine in the first case
<throstur>
jhass: windows machine sees the packet that is sent to the laptop, so it should see an identical one sent to itself -- what if firewall is blocking outgoing connection?
shadoi has quit [Quit: Leaving.]
<Rennex>
anyone here knowledgeable about testing? it seems to me that rspec, test::unit, minitest, shoulda all have TERRIBLE syntax, and cucumber is just stupidly verbose. Bacon looks usable to me though. But is it stupid to use that these days? Or is there something even better?
<jhass>
yeah, that's what I meant, either the outgoing broadcast is filtered or the incoming one
Sawbones has quit [Remote host closed the connection]
<jhass>
throstur: did you try general "lifx found from windows" google searches btw?
<jhass>
*not found
triple_b has joined #ruby
<jhass>
or is there any other windows software for which it works maybe?
<jhass>
in the later case comparing the sent packet would be interesting
nateberkopec has quit [Quit: Leaving...]
dfinninger has joined #ruby
Aswebb_ has joined #ruby
vozcelik has joined #ruby
oo_ has quit [Remote host closed the connection]
Sawbones has joined #ruby
<throstur>
I can't get the other tools to work either
<throstur>
send packets but not found
ParmesanCaesar has quit [Ping timeout: 250 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vozcelik has quit [Client Quit]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
throstur: so your linux lap and your windows box are on the same network (same subnet)? If so, does the linux box see the broadcast packet generated by the windows box? if so does the windows box see the broadcast package generated by the linux box? if so does the linux box see a reply packet to the broadcast package generated by the windows box? or does the windows box see a reply packet to the broadcast
<jhass>
package generated by the linux box?
<throstur>
ok time to figure out how to use wireshark-cli :p
<jhass>
uh, maybe not :P
Soda has quit [Remote host closed the connection]
jaequery has joined #ruby
<jhass>
though you had GUI on both :)
<jhass>
*thought
Aswebb_ has quit [Ping timeout: 272 seconds]
zyxelthrone has quit [Ping timeout: 272 seconds]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<throstur>
I can fetch the linux one
ghr has joined #ruby
<jhass>
well, GUI-less linux to GUI linux would be easy w/ ssh
zacstewart has joined #ruby
<jhass>
you just ssh -X to the GUI less one and can start gui programs
segmond has quit [Ping timeout: 256 seconds]
bofh has joined #ruby
bofh has left #ruby [#ruby]
<jhass>
windows makes everything harder :P
LiquidInsect has quit [Quit: leaving]
<shevy>
you can play games on windows!!!
LiquidInsect has joined #ruby
LiquidInsect has quit [Client Quit]
<throstur>
I don't even know what my wireshark-gtk binary is called
<jhass>
shevy: I played through half life on linux. Without using wine
<jhass>
just wireshark I think
jtdowney has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
threh has quit [Ping timeout: 246 seconds]
LiquidInsect has joined #ruby
<throstur>
yeah should've guessed
<throstur>
zsh didn't autocomplete :p
<jhass>
rehash ^^
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sankaber has joined #ruby
elfuego has quit [Quit: elfuego]
ghr has quit [Ping timeout: 255 seconds]
<throstur>
jhass: the linux box sees the same packet as the windows box being sent from windows to router
threh has joined #ruby
<jhass>
but there's no reply on either?
<throstur>
I ran it three times in a row and the light bulb finally replied
<throstur>
maybe it just... takes longer?
<jhass>
huh
<jhass>
mmh, maybe, weird though
<jhass>
the lightbulb is wireless too I guess?
<throstur>
yes
<jhass>
maybe your router is just bad at routing broadcasts lan -> wireless
bigmac_ has quit [Ping timeout: 252 seconds]
<throstur>
jhass: is there a way to check that?
<jhass>
probably but I don't know
ParmesanCaesar has joined #ruby
<throstur>
the destination port is different in the packets
<jhass>
oh? mh
<throstur>
linux tries 56700 windows tries 56721
<jhass>
interesting
<throstur>
it's actually connected now but sending to 57621
<jhass>
it's still pushing all traffic over broadcast?
jen_ has quit [Quit: jen_]
<jhass>
(255.255.255.255)
threh has quit [Ping timeout: 246 seconds]
<throstur>
jhass: ithe windows client is only sending to 192.168.1.255
<jhass>
oh, right, subnet broadcast
MatthewsFace has quit [Ping timeout: 264 seconds]
<jhass>
so broadcast vs multicast? mmh might explain the difference
<jhass>
also seems to suggest the broadcast sockopt is indeed having no effect on windows :)
<throstur>
I think it's the port though
segmond has joined #ruby
<jhass>
it's all udp still though, no?
<throstur>
the reply from the light bulb is a "STUN" message
<shevy>
hmm collections have .first and .last
<jhass>
so unless the protocol is somehthing funky, reusing the port should be no problem
<shevy>
not .second I suppose?
<jhass>
STUN is a layer above I think
<jhass>
click the packet to see all layers
<jhass>
shevy: rails adds .second iirc
<shevy>
jhass does crystal have .second?
<jhass>
don't think so
segmond has quit [Max SendQ exceeded]
martinbmadsen has joined #ruby
segmond has joined #ruby
<jhass>
throstur: anyway, I kind of doubt port, reusing the port on udp should be no problem unless the protocol is doing something funky, as said, and tcp connections are unique by {srcip, srcport, dstip, dstport}
Vile` has quit [Ping timeout: 264 seconds]
<throstur>
jhass: but it's sending to destination port 56721 instead of 56700
Pupeno has joined #ruby
<jhass>
yeah, that seems silly
<jhass>
but I can't be bothered to dig further into the protocol or gem tbh :P
<shevy>
why not!
<shevy>
you have a lot of time!!!
<jhass>
might even have to do with broadcast vs multicast, I don't know
<jhass>
I think the discovery issues come from ^
<jhass>
shevy: that I could spend on writing crystal instead!
<shevy>
that also is a better programming language
cjim has joined #ruby
segmond has quit [Ping timeout: 245 seconds]
<jhass>
<shevy>
all the languages that were developed in the past, happened out of natural communication with human beings
<shevy>
they aren't really efficient for a computer
<jhass>
<shevy>
I don't see what you are typing there either jhass
braincrash has joined #ruby
<jhass>
shevy: must be sad to be you then
<shevy>
dunno
<shevy>
I feel everything is very simple
<ponga>
shevy: im doing similar kind
threh has quit [Ping timeout: 246 seconds]
<ponga>
better natural language
<throstur>
bah, I'll file a bug report, they can report it upstream to ruby if it's not their own issue
<shevy>
ponga english is simpler than german :)
<ponga>
uh all yorop langs look crap to me anyway
<shevy>
well, the pronounciation is a bit strange
<throstur>
jhass: do you think I should report a bug to ruby myself?
sevvie has quit [Ping timeout: 264 seconds]
<jhass>
throstur: nope
<jhass>
:P
<shevy>
UK english vs. US english, like "colour" vs. "color"
<throstur>
fair enough, it's bed time then and thanks for the help
<ponga>
shevy: i think trunk looks more like a trunk than a boot
<ponga>
but i say boot
Megtastique has quit []
starless has quit [Quit: Leaving]
^Denis has quit [Remote host closed the connection]
throstur has quit [Quit: WeeChat 1.1.1]
mistermocha has joined #ruby
omosoj has quit [Ping timeout: 252 seconds]
Pupeno has joined #ruby
sivsushruth has quit [Ping timeout: 246 seconds]
flip_digits has quit [Remote host closed the connection]
duncannz has joined #ruby
omosoj has joined #ruby
sivsushruth has joined #ruby
ghr has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sevvie has joined #ruby
shmoon_ has quit [Remote host closed the connection]
zachrab has joined #ruby
joset has joined #ruby
tunaCanBruh has joined #ruby
Sawbones has quit [Remote host closed the connection]
Megtastique has joined #ruby
Pupeno has quit [Ping timeout: 272 seconds]
jtdowney has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Megtastique has quit [Client Quit]
Cache_Money has joined #ruby
ghr has quit [Ping timeout: 240 seconds]
cjim has quit [Quit: (null)]
bigmac has quit [Ping timeout: 252 seconds]
segmond has joined #ruby
Channel6 has joined #ruby
ParmesanCaesar has quit [Ping timeout: 256 seconds]
zachrab has quit [Ping timeout: 245 seconds]
_5kg has quit [Ping timeout: 250 seconds]
tunaCanBruh has quit [Ping timeout: 246 seconds]
catmanbun has joined #ruby
w0rldmaker has joined #ruby
oo_ has joined #ruby
iamjarvo has joined #ruby
JDiPierro has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
<ponga>
shevy: do you believe that there can be one better explicit human language
iamjarvo has joined #ruby
<shevy>
dunno
<ponga>
that could better fit in computer era
<shevy>
languages always change by usage
<shevy>
but computers also change humans, see smartphones and tablets
havenwood has quit []
jonr22 has joined #ruby
adriancb has quit [Remote host closed the connection]
pwnz0r has quit [Remote host closed the connection]
pwnz0r has joined #ruby
jonr22 has quit [Ping timeout: 256 seconds]
nevans has quit [Quit: good bye]
bruno- has joined #ruby
swgillespie has joined #ruby
pwnz0r has quit [Ping timeout: 240 seconds]
segmond has quit [Ping timeout: 246 seconds]
davedev24_ has quit []
bigmac has joined #ruby
bruno- has quit [Ping timeout: 246 seconds]
<shevy>
what is a simple way to go from
<shevy>
"foobar-1.0.tar.xz" to "foobar-1.0"?
<shevy>
just .gsub?
juanpablo_ has joined #ruby
kyb3r_ has joined #ruby
<shevy>
or is there something better
thumpba has joined #ruby
rhg135 is now known as rhg135|XX
RegulationD has joined #ruby
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
<jhass>
shevy: .split on . ?
<jhass>
File.basename with second ard?
<jhass>
*arg
x1337807x has joined #ruby
krz has quit [Ping timeout: 250 seconds]
bigmac has quit [Read error: Connection reset by peer]
bigmac has joined #ruby
<shevy>
aha
juanpablo_ has quit [Ping timeout: 245 seconds]
shadoi has joined #ruby
RegulationD has quit [Ping timeout: 244 seconds]
wldcordeiro has joined #ruby
ParmesanCaesar has joined #ruby
mary5030 has quit [Remote host closed the connection]
Cache_Money has quit [Quit: Cache_Money]
xploshioon has joined #ruby
<ponga>
=> ["foobar-1", "0", "tar", "xz"]
<ponga>
;(
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
livingstn has quit []
swgillespie has joined #ruby
omosoj has quit [Quit: leaving]
reinaldob has joined #ruby
segmond has joined #ruby
wldcordeiro has quit [Ping timeout: 256 seconds]
hmnhf has joined #ruby
<shevy>
ponga!
<shevy>
too much java in you
reinaldob has quit [Ping timeout: 245 seconds]
bim has joined #ruby
JBreit has joined #ruby
lkba_ has joined #ruby
JBreit has quit [Read error: Connection reset by peer]
<Qladstone>
hello friends
<Qladstone>
I have a question about binary search trees
<Qladstone>
how does a binary search tree perform compared to a regular sorted array? In terms of binary search / insert operations
<Qladstone>
I'll be implementing it in Ruby
nii236_ has joined #ruby
bim has quit [Ping timeout: 256 seconds]
dfinninger has quit [Remote host closed the connection]
lkba has quit [Ping timeout: 252 seconds]
segmond has quit [Ping timeout: 272 seconds]
tejasmanohar has joined #ruby
<tejasmanohar>
anyone here use capybara on an arch linux box
aewffwea has quit [Ping timeout: 252 seconds]
x1337807x has quit [Ping timeout: 244 seconds]
hmnhf has quit [Ping timeout: 245 seconds]
skj3gg has joined #ruby
nii236 has quit [Ping timeout: 272 seconds]
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Hirzu has joined #ruby
x1337807x has joined #ruby
fabrice31 has joined #ruby
charliesome has quit [Quit: zzz]
bigmac has quit [Ping timeout: 246 seconds]
skj3gg has quit [Client Quit]
Wolland has joined #ruby
sivsushruth has quit [Ping timeout: 256 seconds]
martinbm1dsen has joined #ruby
sivsushruth has joined #ruby
martinbmadsen has quit [Ping timeout: 255 seconds]
fabrice31 has quit [Ping timeout: 246 seconds]
oki has joined #ruby
_5kg has joined #ruby
<nahtnam>
I have this code in my rails mode: https://gist.github.com/nahtnam/1a622c8ebe738e20c619 when I pass something like "https://nahtnam.com", the query and fragment come up as nil. How can I make it so that query and fragment are not included if they are nil without using if statements?
JBreit has joined #ruby
tejasmanohar has quit [Quit: WeeChat 1.1.1]
phutchins has joined #ruby
<nahtnam>
*model
Joufflu has joined #ruby
boshhead has quit [Ping timeout: 250 seconds]
JohnBat26 has joined #ruby
<nahtnam>
Oh wait
<nahtnam>
sorry wrong channel. Its supposed to be on #rubyonrails
arescorpio has quit [Excess Flood]
oki has quit [Ping timeout: 244 seconds]
segmond has joined #ruby
Wolland has quit [Remote host closed the connection]
giuseppesolinas has joined #ruby
Wolland has joined #ruby
ghr has joined #ruby
a5i has quit [Quit: Connection closed for inactivity]
phutchins has quit [Ping timeout: 272 seconds]
Aswebb_ has joined #ruby
sivsushruth has quit [Ping timeout: 244 seconds]
shadoi has quit [Quit: Leaving.]
Wolland has quit [Ping timeout: 256 seconds]
hmnhf has joined #ruby
ghr has quit [Ping timeout: 256 seconds]
mistermocha has quit [Remote host closed the connection]
Aswebb_ has quit [Ping timeout: 272 seconds]
justin_pdx has quit [Quit: justin_pdx]
Sawbones has joined #ruby
checkit has joined #ruby
vdamewood has joined #ruby
checkit has quit [Excess Flood]
checkit has joined #ruby
checkit has quit [Excess Flood]
checkit has joined #ruby
checkit has quit [Excess Flood]
hmnhf has quit [Remote host closed the connection]
checkit has joined #ruby
mesamoo has quit [Remote host closed the connection]
bigmac has joined #ruby
oo_ has quit [Remote host closed the connection]
hmnhf has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
oo_ has joined #ruby
mistermocha has joined #ruby
justin_pdx has joined #ruby
oki has joined #ruby
ParmesanCaesar has quit [Ping timeout: 264 seconds]
ParmesanCaesar has joined #ruby
bigmac has quit [Ping timeout: 256 seconds]
_5kg has quit [Ping timeout: 244 seconds]
sevvie has quit [Ping timeout: 265 seconds]
bigmac has joined #ruby
oki has quit [Ping timeout: 245 seconds]
_5kg has joined #ruby
krz has joined #ruby
Xiti` has joined #ruby
xploshioon has quit [Quit: Leaving]
red_horned_rihno has quit [Ping timeout: 246 seconds]
sivsushruth has joined #ruby
bigmac has quit [Ping timeout: 240 seconds]
bigmac_ has joined #ruby
Xiti has quit [Ping timeout: 240 seconds]
red_horned_rihno has joined #ruby
Qladstone has quit [Remote host closed the connection]
red_horned_rihno has quit [Remote host closed the connection]
Sawbones has quit [Remote host closed the connection]
red_horned_rihno has joined #ruby
krz has quit [Ping timeout: 255 seconds]
Sawbones has joined #ruby
davejacobs has joined #ruby
bigmac_ has quit [Ping timeout: 255 seconds]
Wolland has joined #ruby
hmnhf has quit [Ping timeout: 245 seconds]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Wolland has quit [Read error: No route to host]
davejacobs has quit [Ping timeout: 264 seconds]
charliesome has joined #ruby
Wolland has joined #ruby
aewffwea has joined #ruby
shum has quit [Quit: WeeChat 1.1.1]
Waheedi has joined #ruby
_5kg has quit [Ping timeout: 252 seconds]
User458764 has joined #ruby
lxsameer has joined #ruby
Tinfoilhat_ has quit [Read error: Connection reset by peer]
zachrab has joined #ruby
lolmaus has quit [Quit: Konversation terminated!]
Wolland has quit [Ping timeout: 255 seconds]
giuseppesolinas has joined #ruby
HashNuke has joined #ruby
<HashNuke>
hey all ~!
GnuYawk has quit [Quit: WeeChat 1.0]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
zachrab has quit [Ping timeout: 256 seconds]
f03lipe has quit [Ping timeout: 250 seconds]
bigmac has joined #ruby
<ParmesanCaesar>
hi
<ParmesanCaesar>
looking at pictures of cats
Channel6 has quit [Quit: Leaving]
Qladstone has joined #ruby
Morkel has joined #ruby
JoshGlzBrk has joined #ruby
Sawbones has quit [Remote host closed the connection]
checkit has quit [Quit: (null)]
User458764 has joined #ruby
<shevy>
lol
giuseppesolinas has quit [Quit: This computer has gone to sleep]
<shevy>
let cats code
tunaCanBruh has joined #ruby
anarang has joined #ruby
Hirzu has quit [Remote host closed the connection]
red_horned_rihno has quit [Ping timeout: 245 seconds]
aerth has quit [Ping timeout: 245 seconds]
tobago has joined #ruby
Sawbones has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
yfeldblum has joined #ruby
aerth has joined #ruby
justin_pdx has quit [Quit: justin_pdx]
tunaCanBruh has quit [Ping timeout: 245 seconds]
Sawbones has quit [Remote host closed the connection]
Hirzu has joined #ruby
justin_pdx has joined #ruby
f03lipe has joined #ruby
arup_r has joined #ruby
jeromelanteri has joined #ruby
dj_zubehoer has joined #ruby
<arup_r>
moin
jeromelanteri_ has joined #ruby
jeromelanteri_ has quit [Client Quit]
oo_ has quit [Ping timeout: 240 seconds]
justin_pdx has quit [Client Quit]
systemd0wn_ has joined #ruby
SixiS has joined #ruby
jonr22 has joined #ruby
agent_white has joined #ruby
systemd0wn has quit [Ping timeout: 256 seconds]
Spami has joined #ruby
bigmac has quit [Ping timeout: 245 seconds]
omosoj has joined #ruby
HoloIRCUser2 has joined #ruby
HoloIRCUser2 has quit [Read error: Connection reset by peer]
lemur_ has joined #ruby
<omosoj>
blah = "not blah"; is there a way to get the actual name of that variable (blah) and make it into a string?
lemur has quit [Ping timeout: 252 seconds]
giuseppesolinas has joined #ruby
bigmac has joined #ruby
dj_zubehoer has quit [Remote host closed the connection]
sigurding has joined #ruby
jonr22 has quit [Ping timeout: 265 seconds]
red_horned_rihno has joined #ruby
oo_ has joined #ruby
aewffwea has quit []
ponga has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
x1337807x has joined #ruby
justin_pdx has joined #ruby
x1337807x has quit [Max SendQ exceeded]
oki has joined #ruby
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
_5kg has joined #ruby
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
Xiti` has quit [Quit: Xiti`]
x1337807x has joined #ruby
Limix has quit [Quit: Limix]
x1337807x has quit [Max SendQ exceeded]
x1337807x has joined #ruby
mistermocha has quit [Remote host closed the connection]
x1337807x has quit [Max SendQ exceeded]
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
x1337807x has joined #ruby
x1337807x has quit [Max SendQ exceeded]
Pupeno has joined #ruby
Pupeno has quit [Remote host closed the connection]
x1337807x has joined #ruby
_5kg has quit [Ping timeout: 240 seconds]
hvxgr has quit [Ping timeout: 244 seconds]
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
<certainty>
moin guys
justin_pdx has quit [Quit: justin_pdx]
w0rldmaker has quit [Ping timeout: 256 seconds]
<arup_r>
certainty: I'm in uncertainty.. o/
<certainty>
arup_r: o/
apeiros_ has quit [Ping timeout: 250 seconds]
apeiros_ has joined #ruby
bigmac has quit [Ping timeout: 245 seconds]
thumpba_ has joined #ruby
_5kg has joined #ruby
Wolland has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
last_staff has joined #ruby
thumpba has quit [Ping timeout: 256 seconds]
<omosoj>
i am writing a bunch of rake tasks... what should i name the file that am storing code that's common to all the tasks? is it a concern or service or what?
<omosoj>
i think i reached to stage where i have a good grasp of general programming stuff like thinking in pseudocode and then translating it to ruby, by i need to work on the deeper parts of the lagnauge
<arup_r>
omosoj: your rails version ?
<omosoj>
mine? it's a sinatra app, ruby 2.1.7
djbkd has quit [Quit: My people need me...]
bigkevmcd has joined #ruby
_5kg has joined #ruby
fabrice31 has quit [Ping timeout: 265 seconds]
<shevy>
arup_r what are you creating with rails?
<arup_r>
e commerce site.. :p
zachrab has joined #ruby
dumdedum has joined #ruby
<arup_r>
omosoj: here is the correct syntax Spree::Product.where(description: "").first.attributes.slice("name", "style_code")
<arup_r>
I messed up with as_json methods :only option,, sorry
ereslibre_laptop has quit [Ping timeout: 252 seconds]
mistermocha has quit [Ping timeout: 265 seconds]
kalusn has joined #ruby
zacstewart has quit [Ping timeout: 256 seconds]
joonty has quit [Quit: joonty]
martinbm1dsen has quit [Ping timeout: 245 seconds]
joonty has joined #ruby
iamdoo2 has joined #ruby
jack_rabbit has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
CustosLimen has joined #ruby
bruno- has joined #ruby
ParmesanCaesar has quit [Ping timeout: 255 seconds]
enterprisedc has quit [Quit: enterprisedc]
avril14th has joined #ruby
User458764 has joined #ruby
Dolphi has joined #ruby
CustosLimen has quit [Ping timeout: 252 seconds]
omosoj has quit [Ping timeout: 256 seconds]
Zai00 has joined #ruby
bruno- has quit [Ping timeout: 252 seconds]
omosoj has joined #ruby
<Dolphi>
I am creating my first text adventure in Ruby. Is there a way to control PowerShell with Ruby script? I want to take input from my user and if they press "1" it will CLEAR PowerShell before continuing the rest of the program.
jimms_ has joined #ruby
jimms_ has quit [Client Quit]
mskaesz has joined #ruby
ereslibre has joined #ruby
mkaesz has quit [Read error: No route to host]
jimms has quit [Read error: Connection reset by peer]
jimms_ has joined #ruby
enterprisedc has joined #ruby
<Dolphi>
How would I go about telling PowerShell to execute "CLEAR" with Ruby code?
<tobiasvl>
powershell?
<tobiasvl>
so clear the terminal, you mean
jack_rabbit has quit [Ping timeout: 245 seconds]
marr has joined #ruby
<tobiasvl>
is the command just called clear? system('clear') maybe? I barely know what PowerShell is :P
SouL has joined #ruby
ndrei has quit [Quit: Lost terminal]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<sevenseacat>
powershell?
<toretore>
powershell?
Hobogrammer has quit [Ping timeout: 264 seconds]
<Dolphi>
Yes, clear the terminal
ndrei has joined #ruby
ponga has joined #ruby
<Dolphi>
I will give it a try tobiasvl. Will report back with results.
enterprisedc has quit [Remote host closed the connection]
blackmesa has joined #ruby
serivich has joined #ruby
enterprisedc has joined #ruby
Qladstone has joined #ruby
omosoj has quit [Quit: leaving]
<Dolphi>
Nothing happened. Time to look up some documentation. :P
rdark has joined #ruby
jimms_ has quit [Ping timeout: 264 seconds]
arup_r_ has joined #ruby
Guest123 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ponga has quit [Ping timeout: 245 seconds]
polysics has joined #ruby
piotrj has joined #ruby
rrrutr has joined #ruby
arup_r has quit [Ping timeout: 244 seconds]
User458764 has joined #ruby
sivsushruth has quit [Ping timeout: 256 seconds]
enterprisedc has quit [Quit: enterprisedc]
sivsushruth has joined #ruby
dj_zubeh_ has quit [Remote host closed the connection]
zachrab has joined #ruby
Guest78583 has joined #ruby
nettoweb has joined #ruby
<Dolphi>
I got the desired results by using:
<Dolphi>
puts "\e[H\e[2J"
Takle has quit [Remote host closed the connection]
polysics has quit [Ping timeout: 272 seconds]
mikecmpbll has joined #ruby
FooMunki_ has joined #ruby
nii236_ has quit [Remote host closed the connection]
Takle has joined #ruby
Meow-J has quit [Quit: Connection closed for inactivity]
zachrab has quit [Ping timeout: 244 seconds]
alex88 has joined #ruby
kyb3r_ has quit [Quit: Leaving]
SouL has quit [Ping timeout: 256 seconds]
piotrj has quit [Remote host closed the connection]
<gr33n7007h>
Dolphi: puts "\ec" shorter ;)
w0rldmaker has joined #ruby
godd2 has quit [Ping timeout: 244 seconds]
pontiki has joined #ruby
<Dolphi>
gr33n7007h: Would puts "%x{clear}" work as well?
<gr33n7007h>
Dolphi: yep, without the quotes
<Dolphi>
I've only been messing with Ruby for a few days. This is my first programming language.
piotrj has joined #ruby
<gr33n7007h>
Dolphi: cool :)
<Dolphi>
gr33n7007h: Thanks for the help!
<gr33n7007h>
np
lkba_ has quit [Ping timeout: 265 seconds]
djellemah has joined #ruby
evangeline__ has joined #ruby
Morkel has joined #ruby
tunaCanBruh has joined #ruby
roshanavand has joined #ruby
evangeline_ has quit [Ping timeout: 265 seconds]
w0rldmaker has quit [Ping timeout: 245 seconds]
Vile` has quit [Ping timeout: 245 seconds]
duncannz has quit [Ping timeout: 264 seconds]
sevenseacat has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
Vile` has joined #ruby
tunaCanBruh has quit [Ping timeout: 246 seconds]
piotrj has quit [Remote host closed the connection]
piotrj has joined #ruby
<Dolphi>
gr33n7007h: puts "\ec" isn't working for me, neither is puts %x{clear}. I am running Windows.
Guest123 has joined #ruby
<Dolphi>
It would seem that puts "e[H\e[2J" is the only working solution.
krz has quit [Ping timeout: 264 seconds]
jonr22 has joined #ruby
sinkensabe has quit [Remote host closed the connection]
DaniG2k_ has joined #ruby
DaniG2k_ has quit [Client Quit]
<toretore>
you should mention you're running windows as the first thing you do
<toretore>
nobody expects or assumes that
sinkensabe has joined #ruby
hanmac1 has quit [Ping timeout: 240 seconds]
red_horned_rihno has quit [Ping timeout: 256 seconds]
davzie has joined #ruby
DaniG2k has quit [Ping timeout: 246 seconds]
MatthewsFace has joined #ruby
<Dolphi>
toretore: I'm sorry for not being specific enough. Do you have another solution to my question?
<toretore>
i don't know anything about windows
<gr33n7007h>
Dolphi: well, in powershell the clear command is cls
jonr22 has quit [Ping timeout: 265 seconds]
<Dolphi>
gr33n7007h: It is? I just type "clear" and press enter to clear it.
<gr33n7007h>
Dolphi: what are you running your ruby script from powershell?
<Dolphi>
Pardon my newbie-ness :P
polysics has joined #ruby
<Dolphi>
Yes
Qladstone has quit [Remote host closed the connection]
selu has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Dolphi>
Is that bad?
hanmac1 has joined #ruby
<gr33n7007h>
do %x(cls) to get the ansi code :)
Takle has quit [Remote host closed the connection]
<gr33n7007h>
"\ec" is linux specific
MatthewsFace has quit [Ping timeout: 255 seconds]
<arup_r_>
Guys give me some light.. People talk about domain driven development.. domain objects... etc How to identify which objects are domain ?
<arup_r_>
Brief me about it
<arup_r_>
I'm n00b
<arup_r_>
What's the principals and thoughts are behind of it ?
<arup_r_>
What are the**
juanpablo_ has joined #ruby
mostlybadfly has joined #ruby
ponga has joined #ruby
RegulationD has joined #ruby
<toretore>
domain objects are the things that are important, the stuff you work with
krz has joined #ruby
<toretore>
for a bank it's Account, Transfer, AccountHolder, etc
<toretore>
String and Integer are also important to your app, but they're not domain objects
codecop has quit [Remote host closed the connection]
<toretore>
if you mention the name of a domain object to a non-developer, they'll recognize it
<gr33n7007h>
Yep, looks like cls and clear are just aliases to Clear-Host so yeah within powershell "e[H\e[2J" would work
<arup_r_>
Well toretore: Can I say the objects which I can map to database tables.. they are domain objects..
<arup_r_>
?
yfeldblum has joined #ruby
juanpablo_ has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
<toretore>
arup_r_: don't worry too much about it
<toretore>
it's not important
red_horned_rihno has joined #ruby
<arup_r_>
ok
RegulationD has quit [Ping timeout: 264 seconds]
<toretore>
in the end, everything is bullshit and nothing really matters
<arup_r_>
I have too much understanding the issue about OOP ways
<arup_r_>
ok
User458764 has quit [Ping timeout: 250 seconds]
<arup_r_>
I see toretore
DLSteve has joined #ruby
leafybasil has quit [Remote host closed the connection]
<arup_r_>
toretore: I read about private methods : make them private if it is unstable, public those are stable.. Well.. How about the protecteds then ? No I am not asking how it works.. I', saying how should I think about them.. Best way to think about them and use it properly
yfeldblu_ has joined #ruby
WhereIsMySpoon has quit [Disconnected by services]
lxsameer has joined #ruby
<arup_r_>
I need to improve my OO understanding.. Otherwise I wouldn't get a good quality jobs.. My code is ugly.. although they are working too.. So I have to work on this ugly part.
jimms has quit [Read error: Connection reset by peer]
senayar has quit [Remote host closed the connection]
mskaesz has quit [Ping timeout: 246 seconds]
Guest123 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oo_ has quit [Remote host closed the connection]
gluten_hell has quit [Ping timeout: 246 seconds]
roshanavand has quit [Ping timeout: 244 seconds]
zacstewart has joined #ruby
sigurding has quit [Quit: sigurding]
Guest123 has joined #ruby
jimms_ has quit [Ping timeout: 264 seconds]
sinkensabe has quit [Remote host closed the connection]
sinkensabe has joined #ruby
Takle has joined #ruby
zacstewart has quit [Ping timeout: 246 seconds]
rodfersou has joined #ruby
oo_ has joined #ruby
sigurding has joined #ruby
pontiki has quit [Remote host closed the connection]
serivich has quit [Ping timeout: 246 seconds]
senayar_ has joined #ruby
roshanavand has joined #ruby
senayar__ has joined #ruby
tvw has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
roshanavand has quit [Ping timeout: 265 seconds]
senayar_ has quit [Ping timeout: 264 seconds]
sinkensabe has quit [Remote host closed the connection]
gluten_hell has joined #ruby
sinkensabe has joined #ruby
SouL has joined #ruby
lkba has joined #ruby
nfk has joined #ruby
rdark has quit [Quit: leaving]
catmanbun has quit [Read error: Connection reset by peer]
SOLDIERz has quit [Quit: Be back later ...]
<Dolphi>
Should defined variables be stored in a seperate file and called from said seperate file? Wouldn't that make code look much more readable?
<toretore>
no
<Dolphi>
I'm building a small text adventure and I already feel as if I could make it look nicer if I seperated all of the automated parts.
iamdoo2 has quit [Remote host closed the connection]
<Dolphi>
toretore: Would it slow down my program?
<toretore>
no
<Dolphi>
Thank you for the help.
<toretore>
but it sounds like you're trying to write ruby like you would the language you're more familiar with
<Dolphi>
Java
<toretore>
in general you don't have this "problem" in ruby
withnale__ has joined #ruby
bim has joined #ruby
<Dolphi>
I first started off with Java, so that may be why.
<toretore>
if you write a program that requires a lot of initialization, then it will go into the excutable file, and everything else is required from there
<Dolphi>
I mean, it works at least, but I always wonder if I should be writing it more cleanly.
<toretore>
if you're just writing to learn it's fine
blackmesa has quit [Ping timeout: 264 seconds]
<Dolphi>
I'm just learning right now. This is my first real program in Ruby.
<Dolphi>
I've only made a text adventure in Java, and that is as far as my coding experience goes.
<toretore>
if i were to write it, i would write separate classes in separate files
<toretore>
don't worry too much about it, just have fun writing it
<toretore>
then your next program can be "cleaner"
<toretore>
don't define methods inside other methods though
bim has quit [Ping timeout: 250 seconds]
<Dolphi>
Thank you again for your help toretore. I should probably get ready for work haha. Enjoy your day everybody!
<Dolphi>
Did I define a method inside of another?
<toretore>
def start_game()
<toretore>
def clear_console
gfawcettpq has joined #ruby
<Dolphi>
Ah...Where should they be defined?
<toretore>
you should put all the method definitions at the top
<Dolphi>
The very top of the program?
<toretore>
in this case, yes
<Dolphi>
Will do
User458764 has joined #ruby
_Andres has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
<Hirzu_>
Well, defining a function inside function is fine IMHO, if you want to have local function not available anywhere else. Doesnt that function then also get handle to the context of the function is is created in?
Soda has quit [Remote host closed the connection]
<toretore>
that's not how it works in ruby
<Hirzu_>
oh
<toretore>
it will accept it, but it's the same as defining them side by side
<Hirzu_>
havent really tried it myself, quite rare case when it would be even usefull.
<toretore>
methods in ruby aren't functions; they belong to a class and that's it
evangeline__ has quit [Remote host closed the connection]
<toretore>
they can't exist outside the context of a class
<toretore>
the instance of that class is the scope
paradoja has joined #ruby
evangeline__ has joined #ruby
JDiPierro has quit [Remote host closed the connection]
Zai00 has quit [Quit: Zai00]
senayar__ has quit [Remote host closed the connection]
senayar has joined #ruby
<Hirzu_>
so, module = class ?
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<toretore>
no, a module can't be instantiated
serivich has joined #ruby
<toretore>
you can't call a method defined in a module
<apeiros_>
Hirzu_: other way round: Class < Module
<Dolphi>
toretore: If you wouldn't mind, could you edit my gist? I want to see how you would define the things. I don't want you to make new files and classes
<Dolphi>
I tried to do it and broke my program lol
<apeiros_>
there's only instance methods in ruby. and the only container for instance methods is Module, and by inheritance Class
<toretore>
Dolphi: also, don't use tabs, use 2 spaces
<apeiros_>
(almost) every object has a singleton_class, which is the mechanism for things like class methods. the rest follows from those facts.
chinmay_dd has joined #ruby
kaiZen- has joined #ruby
<Dolphi>
toretore: Alright. Can you help me out please? I want to get this fixed before I head to work
zachrab has joined #ruby
wpp has joined #ruby
vdamewood has quit [Quit: Computer has gone to sleep.]
Guest123 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
senayar has quit [Remote host closed the connection]
polysics has quit [Remote host closed the connection]
ParmesanCaesar has quit [Ping timeout: 256 seconds]
<certainty>
doesn't that make sense? i mean there is only ever one possible instance in those classes so both the singleton class and the class are essentially the same.
Qladstone has quit [Remote host closed the connection]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
despai has quit [Quit: This computer has gone to sleep]
senayar has joined #ruby
davejacobs has quit [Ping timeout: 264 seconds]
rce has joined #ruby
oo_ has quit [Remote host closed the connection]
tkuchiki has quit [Ping timeout: 272 seconds]
mkaesz has joined #ruby
<hanmac1>
apeiros_ bignum also doesnt want to have a singleton_class
<Mon_Ouie>
Yes, it sort of does, but I still find it odd that they're the only objects for which singleton_class returns just the same as class, as opposed to returning a subclass thereof
despai has joined #ruby
<Mon_Ouie>
(and to list all exceptions, floats don't allow it either since some version of Ruby — 2.0 I think)
plashchynski has quit [Quit: plashchynski]
scripore has quit [Quit: This computer has gone to sleep]
unshadow has joined #ruby
oo_ has joined #ruby
<hanmac1>
Mon_Ouie: i think its about flonum ... which only works with 64bit
doodlehaus has quit [Remote host closed the connection]
lanemeyer has quit [Ping timeout: 250 seconds]
danjordan has joined #ruby
dj_zubehoer has quit [Remote host closed the connection]
reinaldob has joined #ruby
<Mon_Ouie>
That might be why it changed, I thought it was just to make it so you can't do it with any numerical types since it would behave oddly for integers anyway
red_horned_rihno has joined #ruby
pwnz0r has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
despai has joined #ruby
samfisher has joined #ruby
<avril14th>
hanmac1: missing a dot? :)
decoponio has joined #ruby
<samfisher>
how can I access browser data (history, form entries) with ruby?
Guest123 has joined #ruby
<wasamasa>
firefox saves history in a sqlite3 database
oo_ has quit [Remote host closed the connection]
<wasamasa>
and other data in a json file
Zai00 has joined #ruby
<wasamasa>
both are present in a profile saved in the user's directory
pwnz0r has quit [Ping timeout: 256 seconds]
doodlehaus has joined #ruby
lkba has quit [Read error: Connection reset by peer]
yeticry has quit [Quit: leaving]
<arup_r>
wasamasa: So we can connect to the FireFox Db and query and get whatever data we want
<arup_r>
?
<apeiros_>
hanmac1: yes, I said "numerics"
<apeiros_>
floats afaik neither
<apeiros_>
don't know about complex
<wasamasa>
arup_r: sure
<wasamasa>
arup_r: how do you think firefox knows the browser history in a session of a certain profile :P
<arup_r>
wasamasa: cool
<wasamasa>
arup_r: the json data stores state such as the tab history
<arup_r>
humm.. I never thought about this
<wasamasa>
arup_r: and probably much more
<wasamasa>
arup_r: there's plenty stuff out there using sqlite3 which is pretty cool
<arup_r>
today I did for you
<wasamasa>
arup_r: I've once written a script that extracts a skype conversation log that way
marr has quit [Ping timeout: 265 seconds]
<wasamasa>
arup_r: the problem is just figuring out which field means what
freerobby has joined #ruby
<arup_r>
So Skype also stores then in Sqllite DB?
<wasamasa>
yes
<wasamasa>
there's also embedded devices doing it
<arup_r>
Ahh!.. Local DB?
<wasamasa>
like my ebook reader
despai has quit [Quit: This computer has gone to sleep]
<wasamasa>
it stores the last books read there
unshadow has quit [Quit: leaving]
<wasamasa>
yes, sqlite3 is a single-file/-user database
oo_ has joined #ruby
<wasamasa>
and is excellent for embedding
<arup_r>
I thought those are stored in their cloud hosted DB
<arup_r>
I see
<workmad3>
arup_r: sqlite is a good choice for an embedded DB that acts as a local cache for data
Millsdev has joined #ruby
<gr33n7007h>
wasamasa: same for google-chrome?
<wasamasa>
gr33n7007h: no idea, but very likely
<jhass>
apeiros_: Ruby 2.2.1 ;)
<wasamasa>
arup_r: nothing stops the application from mirroring the local cache to something remote
<wasamasa>
arup_r: it's just important to have a local cache first
* gr33n7007h
is off to investigate
<wasamasa>
gr33n7007h: great, report back once you've found out
<arup_r>
wasamasa: you opened my eyes today
cpt_yossarian has quit [Quit: And then he took off.]
<wasamasa>
arup_r: you're welcome
Takle has joined #ruby
oo_ has quit [Ping timeout: 246 seconds]
Pupeno has quit [Quit: Leaving...]
<apeiros_>
jhass: thx
Qladstone has joined #ruby
mistermocha has joined #ruby
marr has joined #ruby
strixd has quit [Quit: 500]
krz has quit [Quit: WeeChat 1.0.1]
sivsushruth has quit [Read error: Connection reset by peer]
<phale>
the last time i read a RFC is when i saw ipv6 addresses and ports
<phale>
which created ambiguity
senayar has joined #ruby
<certainty>
i regularily have to read them. they are valuable resources
bMalum has joined #ruby
<PierreRambaud>
certainty, +42
huddy has joined #ruby
<certainty>
some of them i should have said :)
<phale>
2001:4860:4801:5::91:8080
<phale>
how wouldn't that create ambiguity for example
<jhass>
certainty: RFC puzzle: does RFC6698 mandate DNSSEC
<workmad3>
certainty: http2 is on my reading list atm :)
<phale>
that's what I saw from an official IPV6 RFC
Limix has quit [Ping timeout: 265 seconds]
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
doodlehaus has joined #ruby
<workmad3>
phale: it only creates ambiguity to humans
<PierreRambaud>
workmad3, so true
<phale>
weird protocol then
sinkensabe has joined #ruby
<jhass>
the protocol never uses that presentation internally
red_horned_rihno has joined #ruby
gaganjyot has quit [Ping timeout: 250 seconds]
msgodf has quit [Ping timeout: 250 seconds]
<phale>
anyways thanks for the help guys
anaeem1_ has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
doodleha_ has quit [Ping timeout: 272 seconds]
phale has quit [Quit: leaving]
<workmad3>
phale: also, the recommended style is [2001:4860:4801:5::91]:8080
<PierreRambaud>
workmad3, I think he rage quit :)
<workmad3>
ah, just before I put that in :)
zachrab has joined #ruby
<certainty>
jhass: it should. but i don't know if it does. it's on my to-read-list.
<workmad3>
I could still tab-complete his name when I started typing ;)
mitchellhenke has joined #ruby
My_Hearing has joined #ruby
My_Hearing has joined #ruby
<jhass>
certainty: my stand point is that it falls apart if not, but doesn't explicitly state it ;)
senayar has quit [Read error: Connection reset by peer]
<apeiros_>
jhass: my now favorite question for people who want "an integer in hex, but not a string(!)": "what base does 'twelve' have?" because the base of a number is only representational.
Limix has joined #ruby
j_mcnally has joined #ruby
senayar has joined #ruby
_Andres has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
<jhass>
apeiros_: nice one, I'll try to remember it :D
<certainty>
tlsa in theory can exist without dns and thus dnssec but dane explicitly choses to use the domain namespace to store the data
Mon_Ouie has quit [Ping timeout: 255 seconds]
mary5030 has quit [Remote host closed the connection]
<certainty>
and to make it usable you better be sure that records are valid
Limix has quit [Client Quit]
anaeem1_ has quit [Ping timeout: 246 seconds]
<jhass>
yeah, there's also 4.1 which doesn't work without it
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
quazimodo has quit [Ping timeout: 256 seconds]
<workmad3>
jhass: reading through the introduction, DANE seems to basically be saying "The easiest way to secure your DANE bindings is to use DNSSEC to secure your DNS records... however you may have other ways to secure your records, so we aren't strictly mandating that you use DNSSEC"
<jhass>
workmad3: yes, that's what the introduction says. now read 4.1
j_mcnally has quit [Read error: Connection reset by peer]
zachrab has quit [Ping timeout: 256 seconds]
j_mcnally has joined #ruby
<certainty>
jhass: in that case case 3 would match, wouldn't it?
dtordable has quit [Quit: • IRcap • 8.72 •]
<certainty>
say there is no dnssec then the validation state should be indeterminate
Pumukel has quit [Read error: Connection reset by peer]
<certainty>
so yeah it seems to mandate DNSSEC to be usable
<certainty>
seem
dtordable has joined #ruby
Pumukel has joined #ruby
dtordable has quit [Changing host]
dtordable has joined #ruby
iamjarvo has joined #ruby
<workmad3>
jhass: hmm... 4.1 seems to start with "Here is a protocol that uses DNSSEC" so it kinda follows that the description is then dependent on DNSSEC, but I agree that the wording isn't perfectly clear on that front
emocakes has quit [Ping timeout: 256 seconds]
Limix has joined #ruby
scripore has joined #ruby
Pumukel has quit [Read error: Connection reset by peer]
loechel has joined #ruby
skj3gg has joined #ruby
loechel is now known as Pumukel
zacstewart has quit [Remote host closed the connection]
<jhass>
so, now open RFC6394 :P
jlebrech has joined #ruby
fryguy9 has joined #ruby
werelivinginthef has joined #ruby
<apeiros_>
jhass: organizing a digital scavenger hunt?
<jhass>
maybe :P
dtordable has quit [Remote host closed the connection]
<apeiros_>
also, [key => value] is not a thing, {key => value} is
havenwood has joined #ruby
dtordable has quit [Remote host closed the connection]
ghostpl_ has joined #ruby
<jhass>
it is, it's same as [{key => value}] :P
joonty has quit [Quit: joonty]
OrbitalKitten has joined #ruby
<certainty>
jhass: that section sounds different
ghostpl_ has quit [Remote host closed the connection]
ghostpl_ has joined #ruby
SOLDIERz has quit [Read error: Connection reset by peer]
SOLDIERz has joined #ruby
<toretore>
associative array
<jlebrech>
yeah, i'm getting an associative array
<apeiros_>
toretore: careful, associative array does not need to be a hash
sandelius has joined #ruby
ereslibre has quit [Ping timeout: 252 seconds]
boshhead has joined #ruby
<toretore>
i'm just making fun of the way php does arrays
<toretore>
and call them that
luksaur has joined #ruby
luksaur has joined #ruby
juanpablo_ has quit [Read error: Connection reset by peer]
<certainty>
for me one of the interesting ideas with DANE is the possibility to have trust anchors at the level of your desire, thus reducing the need for centralized CAs
<ponga>
what the fuck is better paste you bunch of geeks
<ponga>
pastie does what it needs
<toretore>
gist is better
<toretore>
that's just the way it is
<ponga>
i understand pastebin sucks but pastie does its job
<apeiros_>
paper & pencil does what it needs too
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bMalum has quit [Quit: bMalum]
<apeiros_>
yet, I prefer to use a computer
<havenwood>
cyberpen and cyberpaper
<toretore>
to see my code, telnet me at port 22684
* apeiros_
fingers toretore
<toretore>
hey
mbeasley has quit [Client Quit]
mbeasley has joined #ruby
<apeiros_>
what hey? I want to have infos about you before I telnet! safer telnet, uknow?
<certainty>
jhass: yeah it's a controversial topic. For us DANE is important to secure communications between our mailers
OrbitalKitten has joined #ruby
kaiZen- has joined #ruby
<toretore>
watch out or i'll `touch` your endpoint
rbennacer has joined #ruby
joonty has joined #ruby
* certainty
waits for the obligatory: date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep
rbennacer has quit [Remote host closed the connection]
mitchellhenke has quit [Quit: Computer has gone to sleep.]
<jhass>
certainty: I can see that you need to be careful when deploying DNSSEC to bigger systems, but it's still an improvement in every aspect over the CA system and we won't get an alternative in the next 10 years
sambao21 has joined #ruby
rbennacer has joined #ruby
joonty has quit [Client Quit]
Grantlyk has quit [Remote host closed the connection]
jherbst has joined #ruby
gr33n7007h has joined #ruby
gr33n7007h has quit [Changing host]
gr33n7007h has joined #ruby
adriancb has quit [Ping timeout: 245 seconds]
<certainty>
jhass: probably not. though a common concern with DNSSEC is that it's still somewhat centralized. in order to verify your chain of trust you go up to the owner of your root zone. which is operated by the government (most likely)
<jhass>
and I mean, Dyn does it, Cloudflare is about to launch it to all their customers, ICANN mandates it for all new gTLDs, can't be that bad
senayar has quit [Read error: Connection reset by peer]
startupality has joined #ruby
senayar has joined #ruby
mkaesz has quit [Remote host closed the connection]
mkaesz has joined #ruby
<jhass>
certainty: monitoring root zone -> TLD for unexpected changes should be easy, could built that into OONI or something and faking DNS replies for specific clients at the authoritative servers for a TLD seems like a difficult task
jerius has joined #ruby
<jhass>
and even then at most a single domain is affected, with a root cert you can pretend to be anybody
bruno- has joined #ruby
pwh has joined #ruby
<catsoup>
certainty: the owner of your root zone will not be your gov.t
MrMunchie has joined #ruby
startupality has quit [Ping timeout: 252 seconds]
<jhass>
well, atm it is operated by verisgin, no?
<catsoup>
the chain of trust is a bit broken, frankly
<catsoup>
which *sort of* is run byt the govt, although not really, except where it is
kachi8 has joined #ruby
tjohnson has joined #ruby
jtdowney has joined #ruby
mkaesz has quit [Ping timeout: 264 seconds]
jtdowney_ has quit [Read error: Connection reset by peer]
<catsoup>
but orgs like ICANN have more regulatory control than national gov.ts do
fmcgeough has joined #ruby
oo_ has quit [Remote host closed the connection]
<MrMunchie>
hello I am really new to ruby, I still cannot grasp the entire concept of symbols even after a few articles online. I know you cannot assign anything to a symbol with =, but how does a symbol ever reference anything? how do you make a symbol point to anything?
jtdowney_ has joined #ruby
livathin_ has joined #ruby
ParmesanCaesar has joined #ruby
<jhass>
you don't, a symbol is a value, like a string or a number is
<catsoup>
jhass: if you've faked a response from the root server, how come only one domain will be affected?
joonty has joined #ruby
<jhass>
because otherwise people will notice quickly
<jhass>
so you would want those attacks very targeted
Axy has joined #ruby
Axy has joined #ruby
Mia has quit [Read error: Connection reset by peer]
crueber has joined #ruby
<jhass>
MrMunchie: any other programming languages you know we can relate concepts to?
<MrMunchie>
c or java
bruno- has quit [Ping timeout: 252 seconds]
<jhass>
MrMunchie: do you know enums in Java?
bruno-_ has joined #ruby
hanmac1 has left #ruby [#ruby]
<MrMunchie>
yes, a numbered list with a string identifiers,
jtdowney has quit [Ping timeout: 256 seconds]
<MrMunchie>
i hope thats a correct definition
livathinos has quit [Ping timeout: 265 seconds]
fgo has quit [Quit: WeeChat 1.1.1]
<certainty>
catsoup: i suspect the ICANN gets a good amount of steering from various sides. I wanted to express that the root zones might be under the control of governments.
<jhass>
I'm more relating to the usecases
<jhass>
MrMunchie: ^
serivich has quit [Ping timeout: 272 seconds]
<certainty>
my head aches. i'll call it a day
<certainty>
have fun peeps
<jhass>
MrMunchie: so where you would use an enum in Java, or a magic value assigned to a constant, you use a symbol in Ruby
Mives has quit [Quit: WeeChat 1.1.1]
jtdowney has joined #ruby
agarie has quit [Remote host closed the connection]
<MrMunchie>
okay, this helps. thank you very much!
Takle has quit [Remote host closed the connection]
ParmesanCaesar has quit [Ping timeout: 264 seconds]
jtdowney_ has quit [Read error: Connection reset by peer]
mbeasley has quit [Quit: WeeChat 0.4.2]
mbeasley has joined #ruby
dfinninger has joined #ruby
EasyCo has quit [Quit: Connection closed for inactivity]
LekeFly has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shmoon has joined #ruby
doodlehaus has quit [Read error: Connection reset by peer]
doodlehaus has joined #ruby
piotrj has quit [Remote host closed the connection]
zacstewart has quit [Remote host closed the connection]
<havenwood>
zotherstupidguy: no, probably not in the stdlib of any language, though i'd love to be proved wrong on that - would be interesting to see whose done it
sevvie has joined #ruby
<apeiros_>
zotherstupidguy: IMO doesn't make sense to add something like that to stdlib
Takle has joined #ruby
<apeiros_>
unless you're willing to go the way of the ignoramus and say "english is enough for stdlib"
<zotherstupidguy>
it depends on how it is implemented, is dictionary lists the only way?
<apeiros_>
zotherstupidguy: you have literally *no idea* how plurals work in different languages.
<canton7>
zotherstupidguy, depends on the language
B1n4r10 has joined #ruby
anaeem1__ has joined #ruby
<canton7>
zotherstupidguy, some will have rules that are followed 100%. most will have some ground rules and tons of exceptions
jerius has quit [Quit: /quit]
<canton7>
some will just have lists of words and their plurals
<bhaak>
apeiros_: well, this is ruby, the standard language would probably be "japanese" :-]
anaeem1 has quit [Read error: Connection reset by peer]
DaniG2k has quit [Quit: leaving]
<apeiros_>
bhaak: indeed
<canton7>
some will have weird and wacky concepts of plurals (one, many, lots)
anaeem1__ has quit [Remote host closed the connection]
<havenwood>
hai, dozo!
jtdowney_ has joined #ruby
<zotherstupidguy>
@apeiros languages == encodings?
<canton7>
no, spoken languages
<apeiros_>
zotherstupidguy: no. languages == languages.
<pmarreck>
bradland: well, the symbol is defined as soon as the parser sees it.
Grantlyk has joined #ruby
commmmodo has quit [Quit: commmmodo]
<pmarreck>
:this_is_a_symbol <= now it's defined
jen_ has left #ruby [#ruby]
doodlehaus has joined #ruby
thumpba_ has quit [Ping timeout: 264 seconds]
<bradland>
ah, so defined.
ghostpl_ has joined #ruby
<pmarreck>
I ask because I'm investigating Elixir and I see that it has binary_to_existing_atom (binary is a string, atom is like a symbol) which is pretty smart IMHO. Lets you take advantage of symbols/atoms without running into DDoS issues
segmond has joined #ruby
<bradland>
i thought you meant something more by "seen"
<bradland>
as in, has the value been used in some way
<bradland>
have a look at Symbol.all_symbols
<pmarreck>
right.
<bradland>
that's an array of all defined symbols
einarj has joined #ruby
<bradland>
problem is, i'm not sure how you check for a symbol without using the literal... which would constitute defining it
GnuYawk has joined #ruby
<pmarreck>
bradland: So you'd have to map Symbol.all_symbols to string, see if your prospective symbol (which is still a string at the time) is in that list, and THEN convert it to a symbol?
jlast has joined #ruby
<pmarreck>
Which is silly
ferr has joined #ruby
<bradland>
yeah, that's an interesting question. how to check for the presence of a symbol without using the symbol.
<pmarreck>
That's the only way I can think of
<bradland>
seems expensive to go through and allocate all those strings
<bradland>
but yeah, that seems like it would work
<pmarreck>
and you'd also have to run it EVERY time you check... as the global symbol list may have changed in the meantime
lolmaus has quit [Ping timeout: 252 seconds]
mjuszcza_ has joined #ruby
robustus is now known as robustus|Off
<bradland>
have you dug in to see what Elixir's implementation is like?
<bradland>
if it does something similar, they might have a different idea
reinaldo_ is now known as reinaldob
<pmarreck>
bradland: I am pretty sure it calls down into the Erlang definition, but no I haven't looked at what Erlang does yet :)
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood>
pmarreck: Why are you converting a String to a Symbol?
apeiros_ has quit [Remote host closed the connection]
<pmarreck>
I don't imagine Erlang does anything like that, since it is a BIF and is therefore at the compiler level
amystephen has joined #ruby
<bradland>
sh, sry. not familiar with Elixir.
<havenwood>
pmarreck: What's your concern with doing so?
<pmarreck>
havenwood: I want to not mention a Symbol unless it is already defined. The "non-mentioned" Symbol is currently a String which has not yet been converted, or vetted.
apeiros_ has joined #ruby
razieliyo has quit [Read error: Connection reset by peer]
<havenwood>
pmarreck: Why not mention it unless it's been defined?
<pmarreck>
havenwood: Have you heard of the symbol DDoS?
<bradland>
isn't symbol GC possible in recent versions of Ruby?
j_mcnally has joined #ruby
<havenwood>
pmarreck: Distributed denial of service?
<jhass>
pmarreck: normalize user input to strings, not symbols
<jhass>
if you have to mix with user input, use strings, always
<pmarreck>
jhass: That is a band-aid solution which forces you to give up the utility of symbols
<havenwood>
pmarreck: That doesn't really make sense. But the latest stable Rubies do GC user created Symbols.
sdrew has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
pmarreck: no, it just limits the usage of symbols to their intention
mjuszczak has quit [Ping timeout: 264 seconds]
<jhass>
String#to_sym was a mistake
<havenwood>
pmarreck: I think the best thing to look at is how you can not String#to_sym.
<pmarreck>
Again, I refer you guys to erlang's binary_to_existing_atom, which if it existed in Ruby would be called something like String#to_existing_sym (which has actually been discussed on the Ruby mailing lists)
ycyclist has quit [Quit: Page closed]
<pmarreck>
In fact, that exact name has been discussed, and I only guessed it.
sdrew has joined #ruby
<pmarreck>
jhass: No, it was not. NOT having String#to_existing_sym was the mistake.
<pmarreck>
You can have a whitelist of symbols.
nettoweb has joined #ruby
<pmarreck>
Without forcing everyone to use strings.
<bradland>
curious what happens if there is no existing symbol?
<bradland>
return nil?
atomiccc has joined #ruby
<jhass>
pmarreck: I yet have to see a case whre String#to_sym is used that wouldn't be better solved by using strings at the target instead, so if you have a real world example of that, I'd be highly interested
<pmarreck>
bradland: Good question, and really speaks to how to handle errors/fails. I say if it has a bang on the end, throw.
kachi8 has joined #ruby
<pmarreck>
I mean raise.
apeiros_ has quit [Ping timeout: 265 seconds]
<pmarreck>
jhass: Indexing on a symbol is quite a bit faster than indexing on a string. As is searching for a symbol in a list, etc.
adriancb has quit [Read error: Connection reset by peer]
Soda has joined #ruby
delianides has joined #ruby
<pmarreck>
jhass: Strings use way more memory. Strings in Ruby take up a huge amount of the VM space.
<havenwood>
pmarreck: So there are strings, frozen strings, dynamic symbols and static symbols. It seems to be static symbols you're concerned about. But you can't create them.
mistermocha has joined #ruby
<pmarreck>
jhass: You don't have to deallocate a symbol.
mjuszczak has joined #ruby
<havenwood>
pmarreck: The GC will do that for you, as long as you created the Symbol.
<bradland>
i don't know that you can do this cleanly in pure ruby
<jhass>
pmarreck: sound like academic usecases, got benchmarks of a real world app that prove that was a bottleneck in it?
<havenwood>
pmarreck: Now using frozen Strings, that makes sense. There's a frozen String literal: 'example'.freeze
<havenwood>
pmarreck: That ^ won't create the unfrozen String, just a lovely frozen one.
gr33n7007h has quit [Ping timeout: 255 seconds]
<pmarreck>
jhass: All code that had to convert to using strings instead of symbols is circumstantial evidence. Surely they would have all used strings from the start if symbols weren't merely different.
gr33n7007h has joined #ruby
mjuszcza_ has quit [Ping timeout: 252 seconds]
bricker has joined #ruby
<havenwood>
pmarreck: Why do you need a Symbol? Have a code example?
<havenwood>
pmarreck: Seems you want a frozen string, no?
<bradland>
lots of code that used symbols did so for reasons that weren't related to actual reasons
<jhass>
no, fact is people don't grasp the Symbol usecases fully and misuse them
<bradland>
just a lot of dogma
<pmarreck>
havenwood: I am cool with frozen strings, but I don't know what optimizations exist around that down in the depths.
tgunr has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
BigRonnieRon has joined #ruby
<pmarreck>
jhass: Well, that is a reasonable argument, although essentially based on accepting the ignorance of programmers
<bradland>
if the core concern is memory overflow DDoS, that's solved by GC of symbols, no?
<havenwood>
pmarreck: They are lovely, keep object allocation down.
it0a has joined #ruby
<jhass>
people are ignorant yes. Programmers are no exception
<pmarreck>
bradland: I suppose. Symbol GC is relatively new.
<havenwood>
bradland: the double DD means distributed, so just DoS
gaganjyot has joined #ruby
<bradland>
derp
<pmarreck>
jhass: I like to keep my standards high and not assume my colleagues are ignorant. ;)
<havenwood>
bradland: And yeah, there's no Symbol DoS vector any longer.
<bradland>
ATM Machine!
Takle has quit [Remote host closed the connection]
<havenwood>
Live in the now, maaan!
<bradland>
brah, the evidence supports the cynics in this argument :P
einarj has quit [Remote host closed the connection]
zachrab has joined #ruby
<mistermocha>
Hey all, where would be the right place to ask fpm questions?
<pmarreck>
Eternal optimist I guess ;)
<bradland>
mistermocha: not sure fpm has a specific channel, but you can always ask here.
CustosLimen has quit [Ping timeout: 246 seconds]
<pmarreck>
havenwood: There isn't a symbol DoS vector, at least in the standard gems... but there could still be one in your code, if anyone writes code ignorant of the possibility which accepts user input and symbolizes it... although symbol GC probably mitigates that now
<bradland>
if it's ruby related, someone can probably help
fryguy91 has joined #ruby
SOLDIERz has quit [Quit: Be back later ...]
<mistermocha>
bradland: thanks ... it's just making me scratch my head as to why things behave like they do...
adriancb has joined #ruby
mary5030 has joined #ruby
Takle_ has joined #ruby
<mistermocha>
so i'm making a shared library, call it foo.dll, that has to go in /usr/local/share/foo
<mistermocha>
dpkging it
<havenwood>
pmarreck: Dynamic Symbol GC ftw.
andikr has quit [Remote host closed the connection]
agarie has joined #ruby
<mistermocha>
On my box, I put down directory foo in /usr/local/share, put foo.dll into it, and ran "fpm -n foo-dll -t deb -s dir /usr/local/share/foo"
<mistermocha>
which is what the documentation on fpm hinted at
StoneCypher has joined #ruby
<jhass>
isn't .dll a windows thing?
rhg135|XX is now known as rhg135
polysics has quit [Remote host closed the connection]
TripTastic has joined #ruby
<mistermocha>
dpkg contents show the file put in ./
fryguy9 has quit [Ping timeout: 256 seconds]
<bradland>
holy wow, so fpm has a channel: #fpm
<bradland>
amazing
<mistermocha>
but the file doesn't end up in /usr/local/share/foo ... it ends up on root
<mistermocha>
aw snap ... ok thanks bradland
B1n4r10 has joined #ruby
<bradland>
jordan sissel fights for the user, btw
zachrab has quit [Ping timeout: 245 seconds]
* mistermocha
facepalms at himself
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bradland>
started looking at the docs to see if i could help
<bradland>
and saw that
<pmarreck>
jhass: look here http://www.sitepoint.com/symbol-gc-ruby-2-2/ The very doc about symbol GC states: "We see that indifferent access hash with a string is about half the speed of a regular hash with symbol keys. We also see that using a symbol to access the value in an indifferent access hash is a whopping 5 times slower than using a regular hash with symbol
<pmarreck>
keys."
_2_Suhani has joined #ruby
<pmarreck>
There's your data.
<bradland>
do not conflate indifferent access with string based hashes
<bradland>
that's not the same
<bradland>
because indifferent access requires one additional layer of indirection
<pmarreck>
Disclaimer: I think HashWithIndifferentAccess should die in a fire. Here's a quick question: What happens when you do this? hash_with_indifferent_access.merge!({:a => '1', 'a' => '2'})?
<jhass>
I guess [:a] and ['a'] both will return '2'
<_2_Suhani>
what are you telling
<pmarreck>
If you don't know the answer to that (and all its permutations), you should stay far, far away from HWIA.
<jhass>
_2_Suhani: what a lovely language Ruby is
mjuszczak has quit [Ping timeout: 265 seconds]
<havenwood>
Oh Rails..
JDiPierro has joined #ruby
<bradland>
i stay away from HWIA in general
<pmarreck>
jhass: You are probably correct. In order to answer that you have to know that HWIA stores strings internally. But a while back I managed to get HWIA to store a symbol key... and that resulted in a nasty, nasty bug
<jhass>
pmarreck: there have been numerous attempts to make AS::HWIA the default Hash even, my guess is that Symbol GC is the compromise to silence those
sdrew has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ponga>
lol they had Jruby BEFORE ruby?
<ponga>
that's funny
sdrew has joined #ruby
giuseppesolinas has quit [Ping timeout: 245 seconds]
<workmad3>
ponga: google likes java
gfawcettpq has quit [Ping timeout: 256 seconds]
<ponga>
ewwww
anaeem1_ has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
livathinos has joined #ruby
freerobby has quit [Quit: Leaving.]
kayloos has joined #ruby
sigurding has quit [Quit: sigurding]
giuseppesolinas has joined #ruby
toretore has quit [Quit: This computer has gone to sleep]
freerobby has joined #ruby
niko has quit [Read error: Connection reset by peer]
aarwine has joined #ruby
dapz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<aarwine>
ruby's string.start_with("will", "accept", "multiple", "options") but if I have a list_of_options=["will", "accept", "multiple", "options"] how can I invoke start_with with the options from the list instead of statically?
fabrice31 has joined #ruby
bradleyprice has quit [Remote host closed the connection]
ghostpl_ has quit [Remote host closed the connection]
<apeiros_>
the path given to require is relative to a path in $LOAD_PATH
psy_ has quit [Ping timeout: 246 seconds]
x77686d has joined #ruby
<freezevee>
and I suppose also without ".rb"
<apeiros_>
yes
<jhass>
while it does no harm, it's not needed
<freezevee>
jhass: I am running ruby.rb main.rb inside the /lib
<apeiros_>
IMO preferred without
mkaesz has joined #ruby
coco has joined #ruby
<freezevee>
main.rb has require 'myproject' and it should load a very simple basic class
<apeiros_>
freezevee: an executable does not belong into lib
Hirzu has quit [Remote host closed the connection]
<apeiros_>
and you pass the path to the lib dir with -I
<apeiros_>
so if you're within lib, it's ruby -I.
<jhass>
so we recommend to go up one dir, move the executable to bin/ and do ruby -Ilib bin/my_gem
<freezevee>
am I doing it completely wrong ?
w0rldmaker has joined #ruby
beneggett has joined #ruby
jhwhite has quit [Ping timeout: 240 seconds]
<freezevee>
rather than trying to fix something wrong, should I build it from scratch with bundle gem myproject ?
<apeiros_>
not necessarily
<freezevee>
jhass: I'll try what you said
<jen_>
Senjai:
<jen_>
hi
jenrzzz has quit [Ping timeout: 255 seconds]
danjordan has joined #ruby
<freezevee>
ok I moved main.rb to /lib
dj_zubehoer has joined #ruby
<jhass>
huh?
<jen_>
jhass and havenwood with the help of senjai. here in this room, we made some progress with the Ruby script but still getting a nagging SSL issue.
gluten_hell has joined #ruby
<freezevee>
jhass: and executed ruby bin/main.rb
<freezevee>
is that what you said ?
mkaesz has quit [Ping timeout: 240 seconds]
<jhass>
freezevee: almost ruby -Ilib bin/main.rb
<jhass>
but don't name your executable main.rb
jhwhite has joined #ruby
gregf has quit [Quit: WeeChat 1.0.1]
phale has joined #ruby
<phale>
can u access the deep web with ruby
<phale>
without tor
<jhass>
that'll be awkward when your gem is installed and it's in the path
mjuszczak has joined #ruby
<jhass>
phale: what's the deep web?
<freezevee>
jhass: hmm something's happening
<phale>
i have no idea but i can buy weed from it
<phale>
so i need it
ki0 has joined #ruby
jenrzzz has joined #ruby
<freezevee>
jhass: how do I call the class? simply Myclass.mymethod ?
<jhass>
phale: find out, that'll answer your question
<phale>
okay
oo_ has joined #ruby
<jhass>
freezevee: that seems to lack context :)
<jhass>
remember, I do not see what you're doing/have any kind of access to your computer
<freezevee>
I love solving problems, am I sick ?
<jhass>
no, it's called "programming"
<freezevee>
lol
<freezevee>
I mean the more problems I see the more I enjoy it
jerius has quit [Quit: /quit]
danjordan has quit [Ping timeout: 252 seconds]
snockerton has joined #ruby
jerius has joined #ruby
<freezevee>
jhass: I got a message bin/main.rb:6:in `<main>': uninitialized constant Folderscan (NameError)
fryguy9 has joined #ruby
<jhass>
do you require the file that defines it?
<freezevee>
Folderscan is my class inside the /lib/folderscan.rb
oki has quit [Ping timeout: 264 seconds]
<freezevee>
yeap require 'folderscan'
<jhass>
mmh
<jhass>
and the require is at the top?
<freezevee>
jhass: but I am calling it with new_scan = Folderscan.new("new scan", full_path)
marr has quit []
<freezevee>
yes on the top
<jhass>
mmh
<jhass>
cat lib/folderscan.rb
coco has quit [Ping timeout: 256 seconds]
<jhass>
verify it relly defines that class
<jhass>
at toplevel namespace
kalusn has joined #ruby
jen_ has left #ruby [#ruby]
<freezevee>
it does
<freezevee>
does it matter If it's a module or a class? I guess not
ki0 has quit [Ping timeout: 245 seconds]
wallerdev has quit [Quit: wallerdev]
jenrzzz has quit [Ping timeout: 245 seconds]
yeticry has quit [Ping timeout: 256 seconds]
<jhass>
for calling .new on it it does matter, but that should give a different error
chrishough has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
any chance of maybe committing your current state and pushing it to github or something like that?
scripore has quit [Quit: This computer has gone to sleep]
yeticry has joined #ruby
wallerdev has joined #ruby
Hirzu has joined #ruby
<freezevee>
but I'll try
<shevy>
good science lasts forever!
<shevy>
actually we are already using camelcase
<shevy>
:)
<shevy>
class WaterContainer
panga has joined #ruby
Matthews_ has joined #ruby
ponga has quit [Ping timeout: 264 seconds]
oki has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
Matthews_ has quit [Remote host closed the connection]
B1n4r10 has joined #ruby
Matthews_ has joined #ruby
baweaver has joined #ruby
B1n4r10 has quit [Max SendQ exceeded]
MatthewsFace has quit [Ping timeout: 250 seconds]
rkgudboy has quit [Ping timeout: 244 seconds]
Takle has quit [Remote host closed the connection]
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ki0 has joined #ruby
rdark has joined #ruby
baweaver has quit [Remote host closed the connection]
Grumelo has quit [Read error: Connection reset by peer]
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tgunr has quit [Ping timeout: 256 seconds]
sinkensa_ has quit [Ping timeout: 246 seconds]
chrishough has joined #ruby
w0rldmaker has quit [Ping timeout: 245 seconds]
oki has quit [Ping timeout: 246 seconds]
tunaCanBruh has joined #ruby
mary5030 has quit [Remote host closed the connection]
dumdedum has quit [Quit: foo]
dj_zubehoer has quit [Remote host closed the connection]
gluten_hell has quit [Quit: Computer has gone to sleep.]
jenrzzz has joined #ruby
anaeem1_ has quit [Remote host closed the connection]
<shevy>
test
goshdarnyou has joined #ruby
zorak8 has quit [Ping timeout: 246 seconds]
mjuszczak has quit []
shadoi has joined #ruby
agarie_ has quit [Read error: Connection reset by peer]
ascarter has joined #ruby
panga has quit [Quit: Leaving...]
agarie has joined #ruby
sandelius has joined #ruby
segmond has quit [Ping timeout: 250 seconds]
sandelius has quit [Max SendQ exceeded]
sandelius has joined #ruby
unclouded has joined #ruby
Tuxero has joined #ruby
gr33n7007h has quit [Ping timeout: 252 seconds]
Nahra has quit [Remote host closed the connection]
gluten_hell has joined #ruby
xpoqp has quit [Ping timeout: 252 seconds]
agarie has quit [Read error: Connection reset by peer]
anaeem1_ has joined #ruby
skj3gg has quit [Quit: ZZZzzz…]
erichmenge has quit [Ping timeout: 246 seconds]
agarie has joined #ruby
oki has joined #ruby
lolmaus has joined #ruby
xpoqp has joined #ruby
marr has joined #ruby
mjuszczak has joined #ruby
withnale__ has quit [Ping timeout: 245 seconds]
skj3gg has joined #ruby
mikecmpbll has joined #ruby
baweaver has joined #ruby
sambao21 has joined #ruby
godd2 has quit [Remote host closed the connection]
mjuszczak has quit [Client Quit]
aerth has quit [Ping timeout: 264 seconds]
rodferso1 has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
sevvie has quit [Ping timeout: 240 seconds]
_Andres has joined #ruby
jonr22 has joined #ruby
rodfersou has quit [Ping timeout: 250 seconds]
kirun has joined #ruby
oki has quit [Ping timeout: 252 seconds]
Takle has joined #ruby
aerth has joined #ruby
sinkensabe has joined #ruby
erichmenge has joined #ruby
oki has joined #ruby
tvon has quit [Quit: leaving]
a5i has joined #ruby
coco has joined #ruby
lektrik has joined #ruby
godd2 has joined #ruby
em0ral has joined #ruby
dfinninger has joined #ruby
w0rldmaker has joined #ruby
jonr22 has quit [Ping timeout: 246 seconds]
tmtwd has joined #ruby
xpoqp has quit [Changing host]
xpoqp has joined #ruby
patrick99e99 has joined #ruby
segmond has joined #ruby
sevvie has joined #ruby
ponga has joined #ruby
Waheedi has joined #ruby
<patrick99e99>
hi ruby buddies... this may be a really dumbo quesiton, but I was wondering-- is there any kind of magical ruby method to override the presence of an object? Kind of like I can say module Foo; def self.nil?; true; end; end; ... Foo.nil? ==> true ... I would also like a way I can do: Foo and get nil.. so I can just do x = Foo; unless x; puts "I want to see this even though x is defined as the Foo module"; end ....
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
it0a has quit [Ping timeout: 252 seconds]
<godd2>
I want to believe he typed that without taking a breath
<jhass>
Foo = nil
chrishough has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sinkensa_ has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
agarie has quit [Remote host closed the connection]
valkyrka has joined #ruby
<patrick99e99>
jhass no... ? I don't want Foo to be nil...
<patrick99e99>
I am trying to implement a null object pattern...
<jhass>
so the answer is no ;)
<patrick99e99>
and I want an object that can represent a black hole...
w0rldmaker has quit [Ping timeout: 246 seconds]
<patrick99e99>
I see..
Grantlyk has joined #ruby
<patrick99e99>
I have to do Foo.nil? then... bummer
Hirzu has quit [Remote host closed the connection]
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tgunr has joined #ruby
tgunr has quit [Max SendQ exceeded]
agarie has joined #ruby
gr33n7007h has joined #ruby
freerobby has quit [Quit: Leaving.]
rdark has quit [Quit: leaving]
<godd2>
patrick99e99 null object pattern is for a particular object, not any in general
rbennacer has joined #ruby
iamjarvo has joined #ruby
tgunr has joined #ruby
sigurding has joined #ruby
it0a has joined #ruby
ghr has joined #ruby
tunaCanBruh has quit [Ping timeout: 252 seconds]
RegulationD has joined #ruby
<godd2>
So like for a NullUser where you return sensible nullish things for methods. like NullUser#email would return 'no email' or something
sinkensa_ has quit [Read error: Connection reset by peer]
freerobby has joined #ruby
sinkensabe has joined #ruby
niko has joined #ruby
plashchynski has quit [Quit: plashchynski]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
jenrzzz has joined #ruby
ghr has quit [Ping timeout: 252 seconds]
<shevy>
a black hole object
<shevy>
now you are challenging ruby's object system
<shevy>
it can't quite yet simulate the universe
shevy has quit [Excess Flood]
red_horned_rihno has quit [Ping timeout: 246 seconds]
shevy has joined #ruby
coco has quit [Ping timeout: 265 seconds]
graydot has quit [Quit: graydot]
toretore has quit [Quit: This computer has gone to sleep]
<freezevee>
yes I am idiot in case you're going to ask
<freezevee>
simply like that
topolinux has quit [Ping timeout: 246 seconds]
Hirzu has joined #ruby
<freezevee>
I keep the legend of wrong-case errors alive
<freezevee>
thanks a lot
segmond has quit [Ping timeout: 264 seconds]
tgunr has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
n80 has joined #ruby
kaiZen- has joined #ruby
gfawcettpq has quit [Ping timeout: 255 seconds]
ki0 has quit [Remote host closed the connection]
niko has quit [Read error: Connection reset by peer]
lolmaus has quit [Quit: Konversation terminated!]
mistergibson has joined #ruby
ki0 has joined #ruby
<mistergibson>
is it wise to do byte-pattern matching with Regex? If so, anyone got a cheetsheet, I suck at regex
<jhass>
mistergibson: what do you mean?
bhegel has joined #ruby
<mistergibson>
jhass, I was wondering about doing pattern matching to identify file headers
shevy has quit [Ping timeout: 240 seconds]
<patrick99e99>
godd2: the idea was in a rails serializer I want to do: def service; @options[:service] || Nullbuddy; end... And then other methods can do: def name; if service; 'omg'; else; 'lol'; end... But I have to do if service.nil?; 'omg'; else 'lol'...
sandelius has joined #ruby
mbeasley has quit [Quit: WeeChat 0.4.2]
baroquebobcat has quit [Quit: baroquebobcat]
<mistergibson>
I can get the bytes, but I was looking into using regex for quick pattern matching
<patrick99e99>
Nullbuddy has def nil?; true; end...
mbeasley has joined #ruby
<patrick99e99>
err def self.nil? i mean
pragmatism has joined #ruby
graydot has joined #ruby
<jhass>
mistergibson: hard to tell without knowing the possible values you want to match against
Spooner has joined #ruby
<mistergibson>
jhass, I'd look those up prior of course
Grantlyk has quit [Remote host closed the connection]
<godd2>
patrick99e99 perhaps in this case you should make a class called NullService that wraps nil-like functionality for non-existing services
Pumukel has joined #ruby
<mistergibson>
jhass, for instance: file that begins with FEFF0CB1
<godd2>
so that service.name will return 'omg' if it's a NullService and 'lol' if it's some genuine service or whatever you want
baroquebobcat has joined #ruby
otisZart has joined #ruby
<jhass>
mistergibson: so it's actually no pattern but a static value?
w0rldmaker has joined #ruby
<jhass>
.bytes[0, 4] == [0xfe, 0xff, 0x0c, 0xb1]
<mistergibson>
jhass, ok - it is a byte pattern on the header of a file. I plan to sample the first 4K of the file and see if I can find the pattern that I already know for that file format - see?
FooMunki_ has quit [Quit: FooMunki_]
chinmay_dd has joined #ruby
<mistergibson>
jhass, I just don't know how to do hex matching in regex
shevy has joined #ruby
patrick99e99 has quit [Quit: leaving]
Hirzu has quit [Remote host closed the connection]
doodleha_ has joined #ruby
doodlehaus has quit [Read error: Connection reset by peer]
<mistergibson>
jhass, well, I'd rather use regex because I may have to sift though some bytes
ferr has quit [Quit: WeeChat 1.1.1]
mrsolo has quit [Ping timeout: 264 seconds]
jzigmund has quit [Ping timeout: 245 seconds]
lsmola has quit [Ping timeout: 245 seconds]
scripore has joined #ruby
rodferso1 has quit [Quit: leaving]
rodfersou has joined #ruby
randiman has quit [Quit: (null)]
mrsolo has joined #ruby
agent_white has joined #ruby
shadoi has quit [Ping timeout: 252 seconds]
<jhass>
mistergibson: still not entirely convinced but make sure to read as binary (ASCII-8bit) and just match against /\xFE\xFF\x0C\xB1/n
djellemah has quit [Quit: Leaving]
sinkensa_ has joined #ruby
doodleha_ has quit [Read error: Connection reset by peer]
sinkensabe has quit [Read error: Connection reset by peer]
doodlehaus has joined #ruby
jzigmund has joined #ruby
^Denis has joined #ruby
segmond has joined #ruby
patrick99e99 has joined #ruby
tgunr has joined #ruby
dEPy has quit [Quit: (null)]
doodleha_ has joined #ruby
otisZart has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
The_Phoenix has quit [Read error: Connection reset by peer]
Grantlyk has joined #ruby
sinkensa_ has quit [Read error: Connection reset by peer]
adriancb has quit [Read error: Connection reset by peer]
sinkensabe has joined #ruby
doodlehaus has quit [Ping timeout: 246 seconds]
tunaCanBruh has joined #ruby
doodlehaus has joined #ruby
odin22 has quit [Ping timeout: 245 seconds]
doodleha_ has quit [Read error: Connection reset by peer]
gfawcettpq has joined #ruby
piotrj has quit [Remote host closed the connection]
nisstyre has joined #ruby
blackmesa has joined #ruby
huddy has quit [Quit: Connection closed for inactivity]
<meshugga>
what's the best ruby learning ebook for people who can already program other languages?
mjuszczak has joined #ruby
<meshugga>
something to read on a tablet, no fixed size pdfs preferred
<meshugga>
ruby 2.0+ ideally
dj_zubehoer has joined #ruby
adriancb has joined #ruby
davidhq has joined #ruby
lsmola has joined #ruby
lolmaus has joined #ruby
shevy has quit [Ping timeout: 264 seconds]
Asher has quit [Quit: Leaving.]
baweaver has quit [Remote host closed the connection]
vdamewood has joined #ruby
ki0_ has joined #ruby
dj_zubehoer has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ldnunes has joined #ruby
mjuszczak has quit [Client Quit]
fabrice31 has joined #ruby
baweaver has joined #ruby
mjuszczak has joined #ruby
davidhq has quit [Client Quit]
tvon has joined #ruby
HOrangeJewce has joined #ruby
baweaver has quit [Remote host closed the connection]
ki0 has quit [Ping timeout: 255 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
DerisiveLogic has joined #ruby
doodlehaus has quit [Read error: Connection reset by peer]
paulfm has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<a5i>
Hi DerisiveLogic
doodlehaus has joined #ruby
<DerisiveLogic>
a5i: Haha, figures.
baroquebobcat has joined #ruby
Millsdev has quit [Quit: Leaving.]
WildBamboo-Josh has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
chrishough has joined #ruby
zacstewart has quit [Remote host closed the connection]
sinkensabe has joined #ruby
bluOxigen has quit [Ping timeout: 245 seconds]
coco has joined #ruby
<HOrangeJewce>
Hi, I'm creating a gem but am having problems with my require path, I'm getting an error when attempting to use a file located under lib/[gemname]/ saying the file can't be found even though it's listed in the gemspec. I think I'm missing something obvious.
DerisiveLogic has quit [Ping timeout: 252 seconds]
davejacobs has joined #ruby
shevy has quit [Ping timeout: 252 seconds]
ych4k3r has joined #ruby
diegoviola has joined #ruby
Takle has quit [Remote host closed the connection]
w0rldmaker has quit [Client Quit]
bodge has joined #ruby
martinbmadsen has quit [Ping timeout: 246 seconds]
otisZart has joined #ruby
plashchynski has joined #ruby
segmond has quit [Ping timeout: 265 seconds]
odigity has joined #ruby
Kricir has quit [Remote host closed the connection]
<bodge>
Just upgraded 2.2.0 to 2.2.1 and witnessed an avalanche of "Ignoring <gem> because its extensions are not built. Try: gem ....". Am I really going to have to go through all this every time I upgrade to a minor point release?
ych4k3r_ has quit [Ping timeout: 250 seconds]
alkoma has joined #ruby
beneggett has joined #ruby
mattwildig has joined #ruby
qhartman has quit [Quit: Ex-Chat]
valkyrka has quit [Ping timeout: 264 seconds]
davejacobs has quit [Ping timeout: 250 seconds]
valkyrka has joined #ruby
Hirzu has joined #ruby
despai has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
Takle has joined #ruby
kaiZen- has quit [Quit: Computer has gone to sleep.]
phoo1234567 has joined #ruby
ParmesanCaesar has quit [Ping timeout: 256 seconds]
adriancb has quit [Read error: Connection reset by peer]
adriancb has joined #ruby
despai has quit [Client Quit]
Hirzu has quit [Ping timeout: 255 seconds]
jottr_ has joined #ruby
phoo1234567 has quit [Max SendQ exceeded]
phoo1234567 has joined #ruby
<jhass>
HOrangeJewce: getting unitialized constant Timeout::Error when loading that file directly, but the require seems working here
<havenwood>
bodge: You can rebuild all extensions with: gem pristine --extensions
Zai00 has quit [Quit: Zai00]
sambao21 has joined #ruby
alvaro_o has joined #ruby
kith has quit [Quit: kith]
willharrison has joined #ruby
kith has joined #ruby
<HOrangeJewce>
jhass: did you just touch a ruby file and run the include?
<jhass>
HOrangeJewce: just fired up pry
<HOrangeJewce>
I wonder if my rvm is broke
AlphaTech has quit []
mattwildig has quit []
<jhass>
but ruby -r'sensu-plugins-aws/helpers' -e '' does the same
<HOrangeJewce>
jhass: that's what happens to me too when I run the require in irb
segmond has joined #ruby
baweaver has joined #ruby
Dolphi has quit [Ping timeout: 272 seconds]
<HOrangeJewce>
ill check that out i guess
Morkel has joined #ruby
<jhass>
HOrangeJewce: but in a script you get a LoadError?
<HOrangeJewce>
jhass: yes
<jhass>
how exactly do you run that script?
<havenwood>
bodge: Adding --env-shebang to your .gemrc also helps with being able to update without rebuilding. It look like it won't be a default option until RubyGems 2.5, see: https://github.com/rubygems/rubygems/issues/1049
fryguy9 has quit [Quit: Leaving.]
<havenwood>
bodge: You can add it to your .gemrc: gem: --env-shebang
<HOrangeJewce>
jhass: I run one of the included binaries in the gem
odin22 has joined #ruby
<HOrangeJewce>
check-vpc-vpn.rb
<bodge>
havenwood: Thanks.
<ton31337>
hey
AlexRussia has joined #ruby
<ton31337>
what does rb_call and rb_call0 ?
enebo has joined #ruby
sevvie has quit [Ping timeout: 255 seconds]
<jhass>
HOrangeJewce: oh interesting
<jhass>
I wonder if sensu messes somehting up there
<HOrangeJewce>
its possible i guess
bodge has quit [Quit: BitchX: No wardrobe malfunctions here!]
shevy has joined #ruby
<jhass>
HOrangeJewce: bah, we're both stupid :P
<HOrangeJewce>
but if i do a relative require on the file I don't see the problem
<jhass>
require 'sensu-pulgins-aws/helpers'
<HOrangeJewce>
oh?
patrick99e99 has quit [Ping timeout: 264 seconds]
<jhass>
pulgins
andikr has quit [Remote host closed the connection]
hollywood has quit [Quit: Leaving]
<HOrangeJewce>
i hate myself
robustus|Off is now known as robustus
<HOrangeJewce>
the rage is real
sevvie has joined #ruby
jonr22 has joined #ruby
<jhass>
I can understand
sigurding has quit [Quit: sigurding]
mjuszczak has quit []
patrick99e99 has joined #ruby
meschi has joined #ruby
bhegel has quit [Quit: bhegel]
jen_ has joined #ruby
<HOrangeJewce>
jhass: thank you so so so much for the help
<HOrangeJewce>
<3
<weaksauce>
haha
bweston92 has quit [Ping timeout: 265 seconds]
AlexRussia has quit [Ping timeout: 245 seconds]
EasyCo has joined #ruby
jonr22 has quit [Ping timeout: 272 seconds]
segmond has quit [Ping timeout: 256 seconds]
piotrj has quit [Remote host closed the connection]
zyxelthrone has joined #ruby
piotrj has joined #ruby
enebo has quit [Ping timeout: 256 seconds]
justin_pdx has quit [Quit: justin_pdx]
omosoj has joined #ruby
AlexRussia has joined #ruby
<miah>
~.
enebo has joined #ruby
mjuszczak has joined #ruby
checkit has quit [Ping timeout: 256 seconds]
bhegel has joined #ruby
mbeasley has quit [Quit: WeeChat 0.4.2]
mbeasley has joined #ruby
baweaver has quit [Remote host closed the connection]
oki has quit [Read error: Connection reset by peer]
ldnunes has quit [Quit: Leaving]
oki has joined #ruby
<jen_>
With the help of a developer, we implemented pry. Now, we are running in production and need to remove those binding.pry
<jen_>
grep -r binding.py * isn’t helping.
spyderma_ has quit [Ping timeout: 256 seconds]
aswen has quit [Ping timeout: 245 seconds]
skj3gg_ has joined #ruby
<wasamasa>
perhaps it helps to spell its name correctly "binding.pry"
sarkis has quit [Ping timeout: 244 seconds]
<jen_>
ya ya ya of course
yatish27 has joined #ruby
mkaesz has joined #ruby
<yatish27>
I want to parse a simple string like "My name is **NAME**" to "My name is <strong>NAME</strong>"
<yatish27>
Hoe can I go ahead with this
Hijiri has quit [Quit: WeeChat 1.0.1]
zachrab has quit [Ping timeout: 264 seconds]
<jhass>
yatish27: Please do not crosspost without at least telling so. Experience shows that people don't bother to inform the other channels of provided solutions, therefore it is considered rude.
Morkel has quit [Quit: Morkel]
dtordable has joined #ruby
skj3gg has quit [Ping timeout: 244 seconds]
StoneCypher has quit [Ping timeout: 245 seconds]
<yatish27>
jhass: Got it Thanks
dtordable has quit [Changing host]
dtordable has joined #ruby
ascarter has joined #ruby
<yatish27>
Any heads up on how to go ahead with this ?
<jhass>
yatish27: rubular.com if you want to go the regexp route
thumpba has joined #ruby
postmodern has joined #ruby
<yatish27>
I tried but didnt get any
<jhass>
note that markdown isn't well defined and quite a few edge case hard to handle with a regexp parser
ych4k3r has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bhegel has quit [Quit: bhegel]
etdev has quit [Ping timeout: 265 seconds]
brb3 has quit [Quit: <.<]
mrsolo has quit [Quit: Leaving]
<havenwood>
ducklobster: Bundler is indeed basically the default, so much so that its features are being incrementally merged into RubyGems, so sometime after Bundler 2 it'll theoretically be deprecated once RubyGems can entirely replace its functionality.
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Limix has quit [Quit: Limix]
riotjones has joined #ruby
enebo has quit [Ping timeout: 272 seconds]
kaiZen has joined #ruby
elfuego has joined #ruby
Tuxero has quit [Quit: Tuxero]
beneggett has joined #ruby
replay has quit [Ping timeout: 264 seconds]
adriancb_ has joined #ruby
Tuxero has joined #ruby
gmcintire has joined #ruby
adriancb has quit [Read error: Connection reset by peer]
<GaryOak_>
automating your automation, nice
ghr has joined #ruby
riotjone_ has quit [Ping timeout: 252 seconds]
rbennacer has quit [Ping timeout: 256 seconds]
jerematic has joined #ruby
segmond has joined #ruby
dandaman has joined #ruby
enebo has joined #ruby
baroquebobcat has joined #ruby
tmtwd has quit [Remote host closed the connection]
enebo_ has quit [Ping timeout: 250 seconds]
<dandaman>
I have an array variable I want to be able to add to in a class, I created this method "def standards<<(new_standard)"
Tuxero has left #ruby [#ruby]
<dandaman>
is that the correct way to declare that method to add to my @standards array?
elfuego has quit [Client Quit]
odigity has joined #ruby
zacstewart has quit [Remote host closed the connection]
<jhass>
dandaman: well, does it work like you expect? ;)
<dandaman>
jhass: no, syntax error, unexpected <<, expecting ';' or '\n'
<jhass>
dandaman: so, << is special method name, it's allowed in itself, but not combined with other stuff
ghr has quit [Ping timeout: 264 seconds]
<jhass>
object << "foo" is syntax sugar for object.<<("foo")
mjuszczak has joined #ruby
<jhass>
there for object.accessor << "foo" is syntax sugar for object.accessor.<<("foo")
jerius has quit [Ping timeout: 240 seconds]
<dandaman>
I just want to be able to go myClass.standards << my_standard_class
<dandaman>
where myClass.standards is an array of standards :\
adriancb_ has quit [Read error: Connection reset by peer]
HOrangeJewce has quit [Quit: Leaving.]
<jhass>
I got that
Aswebb_ has joined #ruby
<jhass>
I was trying to explain what's happening you understand it
<jhass>
does anything I said make any sense to you?
maletor has joined #ruby
mjuszczak has quit [Client Quit]
<dandaman>
sorry, I'm doing a coding exercise which i need to have done in an hour, syntax isn't really an important thing for me to get right now
<dandaman>
if i had unlimited time i'd take the time to understand it :\
<bradland>
oh man
<jhass>
sorry, with that attitude you shall fail
shevy has joined #ruby
<jhass>
syntax is all there's to solve this
<bradland>
i know you're not going to want to hear this, but the notion that you can learn programming by learning some incantations is a path to failure
<dandaman>
no, syntax is not the programming exercise, i'm just doing it in ruby to appease them
<bradland>
or rather, memorizing incantations
<dandaman>
i know what you guys are talking about, i need to understand how ruby works, that is not my goal at the moment
<dandaman>
when i have time i will learn that
<jhass>
cool, then you didn't come to the right place
<jhass>
bye
<havenwood>
dandaman: to please who? if you don't want to understand, put parens around everything. >.>
StoneCypher has quit [Ping timeout: 272 seconds]
<shevy>
dandaman you need to try to look at things from the ruby parser
<havenwood>
shevy: or be one
<shevy>
yeah like in order to understand your enemy, you must become the enemy
baroquebobcat has quit [Quit: baroquebobcat]
<havenwood>
a being with a human head and arms, but the body of a Ruby parser
<wasamasa>
lol
mbeasley has quit [Ping timeout: 246 seconds]
sdrew has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Megtastique has quit []
johnh has joined #ruby
segmond has quit [Ping timeout: 252 seconds]
adriancb has joined #ruby
lele has joined #ruby
<bradland>
dandaman: i like to dig around in rubinius source code when trying to figure out how features like foo << bar are implemented
<jhass>
Dolphi: as I said I would do it in the output method instead
sevvie has joined #ruby
<jhass>
instead of puts "Foo".formatted, do formatted_puts "Foo"
<jhass>
and define formatted_puts
<Dolphi>
jhass: Thanks buddy. :)
tunaCanBruh has quit [Ping timeout: 265 seconds]
<Dolphi>
bradland: You never got around to teaching me Linux man!
zyxelthrone has quit [Ping timeout: 265 seconds]
<bradland>
did you end up learning it anyway?
<bradland>
:)
otisZart has joined #ruby
elfuego has joined #ruby
graydot has quit [Quit: graydot]
Musashi007 has joined #ruby
StoneCypherAW has quit [Ping timeout: 264 seconds]
<Dolphi>
I haven't even got around to touching it actually :P I've been learning a bit of web dev but mostly just working. Six day weeks for the passed month or so.
<Dolphi>
I'm still very interested in learning though, and I have Ubuntu Linux installed on VirtualBox. :)
leafybasil has joined #ruby
graydot has joined #ruby
segmond has joined #ruby
tunaCanBruh has joined #ruby
adriancb has quit [Read error: Connection reset by peer]
graydot has quit [Client Quit]
shevy has quit [Ping timeout: 246 seconds]
StoneCypherAW has joined #ruby
wicope has quit [Read error: Connection reset by peer]
mitchellhenke has quit [Quit: Computer has gone to sleep.]
livathin_ has quit []
dtordable has quit [Quit: • IRcap • 8.72 •]
rushed has quit [Quit: rushed]
graydot has joined #ruby
ki0 has quit [Remote host closed the connection]
odin22 has quit [Read error: Connection reset by peer]
bricker has quit [Ping timeout: 272 seconds]
graydot has quit [Client Quit]
adriancb has joined #ruby
Dolphi has quit [Ping timeout: 244 seconds]
Aswebb_ has quit [Remote host closed the connection]
Axy has quit [Read error: Connection reset by peer]
fox_mulder_cp has joined #ruby
Aswebb_ has joined #ruby
beneggett has joined #ruby
<fox_mulder_cp>
does anybody help me with RoR select_tag multiselect helper?
<fox_mulder_cp>
i try to pass select_tag collection, which i need select when page render, but it don't selected items, when rendered page, i must select it manually
yfeldblum has joined #ruby
segmond has quit [Ping timeout: 256 seconds]
enebo has quit [Ping timeout: 256 seconds]
shevy has joined #ruby
<apeiros_>
fox_mulder_cp: #rubyonrails
Aswebb_ has quit [Ping timeout: 272 seconds]
plashchynski has quit [Quit: plashchynski]
<fox_mulder_cp>
thanls
fox_mulder_cp has left #ruby [#ruby]
bricker has joined #ruby
rekky has quit [Remote host closed the connection]
ghr has joined #ruby
funburn has joined #ruby
freerobby has quit [Quit: Leaving.]
mjuszczak has quit []
devdazed has joined #ruby
shevy has quit [Ping timeout: 246 seconds]
ismaelga has joined #ruby
starless has quit [Quit: Leaving]
replay has joined #ruby
paolooo has quit [Ping timeout: 246 seconds]
ghr has quit [Ping timeout: 256 seconds]
Tinfoilhat_ has joined #ruby
Dolphi has joined #ruby
plashchynski has joined #ruby
shevy has joined #ruby
bigmac has quit [Ping timeout: 272 seconds]
Zai00 has quit [Quit: Zai00]
StoneCypherAW has quit [Ping timeout: 240 seconds]
RegulationD has quit [Remote host closed the connection]
thiagovsk has quit [Quit: Connection closed for inactivity]
Hijiri has joined #ruby
segmond has joined #ruby
rekky has joined #ruby
fabrice31 has joined #ruby
shevy has quit [Ping timeout: 244 seconds]
ndrei has quit [Ping timeout: 272 seconds]
replay has quit [Ping timeout: 240 seconds]
snockerton has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yfeldblum has quit [Ping timeout: 256 seconds]
rrrutr has quit [Quit: Leaving]
maknz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shevy has joined #ruby
havenwood has joined #ruby
snockerton has joined #ruby
replay has joined #ruby
fabrice31 has quit [Ping timeout: 246 seconds]
JDiPierro has quit [Remote host closed the connection]
nettoweb has joined #ruby
Pumukel has quit [Ping timeout: 256 seconds]
segmond has quit [Ping timeout: 252 seconds]
blahwoop has joined #ruby
bruno-_ has quit [Ping timeout: 265 seconds]
dandaman has quit [Quit: Leaving.]
<blahwoop>
i wrote a simple guess who game and i'm looking to refactor my code. it's over 200 lines. would anybody mine taking a quick look at it and give some advice? u can leave a comment on it. https://gist.github.com/iRichLau/5143bd87db385cbe5ad0
<blahwoop>
thanks
<bradland>
blahwoop, eh?
<bradland>
HGTTG?
ismaelga has quit [Remote host closed the connection]
shevy has quit [Ping timeout: 240 seconds]
<blahwoop>
?
lordkryss has quit [Quit: Connection closed for inactivity]
beneggett has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Musashi007 has quit [Quit: Musashi007]
<bradland>
i feel like i recognize the name blahwoop from hitchhiker's guide to the galaxy
<blahwoop>
haha
omosoj has quit [Ping timeout: 245 seconds]
justin_pdx has quit [Quit: justin_pdx]
<jhass>
blahwoop: that extra line numbers are kind of distracting :P
<blahwoop>
it's something i made up. been my nick for the past 20 years
sevvie has quit [Ping timeout: 245 seconds]
shevy has joined #ruby
ndrei has joined #ruby
bhegel has joined #ruby
<blahwoop>
jhass: ill remove them lol
DEA7TH has joined #ruby
sevvie has joined #ruby
<jhass>
blahwoop: overall structure seems fine though
<blahwoop>
anyway to make the ask methods less repetitive