Ekho has quit [Quit: An alternate universe was just created where I didn't leave. But here, I left you. I'm sorry.]
spacesuitdiver has joined #ruby
s3nd1v0g1us has quit [Ping timeout: 252 seconds]
mangold has joined #ruby
s3nd1v0g1us has joined #ruby
spacesuitdiver has quit [Ping timeout: 255 seconds]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
t0xik has joined #ruby
Ekho has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
skryking has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
v01d4lph4 has joined #ruby
ellcs has quit [Ping timeout: 245 seconds]
v01d4lph4 has quit [Ping timeout: 245 seconds]
Swyper has joined #ruby
blackmesa has quit [Quit: WeeChat 2.4]
Swyper has quit [Remote host closed the connection]
v01d4lph4_ has joined #ruby
Swyper has joined #ruby
mangold has joined #ruby
Azure|dc has quit [Read error: Connection reset by peer]
Swyper_ has joined #ruby
Azure has joined #ruby
MeiQianChiFan has quit [Remote host closed the connection]
MeiQianChiFan has joined #ruby
v01d4lph4_ has quit [Ping timeout: 246 seconds]
Swyper has quit [Ping timeout: 255 seconds]
AJA4350 has quit [Remote host closed the connection]
Puffball has joined #ruby
GodFather has quit [Remote host closed the connection]
GodFather has joined #ruby
spacesuitdiver has joined #ruby
spacesuitdiver has quit [Client Quit]
luminousnine- has quit [Quit: Goodbye ~ Powered by LunarBNC]
spacesuitdiver has joined #ruby
ChrisBr has quit [Ping timeout: 246 seconds]
ChrisBr has joined #ruby
_habnabit has quit [Ping timeout: 246 seconds]
Jello_Raptor has quit [Ping timeout: 246 seconds]
Emmanuel_Chanel has quit [Ping timeout: 246 seconds]
_habnabit has joined #ruby
Jello_Raptor has joined #ruby
Emmanuel_Chanel has joined #ruby
luminousnine has joined #ruby
<SeepingN>
ugh damnit. I'm trying to find all Devices of a certain type. That type is referred to as Device.product, which is a lookup from another table. We want to match all part_numbers with a certain string in them. Device.where(:product =~ /IQ6/).last.product ...does not give me "IQ6". It seems the where filters out nothing and I can put almost any garbage in there and get back the full Device list
bmurt has joined #ruby
<havenwood>
SeepingN: ActiveRecord?
<havenwood>
SeepingN: Postgres?
<SeepingN>
mysql
<SeepingN>
er
<SeepingN>
activerecord. mysql backend.
<SeepingN>
.. the events table is in a separate database that I can't access, otherwise I'd be done with an SQL query :\
<SeepingN>
Devices.product is defined simply as: PartNumber.product_for_part_num(part_num)
<havenwood>
SeepingN: How about?: Device.where('product LIKE %IQ6%').last
<SeepingN>
Unknown column 'product' in 'where clause': SELECT `devices`.* FROM `devices` WHERE (product LIKE '%IQ6%') ORDER BY `devices`.`id` DESC LIMIT 1
<SeepingN>
from /enphase/enlighten/shared/bundle/ruby/2.2.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in `_query'
<havenwood>
SeepingN: Device.where("product LIKE '%?%'", product_id).last
Swyper_ has quit [Remote host closed the connection]
<SeepingN>
it's unfortunately not a column of Device
<havenwood>
SeepingN: What is it?
Swyper has joined #ruby
kevinburke has quit [Quit: Connection closed for inactivity]
<havenwood>
SeepingN: How do you get a product, I don't follow. Have a code example showing how you call a product?
<SeepingN>
it's defined in PartNumber as PartNumber.product_for_part_num(part_num)
<havenwood>
SeepingN: Okay, so you have a `part_num`. What on Device corresponds to that?
<SeepingN>
part_numbers is a table with id, part_num, product (the english desc of the product), and 2 unrelated columns
<havenwood>
Let me back up. It seems you're trying to find a particular Device record given a part_num?
<havenwood>
Showing a bit more code might give enough context.
<SeepingN>
Device.part_num... but that part_num is a longer form. THe ones in the lookup table "part_numbers" are truncated to the first 9 characters... no subversions
<SeepingN>
I want all devices marked as "IQ7" qhich may include "IQ7+" and "IQ7 vartiation 9482". ie: regex. or I could just list them all in the query aqnd do an "IN" equiv
<SeepingN>
I have no code. I'm trying to start a query to build a data report
<SeepingN>
I usually do this in SQL. Maybe I should try to get that to work and just pass a full query to the connection
<havenwood>
SeepingN: My best guess, from what you've said, without seeing code is:
<havenwood>
SeepingN: That would check Devices in batches of 1000, looking for a `device.part_num` that is a subset of one of the part_numbers Strings.
<SeepingN>
well they'll all match. need to filter to a specifci substring
<SeepingN>
every Device will have a matchin in that lookup table
<adac>
ljarvis, I see yes. But is this always a underlying problem? INfrastructure/Network/DNS?
<ljarvis>
adac: who knows? there's a *lot* of reasons an address might not resolve
keden has joined #ruby
<ljarvis>
most of which are indistinguishable
<adac>
ljarvis, yep I understand. Just trying to figure out on how I can debug this
<ljarvis>
does the URL resolve in your browser?
<ljarvis>
(assuming it's something you can view in a browser)
x77686d has joined #ruby
jane_booty_doe has quit [Remote host closed the connection]
jane_booty_doe has joined #ruby
mtkd has joined #ruby
jcalla has quit [Ping timeout: 252 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 252 seconds]
AJA4351 is now known as AJA4350
x77686d has quit [Quit: x77686d]
dubuc has joined #ruby
j-amoah_ has joined #ruby
j-amoah has quit [Ping timeout: 245 seconds]
Arkantos has joined #ruby
emilford has joined #ruby
lucasb has joined #ruby
keden has quit [Ping timeout: 255 seconds]
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
themsay has quit [Ping timeout: 246 seconds]
emilford has quit [Quit: Lost terminal]
za1b1tsu has joined #ruby
qual has joined #ruby
emilford has joined #ruby
keden has joined #ruby
t0xik has quit [Quit: Connection closed for inactivity]
keden has quit [Ping timeout: 240 seconds]
v01d4lph4 has quit [Remote host closed the connection]
keden has joined #ruby
kapil____ has joined #ruby
akem has quit [Quit: Leaving]
mtkd has quit []
ferr has quit [Quit: WeeChat 2.4]
kent\n has quit [Ping timeout: 250 seconds]
kent\n has joined #ruby
mtkd has joined #ruby
jcalla has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4351 is now known as AJA4350
clemens3 has quit [Read error: Connection reset by peer]
aqd has quit [Quit: Leaving]
aqd has joined #ruby
clemens3 has joined #ruby
alem0lars_ has joined #ruby
alem0lars has quit [Ping timeout: 268 seconds]
rippa has joined #ruby
Azure has quit [Remote host closed the connection]
Azure has joined #ruby
SeepingN has joined #ruby
<Tuor>
Hi, is there ruby a option which passes a string as STDIN to a script? like ruby myscript --stdin '{"secret":"asdf"}'
Arkantos has joined #ruby
conta has quit [Ping timeout: 255 seconds]
awkwords has joined #ruby
awkwords has quit [Client Quit]
<TheBrayn>
you don't have to do anything for that
<TheBrayn>
just read ARGV
<TheBrayn>
or use an option parser
gloscombe has quit [Ping timeout: 252 seconds]
<ellcs>
echo "hi" | ruby puts_stdin.rb
<ellcs>
content of puts_stdin.rb: puts $stdin.readline
qual has quit [Quit: Sleeping..]
gloscombe has joined #ruby
Rapture has joined #ruby
<TheBrayn>
or “ruby puts_stdin.rb <<< 'hi'” if you are using recent versions of bash
conta has joined #ruby
<al2o3-cr>
true, use herestrings.
makr8100 has quit [Quit: Konversation terminated!]
conta has quit [Client Quit]
<Tuor>
I can't call the ruby binary with bash. It's called by my IDE RubyMine and RubyMine doesn't support redirection of STDIN... So I am looking for some other way. Right Now I use STDIN.reopen('/tmp/path.json') in the beginning of my ruby script, but I have to comment it out befor each git commit. That's not very nice.
jane_booty_doe has quit [Remote host closed the connection]
jane_booty_doe has joined #ruby
<ellcs>
TheBrayn: why the hell does this work
<ellcs>
ruby<<<"puts 'hi'"
<ellcs>
i see that
<ellcs>
i checked out your stuff, but wtf
<TheBrayn>
why not?
<TheBrayn>
ruby accepts code on stdin
qual has joined #ruby
<Riviera_>
bash creates a temporary file with puts 'hi' as content, and then it opens ruby with that file as stdin; which ruby reads and executes.
qual has quit [Client Quit]
mtkd has quit []
gloscombe_ has joined #ruby
qual has joined #ruby
Inline has joined #ruby
gnufied has joined #ruby
qual has quit [Client Quit]
gloscombe has quit [Ping timeout: 255 seconds]
gloscombe_ is now known as gloscombe
polishdub has joined #ruby
eb0t_ has quit [Quit: WeeChat 2.3]
Swyper has joined #ruby
crankharder has joined #ruby
gloscombe has quit [Quit: gloscombe]
gloscombe has joined #ruby
AJA4350 has quit [Ping timeout: 255 seconds]
zapata_ has joined #ruby
zapata has quit [Ping timeout: 258 seconds]
zapata_ is now known as zapata
spacesuitdiver has joined #ruby
akem has joined #ruby
aufi has quit [Ping timeout: 246 seconds]
aupadhye has quit [Ping timeout: 252 seconds]
gregf_ has joined #ruby
<Tuor>
How can I test if a passed object to a method is of a specific class?
Swyper has quit [Remote host closed the connection]
<al2o3-cr>
Tuor: obj.is_a?
<ellcs>
1.is_a?(Integer)
<Tuor>
let me try.
<Tuor>
is working thx!
gloscombe_ has joined #ruby
gloscombe has quit [Ping timeout: 240 seconds]
gloscombe_ is now known as gloscombe
renich_ has joined #ruby
renich has quit [Ping timeout: 252 seconds]
renich_ is now known as renich
tdy has joined #ruby
j-amoah_ has quit [Quit: Konversation terminated!]
AJA4350 has joined #ruby
<ytti>
Integer === 1 also
<ytti>
but i guess less idiomatic?
* Tuor
can't remember having see === befor.
<Tuor>
s/see/seen/
<SeepingN>
==> flase
<al2o3-cr>
&ri Object.=== Tuor
<rubydoc>
Tuor: Found no entry that matches class Object class method ===
<al2o3-cr>
&ri Module.=== Tuor
<rubydoc>
Tuor: Found no entry that matches class Module class method ===
<ruby[bot]>
BoomerBile: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<BoomerBile>
The same plugin runs outside the Xen environment just fine
<BoomerBile>
even recompiled it fails in the Xen environment
gigetoo has quit [Ping timeout: 240 seconds]
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sleepingforest has left #ruby ["Leaving"]
<BoomerBile>
al2o3-cr, if I knew how to dig at all i wouldn't be here asking....
gigetoo has joined #ruby
<BoomerBile>
going to re-compile my updates, then ruby, then the plugin system, then the plugin, then if it doesn't work ruby is no longer for me... 5 years of nothing but headache's every update
<BoomerBile>
time to switch to lua
Swyper has joined #ruby
<al2o3-cr>
BoomerBile: so everytime it's been a foot print?
<BoomerBile>
unsure what you're asking
polishdub has quit [Remote host closed the connection]
<al2o3-cr>
BoomerBile: a head ACHE
<BoomerBile>
some kind of joke/pun i'm assuming
jcalla has quit [Remote host closed the connection]
<al2o3-cr>
well, 5 yrs must be ...
<BoomerBile>
probably longer actually
<BoomerBile>
the project is near 17 years old
<al2o3-cr>
BoomerBile: whats the project?
<Xeago>
anyone seen apeiros recently?
<BoomerBile>
unimportant
<al2o3-cr>
why so?
<BoomerBile>
the problem is that ruby says i've encountered a ruby bug
<BoomerBile>
i don't want to file a bug because i've had this issue before with ruby
<BoomerBile>
and it wasn't a ruby bug
<BoomerBile>
I want to find out who's code is at fault cause irb loads my code fine
<BoomerBile>
and executes it
<BoomerBile>
so, is it a ruby bug this time? or third party?
<BoomerBile>
or environment
<al2o3-cr>
BoomerBile: who knows?
<BoomerBile>
you're not being productive
<BoomerBile>
if you don't know, stop scrolling the question
<al2o3-cr>
BoomerBile: neither are you!
hightower2 has joined #ruby
<al2o3-cr>
BoomerBile: you've come in here blasting
hightower2 has quit [Changing host]
hightower2 has joined #ruby
<BoomerBile>
no I didn't
<BoomerBile>
I came in here with a question
BoomerBile has left #ruby ["Shoves everyone out of the way."]
<al2o3-cr>
baweaver: did
za1b1tsu has quit [Remote host closed the connection]
r29v has joined #ruby
xrexeon has joined #ruby
dviola has quit [Quit: WeeChat 2.4]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
<baweaver>
hm?
r29v has quit [Quit: r29v]
zapata has quit [Ping timeout: 258 seconds]
* baweaver
reads back
<baweaver>
What's `nwserver` doing BoomerBile?
<baweaver>
Left I guess.
<baweaver>
al2o3-cr: Doesn't really read like bashing, just annoyance at something breaking.
schleppel has quit [Quit: Konversation terminated!]
tdy1 has quit [Remote host closed the connection]
ravenousmoose has joined #ruby
conta has quit [Ping timeout: 252 seconds]
anjen has joined #ruby
tag has joined #ruby
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
anjen has quit [Client Quit]
cyberarm has quit [Ping timeout: 252 seconds]
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
cyberarm has joined #ruby
Ai9zO5AP has quit [Quit: WeeChat 2.4]
sameerynho has quit [Ping timeout: 245 seconds]
Fernando-Basso has quit [Remote host closed the connection]
hightower2 has quit [Ping timeout: 252 seconds]
AJA4350 has quit [Ping timeout: 255 seconds]
spacesuitdiver has quit [Ping timeout: 255 seconds]
r29v has quit [Quit: r29v]
cnsvc_ has quit [Remote host closed the connection]
keden has quit [Ping timeout: 245 seconds]
AJA4350 has joined #ruby
tekniq_ has quit [Ping timeout: 245 seconds]
llua has joined #ruby
themsay has joined #ruby
zapata has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
r29v has joined #ruby
bjpenn has joined #ruby
cjkinni has joined #ruby
<bjpenn>
hey guys, i want to use a ruby heredoc for a string that contains a literal "\". Lets say "myvar" is set to "foobar". I want my heredoc to be "foobar \". If i want to create a heredoc that contains "#{myvar} \", but have it process the value of "myvar" how do i do it?
<bjpenn>
not sure if thats understandable :D
<leftylink>
huh. I guess that is one thing that is not currently possible to do w/ &>>, demonstrate code containing a heredoc... guess it has to be &url then...
<mozzarella>
bjpenn: you do it exactly like that
DeadPixelz01 has joined #ruby
DaRock has joined #ruby
<bjpenn>
mozzarella: using the &>> like how leftylink pointed out?
<mozzarella>
bjpenn: I think he was trying to use the bot
hightower2 has joined #ruby
<bjpenn>
ohh
<mozzarella>
heredocs in ruby use <<
<bjpenn>
mozzarella: i mean how do i make it interpolate a string like #{myvar} but not interpolate the backslash
<bjpenn>
i want the backslash to show up as a literal backslash
<bjpenn>
whereas now , if i have <<~HEREDOC ..... HEREDOC , it will just disappear
<bjpenn>
i guess one option is using double backslash
<bjpenn>
but is there another way?
<mozzarella>
I don't think so
<bjpenn>
is there a way where i can make it do something like this?