<jhass>
but it's still worthwile to understand the issue in the code you wrote
<doddok>
max(2) loooks so stupid
<doddok>
should be take_max
<Radar>
doddok: patches welcome
sulky has quit [Ping timeout: 272 seconds]
sulky has joined #ruby
doodleha_ has quit [Remote host closed the connection]
<vnk>
jhass: yeah, basicly when I remove that line 10 I get biggest element correctly, but there is problem with second largest. I understund what is problem. problem is when I input for example 2,5,1 array largest one will be set to 2, then largest will be set to 5, and then at the end largest will be larger then 1 and it will set second_largest to 1 but it should be 2.. now I am thinking how I can fix that
norc has quit [Ping timeout: 246 seconds]
SCHAAP137 has quit [Quit: Leaving]
Lytol has quit [Quit: Lytol]
<Radar>
vnk: Why aren't you using max(2) yet?
<al2o3-cr>
it might be a learning exercise
<vnk>
Radar: trying to make this method work, of course I will rewrite whole method with max(2) at the end bescause its much cleaner. but I just want to practice a bit logical thinking :)
Spami has quit [Quit: This computer has gone to sleep]
<jhass>
vnk: well, think about when you found the second largest element _so far_, at which point does that happen?
<jhass>
what other condition might be present at the same time?
<blubjr>
im folding over an array where each element is an array of two elements, where both of those is an array of two elements. is there a way to destructure that into four arguments in the blocks arglist
ta has quit [Read error: Connection reset by peer]
saddad has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cwong_on_irc has quit [Quit: Leaving.]
ta has joined #ruby
JazzyVariable227 has joined #ruby
freerobby has joined #ruby
maloik has joined #ruby
poguez_ has quit [Quit: Connection closed for inactivity]
JazzyVariable227 has quit [Remote host closed the connection]
RobertBirnie has joined #ruby
griffindy has joined #ruby
maloik has quit [Ping timeout: 250 seconds]
tulak has quit [Remote host closed the connection]
marr has quit [Ping timeout: 272 seconds]
yoongkang has quit [Remote host closed the connection]
millerti_ has quit [Read error: Connection reset by peer]
doodleha_ has joined #ruby
bds has joined #ruby
eminencehc has joined #ruby
doodleha_ has quit [Remote host closed the connection]
axsuul has quit [Ping timeout: 240 seconds]
vnk has quit [Read error: Connection reset by peer]
<bds>
Does anyone use the stdlib debug.rb? I would like to use a standard tool but there seems to very limited documentation - can someone recommend something that is similar? Pry itself seems like a lot - just need something to set break/watchpoints and step through the call stack
<jhass>
bds: pry-byebug
<bds>
jhass: ty :)
wilsonc91 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sulky has quit [Ping timeout: 272 seconds]
finisherr has quit [Quit: finisherr]
tref has quit [Quit: tref]
_blizzy_ has quit [Quit: Leaving]
Ropeney has joined #ruby
baweaver has quit [Remote host closed the connection]
millerti has joined #ruby
_stu_ has quit [Quit: _stu_]
newbie1 has quit [Ping timeout: 265 seconds]
djbkd has joined #ruby
yqt has joined #ruby
symm- has quit [Ping timeout: 250 seconds]
_stu_ has joined #ruby
mattwildig has quit [Remote host closed the connection]
mattwildig has joined #ruby
fedexo has quit [Ping timeout: 272 seconds]
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
mattwildig has quit [Ping timeout: 252 seconds]
howdoicomputer has quit [Read error: Connection reset by peer]
karapetyan has joined #ruby
JazzyVariable227 has joined #ruby
howdoicomputer has joined #ruby
aspiers_ has joined #ruby
maloik has joined #ruby
build22 has joined #ruby
eminencehc has quit [Remote host closed the connection]
<al2o3-cr>
I can't understand why it just hangs (confused.com)!
moeabdol has quit [Ping timeout: 272 seconds]
hotpancakes has quit [Remote host closed the connection]
nertzy has quit [Quit: This computer has gone to sleep]
Guest44916 has quit [Quit: Leaving]
krz has joined #ruby
quarters has joined #ruby
_stu_ has quit [Quit: _stu_]
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
nofxx has quit [Changing host]
nofxx has joined #ruby
Mon_Ouie has quit [Ping timeout: 272 seconds]
<al2o3-cr>
I want to make a ping program using the Ruby socket library, any help will be much appreciated!
<quarters>
hello. I was trying to access an octopress page running on a linux server with (rake preview) on a windows client, but while I see activity on the tcpdump, the windows browser doesn't connect, whereas I can run the page on the server's browser
<quarters>
I know that octopress is run using jekyll and rack gems, but wasn't sure if the issue is one of configuration
dorei has quit []
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
maloik has joined #ruby
zenguy_pc has quit [Read error: No route to host]
hotpancakes has joined #ruby
mooe has joined #ruby
maloik has quit [Ping timeout: 260 seconds]
jordanm has quit [Quit: Konversation terminated!]
ismaelga has quit [Read error: Connection reset by peer]
ismaelga has joined #ruby
yoongkang has joined #ruby
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
JazzyVariable227 has joined #ruby
JazzyVariable227 has quit [Remote host closed the connection]
yoongkang has quit [Ping timeout: 255 seconds]
DurstBurger has quit [Ping timeout: 240 seconds]
axsuul has joined #ruby
wilsonc91 has joined #ruby
mattwildig has joined #ruby
pwnd_nsfw has quit [Ping timeout: 246 seconds]
Bellthoven has quit []
<jackcom>
1, 0, ‘’, are all true?
maloik has joined #ruby
babblebre has joined #ruby
mary5030 has quit [Remote host closed the connection]
zenguy_pc has joined #ruby
<jackcom>
:(
<al2o3-cr>
jackcom: yep, only nil and false are non truthy
zenguy_pc has quit [Read error: Connection reset by peer]
<jackcom>
thanks al2o3-cr
<al2o3-cr>
jackcom: np :)
<jackcom>
i know that 0 is false in c
<jackcom>
al2o3-cr:
<al2o3-cr>
jackcom: you'll soon pick ruby up :)
<jackcom>
ok thanks
Mon_Ouie has joined #ruby
maloik has quit [Ping timeout: 264 seconds]
kies has joined #ruby
stannard has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hotpancakes has quit [Remote host closed the connection]
baweaver has joined #ruby
goodcodeguy has joined #ruby
arahael has joined #ruby
<arahael>
Ruby novice here. WHat's the quickest and easiest way for me to do a 'gem install jekyll' into a local directory? (Ie, I can't pollute the system)
pwnd_nsfw has joined #ruby
<Radar>
arahael: Best long term solution is to install Ruby with ruby-install (which'll install Ruby into your home dir) and then use chruby to switch into that Ruby.
<Radar>
arahael: From there, gem install jekyll will install into a dir inside your home directory.
hotpancakes has joined #ruby
baweaver has quit [Ping timeout: 276 seconds]
<arahael>
Radar: Hmm, so using brew's ruby is a somewhat similar approach?
<Radar>
arahael: If it's writable by the user, then sure.
hotpancakes has quit [Remote host closed the connection]
zenguy_pc has joined #ruby
<Radar>
The standard Ruby that comes with OS X is not writable by the user.
<arahael>
Radar: brew's ruby is, yes. Ok, I'll check out that guide.
rgrmatt has quit [Remote host closed the connection]
<arahael>
Looks like that while brew's ruby will work for me, your approach is much more flexible.
<Radar>
Yes, you can install multiple versions of Ruby.
jeffreylevesque has joined #ruby
<jeffreylevesque>
anyone know how to lint puppet templates (i.e. erb) files? Should i use ruby's "rubocop", or is there some command built into puppet?
<jhass>
arahael: that said to answer your actual question, install the bundler gem globally, create a Gemfile in your directory (bundle init) and add `gem "jekyll"` to it, then run bundle install --path vendor
<jhass>
arahael: and bundle exec jekyll to run it
devyn has quit [Remote host closed the connection]
zacts has quit [Ping timeout: 246 seconds]
chipotle has quit [Quit: cheerio]
iyan has joined #ruby
hotpancakes has joined #ruby
<arahael>
jhass: I like that answer better, as I don't actually need multiple rubies yet.
maloik has joined #ruby
<Radar>
Sorry, I've got my head stuck in "people will develop on more than one Ruby project" land
<arahael>
Radar: No, that's a perfectly reasonable space to be in.
mary5030 has joined #ruby
RobertBirnie has joined #ruby
chipotle has joined #ruby
<arahael>
jhass: Works like a charm. A few extra steps were required, but the tool's error messages talked me through it.
build22 has joined #ruby
<Radar>
\o./
maloik has quit [Ping timeout: 272 seconds]
platzhirsch has joined #ruby
<platzhirsch>
How would you check in an ordered array if one item is bigger than its successor?
<arahael>
platzhirsch: What's "bigger"?
howdoicomputer has quit [Ping timeout: 272 seconds]
ellismarte has joined #ruby
<jhass>
ordered how?
<platzhirsch>
arahael: strictly greater than >
<platzhirsch>
this would hold true for example for [1, 2, 3]
<jhass>
?xy
<ruboto>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<arahael>
platzhirsch: Well, that doesn't make sense. If it's an ordered array, then surely the answer is very, very trivial/
driftig has quit [Changing host]
driftig has joined #ruby
<platzhirsch>
probably.. let me think..
<jhass>
platzhirsch: so you simply want true for [1, 2, 3] but false for [1, 1, 2, 3] ?
<platzhirsch>
yeah..
build22 has quit [Ping timeout: 272 seconds]
symm- has joined #ruby
<platzhirsch>
although I already invoke unique on them.. so
<jhass>
.size == .uniq.size if you don't mind the allocation
<platzhirsch>
ah compare it with sorted maybe or so
<jhass>
well, uniq.sort will guarantee that property already
<arahael>
I assume, given that he does NOT have an "ordered array", that he also wants [1, 3, 2] to be false.
<jhass>
the initial question said it's ordered
cashnguns has joined #ruby
<platzhirsch>
yeah true,.. it doens't really make sense
<jhass>
maybe he should actually answer to my "ordered how?"
<platzhirsch>
my apologizes, was stuck for 8h on an aiport :D now trying to write code in the train,.. sort and uniq are already enough to solve my problem
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<platzhirsch>
apologies
<arahael>
platzhirsch: I'm intrigued though - what was the original problem?
<platzhirsch>
arahael: Input are two times, start time t1, end time t2. Then I loop from t1 -> t2 in 10minute steps and create instances with a bit of data for each
<platzhirsch>
in my spec I wanted to test that the loop actually works
symm- has quit [Quit: Leaving...]
<platzhirsch>
and that there is a series of continuous intervals
<platzhirsch>
would also be nice to see, that the distance is always 10 minutes
hotpancakes has quit [Remote host closed the connection]
<platzhirsch>
oh.. each_cons was actually what I was looking for
<arahael>
platzhirsch: I'd probably compuate a sequence of 10 minute times, and then the least-squares difference between those and your actual times, and pass the test if the delta is sufficiently small.
<jhass>
platzhirsch: and that's why I triggered ?xy earlier ;)
<platzhirsch>
jhass: fair enough
blueOxigen has joined #ruby
Melpaws has quit [Quit: Leaving.]
bluOxigen has quit [Ping timeout: 260 seconds]
JazzyVariable227 has joined #ruby
ellismarte has quit [Quit: ellismarte]
fbidu has joined #ruby
maloik has quit [Ping timeout: 260 seconds]
tmtwd has joined #ruby
maloik has joined #ruby
m3_del has quit [Remote host closed the connection]
stannard has quit [Remote host closed the connection]
ellismarte has joined #ruby
<ellismarte>
is there a way to turn a string into ruby syntax? like “steve = User.new” becomes steve = User.new
<jhass>
ellismarte: yes, but we should solve your problem differently. What are you trying to achive?
<arahael>
ellismarte: That string already looks like ruby syntax.
<platzhirsch>
eval? But it's dangerous
<jhass>
^ please don't just use it
JazzyVariable227 has quit [Remote host closed the connection]
bluOxigen has joined #ruby
<platzhirsch>
sorry
<platzhirsch>
don't use eval!
<ellismarte>
jhass: i’m writing a language that takes a sentence like “create a new user called steve” and then it makes a class out of it by parsing the sentence and outputting to a new file
blueOxigen has quit [Ping timeout: 265 seconds]
exadeci has joined #ruby
<jhass>
ellismarte: look at gherkin/cucumber
<ellismarte>
ok
<ellismarte>
jhass: are you saying look @ how they did it?
yqt has quit [Ping timeout: 265 seconds]
<jhass>
I'm saying it sounds like you're reinventing it
<pontiki>
it sounds like he's parsing natural language and turning it into ruby code
<ellismarte>
jhass: yes but i want it to be domain inspecific language
maloik has quit [Ping timeout: 260 seconds]
<jhass>
how is gherkin/cucumber domain specific?
<arahael>
ellismarte: You always have a domain.
platzhirsch has left #ruby [#ruby]
<ellismarte>
jhass: isn’t it made for testing?
<eam>
ellismarte: just say you're doing it for fun / for practice and they'll leave you alone ;)
<ellismarte>
eam: lol yeah it’s for fun
<jhass>
that might be it's primary application, which of course feeds back into the available integrations and its development, but I wouldn't say it's technically limited to that
<pontiki>
so if you're writing a file of ruby code, is there any reason you can't or shouldn't run ruby on it?
JazzyVariable227 has joined #ruby
<pontiki>
like concerns about malicious code, etc
<eam>
everyone's right that it's a bad idea to implement stuff like this from scratch for a production application -- but it's a fantastic thing to do as a project for learning
<pontiki>
there are ruby parsers, for example. not sure what the end result your looking for is
yoongkang has joined #ruby
dkphenom has joined #ruby
lessless has joined #ruby
<pontiki>
writing a grammar and parser is a cool thing, and using it generate ruby code is even cooler
<ellismarte>
can’t figure out how to get rid of the strings … maybe use chomp … and whatever method slices off the first character …
stannard has joined #ruby
mary5030 has quit [Remote host closed the connection]
yoongkang has quit [Ping timeout: 252 seconds]
baweaver has joined #ruby
fbidu has quit [Quit: Leaving]
<arahael>
ellismarte: First, I'll clearly and strongly suggest you find an existing, production system. gherkin/cucumber is probably a perfect match. However, for learning purposes I suggest learning how to write that ruby string to a file, and execute it using ruby as a subprocess.
<pontiki>
you mean the quotes, ellismarte ?
<ellismarte>
pontiki: yes
<ellismarte>
arahael: thanks
ismaelga has quit [Remote host closed the connection]
Melpaws has joined #ruby
<pontiki>
ellismarte: i'm curious how they're getting written in the file in the first place...
<ruboto>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<Radar>
cleopatra: ^
<cleopatra>
sorry for the grammar, my English no is good arahael
<arahael>
cleopatra: The english isn't really the issue here.
<cleopatra>
let me know not to make the mistake again
<arahael>
cleopatra: Learn about the "XY" problem.
<lookingeast>
Radar: i want to use a ruby program in place of a shell script. but with ruby it seems like i need to use File.open(), i'm trying to find out if there's a way to get a ruby program to just use command line io redirection, like program.rb < items.txt > output.txt
<Radar>
?gist lookingeast
<ruboto>
lookingeast, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<Radar>
show us your code
iyan has quit [Quit: iyan]
<cleopatra>
Thank you arahael, Radar :)
braincrash has quit [Ping timeout: 264 seconds]
maloik has joined #ruby
stannard has quit [Remote host closed the connection]
axsuul has quit [Ping timeout: 246 seconds]
axsuul has joined #ruby
<Radar>
quick responses are appreciated, lookingeast.
Axy has joined #ruby
kobain has quit [Ping timeout: 240 seconds]
maloik has quit [Ping timeout: 255 seconds]
Mia has quit [Ping timeout: 276 seconds]
JazzyVariable227 has quit [Remote host closed the connection]
build22 has joined #ruby
mary5030 has quit [Remote host closed the connection]
al2o3-cr1 has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
mattwildig has quit [Remote host closed the connection]
eminencehc has quit [Remote host closed the connection]
al2o3-cr1 has quit [Client Quit]
al2o3-cr has joined #ruby
al2o3-cr has quit [Client Quit]
build22 has quit [Ping timeout: 260 seconds]
al2o3-cr has joined #ruby
bds has joined #ruby
maloik has joined #ruby
patdohere has joined #ruby
ur5us has quit [Remote host closed the connection]
hotpancakes has quit [Remote host closed the connection]
maikowblue has quit [Quit: .]
davedev2_ has joined #ruby
davedev24 has quit [Ping timeout: 240 seconds]
maloik has quit [Ping timeout: 240 seconds]
bds has quit [Ping timeout: 250 seconds]
Rickmasta has joined #ruby
gix has quit [Ping timeout: 240 seconds]
psy_ has joined #ruby
patdohere has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kalz has quit [Quit: exit]
kalzz has quit [Quit: exit]
cashnguns has quit [Remote host closed the connection]
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
gix has joined #ruby
hotpancakes has joined #ruby
kalz has joined #ruby
kalzz has joined #ruby
mary5030 has joined #ruby
arup_r has joined #ruby
maloik has joined #ruby
arup_r is now known as Guest20066
hotpancakes has quit [Ping timeout: 272 seconds]
lurch_ has quit [Quit: lurch_]
tmtwd has joined #ruby
maloik has quit [Ping timeout: 260 seconds]
dkphenom has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<adaedra>
jackcom: learning a language takes time and dedication. It also goes through knowing how to look for things. We're happy to help with specific problems, but we are not specialized teachers, and are not here to do your own work. There's a part to do yourself, and you don't seem to do it.
<norc>
apeiros: Which version are you using?
<adaedra>
norc: it completes for me.
<adaedra>
but not files.
<apeiros>
norc: Pry::VERSION # => "0.10.3"
<j416>
norc: Pry version 0.10.1 on Ruby 2.1.3
<apeiros>
norc: on ruby 2.2.3
Spami has joined #ruby
<al2o3-cr>
norc: I get error too like you
<j416>
so it was fixed in 0.10.2 or 0.10.3, assumingly
sarkis_ has quit [Ping timeout: 250 seconds]
<norc>
j416: Im getting it in 0.10.3
<adaedra>
norc: {:pry=>"0.10.3", :ruby=>"2.2.3", :engine=>"ruby", :platform=>"x86_64-darwin14"} – completes, but wrongly
<j416>
on Ruby ?
<norc>
adaedra: Wrongly? How so
Hounddog has joined #ruby
<apeiros>
norc: what happens when you require 'strscan'?
<adaedra>
it completes methods, not files
<norc>
j416: Yes. MRI 2.2.0 here
<j416>
hum
<norc>
adaedra: It's already loaded
<norc>
err apeiros
bersimoes has joined #ruby
<apeiros>
norc: ok. I thought because I might have it in my pryrc.
<norc>
apeiros: Alright. Ill try it with 2.2.3
Juanchito has joined #ruby
digneety has joined #ruby
Kendos-Kenlen has joined #ruby
gustav_ has joined #ruby
Hounddog has quit [Read error: Connection reset by peer]
stephenh_ is now known as stephenh
jschmid has joined #ruby
Hounddog has joined #ruby
GarethAdams has joined #ruby
stephenh has quit [Changing host]
stephenh has joined #ruby
sarkis_ has joined #ruby
<norc>
apeiros: It's still crashing. Can you pastie me your $LOADED_FEATURES ?
senayar has quit [Remote host closed the connection]
rodfersou has joined #ruby
<thatkid_>
Beginner here, what does a redis client like redis.rb do? Can I use redis directly with ruby without using a client?
zotherstupidguy has quit [Quit: WeeChat 1.3]
htmldrum has joined #ruby
GarethAdams has quit [Client Quit]
rodfersou has quit [Client Quit]
<norc>
apeiros: Wait what. Okay apparently the require 'strscan' fixes it indeed.
rodfersou has joined #ruby
<norc>
It seems like it does something although it returns false.
GarethAdams has joined #ruby
suchness_ has joined #ruby
ur5us has quit [Remote host closed the connection]
<jackcom>
adaedra: just one more time
<jackcom>
i will never ask question to you
sarkis_ has quit [Ping timeout: 250 seconds]
<ja>
jackcom: a question for you: have you ever opened the docs? even once?
<jackcom>
yes ja
<ja>
jackcom: good :3
<adaedra>
the ruby docs?
<jackcom>
yes
skweek has quit [Ping timeout: 246 seconds]
<jackcom>
one more time plz
GarethAdams has quit [Client Quit]
Hounddog has quit [Ping timeout: 272 seconds]
<adaedra>
what, one more time
Hounddog has joined #ruby
<jackcom>
solution of delete all array
tulak has joined #ruby
<jackcom>
adaedra:
<ja>
jackcom: what do you even mean by “delete all array”?
<ja>
you want to remove all the elements of an array?
<jackcom>
no ja
<jackcom>
delete array itself
<ja>
then what?
<jackcom>
ja:
<ja>
there's no concept of deleting objects in Ruby, jackcom
yoongkang has joined #ruby
<jackcom>
Delete all the even numbers from the array given below.[1,2,3,4,5,6,7,8,9]
<jackcom>
ja:
<norc>
ja: There is. But that is an entirely different story. :-)
<adaedra>
That's totally different, jackcom
<ja>
jackcom: yeah, they're talking about deleting/removing elements (the numbers) from the arary
sepp2k has joined #ruby
<jackcom>
element
<jackcom>
oh
<jackcom>
ok
<ja>
norc: really? ^_^ apart from the GC?
<adaedra>
jackcom: you see the example code in your exercice
<adaedra>
?
nfk|laptop has joined #ruby
<norc>
ja: For eduational purposes take a look at banister/free - note that this is not something you should want in your production code for most reasons. ;-)
ismaelga has quit [Remote host closed the connection]
ibouvousaime has quit [Ping timeout: 250 seconds]
<al2o3-cr>
jackcom: did you check the hint by any chance?
hotpancakes has joined #ruby
vikas027 has joined #ruby
<jackcom>
al2o3-cr: there is no hint
<adaedra>
ja: inga problem.
<vikas027>
Hello Everyone, How can I use a variable with quotes as an argument to the class ? I have this code https://dpaste.de/KhC7 where I am using LDAP filter which has few double quotes in it, but I am unable to use in Net::LDAP::Filter. I know it expects two variable, but the problem it is taking my variable isn't expanding there. If I do a `puts filter_all_users` anywhere in the code it works fine.
<jackcom>
so i give a question
<al2o3-cr>
jackcom: yep, there is
<ja>
adaedra: åsch, skulle du villa ha en smörgås?
<adaedra>
jackcom: there is a "Need a hint?" link.
<agent_white>
Hey folks, looking for some advice on my factoid bot! Got 'er all working... but the code just doesn't seem pretty. https://github.com/jakenotjacob/vapebot/blob/master/lib/vapebot/bot.rb#L9 -- Any advice appreciated! Been pouring over other irc-bot code on github for ideas, and been looking at Event Queues, and the Command/Observer patterns for potential avenues of housekeeping.
FernandoBasso has joined #ruby
<adaedra>
ja: inte nu, kanske senare.
<ja>
adaedra: okej. bara säga när.
ibouvousaime has joined #ruby
<adaedra>
agent_white: you've been writing an IRC bot from scratch? Why not use things like cinch or lita?
<agent_white>
adaedra: Yup! And for learning purposes :)
<adaedra>
'k
hotpancakes has quit [Ping timeout: 240 seconds]
<ja>
haha, I love when GitHub sporadically fails to indent a file and I go all “WTF, haven't they heard of indentation?! … oh, right, the GitHub indent bug…”
<agent_white>
Same reason I wrote an IRC client in ncurses before this.
sarkis_ has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
hypnosb has quit [Ping timeout: 260 seconds]
<thatkid_>
Offtopic, But I guess someone know it, How can I download videos from pluralsight ?
<norc>
Oh darn. Byebug just explained to me that rubygems replaces Kernel#require - that probably explains it.
<vikas027>
thatkid: there is a plugin in Mozilla called Download Helper
skade has joined #ruby
hypnosb has joined #ruby
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xcesariox has joined #ruby
Keltia has joined #ruby
sarkis_ has quit [Ping timeout: 240 seconds]
bds has joined #ruby
<al2o3-cr>
vikas027: filter_all_users = ["sAMAccountName", "*"] and splat it
spiman has joined #ruby
shiru has joined #ruby
<adaedra>
jackcom: also, you may be interested by this:
<ja>
Yeah, Integer#even? and Integer#odd? are great
alexherbo2 has joined #ruby
<adaedra>
I've had a bad night of sleep, I need time to type today ;)
<vikas027>
al2o3-cr: Thanks a ton for the hint. Worked like a charm. I am relatively new to Ruby. Thanks again
<jackcom>
ok thanks adaedra :)
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
htmldrum has quit [Ping timeout: 272 seconds]
<al2o3-cr>
vikas027: thats ok :)
roshanavand has joined #ruby
sarkis_ has joined #ruby
bds has quit [Ping timeout: 272 seconds]
<ja>
vikas027: sorry, I'm simply curious: you're relatively new to Ruby, however you understood what “splat it” meant?
<ja>
“SPLAT IT!” Aw, I love Ruby and its terminology.
* adaedra
splats ja
<vikas027>
ja: I am good at Google-ing :)
<adaedra>
vikas027: good, that seems rare nowadays.
<vikas027>
adaedra: :)
* ja
dodges adaedra's splatting
* ja
googles “splat”
* arahael
maintains that google's crap these days.
<adaedra>
how so?
<ja>
“The Splat is a programming block that airs nightly on TeenNick. The block shows reruns of classic 1980s, 1990s and early-mid 2000s children's programming, mostly shows that aired on Nickelodeon during their original runs.” — uhuh
<ja>
“programming block”! even sounds programming-related
<arahael>
adaedra: If I search for the words "foo bar baz", I expect to see results that have the words "foo bar baz" in them.
<arahael>
GOogle tries to guess too much what I mean.
<adaedra>
That works for me
<ja>
oh no, there're more?! adaedra, apeiros, arahael, what the hell are up with your nicknames?!
shiru has quit [Ping timeout: 246 seconds]
<ja>
I need colors
Ilyes512 has joined #ruby
<adaedra>
We're the A-team.
<arahael>
ja: I was first.
<ja>
LOL! Sweet.
<ja>
arahael: how can you be so certain?
<norc>
Good lord... If only I had never touched pry, I would have never figured out how bloated Rails is. :)
<adaedra>
I love it when a code domes together!
<adaedra>
comes*
sarkis_ has quit [Ping timeout: 240 seconds]
<arahael>
ja: Do you doubt me?
<ja>
arahael: not when you put it like that, no
<Cork>
if i have a class that inherits from Hash, how to i "type cast" a hash into it?
<adaedra>
Nick-registration-wise, you're the youngest, arahael.
<arahael>
adaedra: I used to be "Arafangion".
<adaedra>
Cork: you don't.
* arahael
wonders if that's still registered.
arahael is now known as Arafangion
<Cork>
adaedra: care to elaborate on that?
tulak_ has joined #ruby
<adaedra>
You can ask NickServ directly.
<adaedra>
Cork: you can't cast an object to something it isn't.
<Arafangion>
adaedra: 2005, it seems.
<Arafangion>
A decade ago.
djbkd has joined #ruby
<Cork>
adaedra: ok, then how can i simplest convert a hash into a class MyHash < Hash; end ?
doddok has joined #ruby
<adaedra>
Cork: you'll have to create a new MyHash object. Maybe with a constructor that takes a hash.
<Arafangion>
adaedra: So, am I the oldest and youngest now?
sarkis_ has joined #ruby
<adaedra>
Arafangion: let me check the exact date.
<adaedra>
Ah yes, older than apeiros with this nick.
<ja>
i better breakfast (yes, that actually is a verb (surprisingly)) before I choke on my you-people–induced laughter
<Cork>
0
<Ox0dea>
1
<apeiros>
adaedra: probably the reason I love that quote so much :D
<Cork>
opps Ox0dea i solved it with MyHash[*array]
<apeiros>
lunch time for me. cya :D
<Cork>
i was doing Hash[*....as_json.flatten] anyway
<apeiros>
Ox0dea: sniper! ;-)
<Ox0dea>
Cork: Sure, I was just showing you that your class can participate in "hashy" operations pretty seamlessly.
Rovanion_ has quit [Quit: WeeChat 0.4.2]
nso95- has joined #ruby
<apeiros>
or "lurker" is actually more apt I guess
* apeiros
afk
<Cork>
Ox0dea: appreciated! and i'll save that, thx
<Cork>
Ox0dea: actually... that is even better...
<Cork>
will move to that :)
FernandoBasso has quit [Quit: Leaving]
trosborn has joined #ruby
<Cork>
Ox0dea: thx!
krz has quit [Ping timeout: 260 seconds]
FernandoBasso has joined #ruby
bds has joined #ruby
<Ox0dea>
Cork: Sure thing. :)
sarkis_ has joined #ruby
trosborn has quit [Client Quit]
jackcom has quit [Quit: jackcom]
<Ox0dea>
ja: English verbs can't surprise me anymore. :P
EasyCo has quit [Quit: Connection closed for inactivity]
<Ox0dea>
Pretty much every single one of the 25 most frequently used English verbs are all irregular.
bds has quit [Ping timeout: 252 seconds]
GarethAdams has quit [Quit: Leaving...]
arup_r has quit [Remote host closed the connection]
sarkis_ has quit [Ping timeout: 240 seconds]
<Arafangion>
Ox0dea: That's only because nobody's regulated them yet.
skade has joined #ruby
ddv has quit [Ping timeout: 250 seconds]
<Ox0dea>
Arafangion: Prescriptivism is for doctors.
BlackCoyote has joined #ruby
arup_r has joined #ruby
<Arafangion>
Ox0dea: I wasn't prescribing.
hanmac has quit [Ping timeout: 240 seconds]
UtkarshRay has quit [Ping timeout: 240 seconds]
<Ox0dea>
Arafangion: If I'm not much mistaken, we were both punning.
lipoqil has quit [Quit: Connection closed for inactivity]
<Ox0dea>
That said, if you actually do think language should be "regulated", you are in fact a prescriptivist and should ask adaedra how well that's worked out.
UtkarshRay has joined #ruby
<adaedra>
Plaît-il ?
<Arafangion>
Ox0dea: I've always been bad at punning, and punning badly. I never mentioned that they should be 'regulated', only informing that they haven't, infact, been regulated as yet. A historian might say the same.
tubuliferous_ has quit [Ping timeout: 240 seconds]
sarkis_ has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
lurch_ has quit [Quit: lurch_]
ddv has joined #ruby
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
roshanavand has quit [Remote host closed the connection]
bnizzle has joined #ruby
spiman_ has joined #ruby
lurch_ has joined #ruby
roshanavand has joined #ruby
hotpancakes has quit [Remote host closed the connection]
<norc>
Ox0dea - just the freak I need.
<Ox0dea>
norc: At your service. :P
<norc>
Apparently require 'strscan' # => false
spiman has quit [Ping timeout: 264 seconds]
<norc>
Has a sideeffect.
<norc>
Which?
sarkis_ has quit [Ping timeout: 246 seconds]
<Ox0dea>
Arafangion: For what it's worth, "regularized" is probably the word you wanted, but the irregulars are such precisely because they've been with us for so long, and they're unlikely to disappear any time soon.
yoongkang has joined #ruby
<Arafangion>
Ox0dea: Hmm, perhaps I might go with "regularised", but that's not a term I come across regularly.
ismaelga has quit [Read error: Connection reset by peer]
<shevy>
norc pulling in files in ruby can always have sideeffects since every aspect of ruby can be changed at runtime
<Ox0dea>
norc: Well, that'd be RubyGems' core extension, which does lots of spec validation and the like.
dlitvak has joined #ruby
ismaelga has joined #ruby
<norc>
Ox0dea: That was my thinking as well, couldn't find any side effects in the MRI when returning false. ;-)
ddv has quit [Ping timeout: 250 seconds]
<norc>
Really disgusting to have Kernel methods being monkey patched to change some intrinsic behavior.
platzhirsch has joined #ruby
<shevy>
it's a feature at the same time
<norc>
That particular part? I don't think so.
<shevy>
yes it is
<norc>
requiring an already loaded library changing constants?
<norc>
How is that a feature.
<shevy>
a "constant" is not a constant in ruby man
gustav_ has quit [Remote host closed the connection]
<norc>
I expect the behavior of foo() to not change.
yoongkang has quit [Ping timeout: 252 seconds]
<Ox0dea>
norc: Wrong language. :P
<norc>
You get the idea.
<Ox0dea>
I do, but you're fighting the wrong battle.
<norc>
If require tells me false it shouldn't define new constants behind the scenes in random libraries all over the place.
sarkis_ has joined #ruby
<norc>
well
<shevy>
require is a primitive way to add code
hanmac has joined #ruby
<norc>
pry crashes on some file path tab expansion unless you explicitely require strscan, which however already is loaded to the features.
<shevy>
how does import in python work? does it change core aspects of python? does python allow this actually?
<Ox0dea>
norc: Yeah, that is pretty nasty. :/
<Ox0dea>
Python's `import` provides considerably more granularity, but I can't say whether user code is allowed to change its semantics.
<norc>
But then again, complaining about monkey patching core methods and using pry at the same time makes me a hypocrite.... :-)
ddv has joined #ruby
maloik has quit [Ping timeout: 252 seconds]
donske has joined #ruby
<Ox0dea>
Ruby's near-infinite malleability is both a gift and a curse, to be sure.
<adaedra>
monkey-patch no evil.
<shevy>
monkeys need love and patches too
* adaedra
patches shevy
<Ox0dea>
$ gem install shevy -v 2.0
<shevy>
adaedra the gorilla!
roshanavand has quit [Remote host closed the connection]
<adaedra>
er no
adac has quit [Ping timeout: 244 seconds]
<shevy>
ugh no?
<Arafangion>
Ox0dea: I'm not sure they provide much more granulality in python.
roshanavand has joined #ruby
<Ox0dea>
Arafangion: They do.
roshanavand has quit [Remote host closed the connection]
sarkis_ has quit [Ping timeout: 272 seconds]
roshanavand has joined #ruby
<Arafangion>
Ox0dea: There is, strangely enough - less tradition of monkey-patching in python.
<Arafangion>
Ox0dea: Could you give an example?
<shevy>
python can swallow monkeys, I saw it on youtube
<norc>
Ox0dea: To be fair the granular importing can be done in Ruby too, it's just that tons of gems only work by requiring some main library which autoloads everything.
<Ox0dea>
Arafangion: Ruby's `require` is a file-based construct; Python's `import` lets you be much more specific about what you'd like to bring in.
<norc>
Which makes it a developer issue. Not an issue with require.
gustav_ has joined #ruby
<Ox0dea>
I disagree. `require` is only "granular" by dint of it being possible for a programmer to put each method in a separate file.
<Arafangion>
Ox0dea: Well, yes, you could override the import machinery and import just /part/ of a file, or import something else, but that's not the default typcial behaviour. One typically imports a "module", whatever and however that module may be.
roshanavand has quit [Remote host closed the connection]
Rickmasta has joined #ruby
<Ox0dea>
Arafangion: In Python?
<Arafangion>
Ox0dea: Yes, in python
<Ox0dea>
That's simply not true.
<Ox0dea>
`from x import y, z` sees very wide usage.
maloik has joined #ruby
<Arafangion>
Ox0dea: That imports all of 'x', but makes only y and z available.
<Arafangion>
Ox0dea: Or rather, that executes all of 'x'.
<shevy>
I'd like to have a more sophisticated inclusion way in ruby
User458764 has joined #ruby
<norc>
shevy: We don't exclude you, don't worry.
Kendos-Kenlen has quit [Ping timeout: 240 seconds]
roshanavand has joined #ruby
roshanavand has quit [Remote host closed the connection]
sarkis_ has joined #ruby
<Ox0dea>
Arafangion: The distinction isn't meaningless, of course, but I can't think of a better word than "granular" for that provision.
lxsameer has quit [Quit: Leaving]
favadi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
norc things such as pulling in stuff while giving it another namespace for instance
<Ox0dea>
norc: Do you know about two-argument `load` yet? :P
<Ox0dea>
It's probably going to make you angry.
<Arafangion>
Ox0dea: Fair enough. G'night!
<Ox0dea>
Au revoir.
maloik has quit [Ping timeout: 240 seconds]
<shevy>
au la baguette!
akem has joined #ruby
<Ox0dea>
Dominic Decoco!
nso95- has quit [Remote host closed the connection]
<norc>
Ox0dea: Shoot
hotpancakes has joined #ruby
<Ox0dea>
norc: You can tell it to execute the new code under an anonymous module, which is great, only it doesn't then *return* said module, which is retarded.
gguggi has quit [Ping timeout: 272 seconds]
<norc>
So this is just a fancy way of forking... ?
sarkis_ has quit [Ping timeout: 252 seconds]
<norc>
Brilliant.
<Ox0dea>
More to do with namespacing?
<norc>
What is the point?
<Ox0dea>
Clobber prevention, for the most part.
<norc>
If it does not return the module it's just a glorified monkey patch loader that doesn't clopper your NS
<norc>
or am I misunderstanding something
GarethAdams has joined #ruby
doddok has quit [Ping timeout: 276 seconds]
<Ox0dea>
norc: Well, it's not as if we can't get to that Module by way of ObjectSpace.
<norc>
Was about to ask actually. :)
<Ox0dea>
`load` is nice for hot-swapping, but I've done the requisite ObjectSpace dance at least twice now.
<shevy>
...
<shevy>
this is why nobu does not offer you these things!
<shevy>
you are just trying to break ruby
<Ox0dea>
I try to shape it into exactly what I'd like it to be.
Spami has quit [Quit: This computer has gone to sleep]
<Ox0dea>
There is simply no better Play-Doh for that purpose.
<kollapse>
Hi. I'm making a ruby lib with about 10 tests in the tests/ directory. I know gemspec files permit s.test_files = ["tests/test_file1.rb"] but how can I make it select them all without having to manually write each one there ?
toy_ has joined #ruby
<shevy>
vikas027 well, first make sure that you really have two arrays, with only strings there
<j416>
kollapse: use something dynamic maybe
waka has quit [Remote host closed the connection]
waka has joined #ruby
<shevy>
vikas027 I usually use pp for that
<Ox0dea>
kollapse: s.test_files = Dir['test/**']
<shevy>
vikas027 in your code, require 'pp'; pp c before you call .each
<j416>
kollapse: I don't use test_files, but for files I tend to do s.files = `git ls-files`.split("\n")
bersimoes has joined #ruby
<j416>
maybe what Ox0dea says is nicer.
<j416>
dunno really
<Ox0dea>
kollapse: Do you have a particular reason to be specifying your test files?
<shevy>
vikas027 I reason that you can not have the above %w( vkumar abcxyz hellome ) - %w( disabled_users abcxyz ) because otherwise it would work; %w() just constructs an array so that is the same as ["disabled_users","abcxyz"]
<vikas027>
shevy: I understand now, so this is a hash
blackmesa has quit [Ping timeout: 260 seconds]
<shevy>
ok
yoongkang has joined #ruby
sarkis_ has joined #ruby
<shevy>
you should be able to use .reject or .select to filter away the parts of the hash you want to have
<kollapse>
Ox0dea, looks similar with what I was trying with Dir.glob(). Reason? Well not really, it's just what I've seen being done in the gemspec examples.
toy has quit [Ping timeout: 250 seconds]
<shevy>
so in pseudo code "if the key is the same name, reject it" ... or merge ... you get the idea
<vikas027>
shevy: Thanks for the hint, let me google that out
<shevy>
\o/
bubbys has joined #ruby
<Ox0dea>
kollapse: Aye, same thing, but j416 has the right of it in that just specifying all the files that comprise your gem is the more conventional approach.
<norc>
shevy: No.. just no. :(
<norc>
Just pry into the damn thing.
<Ox0dea>
shevy: Yeah...
<norc>
Those debug pp's floating all over ones code to debug what you are doing is so 1990.
<Ox0dea>
vikas027: I'm pretty sure norc's diagnosis was correct.
<vikas027>
Ox0dea: Yes, he was right
bkxd has quit [Ping timeout: 240 seconds]
<Ox0dea>
vikas027: You do have Arrays, don't you?
<kollapse>
Ox0dea, ok, will drop test_files :) thanks
millerti has joined #ruby
<norc>
vikas027: The fix is simple. You probably consider two ldap objects equal if they have the same uid. That should give you enough to go from there. :)
<Ox0dea>
kollapse: Sure thing. Be advised that you'll still want to specify them in, say, your Rakefile, where globbing is the right approach.
<norc>
(Or more generally the same DN)
krz has joined #ruby
sarkis_ has quit [Ping timeout: 246 seconds]
<vikas027>
norc: Yeah, trying that now
maloik has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
scripore has joined #ruby
bersimoes has quit [Read error: Connection reset by peer]
<shevy>
norc simplicity works
trosborn has quit [Quit: trosborn]
krz has quit [Ping timeout: 260 seconds]
bersimoes has joined #ruby
sarkis_ has joined #ruby
skade has joined #ruby
moeabdol has joined #ruby
ismaelga has quit [Remote host closed the connection]
Neon has joined #ruby
sarkis_ has quit [Ping timeout: 240 seconds]
digneety has quit [Ping timeout: 252 seconds]
GarethAdams_ has quit [Ping timeout: 252 seconds]
avril14th has joined #ruby
stamina has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
sarkis_ has joined #ruby
blackmesa has joined #ruby
GarethAdams_ has joined #ruby
CloCkWeRX has quit [Ping timeout: 240 seconds]
sarkis_ has quit [Ping timeout: 240 seconds]
Xeago has quit [Remote host closed the connection]
digneety has joined #ruby
freerobby has joined #ruby
bkxd has joined #ruby
ibouvousaime has quit [Ping timeout: 265 seconds]
benhuda has joined #ruby
Xeago has joined #ruby
gustav_ has quit [Remote host closed the connection]
ibouvousaime has joined #ruby
doddok has quit [Quit: Leaving]
Xeago has quit [Remote host closed the connection]
sarkis_ has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
Pupp3tm4st3r has joined #ruby
adac has joined #ruby
aryaching has joined #ruby
sarkis_ has quit [Ping timeout: 250 seconds]
<metalie>
hi
doddok has joined #ruby
<metalie>
im trying to use @user.update_attribute(:refers_counter, counter)
<metalie>
but it just wont save it to DB
<metalie>
anyone here can help?
<norc>
metalie: Check for present errors.
<adaedra>
rails?
<metalie>
im new to ror, so what do you mean check for present errors? i tried to use @user.errors im getting undefind method
<apeiros>
sounds like @user wasn't an AR::Base based model then…
<apeiros>
?rails metalie
<ruboto>
metalie, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<apeiros>
also ^
<metalie>
if im using @user.update_attribute(:refers_counter, counter) , its comes out true and indeed the value is what counter sets it.. but when trying again its returing back to zero
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<vikas027>
shevy, norc: I couldn't figure out how to use select, but created an array using push and then subtracted it ...which is workign fine :)
sarkis_ has joined #ruby
<norc>
vikas027: I really recommend you figure out select though. Enumerable and its methods are one of the most common things in Ruby. :)
Kendos-Kenlen has joined #ruby
dmolina1 has quit [Quit: Leaving.]
dmolina has joined #ruby
lurch_ has quit [Quit: lurch_]
jackcom has joined #ruby
<vikas027>
sure norc, I will do that tomorrow morning. Gotto hit the bed now, just have few hours to sleep. I am glad I could make few things work at least :)
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bersimoes has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
Ilyes512 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
senayar has joined #ruby
bryanray has joined #ruby
GarethAdams has quit [Quit: Leaving...]
lurch_ has joined #ruby
gustav_ has joined #ruby
sarkis_ has quit [Ping timeout: 272 seconds]
build22 has quit []
tubuliferous_ has joined #ruby
CloCkWeRX has joined #ruby
gustav_ has quit [Remote host closed the connection]
gustav_ has joined #ruby
hotpancakes has joined #ruby
sarkis_ has joined #ruby
atomical has joined #ruby
ibouvousaime has quit [Ping timeout: 250 seconds]
tater has quit [Remote host closed the connection]
xcesariox has joined #ruby
gustav_ has quit [Read error: Connection reset by peer]
gregf__ has quit [Quit: leaving]
gustav_ has joined #ruby
kobain has joined #ruby
rgrmatt has joined #ruby
gregf_ has joined #ruby
Melpaws has quit [Remote host closed the connection]
ibouvousaime has joined #ruby
hotpancakes has quit [Ping timeout: 265 seconds]
vikas027 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sarkis_ has quit [Ping timeout: 264 seconds]
atomical has quit [Ping timeout: 255 seconds]
JazzyVariable227 has joined #ruby
djbkd has joined #ruby
binaryplease has joined #ruby
mattwildig has joined #ruby
tater has joined #ruby
jeffreylevesque_ has joined #ruby
mbeasley has left #ruby ["WeeChat 0.4.2"]
badeball_ is now known as badeball
rethi has joined #ruby
jeffreylevesque has quit [Ping timeout: 240 seconds]
Macaveli has joined #ruby
djbkd has quit [Ping timeout: 264 seconds]
sarkis_ has joined #ruby
mattwildig has quit [Ping timeout: 255 seconds]
rgrmatt has quit []
tater has quit [Remote host closed the connection]
jeffreylevesque_ has quit [Ping timeout: 255 seconds]
BadBlock has joined #ruby
senayar has quit [Remote host closed the connection]
<BadBlock>
Hi there
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
tubuliferous_ has quit [Ping timeout: 252 seconds]
sarkis_ has quit [Ping timeout: 240 seconds]
sdothum has joined #ruby
darkxploit has joined #ruby
centrx has joined #ruby
<Ox0dea>
Howdy, BadBlock.
<ja>
Hullo
bersimoes has joined #ruby
<shevy>
haha
<shevy>
that nick... someone should use a nick called nein too
<shevy>
then ja and nein can communicate with one another
tater has joined #ruby
tater has quit [Remote host closed the connection]
<ja>
and “nej”
<ja>
and “nee”
<ja>
for danish & dutch
tater has joined #ruby
sarkis_ has joined #ruby
<ja>
shevy: my host mask whatchamacallit is “unaffilated/nej” — doesn’t that count a bit?
tater has quit [Remote host closed the connection]
joonty has quit [Quit: joonty]
nfk|laptop has quit [Ping timeout: 246 seconds]
davedev24 has joined #ruby
<shevy>
lol
<shevy>
hejsan ja
c355E3B has quit [Quit: Connection closed for inactivity]
gagrio has quit [Ping timeout: 260 seconds]
<ja>
halløjsa du, shevy
_blizzy_ has joined #ruby
aryaching has quit [Remote host closed the connection]
bersimoes has quit [Read error: Connection reset by peer]
bersimoe_ has joined #ruby
aryaching has joined #ruby
moeabdol has quit [Ping timeout: 272 seconds]
nfk|laptop has joined #ruby
binaryplease has quit [Ping timeout: 276 seconds]
sarkis_ has quit [Ping timeout: 250 seconds]
ibouvousaime has quit [Ping timeout: 272 seconds]
scripore has quit [Quit: This computer has gone to sleep]
tomaz_b has joined #ruby
gagrio has joined #ruby
gagrio is now known as gagrio|mtg
FernandoBasso has quit [Quit: Leaving]
Ropeney has joined #ruby
Ropeney has quit [Client Quit]
ibouvousaime has joined #ruby
bMalum has quit [Ping timeout: 246 seconds]
sarkis_ has joined #ruby
bMalum has joined #ruby
JazzyVariable227 has quit [Remote host closed the connection]
metalie has quit [Ping timeout: 246 seconds]
yes`r has quit [Ping timeout: 255 seconds]
bkxd has joined #ruby
Oli` has joined #ruby
sarkis_ has quit [Ping timeout: 240 seconds]
adac has quit [Ping timeout: 240 seconds]
synthroid has joined #ruby
Ox0dea has quit [Read error: Connection reset by peer]
platzhirsch has quit [Ping timeout: 276 seconds]
yfeldblum has quit [Ping timeout: 272 seconds]
g3funk is now known as braidn
aryaching has quit [Remote host closed the connection]
aryaching has joined #ruby
nertzy has joined #ruby
Tristan-Speccy has quit [Ping timeout: 240 seconds]
sarkis_ has joined #ruby
joonty has joined #ruby
bds has joined #ruby
moeabdol has joined #ruby
moeabdol has quit [Client Quit]
sgambino has joined #ruby
Ilyes512 has joined #ruby
yardenbar has quit [Ping timeout: 240 seconds]
gusTester has joined #ruby
sarkis_ has quit [Ping timeout: 250 seconds]
moeabdol has joined #ruby
roshanavand has joined #ruby
gusTester has left #ruby [#ruby]
bds has quit [Ping timeout: 264 seconds]
dlitvak has quit [Remote host closed the connection]
andikr has quit [Remote host closed the connection]
donske has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ja>
what the hell is up with that background in that screenshot? hahaha
araujo_ has quit [Ping timeout: 255 seconds]
tesuji has quit [Ping timeout: 255 seconds]
<ja>
I think that looks pretty normal though, shevy, apart from `private` not being highlighted
CodingWolf has joined #ruby
<norc>
What the heck is private.
araujo_ has joined #ruby
<norc>
It does not look like a regular method mmm
<ja>
ugh, I wish `def foo options = nil; options ||= {}; … end` could just be written as `def foo options = {}; … end` without it failing if you call foo with explicit nil…
<jackcom>
i don’t know why method don’t need ‘()’ like keys?
<Bish>
i know about [], but could i write a method with works with <opening-char>something<closing-char>
<Bish>
jackcom, because it's possible, that's all there is, you can do it as you like, but you will get problems if it's not well defined what you want to do
wilsonc91 has joined #ruby
BlackCoyote has quit [Remote host closed the connection]
<ja>
jackcom: what do you mean “like keys”? { THIS_IS_A_KEY_IN_A_HASH: "and some value which happens to be a string } — I don’t see any “()” there… apart from the “{}”, but… yeah…
iyan has joined #ruby
<jackcom>
thanks Bish :)
Vile` has joined #ruby
<ja>
jackcom: like Bish said, the () are optional when calling methods
<norc>
ja: Sometimes.
<ja>
Yes
<ja>
Sorry. Sometimes.
<ja>
e.g. `request :get, @table, denormalize params` is a syntax error
wilsonc91 has quit [Client Quit]
<jackcom>
Every Hash object has two methods: keys and values. <<—— ja
<norc>
Most parser errors I have had were due to bizarre behavior of optional parens. :p
<ja>
yeah, me too. or just, y'know… drinking on the job ^___^
sarkis_ has quit [Ping timeout: 250 seconds]
wilsonc91 has joined #ruby
NeverDie has joined #ruby
<ja>
jackcom: yeah, Hash has `keys` and `values` methods for returning an array of just the keys or just the values.
<norc>
Bish: But jokes aside, take an actual look at my link
<ja>
s/has/have
<jackcom>
yeah, ja ok
<jackcom>
thanks :)
<norc>
Bish: L859-L878 are the operators you can define. L879 is specific to the upcoming version and does not exist yet.
<ja>
np, jackcom
dlitvak has joined #ruby
<Bish>
ah, cool, but i can change these in runtime
<Bish>
?
<norc>
Bish: Yes.
<ja>
mmmm yacc files
dravine has joined #ruby
<Bish>
cool.
<Bish>
not that i will ever do that
<norc>
Bish: Note that "unary+" just means +
<norc>
Bish: There are plenty reasons to actually do it
<ja>
norc: wat! how on earth would you change the parser at runtime?
<norc>
ja: stubbing out methods for various reasons, testing, validations
<Bish>
well i like prefix-calling-syntax actually
dorei has joined #ruby
<ja>
norc: “how”, not “why”! :D
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
krz has quit [Read error: Connection reset by peer]
<norc>
Bish: Let's ignore the fact that Ruby uses a VM under the hood, there is only runtime.
_stu_ has joined #ruby
<norc>
Whether you require your libraries or have some event loop running - it's all runtime.
<Bish>
ah now i get what you mean, since i found the lines, it's not what i meant
sarkis_ has joined #ruby
<norc>
ja: How?
<ja>
norc: I think I misunderstod. I thought you were talking about redefining the meaning of () or {}.
<Bish>
what i meant was, if i was able to define stuff like "def method <open-char-defined-by-me>parameter<close-char-defined-by-me>"
<norc>
Bish: Then you have to change the file I showed you.
<ja>
yeah, but then it's not Ruby anymore
B1n4r10 has joined #ruby
<ja>
then it's Bish's Ruby fork
<Bish>
yeah, i got that.
<ja>
BishRuby™ — has a nice ring to it
<ja>
Buby? Maybe
<norc>
Just make a pull request and convince nobu/matz - and then it will be trunk.
<Bish>
BASICruby
<norc>
:-)
closer has quit [Ping timeout: 272 seconds]
<shevy>
ja I found that it visually displeases me ... my eyes have to jump to the right side, whereas normal def methods are aligned more to the left, as can be seen on the picture; although I am that kind of weird dude who actually does this craziness: def foo; new line here; end; then a ';' and a private :name_of_method_here
<ja>
norc: how easily-convincible are nobu/matz? :3 eheheheh
<norc>
ja: Depends on your Japanese.
_blizzy_ has quit [Ping timeout: 244 seconds]
<ja>
shevy: lol, that *is* crazy! but yeah, I can understand how it can be visually displeasing
rippa has joined #ruby
<ja>
norc: hai, hai! nihungoga wakarimas!
<norc>
Anyone here on OSX? I think I managed to actually hang the Ruby process.
<norc>
:-)
<ja>
that was the worst japanese transliteration ever, I think
* ja
@ OS X
<jackcom>
how long it takes time to conquor ruby. i m studying hash part now.
<ruboto>
Bish # => StandardError (StandardError) ...check link for more (https://eval.in/474493)
sarkis_ has quit [Ping timeout: 265 seconds]
<Bish>
HACKING IN PROGRESS...
<jackcom>
adaedra: i learn it with monk
* adaedra
hacks Bish
hotpancakes has joined #ruby
<ja>
FBI: HACKED. ILLUMINATI: HACKED. BANKS: ALL HACKED.
<norc>
ja: Well, it definitely is OSX specific. Under Linux flavors it just terminates irb
<Bish>
hanks for me, too, im on linux.
<Bish>
_.split.first.gsub(/k/,'g')
<ja>
norc: odd. we need to try it on BeOS and HP-UX! ʘ‿ʘ
blueOxigen has joined #ruby
sarkis_ has joined #ruby
* ja
hanks Bish
<Bish>
it's also doing 100% cpu for me :D
<Ankhers>
I just saw something like http://lpaste.net/145832 in a code base. From what I understand about the splat operator, that does nothing. Am I missing something?
<Bish>
yorickpeterse, do you have high hopes in rubinius, or does it's performance already make you happy?
<jackcom>
ok i understand it.
<havenwood>
jackcom: They are Read Eval Print Loops (REPLs). Ruby ships with irb and the pry gem is a popular alternative.
<yorickpeterse>
Bish: there's a ton that needs to be improved
<havenwood>
jackcom: You type your Ruby and it runs it and prints the results.
<jackcom>
havenwood: too difficult.
<jackcom>
anyway i will go next.
<jackcom>
havenwood:
<shevy>
lol
Ilyes512_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood>
jackcom: In your terminal type: irb
<shevy>
it's too difficult
<adaedra>
jackcom: irb/pry are tools to help you experiment
<Bish>
yorickpeterse, but you see potential it outranks all other implementations?
<jackcom>
irb(main):001:0>
<adaedra>
You can type ruby on it. Try: '1.class' then return
<Bish>
jackcom, gratz!
<ja>
jackcom: you really should get irb running as we suggested earlier ^__^
<havenwood>
jackcom: To leave irb type: exit
<ja>
whoops, I was scrolled up in my irc client
<jackcom>
ok thanks
gustav_ has quit [Remote host closed the connection]
<jackcom>
quit command work too.
<shevy>
:D
<havenwood>
jackcom: In irb try: 1.is_a? Integer
<havenwood>
jackcom: And: 1.is_a? Fixnum
<jackcom>
i will use script only
Trynemjoel has joined #ruby
<jackcom>
ruby hello.rb
zeroDivisible has joined #ruby
<adaedra>
why?
m3_del has joined #ruby
hostess_ is now known as hostess
<adaedra>
irb is here to help you experiment
<jackcom>
it is easy for me
<jackcom>
i don’t like irb
<adaedra>
you can try and see the result directly
<adaedra>
it's great
tulak has joined #ruby
<jackcom>
i will use script
<jackcom>
ruby hello.rb
<havenwood>
jackcom: You haven't tried irb long enough. :P
platzhirsch has quit [Ping timeout: 272 seconds]
<ja>
irb is the best thing since unix
grill has joined #ruby
<adaedra>
And then you have pry, which is even better than irb
<havenwood>
?pry
<ruboto>
Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting `binding.pry` directly in your source code. Visit https://pryrepl.org/ or get it now with: gem install pry pry-doc
<yorickpeterse>
yeah lets bury them in more stuff to learn
araujo_ has quit [Quit: Leaving]
teclator has quit [Ping timeout: 240 seconds]
<jackcom>
-bash: pry: command not found
<Bish>
hrhr
<havenwood>
jackcom: If you `gem install pry` you can then type `pry` instead of `irb`.
<yorickpeterse>
^ that should give enough indications as to their experience level
<havenwood>
jackcom: So first: gem install pry
<havenwood>
jackcom: Then: pry
<jackcom>
lol
<havenwood>
jackcom: In Pry: ls 1
<Bish>
yorickpeterse, didn't answer my question intentionally? :p?
<jackcom>
i will use ruby only
<adaedra>
yorickpeterse: don't worry, we'll repeat the same thing tomorrow anyway.
<yorickpeterse>
Bish: oh, missed it
<havenwood>
jackcom: irb ships with Ruby
<jackcom>
ruby hello.rb
pandaant has joined #ruby
<yorickpeterse>
Bish: outranking depends on your use case
<shevy>
what is the content of hello.rb
<jackcom>
i don’t like many thing
<yorickpeterse>
startup time? Unlikely
<yorickpeterse>
jackcom: not being so stubborn can be good at times
<Bish>
well, hopefully all of them, who cares about startup time, bit annoying when doing rails with rbx
nertzy has joined #ruby
DoubleMalt has joined #ruby
<Bish>
but that's about it.
<yorickpeterse>
irb is pretty great to quickly try/explore things, don't bother with pry if you're not familiar with irb
<yorickpeterse>
Bish: short startup time is kinda required for shell scripting needs
* Bish
didn't know about pry
failshell has joined #ruby
avahey has joined #ruby
<yorickpeterse>
so like I said, outranking depends on the use case
lurch_ has joined #ruby
momomomomo has joined #ruby
<ja>
whoa, I should really use `ls` in Pry more…
<adaedra>
pry is great.
<ja>
it really is
<Bish>
*_* pry
<ja>
… irb too, if you aren't even using that… ^__^
<Bish>
why didn't i know about this
momomomomo has quit [Client Quit]
<ja>
s/you aren't/one isn't
<ja>
Bish: Welcome, welcome!
<adaedra>
Once you go pry, you can't go back :p
<ja>
to the great world of Pry!
<ja>
indeed, adaedra
<Bish>
lol it even does less, when output is long
ismaelga has quit [Remote host closed the connection]
<Bish>
yorickpeterse, well what about all other aspects?
<adaedra>
There's completion also, for people who don't know,
ismaelga has joined #ruby
<adaedra>
s/,\z/./
<yorickpeterse>
If you want something that performs ok, supports POSIX, C extensions and concurrency, Rubinius is a good fit
jackcom has left #ruby [#ruby]
<yorickpeterse>
As long as you're not already running Ruby 2.3 shit
<yorickpeterse>
since our stdlib is pretty dated
* yorickpeterse
is working on fixing that
<adaedra>
ruby 2.3 _awesomeness_ you mean.
<yorickpeterse>
To be more specific, if you can balance out some methods being slower with parallelism you should be fine
cwong_on_irc has joined #ruby
htmldrum has quit [Ping timeout: 240 seconds]
<yorickpeterse>
if you're on BSD rbx might be a problem since our BSD support isn't that great I believe
<yorickpeterse>
same goes for ARM
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yorickpeterse>
(ARM should work with the JIT disabled, but that's a bit pointless)
<Bish>
but it will never outrun mri/jruby in method-calling-speed ?
Macaveli has joined #ruby
tubuliferous_ has joined #ruby
patdohere has joined #ruby
<yorickpeterse>
It might at some point, depends on what we optimize
<yorickpeterse>
e.g. last I checked fib() is already faster on Rbx :troll:
anisha has quit [Quit: Leaving]
<Bish>
good to hear, because it's my favourite implementation
pzula has joined #ruby
krz has quit [Quit: WeeChat 1.2]
<Bish>
i just had my first use case which could only be done faster in ruby, when using native threads
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Bish>
rubinius to the rescue, was a great experience
patdohere has quit [Max SendQ exceeded]
<yorickpeterse>
oh, what was fact()
<yorickpeterse>
not fib()
nfk|laptop has quit [Quit: yawn]
<Bish>
fact is the prime example for jit, though, isn't it?
<yorickpeterse>
oh lol, that dude now works for my old employer
<yorickpeterse>
Bish: it's the prime example for everything
<yorickpeterse>
gets very close to the metal
nsuke has quit [Read error: Connection reset by peer]
dimasg has joined #ruby
<Bish>
in fact i already read that, only a few days ago
<yorickpeterse>
heh
<Bish>
in fact, hyuk hyuk
<yorickpeterse>
zing
cdg has joined #ruby
rdavila has joined #ruby
<yorickpeterse>
I hope to get GitLab running on rbx in a month or two or so
<yorickpeterse>
it already boots and you can use the web UI, but didn't really test much more
platzhirsch has joined #ruby
<yorickpeterse>
Though Racc segfaults at times, which will be fun to debug
<Bish>
my first product will be running on rbx too, am i making a mistake :D?
<yorickpeterse>
as long as it works, no?
<adaedra>
yorickpeterse: then, will you use GitLab to host rbx? So you have rbx on GitLab on rbx?
rodfersou|lunch is now known as rodfersou
<Bish>
well i don't know yet, im developing on mri, because of the mentioned startup times
<yorickpeterse>
adaedra: rbx will stay on GitHub
jordanloky has quit [Ping timeout: 272 seconds]
<Bish>
im using webmachine=>reel=>celluloid to make use of native threads, will i benefit from that? last question.
<yorickpeterse>
at least we don't have any plans of moving any time soon
<Bish>
sorry to annoy you
<yorickpeterse>
Bish: np
arup_r has joined #ruby
<yorickpeterse>
Bish: if Celluloid uses threads then yes, you should benefit from not having a GIL
<Bish>
woo~
Rickmasta has joined #ruby
<yorickpeterse>
last I checked Celluloid spawns 1 thread per actor, so you want to make sure you don't end up spawning tens of thousands in a loop
shredding has joined #ruby
<Bish>
GIL can really looks like your computer is from 1998, when using threads, just experienced that, kinda fun to see
<Bish>
can really make it look like your computer*
<yorickpeterse>
it's a shame GILs are still employed in 2015
<adaedra>
'98 was not a bad year, we won the world cup.
<Bish>
like i knew who won the world cup '98. i don't even know who won last time.
<Bish>
well shit i know.
jordanm has joined #ruby
spiman has quit []
<adaedra>
I just happen to know for the '98 one, you know.
digneety has quit [Ping timeout: 272 seconds]
DoubleMalt has quit [Ping timeout: 250 seconds]
<Bish>
yorickpeterse, yeah well, why did they? i mean, doesn't every programmer get pimples from implementing that?
tercenya has quit [Read error: Connection reset by peer]
darkxploit has joined #ruby
<adaedra>
Legacy?
yqt has joined #ruby
<Bish>
oO python has one, too
jordanloky has joined #ruby
<yorickpeterse>
Bish: implementing a GIL makes things easier
skade has quit [Quit: Computer has gone to sleep.]
<yorickpeterse>
it means not having to worry about making thread-safe APIs
<Bish>
yeah, well, i figured, but why are they throwing away so much potential, when everything we do to make computers faster is too put more cpu-cores in it
chouhoulis has quit [Remote host closed the connection]
ldnunes has quit [Ping timeout: 272 seconds]
cornerma1 has joined #ruby
<yorickpeterse>
wouldn't know
doddok has left #ruby [#ruby]
<Bish>
but creating threads in ruby is so cool, changes are so small to make something multi-threaded
<Bish>
jvm does not have native threads, right?
pzula has quit [Read error: Connection reset by peer]
<yorickpeterse>
It does
<canton7>
the jvm has native threads, sure
exadeci has quit [Quit: Connection closed for inactivity]
naftilos76 has quit [Ping timeout: 252 seconds]
eminencehc has joined #ruby
cornerman has quit [Ping timeout: 272 seconds]
blackmesa has quit [Ping timeout: 252 seconds]
cornerma1 is now known as cornerman
iyan has quit [Quit: iyan]
ldnunes has joined #ruby
<headius>
yorickpeterse, Bish: fib is not faster in rbx than in jruby :-P
<headius>
but I certainly hope that's not anyone's metric for which impl to use
djbkd has joined #ruby
<shevy>
Bish python has pimples?
<yorickpeterse>
headius: fib is totally a real world example
<yorickpeterse>
everybody that's cool runs fib in the cloud using AWS lambda
<headius>
nobody's capitalized on a hip fibonacci startup yet unfortunately :-(
mattarse has joined #ruby
<headius>
FaaS
bMalum has quit [Quit: bMalum]
cwong_on_irc has quit [Quit: Leaving.]
m3_del has quit [Remote host closed the connection]
<headius>
yorickpeterse: what a weird bug
<headius>
"Why isn't rbx faster than it is right now"
djbkd has quit [Ping timeout: 260 seconds]
<yorickpeterse>
heh
aryaching has quit [Ping timeout: 244 seconds]
aryaching has joined #ruby
karapetyan has quit [Remote host closed the connection]
vdamewood has joined #ruby
karapetyan has joined #ruby
millerti has joined #ruby
hotpancakes has joined #ruby
mattwildig has quit [Remote host closed the connection]
dfinninger has joined #ruby
darkxploit has quit [Quit: Leaving]
mary5030 has joined #ruby
chipotle has joined #ruby
karapetyan has quit [Ping timeout: 276 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
millerti has joined #ruby
hotpancakes has quit [Ping timeout: 272 seconds]
shinnya has quit [Ping timeout: 250 seconds]
yoongkang has joined #ruby
kies has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jen_ has joined #ruby
jen_ has left #ruby [#ruby]
Gnut has joined #ruby
Neon has quit [Ping timeout: 240 seconds]
agent_white has quit [Read error: Connection reset by peer]
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
binaryplease has quit [Ping timeout: 250 seconds]
roshanav_ has quit [Remote host closed the connection]
aganov has quit [Remote host closed the connection]
Pupp3tm4st3r has quit [Remote host closed the connection]
rubie has joined #ruby
agent_white has joined #ruby
yardenbar has quit [Ping timeout: 264 seconds]
yoongkang has quit [Ping timeout: 272 seconds]
roshanavand has joined #ruby
jonr22 has joined #ruby
DurstBurger has quit [Ping timeout: 246 seconds]
ibouvousaime has quit [Ping timeout: 272 seconds]
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
failshel_ has joined #ruby
lubekpl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
render___ has quit [Ping timeout: 240 seconds]
B1n4r10 has quit [Ping timeout: 264 seconds]
eminencehc has quit [Remote host closed the connection]
mary5030 has quit [Read error: Connection reset by peer]
eminencehc has joined #ruby
atmosx has joined #ruby
arthurix has quit [Remote host closed the connection]
failshell has quit [Ping timeout: 272 seconds]
blackmesa has joined #ruby
failshel_ is now known as failshell
dfinninger has quit [Remote host closed the connection]
<yorickpeterse>
do you mean entities such as ?
<headius>
yorickpeterse: well, that's probably why you're not vulnerable to that CVE :-)
<yorickpeterse>
Or entities defined in the doctype?
<yorickpeterse>
doctypes are just parsed as is, nothing is evaluated
<yorickpeterse>
the official XML/HTML entities are encoded/decoded
nettoweb has joined #ruby
<headius>
oga doesn't support entities defined in the doctype then
cwong_on_irc has joined #ruby
weckl has joined #ruby
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
mark2 has quit [Remote host closed the connection]
SCHAAP137 has quit [Remote host closed the connection]
<yorickpeterse>
correct
maloik has quit [Ping timeout: 240 seconds]
<headius>
I suppose it's not surprising that oga isn't susceptible to a doctype entity expansion attack then :-)
<darix>
headius: I already complained about the lack of custom entities.
<darix>
he didnt want to listen.
<darix>
:D
<yorickpeterse>
They're not supported for that exact reason
antoniobeyah has joined #ruby
s2013 has joined #ruby
teclator has joined #ruby
TomyWork has quit [Remote host closed the connection]
<headius>
yorickpeterse: well, it's nice that you can pick and choose which XML features to support then
Xiti has quit [Read error: Connection reset by peer]
<headius>
but perhaps a bit disingenuous to talk about how oga's not vulnerable :-)
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
momomomomo has quit [Quit: momomomomo]
DurstBurger has joined #ruby
griffindy has joined #ruby
shlomo has quit [Quit: WeeChat 1.3]
digneety has quit [Ping timeout: 246 seconds]
CodingWolf has quit [Ping timeout: 240 seconds]
<yorickpeterse>
well it's not vulnerable
sepp2k has quit [Quit: Leaving.]
CodingWolf has joined #ruby
<yorickpeterse>
the underlying reason doesn't discredit that
momomomomo has joined #ruby
krajos has joined #ruby
bigkevmcd has quit [Ping timeout: 272 seconds]
s2013 has quit [Read error: Connection reset by peer]
elaptics is now known as elaptics`away
<headius>
yorickpeterse: it's not vulnerable because it doesn't support the feature :-P
<headius>
I imagine libyaml is not vulnerable to entity expansion attacks either
griffindy has quit [Client Quit]
<krajos>
Can someone help my noob ass out? Why can't I get this regexp working: "if (string =~ /a.{0,2} z/)" ...what I'm trying to say is " From this string, let me know if there's a 'z', within three positions after an 'a'. Return true if so, false if not.
bigkevmcd has joined #ruby
<darix>
headius: hmm cant you have blocks in yaml too? if i recall correctly there was this &foo thing to reference blocks
Kendos-Kenlen has joined #ruby
Kendos-Kenlen_ has quit [Read error: Connection reset by peer]
<headius>
darix: that may be...you get my point though
<krajos>
Hey everyone, I'm very new to ruby and I'm trying to get some help with regexp's... my expression is not working for some reason I can't pinpoint. Can someone please help me out? I want to find if a provided string has a 'z', within 3 chars after an 'a'. This is what I have: "if (string =~ /a.{0,2} z/)"
psy_ has quit [Max SendQ exceeded]
<krajos>
But it's not working
<havenwood>
krajos: note the space before the z
<havenwood>
krajos: what's that space for?
varesa has quit [Ping timeout: 260 seconds]
svkurowski has joined #ruby
<krajos>
my mistake, but it didn't work without the space either
hotpancakes has quit [Remote host closed the connection]
<havenwood>
krajos: What's one example that doesn't work?
B1n4r10 has joined #ruby
<krajos>
I stand corrected. It did work. I'm a dumbass.
Xeago has quit [Remote host closed the connection]
<krajos>
Thanks!!
antoniobeyah has quit [Quit: antoniobeyah]
<havenwood>
krajos: No prob, you're welcome.
gusrub has joined #ruby
aufi has quit [Quit: Konversation terminated!]
gusrub has quit [Client Quit]
<havenwood>
krajos: Just an aside, but you can omit the `0` and just do `{,2}`.
<krajos>
Ah, nice! Will do.
treehug88 has joined #ruby
<krajos>
Stupid question but what is the ~ after the '=' for?
m_abdelfattah has joined #ruby
<m_abdelfattah>
Hello, I've a question in Rails / ActiveAdmin... When I try to use rails date helper's distance_of_time_in_words inside activeadmin's collection_action, I get this error: undefined method `distance_of_time_in_words' for #<Admin::>.... So, how can I use rails helpers in activeadmin collection_action
<havenwood>
krajos: =~ and !~ are the pattern match operators in Ruby
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
nofxx has quit [Changing host]
nofxx has joined #ruby
<krajos>
Ok great, now I know what to google. Thanks, Havenwood!
antoniobeyah has joined #ruby
B1n4r10 has quit [Ping timeout: 250 seconds]
<havenwood>
krajos: "=~ is Ruby's basic pattern-matching operator."
Xeago has quit [Remote host closed the connection]
hahuang61 has quit [Ping timeout: 246 seconds]
ismaelga has quit [Remote host closed the connection]
<agent_white>
slash_nick: Theres tax dollars hard at work!
jaequery_ has joined #ruby
synthroid has joined #ruby
atmosx has quit [Quit: parting / quiting]
roshanav_ has joined #ruby
hotpanca_ has joined #ruby
hotpanc__ has joined #ruby
DroidBurgundy has joined #ruby
nofxx has quit [Remote host closed the connection]
hotpanca_ has quit [Remote host closed the connection]
adac has quit [Ping timeout: 255 seconds]
nofxx has joined #ruby
c0m0 has quit [Ping timeout: 276 seconds]
<agent_white>
Is `class Foo; def Foo.method...` the same as `class Foo; def self.method...` ?
<jhass>
agent_white: yes, since self inside class is Foo
karapetyan has joined #ruby
mrtomme has quit [Ping timeout: 260 seconds]
roshanavand has quit [Ping timeout: 272 seconds]
<jhass>
that is both self inside class and the constant Foo point to the same object
<agent_white>
jhass: Ah! Which syntax is preferred?
roshanav_ has quit [Read error: Connection reset by peer]
<jhass>
self.
<agent_white>
Okey doke!
<jhass>
since then you can just rename the class
<agent_white>
Thank you
yes`r has quit [Ping timeout: 276 seconds]
<agent_white>
Ahhh
norc_ has joined #ruby
mrtomme has joined #ruby
yes`r has joined #ruby
<norc_>
agent_white: For larger blocks you can also open the singleton class by using class << self
ismaelga has joined #ruby
<jhass>
and for utility modules Module#module_function comes in handy
<norc_>
Okay, so who here has debugging experience with Ruby? I need some pointers here, because I have no idea how to approach this bizarre bug.
mattwildig has joined #ruby
<agent_white>
Good deal, I'll look into both of those!
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
cjbottaro has joined #ruby
_stu_ has quit [Quit: _stu_]
treehug88 has quit [Ping timeout: 240 seconds]
centrx has quit [Quit: If you meet the Buddha on the road, kill him.]
Xeago has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mattwildig has quit [Ping timeout: 240 seconds]
colli5ion has quit [Ping timeout: 276 seconds]
<norc_>
Okay I think I figured it out. Was a mistake in my "uncatchable exception".
<agent_white>
And also on that note... what are Class methods good for then, if they can't access instance vars/methods, but instance vars can use them? Just... scoping?
<norc_>
Does Ruby disable its SIGINT handlers while handling exceptions?
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
SteppenII has joined #ruby
<norc_>
agent_white: Inheritance
<agent_white>
norc_: Ah ok
<norc_>
If you don't need that, chances are you will want to use a Mixin instead.
m_abdelfattah has quit [Ping timeout: 255 seconds]
<jhass>
agent_white: constructing instances for example
<norc_>
agent_white: And in reality there are no class methods.
<norc_>
Well. In full truth there are ONLY class methods.
yoongkang has joined #ruby
<agent_white>
norc_: A class is a module is a class is a module kinda thing? ;P
baweaver has joined #ruby
_stu_ has joined #ruby
dimasg has joined #ruby
<norc_>
agent_white: What you call an "instance method" actually is a method of the class itseelf.
<norc_>
agent_white: And what you call a "class method" is a method of the singleton class of that class.
<norc_>
Only classes have methods.
naftilos76 has quit [Remote host closed the connection]
ChameleonSix has joined #ruby
<agent_white>
Ohhhh
<ChameleonSix>
?
<norc_>
>> def foo; end # even that is added to a class
RegulationD has quit [Remote host closed the connection]
jonr22 has quit []
bds has quit [Quit: leaving]
mattwildig has quit [Remote host closed the connection]
roshanavand has joined #ruby
chouhoul_ has joined #ruby
goodcodeguy has joined #ruby
s1kx has quit [Ping timeout: 252 seconds]
chouhoulis has quit [Ping timeout: 272 seconds]
roshanavand has quit [Ping timeout: 240 seconds]
kollapse has quit [Quit: Out of sector]
failshell has quit []
[Butch] has joined #ruby
<agent_white>
>> alias :top_hey; def hey; puts "heya"; end; class Foo; def top_hey; end; end; Foo.top_hey
<ruboto>
agent_white # => /tmp/execpad-0e2ceabdc871/source-0e2ceabdc871:2: syntax error, unexpected ';' ...check link for more (https://eval.in/474616)
<agent_white>
>> alias :top_hey :hey; def hey; puts "heya"; end; class Foo; def top_hey; end; end; Foo.top_hey
<ruboto>
agent_white # => undefined method `hey' for class `Object' (NameError) ...check link for more (https://eval.in/474617)
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
<agent_white>
>> def hey; puts "heya"; end; alias :top_hey :hey; class Foo; def top_hey; end; end; Thing.top_hey
<ruboto>
agent_white # => uninitialized constant Thing (NameError) ...check link for more (https://eval.in/474618)
User458764 has joined #ruby
<agent_white>
>> def hey; puts "heya"; end; alias :top_hey :hey; class Foo; def top_hey; end; end; Foo.top_hey
<ruboto>
agent_white # => private method `top_hey' called for Foo:Class (NoMethodError) ...check link for more (https://eval.in/474619)
<agent_white>
Hm damn.
digneety has joined #ruby
<agent_white>
Works in pry for me.
arup___ has quit []
lurch_ has quit [Quit: lurch_]
pandaant has quit [Remote host closed the connection]
yeticry has quit [Read error: Connection reset by peer]
<i8igmac>
it is silly, playing with my android phone...
yeticry has joined #ruby
<i8igmac>
Ok, sorry but I made a mistake... the array will have a-z 0-9
<jhass>
I don't get what you want
<jhass>
?xy
<ruboto>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
mellor7 has joined #ruby
<i8igmac>
I guess this is called radix. There is a gem for it
<i8igmac>
but currently I don't have the gem installed on this phone
<jhass>
you're only increasing my confusion over your goal
arooni has joined #ruby
<i8igmac>
I'm trying to produce a progressive permutation using radix
jessemcgilallen has joined #ruby
<jhass>
google gives me only 114 results for "progressive permutation". Are you sure it's a thing?
zacstewart has joined #ruby
<jhass>
meh, statistics, I bail
<i8igmac>
Sorry. Its more of a radix instead of a permutation
<norc_>
So Im thinking the call would access the object behind the constant Class, resolving up until the singleton_class of the RClass Class
<norc_>
call new which would probably construct a new RClass
<norc_>
Then call the method of the RClass Class directly to construct a new class together with a singleton_class, and set that singleton_classes klass pointer to the newly created RClass
ur5us_ has joined #ruby
reaVer has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
SCHAAP137 has quit [Quit: Leaving]
agit0 has joined #ruby
JazzyVariable227 has quit [Remote host closed the connection]
<drbrain>
that sounds about right
arup_r has joined #ruby
<norc_>
Alright nice.
<norc_>
And that newly created RClasses singleton_class would have its klass pointer set to the String RClass of course.
dravine_ has joined #ruby
based_pdev has joined #ruby
last_staff has quit [Remote host closed the connection]
last_staff has joined #ruby
baweaver has joined #ruby
moeabdol has quit [Read error: Connection reset by peer]
SteppenII has quit [Quit: leaving]
bersimoe_ has quit [Remote host closed the connection]
dravine has quit [Ping timeout: 240 seconds]
dravine_ is now known as dravine
moeabdol has joined #ruby
pzula has quit [Read error: Connection reset by peer]
centrx has joined #ruby
<B1n4r10>
win 4
last_staff has quit [Read error: Connection reset by peer]
gusTester has joined #ruby
reaVer has quit [Remote host closed the connection]
radgeRayden has joined #ruby
lurch_ has joined #ruby
diegoaguilar has quit [Read error: Connection reset by peer]
reaVer has joined #ruby
<drbrain>
I'm not sure how the singleton_class get set up
last_staff has joined #ruby
<drbrain>
but if you mean "Foo.some_method" will be looked up as "String.some_method" then "Class.some_method", then that sounds right
purplexed- has quit [Read error: Connection reset by peer]
<norc_>
drbrain: Something is still dazzling me here.
karapetyan has joined #ruby
<norc_>
We have to end up with an RObject for Foo, right?
m3_del has joined #ruby
bersimoes has joined #ruby
<drbrain>
seems so
<drbrain>
well, something with a `super` pointer and a `singleton_class` pointer
<norc_>
no
<norc_>
You only have one klass pointer
wilsonc91 has joined #ruby
ismaelga has joined #ruby
<drbrain>
since Foo is a Class it needs a klass pointer ("I'm a class")
<drbrain>
but it's also a Class object (struct RClass in internal.h) so it also has a "super" pointer
<drbrain>
which is what instances use for method resolution
<drbrain>
you're going to end up with a struct RClass, not a struct RObject from Class.new
SleepySensei has joined #ruby
futilegames has joined #ruby
<norc_>
agent_white: Worse.
<norc_>
I have had a dive into the MRI.
bersimoes has quit [Ping timeout: 240 seconds]
<norc_>
100 times the information and 1/100th the documentation.
JazzyVariable227 has joined #ruby
digneety has quit [Changing host]
digneety has joined #ruby
Mon_Ouie has quit [Ping timeout: 260 seconds]
<agent_white>
norc_: Oh fun! :) Haha so I heard... riddled with dragons, eh?
<norc_>
drbrain: Oh damn that is right, I was mixing klass and super together.
<norc_>
drbrain: However, there is no singleton_class pointer
<norc_>
There is just super.
<drbrain>
the rb_classext_t holds the ivars for the class object, etc.
<drbrain>
which is shared by modules, IIRC
lokulin has quit [Ping timeout: 272 seconds]
<norc_>
uh lets leave modules out for now
MasterNayru has quit [Ping timeout: 240 seconds]
<drbrain>
on trunk, it's right above sturct RClass in internal.h
<drbrain>
sure
s00pcan has quit [Ping timeout: 240 seconds]
<norc_>
I have to wonder whether my book is just outdated for 2.3 MRI
Mon_Ouie has joined #ruby
<drbrain>
I haven't been following ruby-core mailing list, but I don't think there's anything new (like refinements or prepend) that's beyond what 2.2 has in terms of class construction, etc.
treehug88 has joined #ruby
ta has joined #ruby
lguardiola has joined #ruby
<norc_>
Okay so there is two chains to consider
s00pcan has joined #ruby
<norc_>
There is a super chain, and a klass chain
zacstewart has quit []
<norc_>
Or Im getting too confused
<norc_>
What is the super point. What is the klass pointer in RBasic
<drbrain>
klass pointer is "what 'type' is this object"
<norc_>
so both klass and super point at RClass
<drbrain>
`"foo"` is an RObject of class String, so it's klass pointer points to the String class
<norc_>
alright.
dopie has joined #ruby
<drbrain>
well, probably RString, because there is one of those
<norc_>
Yeah, but for the sake of the argument lets assume its not a generic
<drbrain>
but a `"foo"` wouldn't have a super pointer because it is an instance
yardenbar has joined #ruby
<norc_>
so when I call foo.class - ignoring the actual method dispatch - it just ends up resolving klass, showing the name of the RClass behind it
<drbrain>
correct
adac has quit [Ping timeout: 252 seconds]
<norc_>
Okay so when I create a new class, it creates an RObject with klass pointing to the RClass Class
roshanavand has joined #ruby
<norc_>
Its super pointer will point at its singleton_class
<norc_>
Im guessing klass is also how singleton_classes are identified then
<drbrain>
RClass, not RObject
<norc_>
well both
<norc_>
okay first the RClass
<norc_>
and then an RObject
icemancast has quit [Quit: icemancast]
<norc_>
Or...
<drbrain>
no, just RClass, but the RClass shares all the fields of the RObject structure
<norc_>
huh
<drbrain>
(if indirectly through rb_classext_struct)
roshanavand has quit [Remote host closed the connection]
ldnunes has quit [Quit: Leaving]
tulak has quit [Remote host closed the connection]
SCHAAP137 has joined #ruby
<norc_>
Okay so RObjects is the things that get created by Class#new
tulak has joined #ruby
<norc_>
And RClasses get created by Class::new
s00pcan has quit [Ping timeout: 260 seconds]
s00pcan has joined #ruby
<drbrain>
yes
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<norc_>
Alright. Still dont see how RClass shares all the fields of the RObject structure.
kies^ has joined #ruby
trosborn has joined #ruby
<drbrain>
they both have an RBasic
<drbrain>
and RObject has that "as" union which encodes the instance variables
<drbrain>
the RObject implementation is an optimization that can avoid mallocs of a separate table of instance variables
rdavila has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
futilegames has quit [Quit: futilegames]
jessemcgilallen has joined #ruby
<drbrain>
the rb_classext_struct doesn't have any of that, it has the iv_tbl and iv_index_tbl which are not optimized
dikaio has joined #ruby
<norc_>
drbrain: I have a feeling we are both looking at Ruby under a Microscope currently. :-)
baweaver has quit [Remote host closed the connection]
<norc_>
Oh damn I misread the brackets on the union. No it makes sense now.
<norc_>
So it is either a compact ary, or regular heap stuff
<drbrain>
yes
<norc_>
Im guessing it just uses the ary until its filled and then shuffles things around
<drbrain>
yes
<drbrain>
similar optimizations exist for RArray and RString
pzula has joined #ruby
lxsameer has joined #ruby
lxsameer has joined #ruby
iateadonut has quit [Quit: Leaving.]
<norc_>
drbrain: Alright. Digging through the source code also revealed that whether a class is a singleton_class is placed into the flags in its RBasic
<norc_>
(FL_SINGLETON)
rodfersou has quit [Quit: leaving]
dopie has quit [Quit: This computer has gone to sleep]
arup_r has quit [Ping timeout: 240 seconds]
<norc_>
Which makes me wonder what klass actually points to
adac has joined #ruby
dopie has joined #ruby
pzula has quit [Ping timeout: 250 seconds]
<drbrain>
I think the singleton class only gets created when you access it
reaVer has quit [Remote host closed the connection]
<drbrain>
so ordinarily RString("my string")->klass == RClass(String)
<DurstBurger>
when using sinatra, on a POST, how do i call a ruby script with the attached variable from the post and then return the output of the script to the page?
<drbrain>
but if you access it then RString("my string")->klass
<drbrain>
=> RClass(singleton class of that string)->klass == RClass(String)
<drbrain>
but it's been a while since I dug through that
<jhass>
DurstBurger: ideally you would refactor your script into a class that you can just call
<drbrain>
norc_: I need to eat some lunch now, but I should be back in about 90 minutes
<norc_>
drbrain: Alright then. Enjoy and see you then. :)
SleepySensei has quit [Read error: Connection reset by peer]
rdavila has joined #ruby
<norc_>
I shall spend the time to figure out how singleton classes come into existence.
reaVer has joined #ruby
m3_del has quit [Remote host closed the connection]
baweaver has joined #ruby
icemancast has joined #ruby
Channel6 has joined #ruby
atmosx has joined #ruby
afaris has joined #ruby
<norc_>
Okay that was quick. Singleton classes get created automatically.
based_pdev_ has joined #ruby
reaVer has quit [Remote host closed the connection]
based_pdev has quit [Ping timeout: 240 seconds]
JazzyVariable227 has quit [Remote host closed the connection]
roshanavand has joined #ruby
millerti has joined #ruby
JazzyVariable227 has joined #ruby
reaVer has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
tercenya has quit [Read error: Connection reset by peer]
tercenya has joined #ruby
<atmosx>
hello
atomical has quit [Max SendQ exceeded]
chouhoul_ has quit [Remote host closed the connection]
icemancast has quit [Quit: icemancast]
podman has joined #ruby
chouhoulis has joined #ruby
roshanavand has quit [Ping timeout: 250 seconds]
hotpancakes has quit [Remote host closed the connection]
JazzyVariable227 has quit [Ping timeout: 240 seconds]
allcentury has joined #ruby
eminencehc has quit [Remote host closed the connection]
atomical has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
mary5030 has quit [Remote host closed the connection]
<centrx>
Success, Seems like you want to have a class(es)
ciege has joined #ruby
codecop has quit [Remote host closed the connection]
<Success>
centrx: idk... basically i want to have a list of "Proc" 's and as I iterate them load them down with the same set of functions/variables that they share
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<centrx>
I'm not sure I follow
<centrx>
Proc#call is the right way to call a proc
<Success>
yeah but its not perserving @http nor server
yoongkang has joined #ruby
jessemcgilallen has quit [Quit: jessemcgilallen]
icemancast has joined #ruby
lurch_ has quit [Quit: lurch_]
<centrx>
Success, 'server' is a local variable, so it is only defined in the #parent method
<centrx>
Success, Outside of the parent method, it is not defined, it is out of scope
hotpancakes has joined #ruby
<atmosx>
Success: you might wanna change that code into a class and initialize variables
<Success>
centrx: ahh now we're getting somewhere. i'll check that out:)
atomical has quit [Max SendQ exceeded]
<Success>
almost there
shtirlic has quit [Ping timeout: 240 seconds]
<Success>
not quite what i want tho
<Success>
actually i have an idea thanks
Success has quit [Quit: Page closed]
atomical has joined #ruby
dfinninger has quit [Remote host closed the connection]
Marcon has quit [Quit: Verlassend]
Clockwerk has left #ruby [#ruby]
Marcon has joined #ruby
dimasg has quit [Ping timeout: 246 seconds]
platon has left #ruby [#ruby]
Marcon has quit [Client Quit]
`based_pdev` has joined #ruby
rwy has joined #ruby
PaulCape_ has joined #ruby
PaulCapestany has quit [Ping timeout: 244 seconds]
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
based_pdev_ has quit [Ping timeout: 240 seconds]
dfinninger has joined #ruby
themadcanudist has joined #ruby
freerobby has quit [Quit: Leaving.]
yoongkang has quit [Remote host closed the connection]
vikas027 has joined #ruby
tildes has quit [Ping timeout: 272 seconds]
rdavila has joined #ruby
scripore has joined #ruby
eminencehc has quit [Remote host closed the connection]
crunk_bear has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nso95 has joined #ruby
eminencehc has joined #ruby
blackmesa has joined #ruby
allcentury has quit [Ping timeout: 246 seconds]
tgandrews has joined #ruby
moeabdol has quit [Read error: Connection reset by peer]
yalue has quit [Quit: return 0;]
bryanray has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
atmosx has quit [Quit: Lost in trance]
moeabdol has joined #ruby
tildes has joined #ruby
decoponio has quit [Quit: Leaving...]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
nso95 has quit [Ping timeout: 272 seconds]
JazzyVariable227 has joined #ruby
nso95- has joined #ruby
nso95- has quit [Changing host]
nso95- has joined #ruby
joshi4 has joined #ruby
shtirlic has joined #ruby
sdothum has joined #ruby
solenoids has quit [Ping timeout: 250 seconds]
eminencehc has quit [Remote host closed the connection]
tildes has quit [Ping timeout: 252 seconds]
tildes has joined #ruby
ljt has joined #ruby
al2o3-cr has quit [Ping timeout: 250 seconds]
solocshaw has quit [Ping timeout: 246 seconds]
Xeago has joined #ruby
mrd_ has joined #ruby
<joshi4>
I am installing version 1.5.0 of fog through chef and everything was working fine till yesterday. chef-client version is 11.16.4 and ruby version is 1.9.3. It seems that in the past couple of days there was a new dependency added to mime-types: mime-types-data-3.0 which has a hard requirement of ruby 2.0. Now the whole problem arises as fogs dependency of mime-types is mime-types >= 0 which goes in an pulls the latest version.
eminencehc has joined #ruby
solocshaw has joined #ruby
<joshi4>
Would appreciate any ideas on how to get around the problem
JazzyVariable227 has quit [Ping timeout: 244 seconds]
dkphenom has joined #ruby
haxrbyte has joined #ruby
dimasg has joined #ruby
<Radar>
joshi4: upgrade to Ruby 2.0.
<matti>
;)
haxrbyte has quit [Remote host closed the connection]
<Radar>
joshi4: Where should I send my invoice?
<matti>
Radar: Long time no seen
<Radar>
o/ matti
<matti>
o/
haxrbyte has joined #ruby
roshanavand has quit [Remote host closed the connection]
<Radar>
joshi4: it took me many years of knowledge to learn that upgrading Ruby is the most easiest / sensible thing to do
<Radar>
Don't fight the powah.
skullcrasher has joined #ruby
gustav_ has joined #ruby
tulak has quit [Remote host closed the connection]
<joshi4>
Radar: I upgraded my chef-client version to 12.5.1 which has ruby 2.0 and that runs into a different dependency cycle. Also, while upgrading to ruby 2.0 will work for all new machines that are bootstrapped, it won't work for many existing nodes that we have
DroidBurgundy has quit [Ping timeout: 255 seconds]
_stu_ has joined #ruby
dimasg has quit [Ping timeout: 252 seconds]
<Radar>
joshi4: Why are you still stick on 1.9.3? Seems like lazy devops
DroidBurgundy has joined #ruby
NeverDie has joined #ruby
rdark has quit [Ping timeout: 272 seconds]
ljt has quit [Read error: Connection reset by peer]
ljt has joined #ruby
ljt has quit [Read error: Connection reset by peer]
NeverDie has quit [Client Quit]
tildes has quit [Ping timeout: 250 seconds]
ljt has joined #ruby
lokulin has quit [Ping timeout: 244 seconds]
* Radar
does not enjoy it when people treat IRC as if it were an async protocol :\
nso95- has quit [Ping timeout: 272 seconds]
nso95- has joined #ruby
nso95- has joined #ruby
TPBallbag has joined #ruby
IrishGringo has joined #ruby
allcentury has joined #ruby
solenoids has joined #ruby
MasterNayru has quit [Ping timeout: 272 seconds]
Contigi777 has joined #ruby
Contigi777 has quit [Remote host closed the connection]
moeabdol has quit [Read error: Connection reset by peer]
<agent_white>
Heheh
uri has quit [Ping timeout: 250 seconds]
TPBallbag has quit [Client Quit]
adriancb_ has joined #ruby
centrx has quit [Quit: If you meet the Buddha on the road, kill him.]
jbrhbr has joined #ruby
TomPeed has joined #ruby
<Radar>
joshi4: ping.
moeabdol has joined #ruby
ornerymoose has quit [Quit: ornerymoose]
pawnbox has joined #ruby
<norc_>
agent_white: Alright, I had an excessive excursion to give you accurate information now.
<agent_white>
norc_: \o/
dopamean_ has joined #ruby
<agent_white>
norc_: How was it?!
<norc_>
agent_white: defining a function in top level just adds it directly to the methods of Object (read "instance methods")
<norc_>
Refreshing and clearing up much of the confusion.
<adaedra>
'evening
yfeldblum has joined #ruby
<norc_>
Good evening adaedra.
weckl has quit [Remote host closed the connection]
<havenwood>
allo
<blubjr>
hi adaedra
<norc_>
adaedra: By the way, turns out it was not a bug. I just bugged out a loop with exception handling, which incidentally was also entered on SIGINT.
PaulCape_ has quit [Quit: .]
eminencehc has quit [Remote host closed the connection]
Hounddog has quit [Remote host closed the connection]
<norc_>
Redefining StandardError#=== really is not the wisest thing. :-)
<adaedra>
I've a question (my turn!): You can match by classes in a when clause... can you match by respond_to? for duck typing?
PaulCapestany has joined #ruby
skade has joined #ruby
bkxd has joined #ruby
<adaedra>
norc_: Redefining core classes is not often the good thing to do, I think.
themadcanudist has quit [Quit: Leaving.]
<jhass>
adaedra: case/when calls #=== on the items in the when clause and passes it the item in the case clause
moeabdol has quit [Ping timeout: 246 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra>
jhass: so I should understand it's "no"?
<Mon_Ouie>
class Symbol; def ===(o); o.respond_to? self; end; end
<jhass>
I'm not aware of any core implementation of #=== that delgates to respond_to
MasterNayru has joined #ruby
<jhass>
but you could build yourself for example a proc that checks it
haxrbyte has quit [Quit: Leaving...]
pawnbox has quit [Remote host closed the connection]
<adaedra>
Or there's something on === I didn't understood
<norc_>
agent_white: The reason this works is because the default receiver for VCALL is self, which in top level is just an instance of Object.
<jhass>
Proc#=== is an alias for call
VeryBewitching has joined #ruby
<adaedra>
oh
<adaedra>
interesting then.
<VeryBewitching>
G'day folks.
<adaedra>
Hi VeryBewitching
<VeryBewitching>
How's the day adaedra?
<adaedra>
Danke schön, jhass
<adaedra>
VeryBewitching: it should end soon, fortunately.
<norc_>
agent_white: So when you type foo() it really does self.foo(), which calls the instance method foo() of whatever the class (Object) of self is.
<VeryBewitching>
adaedra: One of those huh?
<adaedra>
I slept really badly last night.
al2o3-cr has joined #ruby
B1n4r10 has quit [Ping timeout: 276 seconds]
<norc_>
agent_white: Incidentally since almost every class has Object as one of their ancestors, this works everywhere, thus giving you the notion of a global function.
mary5030 has quit [Remote host closed the connection]
<norc_>
agent_white: There you go, much clearer now. :-)
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<norc_>
Conceptually I mean
scripore has quit [Quit: This computer has gone to sleep]
mattwildig has joined #ruby
<adaedra>
does not taint core object
bersimoes has joined #ruby
<jhass>
what's wrong with def t(method); proc {|obj| obj.respond_to?(method) }; end ?
jessemcgilallen has joined #ruby
saddad has quit [Ping timeout: 252 seconds]
<adaedra>
It's too amazing.
<norc_>
Huh.
ICantCook has joined #ruby
moeabdol has quit [Client Quit]
<adaedra>
This is perfect.
<norc_>
Proc#=== does a call, how amazing is that.
ICantCook has quit [Client Quit]
<norc_>
Sorry must have missed that
<kiki_lamb>
given a block like this { x = calculate_x; nil }, is there a way of either #1. causing 'x = ' to act like 'self.x = ' or option #2. scraping the loal variable x out of the context somehow after executing the block?
<jhass>
I don't think so
skade has joined #ruby
<jhass>
why don't you just return the value from the block?
moeabdol has joined #ruby
skade has quit [Client Quit]
[Butch] has quit [Quit: I'm out . . .]
<kiki_lamb>
i'm implementing a DSL, and in this DSL it would be convenient if the user of the DSL could pass blocks to objects that assign to their attributes without having to write self all over the place
bersimoes has quit [Ping timeout: 246 seconds]
<kiki_lamb>
the DSL is for livecoding (performing music by editing the source code that's making it as it plays), so tersity is a paramount concern
<norc_>
kiki_lamb: You could abuse method_missing? and just use x 'foo' syntax
<adaedra>
Common usage is .foo { |o| o.a = 1; o.b = 2 } I guess
<kiki_lamb>
norc_: yeah, I may end up using 'x! foo'.
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
and that's why instance_exec yields self
<norc_>
kiki_lamb: That is what FactoryGirl does
<norc_>
afaik
hightower4 has joined #ruby
<kiki_lamb>
jhass: yeah, these blocks are being instance eval-ed by the relevant objects
hotpancakes has quit []
<hightower4>
Hey, how would I match words with two identical, repeating letters, like 'aa' or 'egg'?
last_staff has quit [Quit: last_staff]
<kiki_lamb>
I'll either go with 'x!' for assignment or stick 'self.' on the front in the preprocessor, i suppose
<jhass>
hightower4: what exactly do you need as result?
yoongkang has joined #ruby
<hightower4>
kiki_lamb, just a match or no-match, so that I can remove those words from the list
<jhass>
hightower4: so you have strings containing a single word?
DroidBurgundy has quit []
loc22 has joined #ruby
<kiki_lamb>
hightower4: lookahead with a backreference, maybe?
scripore has joined #ruby
<jhass>
>> %w(foo bar baz quuxC).reject {|word| word[/([a-z])\1/] }
<adaedra>
you may have more information in /usr/local/lib64/gems/ruby/pcaprub-0.12.0/
waka has joined #ruby
<Everlost>
I checked the .out file. it contains the same thing as earlier stdout
<Everlost>
can I get gem to be more talkative?
al2o3-cr has joined #ruby
al2o3-cr has quit [Client Quit]
<jhass>
are you really sure it's the same error?
graffix has quit [Quit: graffix]
axsuul has quit [Ping timeout: 264 seconds]
<Everlost>
these returns from gem, it seems like too much exception handling, no file, no line, no stack... You end up with "Could not create Makefile due to some reason"
al2o3-cr has joined #ruby
ChameleonSix has joined #ruby
<jhass>
the relevant part of the last one was checking for pcap_open_live() in -lpcap... *** extconf.rb failed ***
<ChameleonSix>
Hello
<adaedra>
there's only one file in the directory? I though there were two files in those
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tgandrews has quit [Remote host closed the connection]
freerobby has joined #ruby
d0nn1e has joined #ruby
Anthony_ has joined #ruby
trosborn has quit [Quit: trosborn]
<d0nn1e>
Everlost ok what did I miss
pawnbox has joined #ruby
<Everlost>
try and compile the c file manually
<Everlost>
to get a better error report
<Everlost>
you've got to cat your log file though
trosborn has joined #ruby
<Everlost>
mine is : cat /usr/local/lib64/gems/ruby/pcaprub-0.12.0/mkmf.log
<Everlost>
all info is in there
<adaedra>
I'd have expected it to give more info.
jpfuentes2 has joined #ruby
al2o3-cr has joined #ruby
<Everlost>
woops
<Everlost>
I didn't reinstall gcc
<Everlost>
I did on livecd, that why I thought I had it
<d0nn1e>
I did install gcc though
_blizzy_ has quit [Ping timeout: 255 seconds]
<Everlost>
ok
trosborn has quit [Client Quit]
<Everlost>
gcc says nothing
<Everlost>
not even a carriage return, just nothing.
<d0nn1e>
Package gcc-5.1.1-4.fc23.x86_64 is already installed
<d0nn1e>
huh
Anthony_ has quit [Client Quit]
<adaedra>
Everlost: echo $?
kies has quit [Ping timeout: 272 seconds]
<Everlost>
oh
chouhoulis has quit [Remote host closed the connection]
<Everlost>
yay! bettercap installed
<Everlost>
was just missing gcc
Xeago has quit [Remote host closed the connection]
<adaedra>
>_>
<Everlost>
hey guys please really, make your gem verbose
pawnbox has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
<adaedra>
That's the building process, it's the same for all.
<Everlost>
try installing packets with pip and it will tell you that you are missing gcc.
Xeago has quit [Remote host closed the connection]
<jhass>
well, technically this is a mkmf and not a rubygems issue :P
<adaedra>
Binary gems are weird.
<Everlost>
d0nn1e: you've got it working?
<jhass>
and yes, mkmf has .... issues
<marahin>
Hello. I'm trying to make a plugin (a ruby newb here) for cinch bot, so that it gets some RSS and then puts it out. However, I am not really sure where to allocate a method which will continously download data every 10 minutes or so (I would like to create a Thread.new for it). I think the best idea would be to add it to initialize (so after class [plugin in this case] initializaiton it'll automatically run), however I am not sure how to /add/ a
<marahin>
method to initialize without completely overriding the initialize() with only my method.
<Everlost>
d0nn1e: I've installed a few other packets like ruby-devel, libpcap-devel
htmldrum has joined #ruby
<marahin>
e.g.: is there any way in overriding intiialize so it remains as it was but only adding a method at the end, OR is there any other good way to make Object run a method after being initialized?
mooe has joined #ruby
<jhass>
marahin: cinch has a Timer API to delay or periodically do stuff, I don't remember whether it has a nice point to define them though
<marahin>
jhass, oh, I must have missed that
<marahin>
thank you, I'll look it up
<adaedra>
anyway, it's reaaaaally time for me to bed. Good night, Bonne nuit, Gute Nacht, God Natt, or whatever floats your boat.
<marahin>
jhass, In Cinch, two ways for creating timers are available:
<marahin>
The first way is by declaring them for a plugin, in which case they will start as soon as the bot connects to a server.
<Everlost>
[E] undefined method `arp_opcode' for nil:NilClass
<marahin>
seems perfectly crafted for me :-) thank you!
<jhass>
yw
gustav_ has quit [Remote host closed the connection]
jessemcgilallen has quit [Quit: jessemcgilallen]
<d0nn1e>
Everlost, Ill pm you
<Everlost>
ah guys, your gem is mean, but your community is helpful, and bettercap rocks and is ruby powered. So all in all I'd vote your community up :p
icemancast has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
platzhirsch has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
symm- has quit [Ping timeout: 240 seconds]
I has joined #ruby
symm- has joined #ruby
I is now known as Guest19752
exadeci has joined #ruby
jessemcgilallen has joined #ruby
icemancast has left #ruby [#ruby]
<drbrain>
ew, pcaprub (used by bettercap) doesn't release the GVL when waiting for packets
dimasg has quit [Ping timeout: 260 seconds]
<drbrain>
so it blocks threaded processing
s2013 has joined #ruby
yoongkang has joined #ruby
Guest19752 has quit [Ping timeout: 240 seconds]
rdavila has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<drbrain>
oh, worse, it sets non-blocking mode so you need to busy-loop
cryo28 has joined #ruby
<jhass>
drbrain: bored? :P
adriancb_ has quit [Remote host closed the connection]
dopie has joined #ruby
<drbrain>
given that I wrote my own libpcap wrapper, I'm interested in other people's work