stannard_ has quit [Read error: Connection reset by peer]
mleung has quit [Quit: mleung]
pawnbox has quit [Ping timeout: 244 seconds]
stannard has joined #ruby
[gmi] has joined #ruby
mleung has joined #ruby
mleung has quit [Client Quit]
[gmi] has quit [Quit: Leaving]
ensyde__ has joined #ruby
dling has joined #ruby
jkahn has joined #ruby
ensyde__ is now known as ensyde
linoj has joined #ruby
ensyde_ has quit [Ping timeout: 268 seconds]
firstdayonthejob has quit [Ping timeout: 244 seconds]
binaryplease1 has joined #ruby
Abrin_AWAY2 has joined #ruby
sdwrage has quit [Quit: Leaving]
dopamean_ has quit [Ping timeout: 244 seconds]
binaryplease has quit [Ping timeout: 264 seconds]
binaryplease1 has quit [Client Quit]
godzillaenlacasa has quit [Quit: ZZZZZ....]
binaryplease has joined #ruby
n008f4g_ has quit [Ping timeout: 240 seconds]
trosborn has quit [Quit: trosborn]
hxegon is now known as hxegon_AFK
Abrin_AWAY has quit [Ping timeout: 276 seconds]
tummy has joined #ruby
trosborn has joined #ruby
trosborn has quit [Client Quit]
d0nn1e has quit [Ping timeout: 252 seconds]
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sneakerhax has joined #ruby
vikas027 has joined #ruby
hahuang65 has joined #ruby
shinnya has quit [Ping timeout: 268 seconds]
hxegon_AFK is now known as hxegon
ben_vulpes has joined #ruby
nerium has quit [Quit: nerium]
CloCkWeRX has quit [Ping timeout: 244 seconds]
d0nn1e has joined #ruby
tummy has quit [Ping timeout: 248 seconds]
Don_John has joined #ruby
<ben_vulpes>
i have a the dumb question: would like to run a gem with a specific, non-system version of ruby on a server. would really like to not use rbenv or the like, because this is going to get called via shelling out from another language entirely. is there a decent way to get a ruby (say 2.3.0) on a system and then `/opt/the-ruby-i-want gem *args`?
<marchelzo>
hi could someone write a program in ruby that reads from stdin line by line, splits the line on whitespace, filters to keep only words matching /\w+/, and increments the value in a hashmap with that word as the key. then at the end, print the top 10 words in the format '<word>: count'
<Ox0dea>
marchelzo: You could! :)
<Ox0dea>
Sounds like you've got all the ingredients.
<marchelzo>
Ox0dea: I don't know ruby very well
<Ox0dea>
marchelzo: But it seems you know it enough.
<marchelzo>
I want to make sure it's written in an idiomatic style, because I'd like to compare its performance against implementations in a couple of other languages.
<ben_vulpes>
neat Ox0dea
<ruby-lang188>
Thanks for responding havenwood. That website is currently down. Would you happen to know anywhere else I could get those files?
<marchelzo>
I will write one, and could you tell me if it looks good?
<ruby-lang188>
Also there isn't an archive on account of the robots.txt for that site so thats a no go
<Ox0dea>
marchelzo: Sounds good.
d0nn1e has quit [Ping timeout: 248 seconds]
fullofca_ has joined #ruby
<Ox0dea>
marchelzo: If you're familiar with Python's defaultdict, we just pass a value to Hash.new to get (roughly) the same semantics in Ruby.
<marchelzo>
I used defaultdict(int) for the python implementation :)
<Ox0dea>
marchelzo: That'll be `Hash.new(0)` in the Ruby one. :)
<havenwood>
marchelzo: Check in here with Gists if you run into problems!
d0nn1e has joined #ruby
fullofcaffeine has quit [Ping timeout: 240 seconds]
<havenwood>
Or questions or whatever else.
bronson has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
<havenwood>
ruby-lang188: Nope, sorry I don't.
Didac has quit [Ping timeout: 240 seconds]
<ruby-lang188>
Ah, thanks anyway
swills has joined #ruby
tenderlove has quit [Quit: Leaving...]
CloCkWeRX has joined #ruby
sapslaj has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
tenderlove has joined #ruby
stannard has quit [Remote host closed the connection]
Moosashi has quit [Quit: Moosashi]
bezhermoso has quit [Quit: Zzzzz...]
fullofca_ has quit [Remote host closed the connection]
<ruby[bot]>
Radar: # => undefined method `BigDecimal' for 12971293712871239871239871239817239:Bignum (NoMethodError) ...check link for more (https://eval.in/537219)
<Ox0dea>
Radar: Isn't that what `to_s('F')` is for?
gmi_ has joined #ruby
<Radar>
Ox0dea: I love you (in a purely platonic way)
<Ox0dea>
<3
graffix has joined #ruby
beergineer has quit [Quit: Page closed]
maletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aaeron has joined #ruby
sp4rrow_ has joined #ruby
sp4rrow has quit [Read error: Connection reset by peer]
diegoviola has quit [Changing host]
diegoviola has joined #ruby
<marchelzo>
Ox0dea: very nice
jenrzzz has quit [Ping timeout: 248 seconds]
<Ox0dea>
Danke.
gmi_ has quit [Client Quit]
Us54er has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Moosashi has quit [Quit: Moosashi]
Xeago has quit [Read error: Connection reset by peer]
aaeron has quit [Client Quit]
aaeron has joined #ruby
rkazak has joined #ruby
Xeago has joined #ruby
`tim` has joined #ruby
decoponio has quit [Quit: Leaving...]
chouhoulis has joined #ruby
<Ox0dea>
Performance-wise, there's nothing to be done for it that wouldn't violate Knuth's premature optimization rule.
<marchelzo>
scan vs splt then filter is huge
<marchelzo>
split*
jkahn has joined #ruby
<Ox0dea>
If your input was massive, it might be worth maintaining some kind of sliding window into the ten most frequent words.
Mon_Ouie has joined #ruby
<marchelzo>
I just changed my other implementation to use that, and it cut the time in half.
<Ox0dea>
How are you benchmarking?
Vingador has joined #ruby
frustrum has joined #ruby
<marchelzo>
just using a large input and doing a bunch of runs with time(1)
poerror has quit [Ping timeout: 240 seconds]
duckpuppy has joined #ruby
sp4rrow_ has quit [Read error: Connection reset by peer]
pawnbox has joined #ruby
<marchelzo>
it's not perfect, but with a large enough input you can easily learn things
sp4rrow has joined #ruby
Xeago has quit [Ping timeout: 248 seconds]
solocshaw has joined #ruby
[gmi] has quit [Read error: Connection reset by peer]
Guest96677 has quit [Changing host]
Guest96677 has joined #ruby
uglybandersnatch has quit [Ping timeout: 268 seconds]
Guest96677 is now known as duracrisis
Us54er has quit [Quit: Leaving]
uglybandersnatch has joined #ruby
aaeron has left #ruby [#ruby]
frustrum has quit [Ping timeout: 240 seconds]
bjpenn has quit [Ping timeout: 250 seconds]
TechToniK has joined #ruby
<TechToniK>
hello
pawnbox has quit [Ping timeout: 244 seconds]
johnmilton has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
Burnzoire has joined #ruby
sp4rrow has quit [Read error: Connection reset by peer]
<Burnzoire>
#rails doesn't exist anymore?
tenderlove has quit [Remote host closed the connection]
sp4rrow has joined #ruby
A124 has quit [Quit: '']
<havenwood>
Burnzoire: #rubyonrails
<havenwood>
TechToniK: hi
<Burnzoire>
thanks o7
<TechToniK>
has anyone experienced any issues with openssl since the latest update?
<TechToniK>
hi havenwood
<havenwood>
TechToniK: Use the latest version of Ruby for your MAJOR.MINOR.
<havenwood>
TechToniK: 2.1.8, 2.2.4 or 2.3.0
poerror has joined #ruby
A124 has joined #ruby
mistermocha has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 264 seconds]
<TechToniK>
i'm trying to use 2.2.4 because the gems i'm using don't work in 2.3
<havenwood>
TechToniK: What error are you running into?
solocshaw has quit [Quit: solocshaw]
neanderslob has joined #ruby
jkahn has quit [Ping timeout: 250 seconds]
<TechToniK>
sorry the long post.. /opt/ruby2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': /opt/ruby2.2/lib/ruby/2.2.0/x86_64-linux/openssl.so: undefined symbol: SSLv2_method - /opt/ruby2.2/lib/ruby/2.2.0/x86_64-linux/openssl.so (LoadError)
ramortegui has quit [Quit: Ex-Chat]
<Ox0dea>
TechToniK: Distro?
ReK2 has quit [Remote host closed the connection]
Burnzoire has left #ruby [#ruby]
sp4rrow_ has joined #ruby
tenderlove has joined #ruby
<havenwood>
Radar: Or #to_digits
EdwardIII has quit [Ping timeout: 276 seconds]
sp4rrow_ has quit [Client Quit]
<Ox0dea>
havenwood: On BigDecimal?
<TechToniK>
netrunner rolling
<Radar>
havenwood: neato
<TechToniK>
based off of majaro
sp4rrow has quit [Ping timeout: 248 seconds]
<TechToniK>
manjaro sorry
ReK2 has joined #ruby
ReK2 has quit [Changing host]
ReK2 has joined #ruby
<Ox0dea>
So, yeah, your OpenSSL is "too new".
phredus has joined #ruby
<TechToniK>
i should be able to "roll back" yes?
<Ox0dea>
Do you want to?
<havenwood>
Ox0dea: yeah, i ran my "Ferret" code finding code and it came up with: [[:to_digits], [:to_s, "F"], [:to_s, "f"]]
fullofcaffeine has quit [Remote host closed the connection]
<TechToniK>
Ox0dea: if i can run my code then yea ... :)
<phredus>
Hello, I've unistalled rails, bundler Trying to start fresh. I ran gem update I get
EdwardIII has joined #ruby
<Ox0dea>
havenwood: Ah, right, it's from '/util'.
<havenwood>
Ox0dea: :)
<Ox0dea>
TechToniK: Well, better would be to use a Ruby compiled against your new OpenSSL.
<Ox0dea>
Maybe raise an issue with the Netrunner folks and ask for a rebuild?
<phredus>
Hello, I've unistalled rails, bundler Trying to start fresh. I ran gem update I get "ERROR: While executing gem ... (TypeError) no implicit conversion of nil into String"
<TechToniK>
Ox0dea: a Ruby compiled OpeenSSL ?
Us54er has joined #ruby
<Ox0dea>
TechToniK: That function was recently removed from the OpenSSL package shipped by Arch and friends. All of the relevant packages should've received an upgrade.
solocshaw has joined #ruby
tjbiddle has joined #ruby
mnrmnaugh has quit [Remote host closed the connection]
fullofcaffeine has joined #ruby
<TechToniK>
Ox0dea: yes there was just an upgrade, how can i use a Ruby Compiled OpenSSL?
mnrmnaugh has joined #ruby
moeabdol has joined #ruby
linoj has quit [Quit: linoj]
marr has quit [Ping timeout: 250 seconds]
dopie has joined #ruby
Uo9er_ has joined #ruby
<darix>
TechToniK: just reinstall ruby
<TechToniK>
darix: that will recompile OpenSLL ?
fullofcaffeine has quit [Ping timeout: 244 seconds]
<darix>
you need to recompile the openssl extension for ruby
<darix>
not openssl itself
<TechToniK>
hmm ok
maletor has joined #ruby
<havenwood>
TechToniK: When Ruby builds it statically or dynamically links against libraries.
Us54er has quit [Ping timeout: 260 seconds]
moeabdol has quit [Ping timeout: 244 seconds]
<darix>
havenwood: statically linked he wouldnt have that problem.
fullofcaffeine has joined #ruby
jkahn has joined #ruby
<havenwood>
darix: aye
<darix>
anyway... lots of discussion about something with a very simple solution
graffix has quit [Ping timeout: 276 seconds]
<Ox0dea>
Recompilation does seem very simple from behind the veil of knowledge.
sneakerhax has quit [Quit: back later]
<havenwood>
Simply recite the exact incantation required!
<Ox0dea>
Twice, maybe.
<havenwood>
-j8
<Ox0dea>
*-j0
Tref has joined #ruby
<havenwood>
*-j
<Ox0dea>
We have a winner.
DmitryBochkarev has joined #ruby
jenrzzz has joined #ruby
dopie has quit [Quit: Lost terminal]
<TechToniK>
heheh
<phredus>
Hello is anyone here?
<havenwood>
phredus: they are!
graffix has joined #ruby
<Tref>
Hey guys, I have been tasked with writing a Ruby program that: (1) Assembles a collection of student records by parsing data from 3 different files (delimeted by the following delimeters: "," "|" and "$". And (2) Displays the collection 3 times, sorted 3 different ways. From an OOP organizational perspective what's the best way to do this? I was thinking a "Student" class that either extends or includes an "Importer" module.
<phredus>
havenwood: Hello there, new at this dont know much correct etiquette on asking questions.
<Tref>
But I generally have a hard time figuring out whether or not my module should be extended or included in my including class.
<havenwood>
phredus: ask away
<Ox0dea>
tref: `include` is for instance methods.
<Ox0dea>
They start with the same two letters, so it's easy to remember. :)
<phredus>
I've unistalled rails and bundler, I'm trying to start fresh. I ran gem update I get "ERROR: While executing gem ... (TypeError) no implicit conversion of nil into String"
<havenwood>
phredus: the etiquette is to say if you crosspost in multiple channels, Gist more than three lines, and try to show the code and errors :)
<Tref>
Ox0dea: well that makes it easy to remember
<havenwood>
phredus: What version of Ruby and Rails?
<Tref>
Ox0dea: but from a higher level does this seem like the right way to go?
<Ox0dea>
tref: You should certainly have a Student class, but Importer is a little suspect.
<Tref>
Or should I have a separate StudentImporter class that simply requires the Student model and performs these operations?
BSaboia has quit [Ping timeout: 240 seconds]
<Ox0dea>
tref: Well, what you really have is a Parser, wouldn't you say?
<Tref>
Ox0dea: yeah so im importing three files, parsing and sorting them
<havenwood>
phredus: show us?: gem update --backtrace
<phredus>
havenwood: Thank I will follow the rules. ruby 2.1.7p400, No rails yet, starting fresh but want latest rails. I ran "gem update" to make sure all is well with ruby before installing rails.
<Ox0dea>
tref: Is it three files per student, or each student appears in all three files?
<phredus>
havenwood: I have been tinkering with ruby, rails, and bundler las couple of days, now uninstalled rails and bundler and want to make sure ruby is not broken before I proceed
<Tref>
Ox0dea: we can skip the testing portion for now
<havenwood>
phredus: what do you get for?: gem update --backtrace
<phredus>
havenwood: doing it now thanks
chouhoulis has quit [Remote host closed the connection]
TomyLobo has quit [Ping timeout: 244 seconds]
<Ox0dea>
tref: Are you meant to avoid using the CSV library in your solution?
chouhoulis has joined #ruby
<Tref>
Ox0dea: no, since CSV is part of the std lib
<Tref>
Ox0dea: and I can just specify :col_sep for the delimeter
<phredus>
havenwood: http://wklej.org/id/2116401 I've remoded and installed a few gems in an effort to get past the errors, How do restore the originals, I want to go back to default?
<Tref>
Ox0dea: i’m less concerned about the implementation of the parser than I am about the overall design
<phredus>
havenwood: I gem pristine --all, all night and installed and removed gems over 20 by hand then I gave up and unistalled rails and bundler.
<havenwood>
phredus: If you want to restore the gems to factory default you'll want to: gem uninstall --all
mwlang has quit [Quit: mwlang]
<phredus>
havenwood: ok doing that now, thanks
mdih has joined #ruby
<Ox0dea>
tref: Yeah, seems good. I was going to advise against actually using OpenStruct and have Students be initializable from Hashes, which is what they're advocating for here with CSVParser#rows.
<Tref>
Ox0dea: So they’re not using modules here at all
<Ox0dea>
tref: Well, other than ActiveModel.
ruby-lang428 has joined #ruby
<Tref>
Ox0dea: What are they using ActiveModel::Conversion for?
stannard has quit [Ping timeout: 240 seconds]
ramortegui has joined #ruby
<Tref>
Ox0dea: Since I wont have access to rails modules I wont have that available to me
pawnbox has joined #ruby
<Ox0dea>
tref: They're not. I guess that just kinda slipped in.
lessless has joined #ruby
<Tref>
Ox0dea: thaaaaaats what she said….
<Tref>
Ox0dea: sorry, couldnt help it
<Tref>
yeah I wasnt seeing it being used but it seems like you’re ahead of me on understanding how this whole thing works
c355e3b has quit [Quit: Connection closed for inactivity]
<Tref>
Ox0dea: I see them using `if valid?`
arescorpio has joined #ruby
<Tref>
Ox0dea: but what’s this import_factory
<Ox0dea>
tref: That's from ActiveModel::Validations, though.
<Tref>
Ox0dea: yeah that’s what i meant
<Tref>
I don’t necessarily need that and I can write my own validator for that
ramortegui_ has joined #ruby
<Tref>
Ox0dea: I see where they’re defining import_factory
<Tref>
overlooked that
<Ox0dea>
Importer is written to only import valid "types", and it's using the passed "type" to resolve to an actual Class.
mdih has quit [Ping timeout: 260 seconds]
pawnbox has quit [Ping timeout: 246 seconds]
<Ox0dea>
Using disparate "types" to refer to your different input formats would be overkill.
mnrmnaugh has quit [Quit: Leaving]
<Tref>
Ox0dea: but since i’m only working with one type `Student` that seems to be superfluous
<Tref>
right
ramortegui has quit [Ping timeout: 260 seconds]
<phredus>
havenwood: http://wklej.org/id/2116460 ok "gem uninstall --all" ran w/o issues. I expected more default gems only 3, and I think I installed these 3 manually.
fexilal has quit [Ping timeout: 248 seconds]
<Tref>
Ox0dea: and since there’s no requirement to parse any of the files separately im wondering if I need the CSVParser class
mnrmnaugh has joined #ruby
<Tref>
Ox0dea: and where / how to include the implementation of the different row orders
<Ox0dea>
tref: The row orders don't actually matter if you have your importer return an Array of Hashes, and you should definitely do that.
<Tref>
Ox0dea: Sorry I dont mean row orders
<Tref>
Ox0dea: I mean column orders
freerobby has joined #ruby
tjbiddle has quit [Ping timeout: 264 seconds]
<Ox0dea>
tref: And that's how I interpreted your question. :)
wilbert has joined #ruby
<Ox0dea>
Keying into a Hash is order-independent.
mdih has joined #ruby
<Tref>
Ox0dea: Im unclear on how Im supposed to assign the proper keys to the proper attributes then if theyre coming in different orders
mdih has quit [Max SendQ exceeded]
<Tref>
Ox0dea: right but the files have no headers
<Tref>
And therefore no column names
mdih has joined #ruby
<Ox0dea>
tref: Oh, right. That is something you'll need an abstraction for, then.
<Tref>
Ox0dea: Take it easy on me, I’m still fairly new ;)
<Tref>
Ox0dea: :) not ;)
<Ox0dea>
tref: That is a little unpleasant, but it's the damned input's fault for not having headers. :P
ruby-lang428 has quit [Ping timeout: 252 seconds]
blackmesa has joined #ruby
ensyde has quit [Read error: Connection reset by peer]
DrCode has joined #ruby
<Tref>
Ox0dea: well that’s part of the exercise
<Tref>
It was done that way intentionally
<Tref>
Its for a class
ensyde has joined #ruby
<Tref>
Ox0dea: Do you see a cleaner way to do it?
<Ox0dea>
I've gathered as much, but the deliberate lack of headers borders on the sadistic.
ensyde has quit [Read error: Connection reset by peer]
linoj has joined #ruby
ensyde has joined #ruby
AnoHito_ has joined #ruby
[afk]chocoelho is now known as chocoelho
tjbiddle has quit [Client Quit]
mdih has quit [Ping timeout: 260 seconds]
<TechToniK>
thanks all .. worked like a charm!!
<Ox0dea>
tref: OpenStruct would let you initialize students with arbitrary data, but your keys have to come from somewhere.
huddy has quit [Ping timeout: 264 seconds]
<TechToniK>
Ox0dea: +1
<TechToniK>
darix: +
<TechToniK>
1
<TechToniK>
:)
<TechToniK>
i'm off have a good night all!!
<Ox0dea>
TechToniK: Glad you got it sorted. :)
TechToniK has quit [Quit: night time :)]
ade has joined #ruby
mleung has joined #ruby
huddy has joined #ruby
ade has quit [Client Quit]
blackmesa has quit [Ping timeout: 268 seconds]
AnoHito has quit [Ping timeout: 264 seconds]
<i8igmac>
i feelstupid, while true <--- fails
Abrin_AWAY has joined #ruby
johnmilton has joined #ruby
uglybandersnatch has quit [Ping timeout: 276 seconds]
BrianJ has joined #ruby
Sucks has joined #ruby
<BrianJ>
I'm trying to make a rest API call to a teamcity server and I'm getting #<Net::HTTPBadRequest:0x007fcd595c0138> Can anyone take a quick look at my code and let me know if I'm doing something obviously wrong? https://gist.github.com/BrianJakovich/afcb65cc636836d6a76a
Abrin_AWAY2 has quit [Ping timeout: 264 seconds]
<Tref>
Ox0dea: Alright then I think that might be enough for me to get started on this
<ben_vulpes>
how do i shell out to a ruby gem, specifying ruby executeable and gem?
<ben_vulpes>
as in from an entirely non-ruby stack
blackmesa has quit [Ping timeout: 240 seconds]
niksrc has quit [Ping timeout: 240 seconds]
kp666 has joined #ruby
chipotle has quit [Ping timeout: 244 seconds]
terminal_ has joined #ruby
terminal_ has quit [Client Quit]
ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
emilkarl has joined #ruby
bronson has joined #ruby
tvw has joined #ruby
moeabdol has joined #ruby
chipotle has joined #ruby
Chagel has quit [Remote host closed the connection]
n00bdev has quit []
pawnbox has joined #ruby
nanoz has joined #ruby
skade has joined #ruby
Pupp3tm4st3r has joined #ruby
moeabdol has quit [Ping timeout: 276 seconds]
janzo has quit []
Chagel has joined #ruby
pawnbox has quit [Ping timeout: 248 seconds]
solars_ has joined #ruby
Chagel has quit [Remote host closed the connection]
Chagel has joined #ruby
duncannz has quit [Remote host closed the connection]
lxsameer has joined #ruby
djbkd has joined #ruby
<Ox0dea>
tref: Is a delimeter for measuring sandwiches?
<Tref>
Ox0dea: My sausage is 12 delimeters
<Ox0dea>
Not bad.
<Ox0dea>
Google is resisting my efforts to have that converted to Planck lengths. :/
voidsta has left #ruby [#ruby]
beergineer has joined #ruby
Eaven has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bricker has joined #ruby
infra-red has joined #ruby
schaary has left #ruby [#ruby]
mrgrieves has joined #ruby
infra-red has quit [Remote host closed the connection]
emesa has joined #ruby
ayonkhan has joined #ruby
bricker has quit [Ping timeout: 248 seconds]
dionysus69 has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
toretore has quit [Ping timeout: 250 seconds]
govg has quit [Ping timeout: 250 seconds]
iMadper is now known as FaPiao
Moosashi has quit [Quit: Moosashi]
_blizzy_ has joined #ruby
pawnbox has joined #ruby
nerium has joined #ruby
mistermocha has quit [Ping timeout: 240 seconds]
kam270 has joined #ruby
mahk has quit [Quit: mahk]
hk238 has joined #ruby
beergineer has quit [Ping timeout: 252 seconds]
reprazent has joined #ruby
mrgrieves has quit [Ping timeout: 244 seconds]
a11 has joined #ruby
kam270 has quit [Max SendQ exceeded]
terlar has joined #ruby
kam270 has joined #ruby
a11 has quit [Client Quit]
fedexo has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
EdwardIII has quit [Ping timeout: 240 seconds]
yardenbar has joined #ruby
jenrzzz has joined #ruby
firstdayonthejob has joined #ruby
andikr has joined #ruby
EdwardIII has joined #ruby
elifoster has quit [Ping timeout: 268 seconds]
Moosashi has joined #ruby
poerror has joined #ruby
davee_ has joined #ruby
anisha has joined #ruby
cpup has quit [Ping timeout: 244 seconds]
cpup has joined #ruby
biberu has joined #ruby
sphex has quit [Read error: Connection reset by peer]
sphex has joined #ruby
graffix has quit [Ping timeout: 276 seconds]
poerror has quit [Ping timeout: 240 seconds]
mistermocha has joined #ruby
polysics_ has joined #ruby
agit0 has quit [Quit: zzzZZZ….]
blackmesa has joined #ruby
systemsgotyou has quit [Read error: Connection reset by peer]
darkf has quit [Quit: Leaving]
djbkd has quit [Remote host closed the connection]
systemsgotyou has joined #ruby
polysics has quit [Ping timeout: 276 seconds]
RegulationD has joined #ruby
Chagel has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 264 seconds]
ruby-lang151 has joined #ruby
<ruby-lang151>
ruby-lang151 has quit [Client Quit]
ohaibbq has quit [Quit: Leaving...]
blackmesa has quit [Ping timeout: 248 seconds]
tomchapi_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
RegulationD has quit [Ping timeout: 276 seconds]
Suntzu has quit [Read error: Connection reset by peer]
emilkarl has quit [Read error: Connection reset by peer]
Chagel has joined #ruby
hxegon has quit [Quit: BRB]
baweaver has quit [Remote host closed the connection]
blackms has joined #ruby
Couch has joined #ruby
jas02 has joined #ruby
rmulliga` has quit [Ping timeout: 248 seconds]
emilkarl has joined #ruby
merida has quit [Remote host closed the connection]
binaryplease has joined #ruby
Ishido has joined #ruby
yardenbar has quit [Ping timeout: 264 seconds]
mrgrieves has joined #ruby
jaruga has joined #ruby
yardenbar has joined #ruby
Chagel has quit [Remote host closed the connection]
Chagel has joined #ruby
AlexRussia has quit [Ping timeout: 244 seconds]
atmosx has joined #ruby
roshanavand has joined #ruby
graffix has joined #ruby
GriffinHeart has joined #ruby
fexilal has joined #ruby
roshanavand has quit [Client Quit]
uglybandersnatch has quit [Ping timeout: 260 seconds]
emilkarl has quit [Read error: Connection reset by peer]
roshanavand has joined #ruby
ensyde has quit [Read error: Connection reset by peer]
ensyde has joined #ruby
Uo9er_ has joined #ruby
Dimik has quit [Ping timeout: 248 seconds]
mrgrieves has quit [Ping timeout: 252 seconds]
Tref has quit [Quit: tref]
roshanavand has quit [Client Quit]
duncannz has joined #ruby
emilkarl has joined #ruby
U7se6 has quit [Ping timeout: 246 seconds]
ruby-lang708 has joined #ruby
rdark has joined #ruby
roshanavand has joined #ruby
binaryplease has quit [Ping timeout: 248 seconds]
Acontius has joined #ruby
atmosx has quit [Quit: This is aparting message!]
ruby-lang708 has quit [Ping timeout: 252 seconds]
Acontius has quit [Client Quit]
jenrzzz has quit [Ping timeout: 250 seconds]
emilkarl is now known as emilkarl[away]
Suntzu has joined #ruby
SCHAAP137 has joined #ruby
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
emilkarl[away] has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mja has joined #ruby
mja is now known as Guest99095
astrobun_ has quit [Remote host closed the connection]
kedare1 has quit [Quit: WeeChat 1.3]
bronson has quit [Remote host closed the connection]
ropeney has joined #ruby
<kireevco>
anyone has an idea how to convert a python dict object to a valid json in ruby?
kedare has joined #ruby
ropeney has quit [Remote host closed the connection]
vdamewood has joined #ruby
emilkarl has joined #ruby
astrobun_ has joined #ruby
<danjack_>
Hey guys, I want to install a gem, but the extconf fails
CloCkWeRX has joined #ruby
<danjack_>
I thought of changing the extconf script to not fail, but if I try to rerun 'gem install' it just overwrites my changes
<danjack_>
any thoughts on how I could just run the configuration of already downloaded gem?
nerium has quit [Quit: nerium]
Moosashi has quit [Quit: Moosashi]
roshanavand has quit [Quit: This computer has gone to sleep]
binaryplease has joined #ruby
roshanavand has joined #ruby
matp has quit [Ping timeout: 250 seconds]
codecop has joined #ruby
codecop_ has joined #ruby
codecop_ has quit [Read error: Connection reset by peer]
yardenbar has quit [Ping timeout: 260 seconds]
Abrin_AWAY has quit [Ping timeout: 268 seconds]
<Ox0dea>
kireevco: Ew. Just have the Python script emit JSON.
<kireevco>
I can't. I'm parsing a log, can't control input
TvL2386 has joined #ruby
<Ox0dea>
danjack_: You can say `gem install some_local_file.gem`.
Pupp3tm4st3r has quit [Remote host closed the connection]
Moosashi has joined #ruby
Dreamer3_ has quit [Quit: Leaving...]
matp has joined #ruby
<Ox0dea>
You'll want to do that after `gem build foo.gemspec`, of course.
<b|ackwolf>
is it possible that a class has more than one constructor?
<b|ackwolf>
for example; Date.parse() and Date.new().
<kireevco>
b|ackwolf: can't you just have one canonical and call it from an alias method?
<kireevco>
or oyu want different ones?
<kireevco>
make an alias to call your canonical constructor with a parameter
roshanavand has quit [Quit: This computer has gone to sleep]
<Ox0dea>
b|ackwolf: Date.parse calls Date.new, the latter being the only "constructor" in the technical sense.
<b|ackwolf>
Ox0dea, thanks
<gregf_>
b|ackwolf: if you've got a constructor like so def initialize *args, **kwargs;end <== is that not sufficient
queequeg1 has quit [Ping timeout: 264 seconds]
<b|ackwolf>
gregf_, kireevco: thanks to you too. that's reasonable.
roshanavand has joined #ruby
<Ox0dea>
Appropriately named convenience "constructors" are fine, but they should pretty much always delegate to the "real" constructor at the end.
firstdayonthejob has quit [Ping timeout: 240 seconds]
ben_vulpes has left #ruby ["WeeChat 1.1.1"]
<Ox0dea>
That said, "If you have a procedure with 10 parameters, you probably missed some."
Xeago has joined #ruby
riotjones has joined #ruby
roshanavand has quit [Client Quit]
htmldrum has quit [Ping timeout: 260 seconds]
igam has joined #ruby
Xeago has quit [Ping timeout: 248 seconds]
agit0 has joined #ruby
AnoHito has joined #ruby
blackmesa has joined #ruby
roshanavand has joined #ruby
roshanavand has quit [Client Quit]
norc has joined #ruby
barajasfab has quit [Quit: Leaving]
AnoHito_ has quit [Ping timeout: 240 seconds]
<norc>
So Im wondering how to people here interactively develop their gems? Do you just create a separate bundle specifying your gem via a local path, and then just fire up a pry shell from there?
queequeg1 has joined #ruby
ta_ has quit [Remote host closed the connection]
anthony has joined #ruby
ta_ has joined #ruby
anthony is now known as Guest14383
DoubleMalt has joined #ruby
sphex_ has joined #ruby
blackmesa has quit [Ping timeout: 250 seconds]
_blizzy_ has quit [Ping timeout: 248 seconds]
baweaver has joined #ruby
sphex has quit [Ping timeout: 252 seconds]
ta__ has joined #ruby
tjbiddle has joined #ruby
ensyde has quit [Ping timeout: 250 seconds]
merida has joined #ruby
ta_ has quit [Ping timeout: 246 seconds]
htmldrum has joined #ruby
skade has joined #ruby
baweaver has quit [Ping timeout: 250 seconds]
elaptics`away is now known as elaptics
n008f4g_ has joined #ruby
bricker has joined #ruby
<soahccc>
norc: Depends but I've done that before. I think it was our capistrano wrapper where I used that method a lot
Snowy has joined #ruby
bricker has quit [Ping timeout: 260 seconds]
<norc>
In my last gem I tried to avoid interactive shells entirely, spending the time to specify the behaviour I intend to test in RSpec instead.
<norc>
But at some point I realized I was testing far more than I should have.
y2mq37 has quit [Quit: Leaving]
the_drow has joined #ruby
minimalism has quit [Quit: minimalism]
moeabdol has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
atmosx has joined #ruby
emilkarl has quit [Ping timeout: 244 seconds]
gbgdev has joined #ruby
moeabdol has quit [Ping timeout: 240 seconds]
skade has joined #ruby
mark3 has joined #ruby
htmldrum has quit [Ping timeout: 244 seconds]
emilkarl has joined #ruby
decaff has quit [Ping timeout: 246 seconds]
cpup has quit [Ping timeout: 252 seconds]
decaff has joined #ruby
<adaedra>
Hello
cpup has joined #ruby
stan has quit [Remote host closed the connection]
bluOxigen has joined #ruby
the_drow has quit [Quit: Leaving]
stan has joined #ruby
anisha has quit [Quit: Leaving]
htmldrum has joined #ruby
bronson has joined #ruby
mrgrieves has joined #ruby
ur5us has quit [Remote host closed the connection]
forgot has joined #ruby
GreyHands has joined #ruby
drptbl has joined #ruby
gbgdev has quit [Remote host closed the connection]
nofxx has quit [Ping timeout: 260 seconds]
scepticulous has joined #ruby
triangles has joined #ruby
ta__ has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 252 seconds]
baweaver has joined #ruby
the_drow has joined #ruby
ta_ has joined #ruby
marr has joined #ruby
Pupp3tm4st3r has joined #ruby
Pupp3tm4st3r has quit [Read error: Connection reset by peer]
Pupp3tm4st3r has joined #ruby
blackmesa has joined #ruby
ta_ has quit [Ping timeout: 246 seconds]
Moosashi has quit [Quit: Moosashi]
kam270 has quit [Ping timeout: 248 seconds]
Snowy has quit [Read error: Connection reset by peer]
GriffinHeart has quit [Remote host closed the connection]
Pupp3tm4st3r has quit [Read error: No route to host]
Pupp3tm4_ has joined #ruby
Snowy has joined #ruby
andrewvos has joined #ruby
htmldrum has quit [Ping timeout: 248 seconds]
last_staff has quit [Quit: last_staff]
Guest99095 has quit [Read error: Connection reset by peer]
mja has joined #ruby
mja is now known as Guest86774
duncannz has quit [Remote host closed the connection]
nocontrol has joined #ruby
devoid has joined #ruby
Xeago has joined #ruby
<devoid>
I've discovered that using @varname for instance variables means that if I mistype a variable name it's not detected, and just resolves to an empty string. The only alternative seems to be to define an accessor and use that, even from class member functions. Is that right?
Gasher has joined #ruby
platzhirsch has joined #ruby
<Ox0dea>
devoid: Undefined instance variables evaluate to `nil`, but you should have tests that explode if you misspell one.
platzhirsch has left #ruby [#ruby]
ziyadb has joined #ruby
<devoid>
Yes, but if you use it in a string "hello #{@varname}" and @varname isn't defined, it expands silently to an empty string. Where "hello #{undefined_var}" causes an error immediately
<Ox0dea>
If you want to catch misspellings at runtime rather than test time, that's your prerogative.
Pupp3tm4_ has quit [Remote host closed the connection]
kam270 has joined #ruby
Cohedrin has quit [Max SendQ exceeded]
stannard has joined #ruby
Cohedrin has joined #ruby
<devoid>
it's the different behaviour between undefined instance variables '@xxx' and undefined local variables 'xxx' is the problem. Is there some other way to detect mistyped member var names? you can never guarantee that all such cases will be caught in tests.
ta_ has joined #ruby
Rahul_Roy has joined #ruby
Dimik has joined #ruby
<Ox0dea>
devoid: There are IDEs that'll red-flag misspellings, but if all your tests pass even if you've used a bad instance variable, that's a paddlin'.
<devoid>
true but it's something so easy to check in the parser. One of the bugs today was in a log message. The log message was missing an important bit of information, which didn't affect the program operation in any way, but an external process was expecting to see the message at regular intervals.
stannard has quit [Ping timeout: 240 seconds]
<Ox0dea>
In the parser, you say?
mikhael_k33hl has joined #ruby
<mikhael_k33hl>
is there anyway to enable ci_reporter without using rake?
<devoid>
so the only way to get ruby to detect accesses to variables that have never been initialised seems to be to define an accessor for every instance variable and use those rather than the '@' variables for all accesses to the data.
baweaver has quit [Remote host closed the connection]
<Ox0dea>
Or write tests.
<Ox0dea>
Ruby is inherently resistant to static analysis.
drptbl_ has joined #ruby
Xeago has quit [Remote host closed the connection]
evidex has joined #ruby
<shevy>
devoid I sorta tend to do that anyway, seems easier to keep track of when any ivar is changed. problem is that method calls are slower than when one directly uses @foo = 5
drptbl has quit [Ping timeout: 240 seconds]
<devoid>
I have tests, but tests are never complete. You build them up over time as you discover more things that go wrong. Detecting access to a variable that's never been initialised should be trivial?? Going the accessor route will mean that mistyped var names should never be missed.
<Ox0dea>
Well, they won't be variable names anymore, but yes, you'll get runtime errors.
<devoid>
performance isn't a problem for the things we're using ruby for. predictability is more of a problem.
maner has joined #ruby
<devoid>
I would prefer a visible error than silent surprises. It depends what you're doing I guess.
<Ox0dea>
devoid: It's hardly as trivial as you seem to think; instance variables can be defined all sorts of ways at any time.
<Ox0dea>
We have #instance_variable_{get,set,defined?} for doing all sorts of wacky things.
TheIdea has joined #ruby
Pupp3tm4st3r has joined #ruby
<norc>
devoid: Think in terms of interfaces and test only then.
<devoid>
Yep, I have no idea how ruby internals work, but it must maintain some type of symbol table at runtime that could be used to detect accesses? Anyway, for me now I just want a way to make it more likely that a mistyped @var name will show up as an error during testing, rather than slipping through into production
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
<norc>
devoid: If you access an uninitialized variable whether it throws a variable or not, it probably has an effect on your interface somehow.
U7se6 has joined #ruby
hamed_r has joined #ruby
<norc>
devoid: There is some real whacky magic going on under the hood when it comes to dispatching methods and variable access in CRuby.
<Ox0dea>
devoid: Right, an object's instance variable table is essentially just a Hash under the hood; undefined ivars resolve to `nil` the same way Hash#[] does with a nonexistent key.
Snowy has quit [Remote host closed the connection]
<devoid>
norc: these scripts are being used for backend processes that churn away all day every day. So problems may not get noticed for a while.
Dimik has quit [Ping timeout: 248 seconds]
<Ox0dea>
They should get noticed as soon as you run your tests.
<norc>
Which is my point. Test your interfaces, not the internals.
Uo9er_ has quit [Ping timeout: 248 seconds]
noway_ has joined #ruby
ta_ has quit [Ping timeout: 246 seconds]
Xeago has joined #ruby
<norc>
Ox0dea: honestly though, Im not a big fan of access to non initialized ivars not throwing a NameError.
poerror has joined #ruby
Sero has joined #ruby
<norc>
asm>> @f
<ruby[bot]>
norc: I have disassembled your code, the result is at https://eval.in/537433
ta_ has joined #ruby
<Ox0dea>
norc: Would that be trivial to amend?
<devoid>
tests are great but in my experience never perfect. given that and the fact that we can't guarantee that ruby will throw an error for a @varname typo, I guess the accessor thing is the only way.
<shevy>
\o/
drptbl_ has quit [Ping timeout: 264 seconds]
<devoid>
actually the main cause of the error is that nil.to_s returns "". If that threw an error, the problem may be solved?
<TheIdea>
I kind of have found a concept that I belive could solve a lot of our problems worldwide but it could also have very negative effects. Since my IQ is not too high I'd like to discuss this with some smart individuals. It involves cryptocurrencies, crowdfunding, voting, organizing, copyrights etc. It could enable people to earn money by just doing the things thay love to do but also making sure that everything else is done. Anyone here up for it
<TheIdea>
? If not it would be awesome if you could redirect me somewhere where I can discuss it.
<norc>
devoid: If you turn Ruby into verbose mode you should get a warning at least.
<norc>
Ox0dea: Fairly trivial.
<norc>
Ox0dea: Looks like just a small patch to vm_insnhelper.c would be needed.
stardiviner has joined #ruby
<norc>
devoid: no that actually is working as intended.
<norc>
devoid: If you have some behavior you rely on, put it behind an interface. And test it.
<norc>
Tests catch these things.
<Ox0dea>
norc: But surely the same semantics would need to be applied to class variables and globals?
<norc>
If you do not write tests, you might as well pick another language.
<norc>
>> @@f
<ruby[bot]>
norc: # => /tmp/execpad-eb7ec3d7aad3/source-eb7ec3d7aad3:2: warning: class variable access from toplevel ...check link for more (https://eval.in/537446)
<Ox0dea>
Derp.
<Ox0dea>
Just globals, then.
<norc>
;)
<Ox0dea>
Well, no.
<norc>
Well, yes.
<Ox0dea>
Yeah. :P
<norc>
:)
drptbl has joined #ruby
<Ox0dea>
The ivar magic is quite deliberate, then; I wonder at the rationale.
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<norc>
Ox0dea: Lazy people. Uninitialized lvar makes perfect sense to throw an error because its scoped to a small space.
<devoid>
I am pedantic about tests. I write them first and run them before I even start entering the program. But I am not the only one working on this code. So tests are of varying quality, and as I have said before they are never perfect.
<norc>
Ox0dea: But to initialize every damn variable, well coming from C++ I know that it can be annoying at times.
<norc>
Which is why MSVC is so great because it automatically does all that boilerplate for oyu.
TheIdea has left #ruby ["Leaving"]
<norc>
devoid: If your team has problems with good test coverage, that is your real problem then.
<norc>
Not some Ruby quirks. ;-)
<shevy>
you people need to write better code
<Ox0dea>
devoid: If you really think blowing up on interpolated `nil` would help, you might consider doing it with a refinement.
<Ox0dea>
Redefining NilClass#to_s to explode, to clarify.
<manveru>
or just use #to_str
Spami has joined #ruby
<devoid>
that is A problem. but tools can help! and tools can be made more consistent that humans. I don't have a problem with however ruby wants to do things. but if I can have a tool that spots problems, that is better than relying on humans to spot them.
<manveru>
then you probably want another tool than ruby :)
<shevy>
C#
<devoid>
that would make things easier. I've been running rubocop over all the code and it doesn't spot access to undefined @vars.
<manveru>
because @vars can come from elsewhere too
<ready>
shit offtopic
andrewvos has quit [Ping timeout: 276 seconds]
FooMunki has joined #ruby
<norc>
devoid: You basically want some data-flow analysis functionality baked into Rubocop there. ;-)
decaff has quit [Ping timeout: 260 seconds]
<manveru>
there are so many languages that give you those guarantees... and it's not something you can analyze very well in ruby
<norc>
manveru: Really? C/C++ is a rather popular language that does not give you a guarantee here. ;-)
<norc>
*two rather popular langauges.
<manveru>
i didn't talk about popular, nor about C/C++
<norc>
Fair enough.
<manveru>
i don't consider those very soundly typed... more like syntactic sugar on top of ASM
<norc>
To consider C++ not very soundly typed is a bold statement, but I do not feel like arguing over this.
<manveru>
:)
<manveru>
likewise
<devoid>
manveru: yep but scripts these days seem to be done in ruby, python or bash. I've never liked C of any variant. I don't like python because of the ways that different developers with different vim settings can screw up the indenting. compiled software is where I came from, but scripting languages are useful and responsive. But coming from a place where typos are detecting, to somewhere they are not, seems to be a step backwards.
mr_robot_ has joined #ruby
gbgdev has joined #ruby
Felix444 has quit [Ping timeout: 264 seconds]
<norc>
>> const_get("fatal")
<ruby[bot]>
norc: # => undefined method `const_get' for main:Object (NoMethodError) ...check link for more (https://eval.in/537454)
<norc>
>> Module.const_get("fatal")
<ruby[bot]>
norc: # => wrong constant name fatal (NameError) ...check link for more (https://eval.in/537455)
<norc>
ruby[bot]: Now you just hate me...
<Ox0dea>
norc: Er, it's not a constant, is it?
<norc>
Ox0dea: What is it then?
atmosx has quit [Quit: This is aparting message!]
<Ox0dea>
norc: Well, I know it's the name of a class.
<Ox0dea>
So I guess it must be?
<norc>
Think we should try and find where its defined to be sure
<manveru>
devoid: yeah, when i want something like that i usually use Go
<GioVdK>
what I'm trying to do is convert the body part of an email, and with Iconv I found this snippet that worked: Iconv.conv('UTF-8', email.html_part.charset, email.html_part.body.to_s)
<GioVdK>
but email.html_part.body.to_s.encode(Encoding::UTF_8) isn't as happy
decaff has joined #ruby
TheHodge has joined #ruby
rodfersou has joined #ruby
Chagel has quit [Ping timeout: 244 seconds]
bricker has joined #ruby
baweaver has quit [Ping timeout: 268 seconds]
mariano_ has quit [Remote host closed the connection]
uglybandersnatch has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
trinaldi has joined #ruby
<GioVdK>
ok found it -> .encode(Encoding::UTF_8, @email.html_part.charset)
<GioVdK>
I initially missed the second parameter: encode(dst_encoding, src_encoding [, options] ) ;)
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bricker has quit [Ping timeout: 276 seconds]
uglybandersnatch has quit [Ping timeout: 244 seconds]
arlek has joined #ruby
ukazap has quit [Ping timeout: 248 seconds]
mdih has quit [Ping timeout: 248 seconds]
last_staff has joined #ruby
FooMunki has quit [Quit: FooMunki]
Snowy has joined #ruby
FooMunki has joined #ruby
mfaeh has joined #ruby
b|ackwolf has quit [Ping timeout: 240 seconds]
n008f4g_ has quit [Ping timeout: 248 seconds]
mahk has joined #ruby
duckpuppy has joined #ruby
CloCkWeRX has quit [Ping timeout: 276 seconds]
Felix444 has joined #ruby
workmad3_ is now known as workmad3
drptbl_ has joined #ruby
drptbl has quit [Ping timeout: 240 seconds]
poerror has quit [Ping timeout: 252 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
tjbiddle has quit [Quit: tjbiddle]
binaryplease has quit [Ping timeout: 250 seconds]
last_staff has quit [Quit: last_staff]
<shevy>
>> "\x68\x65\x6c\x6c\x6f".b + ' world!'
<Ox0dea>
Ten points from Gryffindor.
poerror has joined #ruby
krz has joined #ruby
<shevy>
Ox0dea you made me google for Gryffindor... now I am reading up on hairy potter ... :(
<workmad3>
Ox0dea: I'm not sure how much I'd class "Has an image on a CDN still" as "Still a thing" :)
<Ox0dea>
workmad3: Well, no, but the site does indeed still exist.
<Ox0dea>
Internet 2.0 has not been kind to it, in my estimation.
krz has quit [Ping timeout: 260 seconds]
<workmad3>
:)
<shevy>
workmad3 hah
RegulationD has joined #ruby
atmosx has joined #ruby
stannard has joined #ruby
ukazap has quit [Ping timeout: 248 seconds]
hanmac has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
lenwood has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 244 seconds]
stannard has quit [Remote host closed the connection]
vondruch has quit [Ping timeout: 248 seconds]
moeabdol has joined #ruby
decaff has quit [Ping timeout: 248 seconds]
astrobu__ has joined #ruby
Pupp3tm4st3r has joined #ruby
astrobun_ has quit [Ping timeout: 244 seconds]
Coldblackice has quit [Ping timeout: 240 seconds]
but3k4 has joined #ruby
merida has quit [Quit: Leaving...]
moeabdol has quit [Ping timeout: 260 seconds]
Pupp3tm4st3r has quit [Ping timeout: 268 seconds]
mg^ has quit [Ping timeout: 276 seconds]
blackmesa has joined #ruby
vondruch has joined #ruby
Guest86774 has quit [Quit: Lost terminal]
hanmac has joined #ruby
unseatingbread has quit [Ping timeout: 250 seconds]
Pupp3tm4st3r has joined #ruby
nanoz] has joined #ruby
bricker has joined #ruby
decaff has joined #ruby
merida has joined #ruby
ukazap has joined #ruby
godzillaenlacasa has joined #ruby
aryaching has joined #ruby
nanoz has quit [Ping timeout: 244 seconds]
blackgoat has quit [Quit: WeeChat 1.4]
blackmesa has quit [Ping timeout: 250 seconds]
nanoz] has quit [Read error: Connection reset by peer]
tvw has joined #ruby
Uo9er_ has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
Spami has quit [Read error: Connection reset by peer]
Spami_ has joined #ruby
<norc>
I have a set of objects that give me a slight delay when I try to invoke a not existing method. No method_missing was defined, and the only thing I can see being related to this is that deeper down in the instance variables there is a telnet connection somewhere that is a bit slow.
bricker has quit [Ping timeout: 248 seconds]
<norc>
How can I sensibly get to the bottom of this?
nanoz] has joined #ruby
synthroid has joined #ruby
U7se6 has quit [Ping timeout: 248 seconds]
hs366 has joined #ruby
mg^ has joined #ruby
<andrewvos>
use pry maybe
<shevy>
weird error
third has joined #ruby
<shevy>
do these objects read any data from a harddisc at runtime?
<andrewvos>
how slight of a delay
torarne has quit [Quit: Leaving.]
aryaching_ has joined #ruby
freakcoder has joined #ruby
aryaching has quit [Ping timeout: 260 seconds]
patrick_star_2 has joined #ruby
nanoz] has quit [Ping timeout: 276 seconds]
patrick_star has quit [Ping timeout: 240 seconds]
Mon_Ouie has joined #ruby
tk__ has joined #ruby
guest805 has joined #ruby
decaff has quit [Ping timeout: 260 seconds]
stannard has joined #ruby
emilkarl has quit [Read error: Connection reset by peer]
swills has quit [Ping timeout: 276 seconds]
chouhoul_ has joined #ruby
emilkarl has joined #ruby
rapha has joined #ruby
<rapha>
Hi!
<rapha>
Is it possible that the return value of such an expression: "(plans & plan_types[locale.to_sym]).empty?" has changed somewhere between Ruby 1.8 and 2.3?
<darix>
rapha: you would need to tell us the types of the variables
chouhoulis has quit [Ping timeout: 252 seconds]
<rapha>
darix: sorry, plans is an array containing integers. plan_types is a hash containing arrays containing integers. locale may be a string or a symbol.
bronson has joined #ruby
guest805 has quit [Ping timeout: 248 seconds]
JohnBat26 has joined #ruby
JohnBat26 has quit [Remote host closed the connection]
ukazap has quit [Read error: Connection reset by peer]
stannard has quit [Ping timeout: 268 seconds]
arlek has quit [Ping timeout: 248 seconds]
<darix>
uhm
hs366 has quit [Quit: Leaving]
freakcoder has quit [Quit: Leaving.]
Pupp3tm4st3r has joined #ruby
jottr has joined #ruby
<rapha>
darix: i'm trying to figure out why in the world I wrote "unless (plans & plan_types[locale.to_sym]).empty?" and expected it to get me into the unless's block when "plans" contained the right number or numbers.
blackmesa has joined #ruby
drptbl_ has quit [Quit: My MAC has gone to sleep. zZz..]
Pupp3tm4st3r has quit [Remote host closed the connection]
liquid-silence has joined #ruby
liquid-silence has joined #ruby
nfk|laptop has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
<rapha>
hmm wait it does exactly what it's supposed to do, and even does it correctly
* rapha
hates debugging his own years-old self
<shevy>
rapha hah
<shevy>
I hate doing rewrites of large old codebases the most
ukazap has joined #ruby
guest805 has joined #ruby
decaff has joined #ruby
<ddv>
u love it
<ddv>
it makes u feel like a special snowflake
<shevy>
it takes so much time away!
<adaedra>
that's why you're stuck with ISO-8859-1 and CGI?
<rapha>
hmm
tvw has quit [Remote host closed the connection]
<rapha>
i would actually *love* to be able to rewrite this whole thing. just i wanna be paid to do it. but i'm only being paid to maintain it.
drptbl has joined #ruby
guest8051 has joined #ruby
guest805 has quit [Ping timeout: 244 seconds]
<norc>
adaedra: Things are really dire when you turn around and your collegue is pulling out a brand new PDH service unit out of the closet as a replacement... that is when you look at your outdated codebase and still smile.
<shevy>
adaedra why do you write "stuck"?
MrDoctor has joined #ruby
freakcoder has joined #ruby
<shevy>
rapha I found that especially in the late stage of a rewrite, I tend to more readily throw away the few things that seem too boring to still port
<rapha>
lol
skade has quit [Quit: Computer has gone to sleep.]
<rapha>
shevy: let's call it "evolution through minimisation"
decaff has quit [Ping timeout: 248 seconds]
<shevy>
for instance, I once had a disco prompt in something that interactively reads user input
<shevy>
but I question how useful this really is...
jottr has quit [Ping timeout: 276 seconds]
polysics_ has quit []
davee_ has quit [Ping timeout: 252 seconds]
the_drow has quit [Quit: This computer has gone to sleep]
meinside has joined #ruby
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
<rahc>
how can I get more useful information about what rake is failing to do?
<rahc>
I've searched the web and the rake documentation but I can't find anything helpful
merida has quit [Remote host closed the connection]
freerobby has joined #ruby
<rahc>
hmm$ sudo su -c 'RAILS_ENV="production" RAILS_ROOT="/srv/www/obs/webui/" ls' www-data
<rahc>
This account is currently not available.
<rahc>
nm :-)
irick has quit [Ping timeout: 260 seconds]
thomasfedb_ has quit [Ping timeout: 260 seconds]
Mon_Ouie has quit [Ping timeout: 244 seconds]
irick has joined #ruby
brixen_ has quit [Ping timeout: 260 seconds]
Dreamer3 has quit [Ping timeout: 260 seconds]
<n1colas>
o/
drptbl has joined #ruby
merida has joined #ruby
jaruga has quit [Ping timeout: 244 seconds]
matp has quit [Ping timeout: 250 seconds]
moeabdol has joined #ruby
lessless has joined #ruby
thomasfedb has joined #ruby
thomasfedb has joined #ruby
Chagel has joined #ruby
sesquipedalian has joined #ruby
Dreamer3 has joined #ruby
brixen has joined #ruby
mnms_ has joined #ruby
tvw has joined #ruby
Uo9er_ has quit [Ping timeout: 248 seconds]
Dreamer3 has quit [Max SendQ exceeded]
Dreamer3 has joined #ruby
matp has joined #ruby
nanoz] has joined #ruby
baweaver has joined #ruby
Xeago has quit [Remote host closed the connection]
vondruch_ has joined #ruby
gbgdev has quit [Remote host closed the connection]
<rapha>
darix: shevy: figured it out. Apparently the code wasn't really at fault, but I was being too intolerant about time and didn't take into account that the user's clock might be out of sync with the server's clock.
mr_robot_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
third has quit [Ping timeout: 260 seconds]
<mnms_>
Hi. I use sambal gem and I get "Unknown Process Failed!! (can't get Master/Slave device)". What could be the cause ? Permission problem ?
baweaver has quit [Ping timeout: 248 seconds]
<mnms_>
I get this when I try to connect to samba resource
xaxisx has joined #ruby
vondruch has quit [Ping timeout: 276 seconds]
joxer has joined #ruby
mfaeh has joined #ruby
davedev24 has joined #ruby
liquid-silence has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gbgdev has joined #ruby
aupadhye has quit [Ping timeout: 248 seconds]
shredding has joined #ruby
joonty has quit [Ping timeout: 268 seconds]
Pupp3tm4st3r has joined #ruby
Pupp3tm4st3r has quit [Remote host closed the connection]
freakcoder has quit [Quit: Leaving.]
<shevy>
rapha a simple bug is a better bug than a heisenberg schroedinger-cat bug!
hogetaro_ has quit [Quit: Leaving...]
freakcoder has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
liquid-silence has joined #ruby
liquid-silence has joined #ruby
<shevy>
mnms_ I don't think many people here know how the sandal gem works
Xeago has joined #ruby
nerium has joined #ruby
<mnms_>
shevy: I was counting that someone use this gem :)
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
jrafanie has joined #ruby
Pupp3tm4st3r has joined #ruby
victortyau has joined #ruby
drptbl has joined #ruby
grill has joined #ruby
`tim` has joined #ruby
stannard has joined #ruby
freerobby has quit [Quit: Leaving.]
Acontius has joined #ruby
skweek has joined #ruby
yeticry_ has quit [Read error: Connection reset by peer]
sdothum has joined #ruby
bluOxigen_ has joined #ruby
CloCkWeRX has joined #ruby
guest805 is now known as unseatingbread
freakcoder has quit [Quit: Leaving.]
yeticry has joined #ruby
sdothum has quit [Client Quit]
RegulationD has joined #ruby
emilkarl has joined #ruby
sdothum has joined #ruby
blandflakes has joined #ruby
davedev2_ has joined #ruby
bluOxigen has quit [Ping timeout: 268 seconds]
griffindy has joined #ruby
kith_ is now known as kith
davedev__ has joined #ruby
freakcoder has joined #ruby
davedev24 has quit [Ping timeout: 240 seconds]
RegulationD has quit [Ping timeout: 246 seconds]
ferr has joined #ruby
yeticry_ has joined #ruby
paatala_bhairavi has joined #ruby
paatalaBhairavi has joined #ruby
paatalaBhairavi has quit [Client Quit]
paatala_bhairavi has quit [Read error: Connection reset by peer]
hxegon has joined #ruby
yeticry has quit [Ping timeout: 244 seconds]
davedev2_ has quit [Ping timeout: 250 seconds]
aegis3121 has joined #ruby
davedev__ has quit []
davedev24 has joined #ruby
eurialo has joined #ruby
whippythellama has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
pietr0 has quit [Quit: pietr0]
devoid has quit [Quit: Leaving]
moeabdol has quit [Quit: WeeChat 1.4]
Xeago has joined #ruby
zarubin has joined #ruby
qhp_ has joined #ruby
SenpaiSilver_ has joined #ruby
aryaching_ has quit [Read error: Connection reset by peer]
idle_task has joined #ruby
agit0 has quit [Quit: zzzZZZ….]
bricker has joined #ruby
idletask has quit [Ping timeout: 268 seconds]
Abrin_AWAY has joined #ruby
SenpaiSilver has quit [Read error: Connection reset by peer]
SenpaiSilver_ has quit [Max SendQ exceeded]
dgncn has quit [Ping timeout: 244 seconds]
qhp has quit [Ping timeout: 244 seconds]
SenpaiSilver_ has joined #ruby
aryaching has joined #ruby
ruind has joined #ruby
emilkarl has quit [Read error: Connection reset by peer]
haylon has joined #ruby
norc has quit [Ping timeout: 252 seconds]
axl_ has joined #ruby
hxegon has quit [Ping timeout: 252 seconds]
zarubin has quit [Quit: leaving]
zarubin has joined #ruby
zarubin has quit [Client Quit]
bricker has quit [Ping timeout: 240 seconds]
agit0 has joined #ruby
dgncn has joined #ruby
freerobby has joined #ruby
emilkarl has joined #ruby
spintronic has joined #ruby
Chagel has quit [Ping timeout: 248 seconds]
jgpawletko has joined #ruby
poerror has quit [Ping timeout: 268 seconds]
Snowy has quit [Read error: Connection reset by peer]
decoponio has joined #ruby
Snowy has joined #ruby
hxegon has joined #ruby
joonty has joined #ruby
Skelz0r has quit [Ping timeout: 268 seconds]
skweek has quit [Ping timeout: 276 seconds]
Snowy has quit [Remote host closed the connection]
Snowy has joined #ruby
FooMunki has quit [Quit: FooMunki]
FooMunki has joined #ruby
FooMunki has quit [Client Quit]
codecop has quit [Remote host closed the connection]
FooMunki has joined #ruby
jottr has joined #ruby
poerror has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
Snowy has quit [Ping timeout: 276 seconds]
spintronic has quit [Remote host closed the connection]
cpup has quit [Ping timeout: 276 seconds]
VeryBewitching has joined #ruby
tvw has quit [Read error: Connection reset by peer]
iamvery has quit [Ping timeout: 276 seconds]
poerror has quit [Ping timeout: 260 seconds]
<VeryBewitching>
G'day folks.
fullofcaffeine has joined #ruby
bry4n_ has joined #ruby
cpup has joined #ruby
freakcoder has quit [Quit: Leaving.]
tk__ has quit [Quit: ばいばい]
Snowy has joined #ruby
nando293921 has joined #ruby
iamvery has joined #ruby
andikr has quit [Remote host closed the connection]
andrewvos has quit [Ping timeout: 244 seconds]
* Acontius
waves at VeryBewitching
bronson has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
skade has quit [Read error: Connection reset by peer]
skade has joined #ruby
roshanavand has joined #ruby
kies has quit [Ping timeout: 276 seconds]
jottr has quit [Ping timeout: 250 seconds]
LiquidInsect has quit [Ping timeout: 260 seconds]
hxegon has quit [Ping timeout: 276 seconds]
LiquidInsect has joined #ruby
freerobby has quit [Quit: Leaving.]
bronson has quit [Ping timeout: 252 seconds]
krz has joined #ruby
emilkarl has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
daivyk has joined #ruby
nando293921 has quit [Ping timeout: 276 seconds]
blackmesa has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
Karix has joined #ruby
dionysus69 has joined #ruby
hxegon has joined #ruby
<shevy>
<yorickpeterse> omg stop casting spells on us
mrmortondk has joined #ruby
ruind has quit [Ping timeout: 260 seconds]
spintronic has joined #ruby
victortyau has quit [Quit: Leaving]
beergineer has joined #ruby
crowell has quit [Ping timeout: 268 seconds]
mallu has joined #ruby
<beergineer>
hey, what's the difference between class A; def self.method; end ;end and class << self; def method; end; end? What are the use common use cases of each?
saneax is now known as saneax_AFK
fostertheweb has joined #ruby
kam270 has quit [Ping timeout: 244 seconds]
freakcoder has joined #ruby
tjohnson has joined #ruby
DaniG2k has joined #ruby
spintronic has quit [Ping timeout: 244 seconds]
moeabdol has joined #ruby
<workmad3>
beergineer: between those examples? nothing (they both define a method on the singleton class of A). `class << self` lets you do some extra stuff though, like `class A; class << self; attr_accessor :foobar; end; end` for setting up A.foobar and A.foobar=
DmitryBochkarev has joined #ruby
gbgdev has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
roshanavand has quit [Quit: This computer has gone to sleep]
crowell has joined #ruby
Xentil has joined #ruby
idle_task is now known as idletask
<beergineer>
workmad3: hmmn, but can't I do the same with to class A; attr_accesor :foobar; end as well?
<beergineer>
beergineer: is it just a matter of syntax preference or there's more into it?
emesa has quit [Ping timeout: 268 seconds]
maletor has joined #ruby
<workmad3>
beergineer: that would define foobar and foobar= on instances of A, not on A itself
Xeago has joined #ruby
<beergineer>
workmad3: aahh, that make sense. thanks
<workmad3>
beergineer: or, in normal convention, A#foobar and A#foobar= rather than A.foobar and A.foobar= :)
Xeago has quit [Remote host closed the connection]
spintronic has joined #ruby
agit0 has quit [Quit: zzzZZZ….]
<beergineer>
workmad3: so, class A; def self.foobar=(x); end; def self.foobar; end; end is the same as class << self attr_accessor :foobar ;end?
andrewvos has joined #ruby
<workmad3>
beergineer: essentially, yes
pawnbox has quit [Remote host closed the connection]
<beergineer>
workmad3: gotcha, wonderful. One blunder cleared :)
iamvery has quit [Ping timeout: 240 seconds]
freakcoder has quit [Quit: Leaving.]
pawnbox has joined #ruby
iamvery has joined #ruby
<rik>
anyone wanna build me a marginally-custom gem?
riotjones has quit []
marxarelli has joined #ruby
zz_flazz is now known as flazz
flazz has left #ruby ["WeeChat 1.4"]
<rik>
or teach me how?
inukshuk_ has joined #ruby
inukshuk_ has quit [Client Quit]
krz has quit [Ping timeout: 248 seconds]
freerobby has joined #ruby
polishdub has joined #ruby
halfamind has joined #ruby
rippa has joined #ruby
tomatoes has joined #ruby
merida has joined #ruby
axl_ has quit [Quit: axl_]
[afk]chocoelho is now known as chocoelho
baweaver has joined #ruby
resin has joined #ruby
aegis3121 has quit [Ping timeout: 260 seconds]
frustrum has quit [Ping timeout: 248 seconds]
hogetaro has joined #ruby
krz has joined #ruby
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
<EdwardIII>
sorry for the baity question but... is there a rough consensus on which tool to use to get a nice new version of ruby running? i've used chruby on my app, but i'm now preparing ansible (and maybe cap) jobs to deploy into prod
hxegon has quit [Ping timeout: 260 seconds]
Pupp3tm4st3r has quit [Remote host closed the connection]
<apeiros>
EdwardIII: no
platzhirsch has quit [Quit: Leaving.]
<EdwardIII>
so just pick one and use it then i guess
uglybandersnatch has quit [Ping timeout: 260 seconds]
<apeiros>
there's rough consensus that you should use one of (I think) 3, but there's little to no consensus on which to use
<havenwood>
EdwardIII: Usually one only needs a single version of Ruby in production so there's no need for a Ruby version switcher. A nice modern package manager Ruby is preferred. Or you can ruby-install to /usr/local with: ruby-install --latest --system
madhatter has joined #ruby
<apeiros>
I think chruby is nowadays the most "advertized"
<havenwood>
And best! :P
<apeiros>
I myself use rvm and am happy with it
<EdwardIII>
hrm with ubuntu lts i'm not going to get a nice modern version fo ruby
Snowy_ has joined #ruby
platzhirsch has joined #ruby
<apeiros>
and rbenv is the one I hear about the thirdmost about it. not sure about how good it is.
<EdwardIII>
one thing about chruby that i'm not so wild about, everyone seems to use it as root-by-default, whereas local::lib and virtualenv are always my-user-by-default
shinnya has joined #ruby
<apeiros>
and +1 re havenwood's ruby-install if you're on a prod box which only needs a single ruby
<havenwood>
EdwardIII: Create a .ruby-version file.
<EdwardIII>
(or perlbrew might be a better comparision)
<EdwardIII>
apeiros: ruby-install... without chruby?
<EdwardIII>
apeiros: and just install as root?
<apeiros>
EdwardIII: not necessarily as root. havenwood certainly has a better idea there.
x77686d has joined #ruby
<EdwardIII>
mmm brightbox looks like quite a nice solution
<havenwood>
EdwardIII: ruby-install --system to install Ruby into /usr/local (where it will be in your PATH)
<havenwood>
EdwardIII: Brightbox is a nice solution!
Snowy has quit [Ping timeout: 248 seconds]
Xeago has quit [Remote host closed the connection]
<rik>
andrewvos: oops. sorry - just switched back. HAve you seen sqlcipher? It's a fork of sqlite that adds some pragma commands to deal with block encryption on the whole database.
zotherstupidguy has quit [Quit: WeeChat 1.3]
[afk]chocoelho is now known as chocoelho
ukazap has quit [Ping timeout: 268 seconds]
<rik>
i would very much like to make use of this with Sequel.
`tim` has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
platzhirsch has left #ruby [#ruby]
<rik>
it *should* be as simple as linking against the sqlcipher libraries and using their headers, with no code changes - at least from me browsing the C headers last night.
reprazent has quit [Ping timeout: 244 seconds]
<rik>
but i've never made a ruby gem before, and it's not what i want to get side-tracked learning right now.
aganov has quit [Remote host closed the connection]
terlar has quit [Ping timeout: 248 seconds]
p0p0pr37 has quit [Ping timeout: 244 seconds]
agit0 has joined #ruby
mfaeh has quit [Remote host closed the connection]
slawrence00 has joined #ruby
<EdwardIII>
yeah let's use brightbox hehe
woodruffw has joined #ruby
* EdwardIII
uninstalls chruby
iamvery has quit [Ping timeout: 268 seconds]
jottr has joined #ruby
DaniG2k_ has joined #ruby
neilhwatson has joined #ruby
`tim` has joined #ruby
gbgdev has joined #ruby
DaniG2k has quit [Ping timeout: 264 seconds]
nfk|laptop has quit [Quit: yawn]
Pupp3tm4st3r has joined #ruby
kies has joined #ruby
Felix444 has quit [Quit: Leaving]
hxegon has joined #ruby
<manveru>
EdwardIII: nix :)
<andrewvos>
chruby is the best
<andrewvos>
it's never given me even the tiniest bit of a problem
Skelz0r has joined #ruby
<havenwood>
:)
dhollinger has joined #ruby
<andrewvos>
also ruby-install
* manveru
uses nix-shell + direnv for all development
jas02 has quit [Quit: jas02]
<manveru>
and nix + nixops for deployment
<andrewvos>
don't listen to manveru
<andrewvos>
<3
synthroid has quit [Remote host closed the connection]
washt has joined #ruby
<duderonomy>
are there use cases where rbenv has pain points that do not exist in chruby ?
<andrewvos>
use rbenv if you want to be unhappy
Abrin_AWAY has quit [Ping timeout: 260 seconds]
<andrewvos>
probably don't use a version manager in production though
<andrewvos>
actually definitely don't
<manveru>
why's that?
DaniG2k_ has quit [Quit: leaving]
cdg has joined #ruby
DaniG2k has joined #ruby
Snowy_ has quit [Ping timeout: 240 seconds]
<andrewvos>
cause then your provisioning becomes more painful?
<manveru>
:)
<rik>
hm
djbkd has joined #ruby
Snowy has joined #ruby
nando293921 has joined #ruby
<manveru>
yours, sure
<andrewvos>
unless you like working with ansible or puppet or whatever is in vogue atm
<rik>
y'know those times where you realize ... maybe you've been going about something the wrong way?
<manveru>
i specify even the checksums for the gems i use
<rik>
i think i just realized that.
snockerton has joined #ruby
<havenwood>
duderonomy: Having to reshim, slowness when shimming over so much that rbenv ships with a C ext replacing a shell builtin, shipping it's own openssl ignoring your package manager's, etc.
weemsledeux has joined #ruby
rahc has left #ruby [#ruby]
<havenwood>
its*
<andrewvos>
doesn't sound like fun that manveru :)
fullofcaffeine has quit [Remote host closed the connection]
<apeiros>
crayon: I've seen this question before and pondered to answer. in case you wonder why nobody replies, here's why that's probably the case:
mrgrieves has quit [Ping timeout: 264 seconds]
<apeiros>
the question is far too broad
<apeiros>
it's similar to the famous "how do I build a videogame" question.
<crayon>
i disagree. i think it's quite straightforward. i want to host a command line tool, wpscan namely, as a web accessible service.
<apeiros>
ok then, here a similarly broad answer as your question:
<siaw>
hello. i want to write a method that will do execute e method after say every hour without using #sleep. this is what i have so far. https://gist.github.com/siaw23/3e3f6a6e97b14ef42b01 how can i accomplish this easy task?
<siaw>
that will execute a method****
<crayon>
i'm not sure how to go about doing this because wpscan is a cli ruby tool and is not normally deployed as a web service
<apeiros>
build a webapp using any of the many available frameworks, then run either shell out to the executable from it, or use the library code directly.
mrgrieve1 has quit [Quit: leaving]
<crayon>
that answers my question
BrianJ has joined #ruby
<apeiros>
*then either shell out to run… - somehow when rearranging the phrase, the word kept stuck.
<apeiros>
crayon: you can disagree with me all you want - fact is you didn't get an answer. and there's usually two options for that: nobody knows, or your question is bad.
<andrewvos>
there's probably a french word for that
<shevy>
siaw you can use .send to invoke a method on any given object
SenpaiSilver_ has quit [Quit: Leaving]
<apeiros>
s/.send/.public_send/ please
<apeiros>
siaw: what's that arbitrary "without sleep" requirement?
<siaw>
apeiros: i want to do the same thing, prolly with a “more effiecient” method than #sleep if there is
DaniG2k has quit [Quit: leaving]
<apeiros>
what makes you think sleep was inefficient?
<shevy>
sleep is very efficient
<shevy>
it does nothing but wait for the specified duration!
<apeiros>
it actually does something - it informs the scheduler that it doesn't need to be scheduled. which makes it tons better than a busyloop.
<siaw>
apeiros: i was thinking, that if i use this in my code. and there are say 20million users on my site using this method, i’ll have some problems, no?
<apeiros>
if 20 million users hit that code, then yes, and then you're doing something wrong. you want to background that.
<apeiros>
things like sidekiq, resque etc. are your friends for that
<siaw>
exactly! that’s why i asked. i’m no expect (not yet :p)
<siaw>
thanks anyway apeiros and shevy :)
tamole has joined #ruby
bluOxigen_ has joined #ruby
<apeiros>
siaw: but do you have 20mio users? or will it be 2?
bronson has joined #ruby
<siaw>
apeiros: 0 users actually. i’m just playing :D :D
<apeiros>
also - users? so that code is in a webapp?
<siaw>
apeiros: i’m trying to use the Twitter api to post to a twitter account from a list of tweets, after say each hour
zacts has quit [Remote host closed the connection]
<apeiros>
and from where? cli app? webapp? something else?
<siaw>
cli app
trinaldi has quit [Ping timeout: 250 seconds]
<apeiros>
then you won't have 20mio users
<siaw>
no i won't
<siaw>
it’s a test app
<apeiros>
you'll have precisely *one*
<siaw>
i’m building it slowly
<siaw>
from cli
Snowy has joined #ruby
<siaw>
later to web
bluOxigen has quit [Ping timeout: 248 seconds]
<siaw>
so i’m learning to build the api client by testing functionality first, in the cli and later to heroku
tomchapin has joined #ruby
ferr has quit [Ping timeout: 260 seconds]
<apeiros>
siaw: ok. then I'd make sure you cleanly separate the scheduling part from the API interaction part.
bronson has quit [Ping timeout: 252 seconds]
<siaw>
and if i do separate it, that’s when sidekiq comes in right?
<apeiros>
whichever scheduler works on heroku.
<apeiros>
heroku will probably be the limiting factor there. so best you figure out what will work there and what won't.
crameth_ has quit [Read error: Connection reset by peer]
<siaw>
cool
<siaw>
:)
elifoster has joined #ruby
yqt has joined #ruby
sneakerhax has joined #ruby
davee_ has joined #ruby
agit0 has quit [Quit: zzzZZZ….]
djbkd has quit [Remote host closed the connection]
crowell has quit [Ping timeout: 240 seconds]
Dimik has joined #ruby
joxer has quit [Remote host closed the connection]
mfaeh has quit []
bluOxigen has joined #ruby
bluOxigen_ has quit [Read error: Connection reset by peer]
andrewvos has quit [Ping timeout: 268 seconds]
scepticulous has quit [Ping timeout: 248 seconds]
andrewvos has joined #ruby
roshanavand has quit [Ping timeout: 248 seconds]
trinaldi has joined #ruby
htmldrum has joined #ruby
bezhermoso has joined #ruby
peteykun has joined #ruby
tubulife- has joined #ruby
nerium has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rbennacer has quit [Remote host closed the connection]
decaff has joined #ruby
nerium has quit [Client Quit]
aegis3121 has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
Xeago has joined #ruby
Devalo has joined #ruby
joonty has joined #ruby
SenpaiSilver has joined #ruby
tubulife- has quit [Ping timeout: 260 seconds]
<Devalo>
I'm making a little hangman game, where I want to reveal the letters of the word once the player guesses the right letter. I have a method called reveal_some_of_word with puts @word.gsub(@word, "-" * @word.length). How can I change one of the '-' to the correct letter?
boontdustie has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 268 seconds]
chouhoul_ has quit [Remote host closed the connection]
<canton7>
instead of substituting @word, instead substitute only letters which the user hasn't guessed yet
<shevy>
Devalo many ways. one is to store your word as array instead
<darix>
@word.gsub(/[^#{guessed_letters}]*/, '-')
<canton7>
alternatively, loop through each letter in the word, and either add it or "-" to the string to display the user
baweaver has quit [Remote host closed the connection]
rodfersou|lunch is now known as rodfersou
elifoster has quit [Ping timeout: 248 seconds]
diegoviola has joined #ruby
<halfamind>
Hi. I am curious if anyone's customized IRB to be copy+paste-able into runnable Ruby. E.g., with the outputs printed as comments.
<halfamind>
Alternatively, I'd love to get pointers to help me build such a thing.
rbennacer has quit [Ping timeout: 260 seconds]
<halfamind>
(I find myself editing IRB transcripts to be syntax-highlightable and runnable as ruby.)
<apeiros>
halfamind: a) use pry, b) in both pry & irb you can change the printed value
codecop has joined #ruby
codecop_ has joined #ruby
mr_robot_ has joined #ruby
stunder001 has joined #ruby
_ChiefAlexander has joined #ruby
drale2k has joined #ruby
wldcordeiro has joined #ruby
_ChiefAlexander has quit [Client Quit]
_blizzy_ has joined #ruby
<halfamind>
apeiros: Thanks, interesting. I've done a little IRB customization for https://github.com/joeyAghion/console_color, but didn't see clear ways to reach into all of the output formatting.
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros>
for pry, just read the wiki. iirc it has an entry on how to modify the inspect mode.
shredding has quit [Ping timeout: 248 seconds]
<halfamind>
Thanks will check it out.
anagha_ has quit [Quit: Connection closed for inactivity]
GioVdK has quit [Ping timeout: 244 seconds]
choke has joined #ruby
<apeiros>
hm, interesting. seems I never updated my pryrc the way I did my irbrc. I had "=> <inspect>" replaced with "# => <inspect>" back in irb days.
zast has quit [Remote host closed the connection]
<apeiros>
which would actually be exactly what you're asking for.
woodruffw has quit [Ping timeout: 260 seconds]
aegis3121 has quit [Ping timeout: 244 seconds]
stunder001 has quit [Ping timeout: 248 seconds]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<halfamind>
Yes, exactly. Plus, would need to modify the prompt, and maybe a few other things.
<apeiros>
darix: for protocols I tend to stick with smaller regexen and use strscan
AlexRussia has joined #ruby
<darix>
apeiros: just validating email addresses with regexp can be fun already :p
<apeiros>
oh, it is
kriskropd has joined #ruby
<apeiros>
I have a list of emails my regex rejects
kriskropd has quit [Client Quit]
jenrzzz has joined #ruby
ruby2016 has quit [Quit: Page closed]
<apeiros>
specifically emails with comments (valid), with whitespace (valid) with only a local part (valid), and some others
<apeiros>
and in the default config it only validates the length of the domain name, not the format. instead of doing that it does a dns lookup for AAAA, A, C and MX.
kobain has quit [Ping timeout: 260 seconds]
fostertheweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sauvin has quit [Read error: Connection reset by peer]
toretore has joined #ruby
Vlat- has joined #ruby
arlek has joined #ruby
elaptics is now known as elaptics`away
spider-mario has joined #ruby
rbennacer has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Vlat->
hi! sorry for maybe newbie question, but is there a way in Ruby to pass same argument to multiple functions? Like ->> in Clojure or .Set method in C# (or with statement in pascal flavors) ?
crowell has quit [Ping timeout: 276 seconds]
emilkarl has joined #ruby
x77686d has quit [Quit: x77686d]
bronson has joined #ruby
arlek has quit [Ping timeout: 244 seconds]
solars has joined #ruby
IrishGringo has quit [Ping timeout: 250 seconds]
jenrzzz_ has joined #ruby
wreet has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
<Ox0dea>
Vlat-: We tend to just chain method calls.
ldnunes has quit [Ping timeout: 240 seconds]
davedev24 has joined #ruby
<riceandbeans>
quick question, anyone here used monit/god/bluepill?
jenrzzz has quit [Ping timeout: 244 seconds]
bronson has quit [Ping timeout: 252 seconds]
<riceandbeans>
I've used monit/god and I'm just curious about opinions on bluepill in comparison to them
<Vlat->
Ox0dea: thx
Pupp3tm4st3r has quit [Quit: Leaving...]
Xeago has joined #ruby
<Ox0dea>
>> 0.upto(Float::INFINITY).lazy.map { |x| x * x }.select(&:even?).take(10).reduce(:+)
<Papierkorb>
And I thought Erlang has insane syntax
<riceandbeans>
I failed pretty bad at clojure, also leinengen runtimes made me cry
<Papierkorb>
erlang is still worse though
<Ox0dea>
riceandbeans: Drip helps.
<riceandbeans>
drip?
<Vlat->
Ox0dea: in fact I did the same in my ruby project. Just missed a neat clojure-ish "->" macro in ruby. But blocks do the same in fact, just with other syntax
crowell has joined #ruby
<riceandbeans>
I think clojure is just too functional for my brain
<Ox0dea>
riceandbeans: For running on a persistent JVM.
<riceandbeans>
ah
LoneHerm_ has joined #ruby
<Ox0dea>
Ruby is extremely functional if you want it to be.
<riceandbeans>
I found rust much easier to comprehend
ldnunes has joined #ruby
haylon_ has joined #ruby
<riceandbeans>
I tried ocaml too, had a hell of a time with that
<riceandbeans>
you can't write ruby like you can something in the ML family
<Ox0dea>
How do you mean?
<riceandbeans>
or if you can, I've never seen it or heard of it
<Vlat->
riceandbeans: I think clojure is just too functional for my brain
<Vlat->
high five :)
<Vlat->
I love clojure, but I caught myself, that I'm spending three hours of thinking, about how to write function the most functional way
<riceandbeans>
Vlat-: I'm not saying I dislike clojure, I'm just saying I couldn't get it when I tried, I'll probably come back to it later, for now though my free time is learning rust
<riceandbeans>
rust is kinda functional but not full on ML functional
yqt has quit [Ping timeout: 264 seconds]
<Ox0dea>
I feel like you must not be doing Ruby right if you find yourself with so tenuous a grasp of functional programming. :(
<Vlat->
In ruby I can do the same thing in 15 minutes.
<Vlat->
But... after clojure ruby seems too imperative. :)
siaw has quit [Ping timeout: 260 seconds]
haylon has quit [Ping timeout: 260 seconds]
<Ox0dea>
Vlat-: The translation I posted is "functional" in every meaningful sense of the term.
IrishGringo has joined #ruby
poerror has quit [Ping timeout: 260 seconds]
<Ox0dea>
Ruby just gives us what feels like a firmer foundation (objects).
siaw has joined #ruby
[Butch] has joined #ruby
yuung has joined #ruby
olspookishmagus has joined #ruby
polishdub has quit [Quit: Leaving]
<Vlat->
Ox0dea: oh, I didn't meant to offend Ruby :) It's my most favorite non-esoteric lang. :) And I completely agree with that functional code can be written in Ruby. It's all about language expressiveness.
<Ox0dea>
You done done it now. What's your favorite esolang?
maletor has joined #ruby
<Vlat->
Ox0dea: well... Common Lisp :)
<Ox0dea>
Cheeky. :P
<yuung>
why is lisp an esoteric language?
<Vlat->
prefix notation maybe
<Vlat->
but after couple of weeks it become your best friend, in fact
crowell has quit [Ping timeout: 276 seconds]
merida has quit [Remote host closed the connection]
<yuung>
Vlat- i would argue that it's been around too long to be an esoteric language
<yuung>
Vlat- /used by a lot of institutions. but idk, it's a subjective term
dopamean_ has quit [Quit: WeeChat 1.3]
<Vlat->
yuung: well, IMHO "esoteric" term is only a question of belief. If someone feels comfortable with brainf*ck - it's can't count as "esoteric" for such one. I rely on wikipedia, which counts lisp-family as "esoteric"
<Vlat->
about objects... in CL there's CLOS, which is one of the most advanced object model. In functional pardigm.
skade has joined #ruby
<djellemah>
In one sentence - objects have an inside and an outside.
<Vlat->
Ox0dea: you rock. :)
uglybandersnatch has quit [Ping timeout: 244 seconds]
davedev2_ has joined #ruby
<Ox0dea>
^_^
stunder001 has joined #ruby
<Ox0dea>
djellemah: I suppose that's fair, but closures do the same thing; it's just the wall "feels" thinner.
PedramT has joined #ruby
<Ox0dea>
To my mind, at any rate.
bjpenn has quit [Ping timeout: 276 seconds]
hxegon is now known as hxegon_AFK
jbueza has joined #ruby
crowell has joined #ruby
davedev24 has quit [Ping timeout: 240 seconds]
<djellemah>
After that an object can be used in many ways - as a closure over a specified subset of values (the params to initialize), as auto-multi-monad (every method can take a block), as partially-applied function (and relatedly as a locus for memoisation), as a container for state.
bakedb has joined #ruby
nano- has joined #ruby
stunder001 has quit [Ping timeout: 260 seconds]
<Ox0dea>
This Ruby thing sounds really good! :)
Mon_Ouie has quit [Ping timeout: 244 seconds]
U7se6 has joined #ruby
wreet has quit [Quit: Leaving]
<nano->
Trying to use rdoc to document a some C bindings that are split across multiple files. Noticed that it's broken - only a fraction of the methods are included in the docs. Tried workaround to cat everything into the same file which does generate docs for everything, but everything is in the top level namespace rather than in sub modules.
davedev24 has joined #ruby
emilkarl_ has joined #ruby
<Vlat->
about memoisation... can Ruby play into laziness? :)
<djellemah>
But I also find it difficult to say precisely.
<nano->
or is it fine to define the same module multiple times?
emilkarl has quit [Ping timeout: 246 seconds]
davedev2_ has quit [Ping timeout: 240 seconds]
cjbottaro has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Uo9er_ has quit [Ping timeout: 268 seconds]
<Ox0dea>
nano-: Reopening a module is totally kosher.
darkf has joined #ruby
_stu_ has quit [Quit: _stu_]
<Ox0dea>
Ah, but you're talking about invoking rb_define_module() with the same name.
platzhirsch has joined #ruby
<djellemah>
Vlat-: class Locus; def lazy; @lazy ||= :some_value end end is one way to do memoisation (except the value is nil). There are also lazy collections see docs for Enumerable#lazy
<djellemah>
*when the value is nil
<Ox0dea>
Vlat-: Memoization is quite different from laziness, mind, but Ruby certainly supports both.
<nano->
Ox0dea: yeah.. if that can exist there without the ifdef. I would like to avoid the ifdef there if possible to remove extra noise for the buildsystem.
<nano->
But maybe that messes up the type system.
marxarelli is now known as marxarelli|afk
bjpenn has joined #ruby
<Vlat->
djellemah & Ox0dea thx
<Ox0dea>
nano-: TFA explains why this hack is necessary, but I couldn't say whether it's since been obviated.
choke has joined #ruby
<Ox0dea>
(Probably not. :P)
emilkarl_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Vlat->
really apreciate your help for newbie.
siaw has quit [Quit: siaw]
<Vlat->
and a final question. Is there anything like lisp "macros" in Ruby, to completely fsck up with AST ? :)
<nano->
Ox0dea: TFA? I understand the workaround - was just hoping for a better solution. And lack of one, I was pondering if it would be an issue to define the top module always - rather than only for rdoc - thus avoiding the ifdef. But I guess I could just try it out instead of bothering people here with silly questions.
Snowy has joined #ruby
stunder001 has joined #ruby
baweaver has joined #ruby
<Ox0dea>
nano-: TFA is "the fuzzy article".
aegis3121 has joined #ruby
bjpenn has quit [Ping timeout: 276 seconds]
fmcgeough has joined #ruby
<Ox0dea>
Since RDoc doesn't understand C, you have to play by its rules and give it an rb_define_module() to match before it'll proceed to document the relevant methods.
huddy has quit [Quit: Connection closed for inactivity]
stunder001 has quit [Ping timeout: 248 seconds]
htmldrum has quit [Ping timeout: 248 seconds]
freakcoder has joined #ruby
duckpuppy has quit [Ping timeout: 268 seconds]
<Ox0dea>
Vlat-: You can play with virtually everything but the AST.
jackjackdripper has quit [Ping timeout: 252 seconds]
yuung has quit [Ping timeout: 248 seconds]
baweaver has quit [Remote host closed the connection]
washt has quit [Ping timeout: 248 seconds]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jackjackdripper has joined #ruby
<Vlat->
djellemah: I'll save this link. It describe Ruby by a few words, but worth a 100+ page book. :)
marxarelli|afk is now known as marxarelli
washt has joined #ruby
linoj has joined #ruby
rdark has quit [Ping timeout: 240 seconds]
<djellemah>
adaedra: C is OK, provided you have #include "ruby.h" :-p
<adaedra>
hah.
jackjackdripper has quit [Client Quit]
jackjackdripper has joined #ruby
stunder001 has joined #ruby
<Ox0dea>
Vlat-: Memoization and laziness in a neat little bundle: https://eval.in/537715
Coldblackice has joined #ruby
<Ox0dea>
It only calculates the next in the sequence when you ask it to (but it'll do so forever), and it uses Hash.new's block form (maybe my favorite method) to avoid re-computing known values.
<Vlat->
Ox0dea: now that was a quite 'functional' :)
<Ox0dea>
Vlat-: Ah, well, I am re-assigning `i` there, but close enough. :P
jottr has quit [Quit: WeeChat 1.4]
bjpenn has joined #ruby
wreet has joined #ruby
<ljames>
any way to load a file (like 'require') as if it was typed directly into irb - keeping the local variables as is? some sort of instance_eval or module_eval?
<shevy>
ljames not sure
<Ox0dea>
ljames: Er, why not just `eval`? Also, please reconsider.
<shevy>
you could have a look how irb loads ruby code
peteykun has quit [Remote host closed the connection]
agit0 has joined #ruby
stunder001 has quit [Ping timeout: 240 seconds]
<Vlat->
Ox0dea: however, I think we both can admit, that it's a dirty hack :)
<Papierkorb>
ljames: *cough* binding.eval
<Ox0dea>
Vlat-: No, I can't say I agree there.
<Vlat->
Ox0dea: yep, it works, but the whole language concept will protest about such code
freakcoder has quit [Quit: Leaving.]
<Ox0dea>
Vlat-: I concede that it doesn't align terribly well with convention, but it's not out of place either.
<shevy>
Ox0dea suggested eval before!
tomatoes has quit [Ping timeout: 268 seconds]
<Ox0dea>
Papierkorb: That doesn't permit the introduction of new locals.
bluOxigen has quit [Ping timeout: 264 seconds]
Suntzu has quit [Read error: Connection reset by peer]
al2o3-cr has quit [Quit: WeeChat 1.4 %t]
skade has quit [Quit: Computer has gone to sleep.]
LoneHerm_ has quit [Remote host closed the connection]
rhg135 has joined #ruby
rhg135 has quit [Read error: Connection reset by peer]
zacstewart has joined #ruby
mwlang has joined #ruby
rhg135 has joined #ruby
guest805 has joined #ruby
Sucks has quit [Remote host closed the connection]
siaw has joined #ruby
mistermo_ has quit [Remote host closed the connection]
pawnbox has joined #ruby
<shevy>
would someone stop patching those poor monkeys!
Karix has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
neilhwatson has quit [Quit: leaving]
kobain has joined #ruby
MalcolmReynolds has quit [Max SendQ exceeded]
IanMalcolm has joined #ruby
pawnbox has quit [Ping timeout: 248 seconds]
Snowy has quit [Remote host closed the connection]
baweaver has joined #ruby
synthroid has quit []
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
bricker has quit [Ping timeout: 240 seconds]
chrisja has joined #ruby
lemur has joined #ruby
guest805 has quit [Ping timeout: 240 seconds]
guest805 has joined #ruby
biberu has quit []
LoneHermit has joined #ruby
hxegon has quit [Ping timeout: 260 seconds]
baweaver has quit [Ping timeout: 246 seconds]
lemur is now known as baweaver
woodruffw has quit [Ping timeout: 248 seconds]
ChiefAlexander has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
baweaver has quit [Remote host closed the connection]
third has quit [Read error: Connection reset by peer]
IrishGringo has quit [Ping timeout: 250 seconds]
codecop has quit [Quit: Išeinu]
codecop_ has quit [Quit: Išeinu]
poerror has joined #ruby
guest805 has quit [Ping timeout: 248 seconds]
mostlybadfly has joined #ruby
woodruffw has joined #ruby
babblebre has quit [Quit: Connection closed for inactivity]
roshanavand has quit [Quit: This computer has gone to sleep]
rodfersou has quit [Quit: leaving]
varesa has quit [Remote host closed the connection]
bjpenn has quit [Ping timeout: 260 seconds]
aryaching_ has quit [Read error: Connection reset by peer]
roshanavand has joined #ruby
Xeago has quit [Remote host closed the connection]
guest805 has joined #ruby
poerror has quit [Ping timeout: 276 seconds]
bricker has joined #ruby
Xeago has joined #ruby
drptbl has joined #ruby
varesa has joined #ruby
_stu_ has quit [Quit: _stu_]
washt has quit [Ping timeout: 240 seconds]
Xeago has quit [Ping timeout: 244 seconds]
Uber|Dragon has joined #ruby
ChiefAlexander has joined #ruby
ldnunes_ has quit [Quit: Leaving]
jwinder has joined #ruby
bjpenn has joined #ruby
_stu_ has joined #ruby
Uo9er_ has joined #ruby
ctrlrsf has quit [Ping timeout: 268 seconds]
Cohedrin has joined #ruby
flopsec has quit [Ping timeout: 244 seconds]
Devalo has quit [Remote host closed the connection]
LoneHermit has quit [Remote host closed the connection]
U7se6 has quit [Ping timeout: 244 seconds]
bjpenn has quit [Ping timeout: 276 seconds]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sepp2k has joined #ruby
Don_John has joined #ruby
choke has joined #ruby
<jottr>
How could I do something like this: User.find(1..10) ? < This is obviously not possible, but is there some similar construct?
ziyadb has quit [Quit: Connection closed for inactivity]
<Ox0dea>
jottr: You... want the first 10 Users?
LoneHermit has joined #ruby
<jottr>
Ox0dea: yep
<Ox0dea>
jottr: I bet there's a dedicated method for that. ;)
<jottr>
Ox0dea: you bet, or know?
<Ox0dea>
jottr: Note the winky face.
rattatmatt has joined #ruby
freakcoder has quit [Quit: Leaving.]
<jottr>
Ah. first takes a parameter
<jottr>
...
<jottr>
Good to know. :)
<jottr>
One more question:
<Ox0dea>
jottr: I suppose that is a little surprising the first time round; #take is a little more appropriate without any context.
djbkd has joined #ruby
platzhirsch has quit [Ping timeout: 250 seconds]
<jottr>
neat
flopsec has joined #ruby
<jottr>
So, I do the following: F.all.each do |u| hsh = { uid: user.id }
<jottr>
sorry. let me try again:
drptbl has quit [Quit: My MAC has gone to sleep. zZz..]
<Ox0dea>
Sounds like you might want #map.
<jottr>
Foo.all.each do |f| hsh = { foo_id: foo.id, count: foo.users.count } end
<Ox0dea>
Why count the users more than once?
skade has joined #ruby
ctrlrsf has joined #ruby
slash_nick is now known as slash_mode
<jottr>
This is just a conrtived example. What I want is to iterate over Foo, and store each foo.id and the number of users associated with foo in a hash.
jzigmund has quit [Ping timeout: 244 seconds]
tvon has joined #ruby
vondruch_ has quit [Ping timeout: 260 seconds]
lsmola has quit [Ping timeout: 260 seconds]
gagrio has quit [Ping timeout: 268 seconds]
blackgoat has joined #ruby
jzigmund has joined #ruby
<jottr>
Ox0dea: ^
<Ox0dea>
jottr: Needs less contrivance.
fmcgeough has quit [Quit: fmcgeough]
flopsec has quit [Ping timeout: 244 seconds]
ctrlrsf has quit [Ping timeout: 268 seconds]
PedramT has quit [Remote host closed the connection]
johnmilton has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
[Butch] has quit [Quit: I'm out . . .]
kalopsian has quit [Ping timeout: 246 seconds]
tvw has quit [Remote host closed the connection]
johnmilton has quit [Ping timeout: 250 seconds]
mrgrieves has quit [Ping timeout: 276 seconds]
stannard has quit [Remote host closed the connection]
wreet has joined #ruby
wreet has joined #ruby
lsmola has joined #ruby
vondruch_ has joined #ruby
gagrio has joined #ruby
pawnbox has joined #ruby
jwinder has quit [Ping timeout: 268 seconds]
poerror has joined #ruby
fostertheweb has quit [Ping timeout: 246 seconds]
ruby312 has joined #ruby
pawnbox has quit [Ping timeout: 244 seconds]
roshanavand has quit [Quit: This computer has gone to sleep]
grill has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
uglybandersnatch has joined #ruby
<ruby312>
not sure if this is the right place for this. new to Ruby. if I have multiple versions of rbenv installed. which is the appropriate directory if I'm using zshrc -- usr/local/bin or Users/admin?
RegulationD has joined #ruby
<adaedra>
Multiple versions of _rbenv_? Why?
jottr has quit [Ping timeout: 244 seconds]
<ruby312>
not sure how it happened...
<adaedra>
Maybe you want to clean all this mess
<adaedra>
Because it sounds like the best idea to have problems
johnmilton has joined #ruby
junixbr has joined #ruby
<junixbr>
hi there
<ruby312>
but I'm trying to upgrade my Ruby build and I'm not able to get access to the latest build...
Xentil has quit [Ping timeout: 268 seconds]
noway_ has quit [Ping timeout: 246 seconds]
<ruby312>
so if I were starting from scratch what directory path would I use for rbenv?
<junixbr>
I'm trying to install rails in my server, but when I try to install "gem install bundler", I've got the error: 'ERROR: While executing gem ... (OpenSSL::BNError) PRNG not seeded'
<junixbr>
some tip?
coyo has quit []
<adaedra>
You seem to be on a mac, I think homebrew (if you use it) can take care of installing it for you, iirc
<junixbr>
doesn't matter my source
<junixbr>
https or not
mintux has joined #ruby
<ruby312>
yeah, used Homebrew, but still having the problem...
<adaedra>
junixbr: you seem to have something eating your entropy or not having enough entropy source.
<ruby312>
when I run `brew upgrade rbenv ruby-build` its not giving me access to all the builds... 2.3.0 is still the dev version...
RegulationD has quit [Ping timeout: 240 seconds]
<ruby312>
need 2.3.0
<ruby312>
getting 2.3.0-dev
<junixbr>
adaedra: this is a chrooted environment
<adaedra>
what does `which rbenv` gives, ruby312?
<adaedra>
junixbr: have you mounted /dev in it or at least provided /dev/{,u}random ?
WebDawg has quit [Ping timeout: 276 seconds]
platzhirsch has joined #ruby
<junixbr>
adaedra: I have no random
gregf has quit [Quit: WeeChat 1.4]
Noxilex has joined #ruby
flopsec has joined #ruby
<adaedra>
junixbr: seems like this is your problem here. Either bind mount a /dev, either create {,u}random devices in your chrooted environment.
ctrlrsf has joined #ruby
<junixbr>
adaedra: thanks, I'm gonna try
roshanavand has joined #ruby
<ruby312>
not getting a path when I run 'which rbenv'
<adaedra>
ruby312: try `/usr/bin/which rbenv`
<adaedra>
should bypass the function
axl_ has quit [Quit: axl_]
<adaedra>
anyway, I would recommend you to find and destroy all rbenv installed, then do a clean, brew controller install of it (or better — but I'm being partial here — switch to chruby)
baweaver has joined #ruby
<junixbr>
adaedra: /proc/sys/kernel/random/entropy_avail is 167
SG045734 has quit [Ping timeout: 248 seconds]
<ruby312>
getting /usr/local/bin/rbenv
davee_ has quit [Quit: Leaving]
Uber|Dragon has quit [Ping timeout: 264 seconds]
<adaedra>
junixbr: if your chrooted environment has no access to the random device, this is no use
<junixbr>
adaedra: ok
<junixbr>
I'll fix it
<adaedra>
ruby312: sounds like brew-controlled one. Did you try updating ruby-build too?
woodruffw has quit [Ping timeout: 252 seconds]
<ruby312>
which is one of the paths I get when I curl rbenv-doctor...
stannard has joined #ruby
dhollinger has quit [Quit: WeeChat 1.4]
Rahul_Roy has quit [Quit: Connection closed for inactivity]
<ruby312>
yep, ran 'brew update' first... then `brew upgrade rbenv ruby-build`
<adaedra>
and still no 2.3.0 available in rbenv?
<ruby312>
then `rbenv install -l`
<ruby312>
nope only got 2.3.0-dev
<adaedra>
and if you do rbenv install 2.3.0 anyway?
<ruby312>
yep, threw and error.
guest8051 has joined #ruby
<adaedra>
I don't remember rbenv well enough at this point.
<Ox0dea>
Refinements aren't supposed to active for "indirect" invocations, but that seems pretty direct by my lights.
baweaver has quit [Ping timeout: 252 seconds]
<ruby312>
I get this when I run `rbenv install 2.3.0` -- `ruby-build: definition not found: 2.3.0 The following versions contain `2.3.0' in the name: 2.3.0-dev rbx-2.3.0 See all available versions with `rbenv install --list'. If the version you need is missing, try upgrading ruby-build:`
stannard has quit [Ping timeout: 240 seconds]
<darix>
junixbr: install haveged
<ruby312>
also force uninstalled ruby-build and reinstalled. still no dice...
<junixbr>
darix: in chroot?
<darix>
on the host probably
woodruffw has joined #ruby
woodruffw has quit [Excess Flood]
<ruby312>
got adaedra, thx for trying to help tho...
woodruffw has joined #ruby
<ruby312>
got you adaedra, thx for trying to help tho...
<adaedra>
ruby312: what I said about chruby (and its friend ruby-install) still holds :p
skade has joined #ruby
<ruby312>
missed that part. could you repeat... :-)
braincrash has quit [Ping timeout: 276 seconds]
<adaedra>
You can remove rbenv (and ruby-build) totally and switch to chruby+ruby-install.
<adaedra>
It's even capable of using your rbenv installed rubies.
Xeago has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
<ruby312>
aha, got you. thx, I'll look into that.
guest805 has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
Atrox has quit [Ping timeout: 276 seconds]
platzhirsch has left #ruby [#ruby]
rvchangue has quit [Ping timeout: 248 seconds]
braincrash has joined #ruby
norc has quit [Ping timeout: 244 seconds]
DylanJ has quit [Ping timeout: 276 seconds]
Koshian has quit [Ping timeout: 276 seconds]
amclain_ has joined #ruby
hplar_ has joined #ruby
Karunamon has quit [Excess Flood]
badeball has quit [Ping timeout: 277 seconds]
iNeedHelp has joined #ruby
canton7_ has joined #ruby
zenlot has joined #ruby
badeball has joined #ruby
Karunamon has joined #ruby
FifthWall_ has joined #ruby
rvchangue has joined #ruby
tvon has quit [Remote host closed the connection]
hplar has quit [Ping timeout: 260 seconds]
UserInNeed has quit [Ping timeout: 260 seconds]
Koshian_ has joined #ruby
canton7 has quit [Ping timeout: 260 seconds]
FifthWall has quit [Ping timeout: 260 seconds]
zenlot6 has quit [Ping timeout: 260 seconds]
canton7_ is now known as canton7
FifthWall_ is now known as FifthWall
DylanJ has joined #ruby
tvon has joined #ruby
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mintux has left #ruby [#ruby]
mleung has joined #ruby
roshanavand has quit [Quit: This computer has gone to sleep]
<shevy>
ruby ruby ruby
<shevy>
what is up with jhass ... he is so quiet since like 8 months... :(
haylon_ has quit [Read error: Connection reset by peer]
ChiefAlexander has quit [Remote host closed the connection]
amclain has quit [Ping timeout: 276 seconds]
Queeniebee has joined #ruby
tigarcia has joined #ruby
Elenka has quit [Quit: Page closed]
uglybandersnatch has quit [Ping timeout: 248 seconds]
dwyn has joined #ruby
Noxilex has quit [Ping timeout: 246 seconds]
<junixbr>
adaedra: mount -o bind /dev /virtual/dev/ solve my problem
<junixbr>
thank you
<darix>
shevy: you scared jhass
<junixbr>
thank you darix
<junixbr>
=)
<darix>
junixbr: uhm
<darix>
junixbr: mknod would have been enough i think
<darix>
with just dev/urandom
baweaver has joined #ruby
tvon has quit [Ping timeout: 268 seconds]
<darix>
+ /dev/null /dev/zero
_grill is now known as mane
<junixbr>
darix: probably
<adaedra>
depending on the requirements, the full bind may be quicker for the same results
<darix>
adaedra: maybe
tvon has joined #ruby
<darix>
i usually "chroot" apps with apparmor+syscall filter
<adaedra>
if you have a chroot for security requirements, on the other hand, rather go for manual creation, sure
<adaedra>
but at least, this could confirm what the problem is :)
<darix>
i would still install haveged ... your entropy_avail was low
<darix>
and it will help with that.
wldcordeiro has quit [Ping timeout: 244 seconds]
baweaver has quit [Remote host closed the connection]
DylanJ has quit [Read error: Connection timed out]
DylanJ has joined #ruby
WebDawg has joined #ruby
freakcoder has joined #ruby
govg has quit [Ping timeout: 248 seconds]
<Ox0dea>
Could've just twiddled his mouse a bit.
endash has quit [Quit: endash]
<Ox0dea>
How many bits of entropy to the mickey?
govg has joined #ruby
<adaedra>
Depends, they may be between a ssh.
<adaedra>
behind*
kobain has quit [Ping timeout: 260 seconds]
htmldrum has joined #ruby
<Ox0dea>
Mickeys on the Wire.
<darix>
Minnie doesnt like when Mickey is on the wire. she always screams
Xeago has quit [Ping timeout: 244 seconds]
bronson has joined #ruby
solocshaw has joined #ruby
LoneHermit has quit [Remote host closed the connection]
decoponio has quit [Quit: Leaving...]
ruby312 has quit [Ping timeout: 252 seconds]
tigarcia has quit []
<adaedra>
Bye
dwyn has quit [Remote host closed the connection]
rnda has joined #ruby
htmldrum has quit [Ping timeout: 260 seconds]
rnda has quit [Client Quit]
urunda has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
baweaver has joined #ruby
urunda is now known as rnda
zenlot6 has joined #ruby
LoneHermit has joined #ruby
ziyadb has joined #ruby
freakcoder has quit [Quit: Leaving.]
last_staff has quit [Quit: last_staff]
nando293921 has joined #ruby
zenlot has quit [Ping timeout: 244 seconds]
snockerton has joined #ruby
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yuung has quit [Ping timeout: 268 seconds]
Mattx has joined #ruby
yuung has joined #ruby
jaruga has joined #ruby
aibot has quit [Remote host closed the connection]
aibot has joined #ruby
weemsledeux has joined #ruby
Mattx has quit [Quit: Leaving]
bry4n_ has quit [Ping timeout: 276 seconds]
mrgrieves has joined #ruby
Queeniebee has quit [Remote host closed the connection]
Mattx has joined #ruby
baweaver has quit [Remote host closed the connection]
govg has quit [Ping timeout: 244 seconds]
gregf has joined #ruby
digitalcakes has left #ruby [#ruby]
uglybandersnatch has joined #ruby
rnda has quit [Ping timeout: 276 seconds]
junixbr has quit [Quit: Leaving]
govg has joined #ruby
yuung has quit [Ping timeout: 244 seconds]
Mattx has quit [Client Quit]
tvon has quit [Remote host closed the connection]
WebDawg has quit [Remote host closed the connection]
tvon has joined #ruby
wldcordeiro has joined #ruby
uglybandersnatch has quit [Ping timeout: 260 seconds]
uglybandersnatch has joined #ruby
jkahn has quit [Ping timeout: 260 seconds]
platzhirsch has joined #ruby
jottr has joined #ruby
_stu_ has quit [Quit: _stu_]
tvon has quit [Ping timeout: 244 seconds]
johnmilton has quit [Ping timeout: 260 seconds]
woodruffw has quit [Ping timeout: 248 seconds]
wldcordeiro has quit [Client Quit]
govg has quit [Ping timeout: 264 seconds]
Moosashi has joined #ruby
chrisja has quit [Quit: leaving]
jdreaver has joined #ruby
PlasmaStar has quit [Ping timeout: 240 seconds]
<jdreaver>
I'm trying to use standalone_migrations to make a migration, and for some reason it ignores a "GRANT USAGE" command. Has anyone used this tool for GRANT USAGE?
woodruffw has joined #ruby
dikaio has quit [Ping timeout: 260 seconds]
tubulife- has joined #ruby
bezhermo_ has joined #ruby
mrgrieves has quit [Ping timeout: 244 seconds]
maletor has quit [Read error: Connection reset by peer]
bezhermoso has quit [Ping timeout: 244 seconds]
tvon has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
<lxsameer>
how can i get time in microsecond
dikaio has joined #ruby
solars has quit [Ping timeout: 250 seconds]
rbennacer has quit [Remote host closed the connection]
LoneHermit has quit [Remote host closed the connection]
woodruffw has quit [Ping timeout: 246 seconds]
nfk has joined #ruby
symm- has quit [Ping timeout: 252 seconds]
rattatmatt has quit []
<phredus>
havenwood: Thank you very mudch for the help yesterday, the discussion with you helped me understand how rails is put together. I was able to get my system working well and without errors.
<nano->
darix: yes, yard looked like crap. should look at sdoc then.
<nano->
darix: do you know of any page that reviews yard templates?
n008f4g_ has joined #ruby
<nano->
darix: sdoc doesn't emit constants either. although yard does.
marchelz1 has joined #ruby
mleung has quit [Quit: mleung]
htmldrum has joined #ruby
radgeRayden has joined #ruby
<marchelz1>
hi, what is the point of the each_with_object method on Array? is there some in particular that makes it interesting/necessary, or is it just a convenience thing?