Mumm-Ra has quit [Remote host closed the connection]
gigetoo has quit [Ping timeout: 256 seconds]
jeyraof__ has joined #ruby
bocaneri has joined #ruby
JeanCarl1Machado has joined #ruby
jeyraof_ has quit [Read error: Connection reset by peer]
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JeanCarloMachado has quit [Ping timeout: 258 seconds]
hutch34 has joined #ruby
Cohedrin_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
renchan has joined #ruby
pawnbox has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
maloik has quit [Remote host closed the connection]
maloik has joined #ruby
iMadper has joined #ruby
iMadper has joined #ruby
iMadper has quit [Changing host]
pawnbox has quit [Remote host closed the connection]
bkxd has joined #ruby
gigetoo has joined #ruby
squ has joined #ruby
bkxd has quit [Ping timeout: 252 seconds]
pawnbox has joined #ruby
Kug3lis_off is now known as Kug3lis
Cohedrin_ has joined #ruby
naprimer_3 has quit [Ping timeout: 240 seconds]
xall has quit [Ping timeout: 264 seconds]
gigetoo has quit [Ping timeout: 240 seconds]
shortdudey123 has quit [Ping timeout: 255 seconds]
shortdudey123 has joined #ruby
CloCkWeRX has left #ruby [#ruby]
gigetoo has joined #ruby
hays has quit [Read error: Connection reset by peer]
jeyraof__ has quit [Quit: Leaving]
jeyraof has joined #ruby
ifctj has joined #ruby
nobitanobi has joined #ruby
brent__ has joined #ruby
Kug3lis is now known as Kug3lis_off
JeanCarl1Machado has quit [Ping timeout: 240 seconds]
nankyokusei has joined #ruby
naprimer_3 has joined #ruby
nobitanobi has quit [Ping timeout: 248 seconds]
username_ has quit [Ping timeout: 252 seconds]
JeanCarloMachado has joined #ruby
saneax-_-|AFK is now known as saneax
gigetoo has quit [Read error: Connection reset by peer]
nankyokusei has quit [Ping timeout: 240 seconds]
gigetoo has joined #ruby
tlahtoani has quit [Quit: Connection closed for inactivity]
hays has joined #ruby
chouhoulis has quit [Remote host closed the connection]
brent__ has quit [Remote host closed the connection]
anisha_ has joined #ruby
JeanCarloMachado has quit [Ping timeout: 256 seconds]
Fin1te has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gigetoo has quit [Ping timeout: 256 seconds]
JeanCarloMachado has joined #ruby
gigetoo has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
harai_ has joined #ruby
Immune_ has joined #ruby
harai has quit [Ping timeout: 256 seconds]
tildes has joined #ruby
Immune has quit [Ping timeout: 255 seconds]
gigetoo has quit [Ping timeout: 258 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tildes has quit [Ping timeout: 240 seconds]
xall has joined #ruby
hcgatewood has joined #ruby
hcgatewood has left #ruby [#ruby]
tildes has joined #ruby
JeanCarloMachado has quit [Ping timeout: 276 seconds]
bkxd has joined #ruby
patarr has joined #ruby
gusrub has quit []
AnoHito_ has quit [Read error: Connection reset by peer]
AnoHito_ has joined #ruby
bkxd has quit [Ping timeout: 256 seconds]
patarr has quit [Ping timeout: 245 seconds]
EckT has quit [Ping timeout: 245 seconds]
Derperperd has quit [Ping timeout: 240 seconds]
agit0 has quit [Quit: zzzZZZ….]
ifctj has quit [Ping timeout: 256 seconds]
tildes has quit [Ping timeout: 256 seconds]
shortCircuit___ has joined #ruby
<shortCircuit___>
hi
<shortCircuit___>
need some help with Net::HTTP
youch has joined #ruby
<shortCircuit___>
"{\"resource_owner_id\":1,\"resource_owner_type\":\"customer\",\"country_code\":\"+91\",\"phone_number\":\"019836870428\",\"retry\":null}" this my params.to_json. the 1 is fixnum not string, http = Net::HTTP.new(uri.host, uri.port); http.post(uri.path, params.to_json, headers) it throws an error saying cannot apply strip on fixnum
<shortCircuit___>
how to solve this, I could change the 1 to 1.to_s in the original params, but that is not possible bcoz the other service expects it to be int not string
tmtwd has quit [Ping timeout: 240 seconds]
youch has quit [Ping timeout: 276 seconds]
jshjsh has joined #ruby
andikr has joined #ruby
aufi has joined #ruby
aufi has quit [Remote host closed the connection]
aufi has joined #ruby
graft has quit [Ping timeout: 256 seconds]
c355e3b has quit [Quit: Connection closed for inactivity]
ifctj has joined #ruby
toretore has joined #ruby
blaxter has joined #ruby
dionysus69 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
conta has joined #ruby
hutch34 has joined #ruby
JoshS has joined #ruby
jovial_ has quit [Remote host closed the connection]
SesMan has joined #ruby
jshjsh has quit [Ping timeout: 245 seconds]
hutch34 has quit [Ping timeout: 258 seconds]
kassav_ has joined #ruby
troulouliou_div2 has joined #ruby
ifctj has quit [Ping timeout: 240 seconds]
madhatter has quit [Remote host closed the connection]
gigetoo has joined #ruby
bkxd has joined #ruby
TomyWork has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
SesMan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jeyraof has quit [Quit: This computer has gone to sleep]
bkxd has quit [Ping timeout: 240 seconds]
MadWasp has left #ruby [#ruby]
jeyraof has joined #ruby
astrobunny has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 264 seconds]
EckT has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
gigetoo has joined #ruby
mark_66 has joined #ruby
skarlso has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
csk157_ has joined #ruby
scootaloo has joined #ruby
vondruch has joined #ruby
clauswitt has joined #ruby
naftilos76 has joined #ruby
pawnbox has quit [Ping timeout: 256 seconds]
gigetoo has quit [Ping timeout: 255 seconds]
nankyokusei has joined #ruby
gigetoo has joined #ruby
scootaloo has quit [Ping timeout: 240 seconds]
polysics has joined #ruby
nankyokusei has quit [Ping timeout: 245 seconds]
scootaloo has joined #ruby
vikas027 has joined #ruby
<vikas027>
Hello Everyone, Why do I have to use @vms_list as an instance variable. I am not using it any other method. https://dpaste.de/vHxT#L3
<scootaloo>
Well what happens if you don't use an instance variable?
JoshS has quit [Ping timeout: 256 seconds]
youch has joined #ruby
grh has joined #ruby
madhatter has joined #ruby
Airforce has quit [Read error: Connection reset by peer]
sarbs has quit [Ping timeout: 240 seconds]
jeyraof has quit [Quit: Leaving]
<vikas027>
nothing, script exits without printing anything
JoshS has joined #ruby
<herwin>
the anser is in line 8
<herwin>
answer
Snickers has joined #ruby
<vikas027>
@herwin: was that for me /
<vikas027>
?
<herwin>
vikas027: yes
aganov has joined #ruby
<vikas027>
@herwin: hmm.. can you please explain a bit ?
simmib___ has joined #ruby
gigetoo has quit [Ping timeout: 256 seconds]
sarbs has joined #ruby
youch has quit [Ping timeout: 245 seconds]
gigetoo has joined #ruby
<vikas027>
ah, I guess the method is calling itself ... is that the reason ?
<herwin>
yes, and that will create a new variable
jeyraof has joined #ruby
aupadhye has quit [Quit: Leaving]
<vikas027>
sorry, relatively new to ruby and trying to learn stuff.
<herwin>
this is not really specific to ruby ;)
<vikas027>
cool, that explains. Thanks a ton herwin
<vikas027>
yeah, I know. I guess I overlooked it and thought it to be ruby specific. My bad
simmib_ has quit [Ping timeout: 248 seconds]
minn has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
clauswit_ has joined #ruby
nahra has joined #ruby
optiz0r has joined #ruby
clauswitt has quit [Ping timeout: 264 seconds]
scootaloo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<herwin>
vikas027: the code is still pretty scary, because it might reset the @vms_list variable
<herwin>
a more reliable way would be to do "def vms(folder, vms_list = [])"
pkgnei has joined #ruby
<herwin>
then you can just use vms_list instead of @vms_list
jenrzzz has joined #ruby
<herwin>
and change line 8 to "vms(x, vms_list)"
<herwin>
or initialize the instance variable in find_vms_to_delete
gigetoo has quit [Ping timeout: 255 seconds]
nobitanobi has joined #ruby
gigetoo has joined #ruby
mikecmpbll has joined #ruby
<vikas027>
ah... let me try that
optiz0r has quit [Ping timeout: 240 seconds]
scootaloo has joined #ruby
optiz0r has joined #ruby
mikecmpbll has quit [Client Quit]
pawnbox has joined #ruby
antgel has joined #ruby
Joost has joined #ruby
<Joost>
is there a difference between hash.key?[:foo] and hash[:foo].present?
<vikas027>
herwin: Thank you, worked like a charm :)
clauswitt has joined #ruby
gigetoo has quit [Ping timeout: 258 seconds]
<vikas027>
One more question. Is there a neat way to print everything in one line but break line with puts/print/etc ? https://dpaste.de/uF0a rubocop complains of long lines. If I break this into multiple lines, it breaks in the output as well, which I do not want. Is there an alternative ?
gigetoo has joined #ruby
clauswit_ has quit [Read error: Connection reset by peer]
teclator has joined #ruby
<fumk>
ba ouai
<fumk>
sorry, wrong chan
<toretore>
vikas027: use print instead of puts
<herwin>
vikas027: you can do things like "puts 'foo' +\n'bar'"
<vikas027>
@herwin: Perfect. You are a life saver :)
biberu has joined #ruby
<vikas027>
toretore: I did tried using print in vain. It too broke the output in multiple lins
<toretore>
no it didn't
ledestin has joined #ruby
blackwind_123 has quit [Ping timeout: 248 seconds]
scootaloo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dminuoso>
doanguyen: And the reason for this is to allow Ruby to easily implement internal instance variables (the ones without @) which are completely inaccessible to the Ruby world.
optiz0r has joined #ruby
pawnbox has quit [Remote host closed the connection]
hutch34 has joined #ruby
doanguyen has quit [Quit: Page closed]
Silthias has left #ruby [#ruby]
Silthias has joined #ruby
gigetoo has quit [Ping timeout: 260 seconds]
Silthias has left #ruby [#ruby]
gigetoo has joined #ruby
teclator has quit [Remote host closed the connection]
Silthias has joined #ruby
Silthias has left #ruby [#ruby]
hutch34 has quit [Ping timeout: 276 seconds]
xall has quit [Ping timeout: 240 seconds]
Silthias has joined #ruby
Snickers has quit [Ping timeout: 252 seconds]
<vikas027>
toretore, herwin : This looks best to me (see the last line)
gregf_ has joined #ruby
Beams has joined #ruby
Silthias1 has joined #ruby
optiz0r has quit [Ping timeout: 240 seconds]
Silthias has quit [Ping timeout: 255 seconds]
gigetoo has quit [Ping timeout: 256 seconds]
workmad3 has joined #ruby
gigetoo has joined #ruby
xen0fon has quit [Quit: xen0fon]
shortCircuit___ has quit [Quit: Page closed]
agit0 has joined #ruby
hutch34 has joined #ruby
Shashikant86 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
gigetoo has quit [Ping timeout: 255 seconds]
Shashikant86 has joined #ruby
CloCkWeRX has joined #ruby
sarbs has quit [Ping timeout: 252 seconds]
<toretore>
vikas027: you are explicitly putting \n in your string..
xall has joined #ruby
<toretore>
vikas027: \n = newliine = line break
<vikas027>
toretore: No I am not see the last puts statement. It breaks the line (similar to bash) in code but still prints the text in one line
<valkyrka>
I have that recipe iterating through the node and for some reason, evne if I don’t set the :locked attribute, it still creates the username with no SSH keys
<valkyrka>
it does work if I use if user[:locked] == ‘true’ but I am wondering if this is the correct way in Ruby?
<dminuoso>
valkyrka: What exactly is your question?
Shashikant86 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<valkyrka>
sorry, it’s basically
<elomatreb>
What is the value of user[:locked] if it's not "true"?
Burgestrand has joined #ruby
Shashikant86 has joined #ruby
<valkyrka>
false
bkxd has quit [Ping timeout: 276 seconds]
<dminuoso>
false or "false" ?
<toretore>
false and "false are two different things
<valkyrka>
oh
<valkyrka>
sorry, I didn’t realize
<elomatreb>
So yes, your solution with == "true" is probably good
banisterfiend has joined #ruby
<dminuoso>
valkyrka: There's only one thing I would change in your gist.
jshjsh has joined #ruby
<dminuoso>
valkyrka: I would move the opening array [ in line 20 to the end of line 19.
inra has quit [Quit: Leaving]
<valkyrka>
sweet, I will do that, thank you
<dminuoso>
Beyond that it looks idiomatic
<elomatreb>
If we're picking about style, you should use symbol: "value" in that hash :P
<valkyrka>
what should I look for to clarify what’s the difference between false and “false”?
Tristan-Speccy has joined #ruby
<dminuoso>
valkyrka: One is just a string
<dminuoso>
The other is a boolean value
Tristan-Speccy is now known as Guest31531
<valkyrka>
got it, thanks!
<elomatreb>
In Ruby, if considers everything that is not either boolean false or nil (equivalent of null) to be truthy
<dminuoso>
^- even an empty string.
<dminuoso>
>> puts !!""
<ruby[bot]>
dminuoso: # => /tmp/execpad-e57ae304f660/source-e57ae304f660:2: warning: string literal in condition ...check link for more (https://eval.in/729603)
* dminuoso
kicks ruby[bot]
UserJosh has quit [Ping timeout: 240 seconds]
Chagel has quit [Ping timeout: 258 seconds]
Silthias has joined #ruby
paradisaeidae has joined #ruby
paradisaeidae_ has joined #ruby
<dminuoso>
Ruby has no un-expected implicit type casting, making this rule very easy to remember and apply.
<valkyrka>
I got it, thanks a million guys
Silthias1 has quit [Ping timeout: 252 seconds]
youch has joined #ruby
Silthias1 has joined #ruby
charliesome has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
Burgestrand has quit [Quit: Closing time!]
brent__ has joined #ruby
Silthias has quit [Ping timeout: 240 seconds]
elomatreb has quit [Quit: mep mep]
elomatreb has joined #ruby
JoshS has joined #ruby
Shashikant86 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
youch has quit [Ping timeout: 240 seconds]
last_staff has quit [Quit: later]
Burgestrand has joined #ruby
jshjsh has quit [Ping timeout: 256 seconds]
nobitanobi has quit [Remote host closed the connection]
brent__ has quit [Ping timeout: 260 seconds]
grh has quit [Remote host closed the connection]
inra has joined #ruby
Burgestrand has quit [Client Quit]
Burgestrand has joined #ruby
jameser has joined #ruby
byte512 has joined #ruby
grh has joined #ruby
gigetoo has joined #ruby
<valkyrka>
actually, it seems that that didn’t work
synthroid has quit [Remote host closed the connection]
Silthias1 has quit [Ping timeout: 276 seconds]
amagawdd has joined #ruby
lrns has quit [Ping timeout: 260 seconds]
cajone has joined #ruby
danguita has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
scootaloo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nankyokusei has joined #ruby
TvL2386 has quit [Remote host closed the connection]
scootaloo has joined #ruby
{Dolphin} has joined #ruby
ginetom_ has quit [Quit: ginetom_]
brent__ has joined #ruby
inra has quit [Quit: Leaving]
Derperperd has quit [Ping timeout: 276 seconds]
valkyrka has quit [Quit: valkyrka]
bkxd has quit [Ping timeout: 255 seconds]
kobain has joined #ruby
AndBobsYourUncle has joined #ruby
nankyokusei has quit [Ping timeout: 245 seconds]
conta has quit [Ping timeout: 240 seconds]
karapetyan has quit [Remote host closed the connection]
Shashikant86 has joined #ruby
ddrmanxbxfr has joined #ruby
Guest31531 is now known as Tristan-Speccy
kobain has quit [Ping timeout: 252 seconds]
AndBobsYourUncle has quit [Ping timeout: 255 seconds]
cajone has quit [Ping timeout: 255 seconds]
nhhc has quit [Quit: Leaving]
howdoi has quit [Quit: Connection closed for inactivity]
synthroid has joined #ruby
youch has quit [Ping timeout: 240 seconds]
lanc_ has quit [Ping timeout: 240 seconds]
cajone has joined #ruby
simmib has quit [Remote host closed the connection]
zazen has joined #ruby
lenwood has quit [Ping timeout: 240 seconds]
SesMan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
username_ has joined #ruby
EckT has quit [Quit: -a- IRC for Android 2.1.32]
lpaste_ has joined #ruby
simmib_ has joined #ruby
Anonymoose2 has joined #ruby
jhack has quit [Quit: jhack]
reverberations has quit [Ping timeout: 240 seconds]
tubbo has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
amclain has joined #ruby
jayrmotta has quit [Quit: Connection closed for inactivity]
username1 has joined #ruby
eindoofus has joined #ruby
skarlso has quit [Remote host closed the connection]
skarlso has joined #ruby
blackmesa has joined #ruby
harai_ has joined #ruby
jhack has joined #ruby
cschneid_ has joined #ruby
shinnya has quit [Ping timeout: 276 seconds]
mark_66 has quit [Remote host closed the connection]
skarlso has quit [Ping timeout: 264 seconds]
matp has quit [Remote host closed the connection]
harai_ has quit [Ping timeout: 240 seconds]
matp has joined #ruby
enterprisey has joined #ruby
simmib_ has quit [Remote host closed the connection]
lpaste_ is now known as lpaste
<eindoofus>
hi, strange question, just out of curiosity is anyone in here a bad reader? for example, had trouble with reading comprehension growing up, or is dyslexic, or has problems maintaining focus while reading?
scootaloo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lpaste has quit [Changing host]
lpaste has joined #ruby
lenwood has joined #ruby
cdg_ has joined #ruby
pawnbox has quit [Remote host closed the connection]
conta has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 255 seconds]
dionysus69 has joined #ruby
harai_ has joined #ruby
tlahtoani has quit [Quit: Connection closed for inactivity]
<Mumm-ra>
eindoofus a psychiatrist can diagnose that.
duderonomy has quit [Ping timeout: 240 seconds]
<Mumm-ra>
eindoofus by the way, i think you're just hypocondriac though.
scootaloo has joined #ruby
scootaloo has quit [Client Quit]
GarouDan has joined #ruby
nobitanobi has quit [Remote host closed the connection]
markholmes has joined #ruby
mholmes has joined #ruby
mholmes has quit [Remote host closed the connection]
choke has quit [Read error: Connection reset by peer]
pawnbox has joined #ruby
markholmes has quit [Remote host closed the connection]
<GarouDan>
Is there in ruby a way to handle all exceptions? The motivation for this is handle the exception, maybe looging to a specific files some kind of exceptions or send and e-mail to the system administrator
<GarouDan>
Is there a way to do this?
fuzzyhorns has quit [Quit: Leaving.]
<GarouDan>
In Java we have: Thread.setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler ex)
<GarouDan>
In NodeJS we have: process.on('uncaughtException', function(err) {/*code*/})
<GarouDan>
How can we do this in ruby?
conta has quit [Quit: conta]
Derperperd has joined #ruby
hutch34 has quit [Quit: WeeChat 1.5]
nobitanobi has joined #ruby
nobitanobi has quit [Remote host closed the connection]
nobitanobi has joined #ruby
bkxd has joined #ruby
Shashikant86 has quit [Ping timeout: 240 seconds]
enterprisey has quit [Remote host closed the connection]
skweek has joined #ruby
saslam has joined #ruby
nobitanobi has quit [Remote host closed the connection]
TomyWork has quit [Remote host closed the connection]
jackjackdripper has joined #ruby
hutch34 has joined #ruby
djbkd has joined #ruby
jackjackdripper has quit [Client Quit]
jackjackdripper has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
djellemah has quit [Ping timeout: 256 seconds]
jshjsh has joined #ruby
armyriad has joined #ruby
jaruga_____ has quit [Quit: jaruga_____]
jaruga_____ has joined #ruby
JoshS has quit [Ping timeout: 256 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
antoniobeyah has joined #ruby
<antoniobeyah>
i have a set of files in a directory that I want to templatize and be able to create instances of those templates in another directory- is there a gem that handles that for me?
<antoniobeyah>
ruby774: i'm not sure what the problem is but I would use POST (for new) and PUT to overwrite
<antoniobeyah>
no need for a seperate uri
milardovich has joined #ruby
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
nankyokusei has joined #ruby
dionysus69 has quit [Ping timeout: 255 seconds]
theta8 has joined #ruby
jshjsh has quit [Read error: Connection reset by peer]
jshjsh has joined #ruby
<antoniobeyah>
if you can say more about what you are seeing, what error you are getting, and what you expect to happen it may help in answering your question
<ruby774>
That means it will read txt from wiki.txt and write it in wiki2txt file So whatever was in wiki2.txt will be replaced with the text from wiki.txt
tjvc has joined #ruby
tjvc has quit [Changing host]
enterprisey has joined #ruby
tjvc has joined #ruby
Scient has joined #ruby
<ruby774>
antoniobeyah
pizzaops has quit [Ping timeout: 240 seconds]
kireevco has quit [Ping timeout: 240 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Brak__________ has joined #ruby
Silthias has joined #ruby
davidmichaelkarr has quit [Ping timeout: 245 seconds]
ec has quit [Ping timeout: 240 seconds]
craysiii has joined #ruby
weez17 has quit [Ping timeout: 276 seconds]
Silthias2 has quit [Ping timeout: 260 seconds]
Derperperd has quit [Ping timeout: 240 seconds]
ggherdov has quit [Ping timeout: 264 seconds]
theta8 has quit [Quit: leaving]
<ruby774>
Hello
MMZF has joined #ruby
MMZF has joined #ruby
MMZF has quit [Changing host]
<ruby774>
I need help please for my project
fuzzyhorns has joined #ruby
jpinnix has joined #ruby
JoshS has joined #ruby
skweek has joined #ruby
kireevco has joined #ruby
weez17 has joined #ruby
<antoniobeyah>
ruby774: i don't know what you are trying to do, what problem you are having, and I don't have time to piece it all together. is there a specific error you are getting?
enterprisey has quit [Remote host closed the connection]
lenwood has quit [Ping timeout: 255 seconds]
kies has joined #ruby
varesa has joined #ruby
varesa has quit [Max SendQ exceeded]
jhack has quit [Client Quit]
varesa has joined #ruby
varesa has quit [Max SendQ exceeded]
psychicist__ has joined #ruby
karapetyan has quit [Remote host closed the connection]
gusrub has quit [Ping timeout: 255 seconds]
<nullsign>
is there a easy way in ruby - with grep or via a gem to remove any line that isn't a valid IPv4 address?
<nullsign>
ah.. ipaddress gem..
sanguisdex has joined #ruby
jhack has joined #ruby
<sanguisdex>
so I have been looking around and I cant find any way to use a rake task to export an environmental variable. Is this true or am I missing somthing.
<nullsign>
someone mind telling me where i've gone off the rails at the bottom with the true or false part?
<nullsign>
im using ipaddress to test to test if a ip is true or false, that works fine, i just need a working if/else based on if it is true or false.
gnufied has quit [Ping timeout: 255 seconds]
nobitanobi has joined #ruby
ramfjord has joined #ruby
<sanguisdex>
havenwood: so should I use a multitask or create a method that gets extended for each task (sorry operations person here)
[Butch]_ has joined #ruby
CloCkWeRX has joined #ruby
<Jayson_Virissimo>
nullsign: if true will always execute.
gusrub has joined #ruby
<nullsign>
where am i going wrong then?
<nullsign>
do i even need that def line?
<nullsign>
should i remove it and go with if value="true" ?
bkxd has quit [Ping timeout: 255 seconds]
<Jayson_Virissimo>
if i.is_ip? then puts "TRUE" else puts "FALSE" end
[Butch] has quit [Ping timeout: 255 seconds]
[Butch]_ is now known as [Butch]
<nullsign>
oh
<nullsign>
... that works
<nullsign>
thank you
gloscombe_ has joined #ruby
nobitanobi has quit [Ping timeout: 240 seconds]
<Jayson_Virissimo>
No need for that method declaration at all.
<Jayson_Virissimo>
Just do that inside the for loop.
nankyoku_ has quit [Remote host closed the connection]
nankyokusei has joined #ruby
<nullsign>
ruby seems to natively work with true/false then
<Jayson_Virissimo>
The for loop and that one-line if-then-else aren't idiomatic Ruby though, just FYI.
<nullsign>
thats pretty cool
<nullsign>
nowhere in that am i defining that i'm sending it true/false
<nullsign>
yet it interprets it correctly
<nullsign>
neat.
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nullsign>
ive spent too long in bash
milardovich has quit [Remote host closed the connection]
<Jayson_Virissimo>
If you are impressed by that, you are really gonna love Ruby.
gusrub has quit [Remote host closed the connection]
CloCkWeRX has quit [Ping timeout: 276 seconds]
<Jayson_Virissimo>
That is just the tip of the iceberg.
<sanguisdex>
how do I reuse a Rake task as a prerequisite for other rake tasks?
rikai has joined #ruby
brendan- has quit [Read error: Connection reset by peer]
gusrub has joined #ruby
gusrub has quit [Remote host closed the connection]
<Jayson_Virissimo>
sanguisdex: you mean how do you call a rake task from within a rake task?
gusrub has joined #ruby
wilbert has joined #ruby
Fernando-Basso has quit [Quit: WeeChat 1.5]
<ytti_>
puts puts i.is_ip? ? "TRUE" : "FALSE"
lenwood has joined #ruby
<nullsign>
neat.. this can combined down to "IPADDR = CSV.read(file, :headers=>true)['IP Address']"
<Jayson_Virissimo>
sanguisdex: You can do something like Rake::Task['other:task'].execute from within a rake task.
Qommand0r has quit [Client Quit]
UnknownSoldier has joined #ruby
Burgestrand has joined #ruby
<baweaver>
antoniobeyah: you have to be auth'd to nickserv
kobain has joined #ruby
__Yiota has joined #ruby
gnufied has joined #ruby
SCHAAP137 has quit [Read error: Connection reset by peer]
Burgestrand has quit [Client Quit]
<sanguisdex>
Jayson_Virissimo: I have a series of Rake tasks that interact with EC2. each task with need to start with pinging the aws api to get security group and subnet id's. How do I create a method in my Rakefile that is reused at the beginning of every ec2 Rake task?
SCHAAP137 has joined #ruby
Qommand0r has joined #ruby
gnufied__ has joined #ruby
<sanguisdex>
is this crazy talk?
<elomatreb>
A Rakefile is jjust regular Ruby code, you can just define the method and call it?
ur5us has quit [Remote host closed the connection]
<TomyLobo>
i want to install the pcaprub on cygwin as a dependency for another gem, packetfu. it's a hard dependency, but it's (i think) not required for what i want to do with packetfu
<TomyLobo>
the problem is, cygwin has no libpcap, so the native parts of pcaprub fail to build. is there a way to skip the native extension build?
ifctj has joined #ruby
synthroid has quit [Remote host closed the connection]
cdg has joined #ruby
cdg has quit [Remote host closed the connection]
grh has joined #ruby
cdg has joined #ruby
Renich has quit [Quit: leaving]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest95086 is now known as adam12
synthroid has joined #ruby
theta8 has joined #ruby
Derperperd has joined #ruby
ruby774 has quit [Ping timeout: 260 seconds]
<nullsign>
hrm.. suggestion? IPADDR = CSV.read(FILE, :headers=>true)['IP Address'] <- this works great
<nullsign>
tho i'd like to add in some safety by dying if the csv fails to have a column named that.
Burgestrand has joined #ruby
<theta8>
I'm building an array of regex matches from a multiline string, each value is taken from the string via array = [string[/key: (.*)/,1], etc. ] however the resulting array of values is not being constructed properly - not sure why
kht has joined #ruby
JeanCarloMachado has quit [Ping timeout: 245 seconds]
markholmes has quit [Ping timeout: 256 seconds]
vuoto has joined #ruby
cdg has quit [Ping timeout: 255 seconds]
<theta8>
I'm getting only some of the matches, even though each item is there and they are out of order
jhack has quit [Quit: jhack]
wilbert has quit [Ping timeout: 240 seconds]
markholmes has joined #ruby
Bounga has joined #ruby
vuoto has quit [Remote host closed the connection]
byte512 has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
inra has joined #ruby
dn` has joined #ruby
Bounga has quit [Ping timeout: 252 seconds]
Burgestrand has quit [Quit: Good bye and have a nice day!]
jenrzzz has quit [Ping timeout: 255 seconds]
InsaneSplash2 has joined #ruby
GBrawl has quit [Quit: (null)]
nankyokusei has quit [Remote host closed the connection]
dopamean_ has joined #ruby
InsaneSplash has quit [Ping timeout: 248 seconds]
dionysus69 has joined #ruby
Fernando-Basso has joined #ruby
InsaneSplash2 is now known as InsaneSplash
dopamean_ has quit [Client Quit]
nankyokusei has joined #ruby
millerti has joined #ruby
nobitanobi has joined #ruby
wilbert has joined #ruby
kht has quit [Ping timeout: 240 seconds]
enterprisey has quit [Remote host closed the connection]
millerti has quit [Client Quit]
jenrzzz has joined #ruby
nowhereman has joined #ruby
ldnunes has quit [Quit: Leaving]
millerti has joined #ruby
millerti has quit [Client Quit]
brendan- has joined #ruby
cdg has joined #ruby
bkxd has joined #ruby
bjh13 has quit [Remote host closed the connection]
theta8 has quit [Quit: leaving]
jhack has joined #ruby
brendan- has quit [Read error: Connection reset by peer]
mrVandermare has joined #ruby
bkxd has quit [Ping timeout: 255 seconds]
nankyoku_ has joined #ruby
OTORelic has quit [Ping timeout: 260 seconds]
harai_ has joined #ruby
nankyoku_ has quit [Remote host closed the connection]
cdg has quit [Remote host closed the connection]
nankyoku_ has joined #ruby
cdg has joined #ruby
quick has joined #ruby
cdg_ has joined #ruby
brendan- has joined #ruby
nankyokusei has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 245 seconds]
cdg has quit [Read error: Connection reset by peer]
tomphp has quit [Read error: Connection reset by peer]
tomphp has joined #ruby
guacamole has quit [Quit: leaving]
ramortegui has quit [Read error: Connection reset by peer]
Burgestrand has joined #ruby
ramortegui has joined #ruby
coredump has joined #ruby
<coredump>
So, I started getting this weird warnings
<coredump>
W, [2017-02-03T16:36:23.428802 #11557] WARN -- : You are setting a key that conflicts with a built-in method Hashie::Mash#frozen? defined in Kernel. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
<coredump>
Any idea what causes this, or if there's way to silence them (they are not on stderr)
rikai has quit [Remote host closed the connection]
wilbert has joined #ruby
xen0fon has joined #ruby
tvw has joined #ruby
blackmesa has joined #ruby
guacamole has joined #ruby
hobodave has joined #ruby
msmith has quit []
jenrzzz has joined #ruby
tyang_ has quit [Read error: Connection reset by peer]
tomphp has quit [Ping timeout: 241 seconds]
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
Phenix has joined #ruby
varesa has joined #ruby
Norm has quit [Quit: Norm]
clauswitt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_djbkd has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
timmytodd has joined #ruby
jackjackdripper has joined #ruby
jhack has quit [Quit: jhack]
jhack has joined #ruby
<timmytodd>
Hey, I'm a ruby beginner and have what is probably a really simple question. I'm trying to rescue an error in a begin/rescue structure but it isn't being rescued. Whenever I try to search for this it's about errors that don't inherit from StandardError but that is not my problem. I'm specifying the exact error type and it's still not being caught.
_djbkd has quit [Quit: My people need me...]
<SeepingN>
some cut'n'paste is in order
Jackneill has quit [Remote host closed the connection]
gnufied has quit [Quit: Leaving]
szulak has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
sepp2k has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
cahoots has joined #ruby
szulak has joined #ruby
<cahoots>
hi, i'm trying to write out a gzipped string to a file. currently, i'm doing `File.open('asdf.gz', 'w') {|f| gz = Zlib::GzipWriter.new(f, 9) ; gz.write 'jugemu jugemu gokou no surikire...' ; gz.close }`, but i find that the end result has the same text as what i entered. any ideas?
yqt has quit [Ping timeout: 260 seconds]
nobitanobi has quit [Ping timeout: 258 seconds]
last_staff has quit [Quit: last_staff]
cdg_ has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
<matthewd>
cahoots: I just copy & pasted the above into irb and it wrote a rather compressed-looking file
brent__ has quit [Ping timeout: 240 seconds]
<cahoots>
matthewd, hrm that's odd
<cahoots>
but i fixed it anyways by just using command-line gzip. thanks though!
Yxhuvud has quit [Remote host closed the connection]
Technaton has quit [Ping timeout: 256 seconds]
Yxhuvud has joined #ruby
pawnbox has joined #ruby
Guest71019 is now known as Radar
Radar has quit [Changing host]
Radar has joined #ruby
tomphp has joined #ruby
youch has quit [Quit: WeeChat 1.7]
Technaton has joined #ruby
hobodave has quit [Ping timeout: 260 seconds]
alamar has quit [Ping timeout: 252 seconds]
pawnbox has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
markholmes has quit [Read error: Connection reset by peer]
chouhoulis has quit []
timmytodd has quit [Quit: Leaving]
alamar has joined #ruby
jhack has quit [Quit: jhack]
alamar is now known as Guest79130
chouhoulis has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
jhack has joined #ruby
wilbert has quit [Ping timeout: 258 seconds]
cdg has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
rikai has joined #ruby
jaegerca has joined #ruby
<jaegerca>
Can anyone convince me that implementing a singleton class is better than just using a module?
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
cdg_ has quit [Ping timeout: 260 seconds]
<jaegerca>
The only reason I can see using a singleton class is because you wouldn't want to extend or include it in another class/module.
madsa has quit [Read error: Connection reset by peer]
cdg_ has joined #ruby
<jaegerca>
But that argument doesn't apply at all to modules creating a namespace - so it's not really an argument so far as I can tell.
<havenwood>
jaegerca: It's also often the case that if you have state to instantiate but only one instance of that state then you're also likely to want to be able to serialize that state.
balazs has quit [Ping timeout: 260 seconds]
<jaegerca>
havenwood: I am not sure what you mean by serialize in this context.
<havenwood>
jaegerca: Singleton also provides Marshal dump and load helpers.
<havenwood>
jaegerca: If you have nothing to instantiate, a module. If you have only one instance, a Singleton Class. If you have many instances, a Class.
cdg has quit [Ping timeout: 264 seconds]
<jaegerca>
havenwood: I understand - I can get on board with that, thank you.
_sfiguser has joined #ruby
<havenwood>
jaegerca: No prob. But yeah, you can do one or many instances with a module yourself, but it's nice to use the singleton class or class as provided.
<havenwood>
jaegerca: It signals to the reader what exactly you have. It keeps you from having to write your own instance-handling methods.
Burgestrand has quit [Quit: Closing time!]
<jaegerca>
havenwood: That makes perfect sense.
chouhoul_ has joined #ruby
harai_ has quit [Ping timeout: 255 seconds]
saneax-_-|AFK is now known as saneax
pawnbox has joined #ruby
saslam has quit [Ping timeout: 248 seconds]
chouhoulis has quit [Ping timeout: 260 seconds]
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoul_ has quit [Ping timeout: 248 seconds]
<chrisseaton>
How do I find out if a class is a subclass of some other class, possibly transitively via other subclasses in between?
<chrisseaton>
I can't find a method but maybe I'm not searching with a sensible name
<havenwood>
chrisseaton: Like?: Fixnum < Numeric
<chrisseaton>
Yeah, I want to do Fixnum.subclass_of?(Numeric)