<skarlso>
Here... saying Not available on all platforms.
<skarlso>
because it looks like this method is not working the same way on linux and OSX
<skarlso>
since osx is probably using APSF
<skarlso>
But I have no clue as to what to use instead of it?
Thenekofell has joined #ruby
ellcs has joined #ruby
ramfjord has quit [Ping timeout: 272 seconds]
conta has quit [Ping timeout: 246 seconds]
al2o3-cr has quit [Quit: If the universe is a machine where the future is uniquely determined by its present state, it would not be possible to calculate what the future will be.]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
Technodrome has quit [Remote host closed the connection]
conta has joined #ruby
Technodrome has joined #ruby
leitz has joined #ruby
<leitz>
Okay, newbie question. My plan is to build a gem with a couple of programs that can be run from anywhere on the filesystem. For example, put in /usr/local/bin. How do I ensure the path to the data files needed are always set for the programs?
suukim has quit [Ping timeout: 272 seconds]
fphilipe has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
fphilipe has joined #ruby
<skarlso>
you use ruby's environment instead of a binary under /usr/local/bin to find binaries ,or you create a shim which loads your installed gem and executes some code from there
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<leitz>
Okay, seems like I have some reading and figuring out to do. Thanks!
fphilipe has joined #ruby
<skarlso>
np
Thenekofell has quit [Ping timeout: 252 seconds]
Cork has quit [Ping timeout: 245 seconds]
<Tuor>
Hi, I loaded a YAML file into an object called 'lxc'. It contains a list containers and a lot of information fields about the containers. Know I would like to look for keys in the object. LXC is an arary, but is shurely containing other arrays, hashes, strings. I would like to print the array entry which contains a hash with a key name matching a regex. I tried to google recursiv lookup but it seems, it's more complicated then I thought.
Cork has joined #ruby
<Tuor>
I tried to list all names like this, but I get only one name: `names = Array.new; lxc.each { |item| names =+ item['container']['name'] }`
<Tuor>
ah with map instead of each it works. :) I have to check documentation about map and each...
<Tuor>
but that's not very readable in my opinion^^
<Tuor>
i tried dig and it's longer but more readable now: `imgs = Hash.new; lxc.map { |item| name=item.dig('container', 'name'); img=item.dig('container', 'config', 'image.description'); imgs[name]=img }`
cellmaker has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
<Tuor>
thx.
cd has quit [Quit: cd]
queip has quit [Ping timeout: 258 seconds]
Selvaraj has joined #ruby
ZAJDAN has joined #ruby
<ZAJDAN>
in ruby 2.3.0 I use 'system('mkdir', '-p', File.join("#{path}/SAP"), File.join("#{path}/CAD"), File.join("#{path}/NEST"), File.join("#{path}/ORDER") ) unless File.exists?(@commission.commission_num)' in Ruby 2.3.3 is problem..returns: TypeError (no implicit conversion of Fixnum into String)
queip has joined #ruby
<ZAJDAN>
I would like to use something like: system('mkdir -p test/{SAP,CAD,NEST,ORDER}') .but it does not create the subfolders
jenrzzz has quit [Ping timeout: 244 seconds]
xco has quit [Quit: xco]
jenrzzz has joined #ruby
xco has joined #ruby
aupadhye is now known as aupadhye|brb
schne1der has quit [Ping timeout: 272 seconds]
AJA4350 has joined #ruby
xco has quit [Quit: xco]
cellmaker has quit [Quit: cellmaker]
yalue has joined #ruby
xco has joined #ruby
Tuor has quit [Remote host closed the connection]
aupadhye|brb is now known as aupadhye
tpanarch1st has quit [Quit: Thanks for your help, nice to see you, take care.]
<phaul>
Any reason to fork sub-processes/shells for this? I would just use the Dir class
<phaul>
if you are pasting path segments together into a string like "#{path}/CAD" there isn't much point in calling File.join on it.. It would just give back the same string
Selvaraj has quit [Remote host closed the connection]
<phaul>
the point would be to pass the segments to join as separate arguments, so it can use the system specific path separator
Swyper has joined #ruby
involans has joined #ruby
queip has quit [Ping timeout: 246 seconds]
Swyper has quit [Remote host closed the connection]
howdoi has quit [Quit: Connection closed for inactivity]
aphprentice__ has quit [Quit: Connection closed for inactivity]
queip has joined #ruby
mkaito_ has joined #ruby
aupadhye has quit [Ping timeout: 244 seconds]
<ZAJDAN>
phaul: thank You
RiPuk has quit [Read error: Connection reset by peer]
tf2ftw has joined #ruby
RiPuk has joined #ruby
Swyper has joined #ruby
jmcgnh_ has joined #ruby
jmcgnh has quit [Ping timeout: 248 seconds]
jmcgnh_ is now known as jmcgnh
jenrzzz has quit [Ping timeout: 248 seconds]
Rapture has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
ElFerna has joined #ruby
Swyper has joined #ruby
ElFerna has quit [Client Quit]
alem0lars_ has joined #ruby
conta has quit [Ping timeout: 258 seconds]
conta1 is now known as conta
alem0lars has quit [Ping timeout: 258 seconds]
schne1der has joined #ruby
tdy has quit [Ping timeout: 248 seconds]
alem0lars__ has joined #ruby
BrianWGray has joined #ruby
alem0lars_ has quit [Ping timeout: 245 seconds]
drnerdius has joined #ruby
<Bish>
how do people regulary encode fields in csv that have multiple values
<Bish>
like an array
<Bish>
in this case it's string it could be comma separated itself, but that's od
<ryouba>
Bish: so use quotation
<Bish>
well, okay
<havenwood>
Bish: Switch to JSON? :P
<Bish>
well, as you can expect csv wasn't my choice, and json is not making me happy in any way either
<Bish>
well, in some ways, but not all
<Bish>
also how do you encode much data with json?
<Bish>
one big array? one document per line?
Azure has quit [Ping timeout: 244 seconds]
<havenwood>
Bish: Folk do it both ways. In WireShark, for example, the .ek format is a JSON doc per line. That can be reasonable for *huge* run-on formats.
<Bish>
i've done that in private a lot of time where nobody was watching
<Bish>
never expected it to be used somewhere as "format"
<havenwood>
haha
involans has quit [Quit: involans]
absolutejam has quit [Read error: Connection reset by peer]
involans has joined #ruby
absolutejam has joined #ruby
aupadhye has joined #ruby
Azure has joined #ruby
lucasb has joined #ruby
unixcat has joined #ruby
Swyper has quit [Remote host closed the connection]
involans has quit [Ping timeout: 248 seconds]
Swyper has joined #ruby
involans has joined #ruby
dbugger has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
icholy has joined #ruby
<icholy>
when using "xmlrpc/server" is there a way to return a different http status code than 200?
ivlioioilvi has quit [Remote host closed the connection]
ivlioioilvi has joined #ruby
ivlioioilvi has quit [Remote host closed the connection]
jenrzzz has joined #ruby
ivlioioilvi has joined #ruby
ivlioioilvi has quit [Max SendQ exceeded]
Technodrome has joined #ruby
<icholy>
havenwood: so no?
tf2ftw has quit [Quit: This computer has gone to sleep]
aupadhye has quit [Quit: Leaving]
icholy has left #ruby [#ruby]
involans has quit [Quit: involans]
tf2ftw has joined #ruby
fphilipe has quit [Ping timeout: 245 seconds]
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 276 seconds]
matheusmoreira has joined #ruby
openstruct has joined #ruby
<openstruct>
I've been reading through all the "don't use Ruby timeout" blog posts and I'm not sure how I see that it's unsafe if I'm explicitly rescuing Timeout::Error every time I use it?
<openstruct>
Is it still problematic because it can cause a client from a connection pool to be corrupted?
jenrzzz has quit [Ping timeout: 246 seconds]
DTZUZO has joined #ruby
DTZUZO has quit [Ping timeout: 246 seconds]
involans has joined #ruby
duderonomy has joined #ruby
leeijaw has joined #ruby
leeijaw has left #ruby [#ruby]
xco has quit [Quit: xco]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tf2ftw has quit [Quit: This computer has gone to sleep]
tf2ftw has joined #ruby
absolutejam has quit [Ping timeout: 248 seconds]
alem0lars has joined #ruby
LtHummus has quit [Ping timeout: 268 seconds]
LtHummus has joined #ruby
deepredsky has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
absolutejam has joined #ruby
plujon has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Galopin has joined #ruby
Galopin has left #ruby [#ruby]
jackChronicle has joined #ruby
Azure has joined #ruby
jackChronicle has left #ruby [#ruby]
<plujon>
I'm interested in embedding ruby in a C program. Where can I find good documentation for rb_* such as rb_load ?
ascarter has joined #ruby
Azure has quit [Read error: Connection reset by peer]
<plujon>
I'm looking for rb_eval or something similar, that would allow me to evaluate a script that is embedded in the executable as a plain old C string.
<plujon>
Oh! I see rb_eval_string in ruby.h; I'll give that a try.
involans has joined #ruby
sameerynho has joined #ruby
fphilipe has joined #ruby
<plujon>
It works! Now, to figure out how to compile the thing on Windows...
tf2ftw has quit [Quit: This computer has gone to sleep]
tf2ftw has joined #ruby
leitz has quit [Quit: Leaving]
deepredsky has quit [Ping timeout: 248 seconds]
Azure has joined #ruby
fphilipe has quit [Ping timeout: 250 seconds]
conta2 has joined #ruby
tf2ftw has quit [Quit: This computer has gone to sleep]
conta2 has quit [Ping timeout: 245 seconds]
tf2ftw has joined #ruby
lxsameer has quit [Ping timeout: 248 seconds]
involans has quit [Remote host closed the connection]
involans has joined #ruby
mochiyoda has joined #ruby
Goon6 has joined #ruby
d^sh has quit [Ping timeout: 258 seconds]
d^sh has joined #ruby
jenrzzz has joined #ruby
Technodrome has joined #ruby
yalue has quit [Quit: Leaving]
conta has quit [Quit: conta]
involans has quit [Quit: involans]
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
queip has quit [Ping timeout: 272 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
mochiyoda has left #ruby ["Konversation terminated!"]
tf2ftw has quit [Quit: This computer has gone to sleep]
tf2ftw has joined #ruby
queip has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
Thenekofell has joined #ruby
codefriar has quit [Ping timeout: 246 seconds]
oncall-pokemon has joined #ruby
wald0 has quit [Quit: Lost terminal]
reber has quit [Read error: Connection reset by peer]
codefriar has joined #ruby
alem0lars has quit [Remote host closed the connection]
involans has joined #ruby
sameerynho has quit [Ping timeout: 268 seconds]
codefriar has quit [Remote host closed the connection]
codefriar has joined #ruby
crankharder has joined #ruby
ellcs has quit [Remote host closed the connection]
tf2ftw has quit [Quit: This computer has gone to sleep]
involans has quit [Read error: Connection reset by peer]
sameerynho has joined #ruby
fphilipe has quit [Ping timeout: 250 seconds]
evdubs has quit [Quit: Leaving]
ledhed2222 has joined #ruby
evdubs has joined #ruby
<ledhed2222>
i just wrote a lil script where i wanted to trap some signals. #til about Signal.trap as opposed to rescuing SignalException and re-raising. Ruby is the only lang I’ve ever worked with that exposes signals as exceptions in this way. I’m curious whether anyone has a rule-of-thumb for which approach to take when trapping signals?
<adam12>
ledhed2222: Can't say I've ever seen SignalException rescued in the wild before...
hi has joined #ruby
<ledhed2222>
yeah i haven’t seen any ruby code in the wild that traps signals in the first place. so you think that one should just use Signal.trap 100% of teh time?
hi has quit [Remote host closed the connection]
sgen has joined #ruby
sameerynho has quit [Ping timeout: 246 seconds]
<adam12>
ledhed2222: I've only see Signal.trap used. I'm presuming there's a reason for it.
<ledhed2222>
yeah that makes sense. it was always funky to me the way Ruby wraps sigs in exceptions. thanks dude!
involans has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
mochiyoda has joined #ruby
AJA4350 has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 258 seconds]
ledhed2222 has quit [Quit: ledhed2222]
al2o3-cr has quit [Quit: If the universe is a machine where the future is uniquely determined by its present state, it would not be possible to calculate what the future will be.]
jinie has joined #ruby
absolutejam has quit [Ping timeout: 258 seconds]
al2o3-cr has joined #ruby
brool has joined #ruby
noobineer has joined #ruby
jenrzzz has joined #ruby
crankharder has joined #ruby
AJA4350 has joined #ruby
AJA4351 has joined #ruby
skryking has quit [Quit: WeeChat 2.4]
AJA4350 has quit [Ping timeout: 268 seconds]
skryking has joined #ruby
gell5 has quit [Read error: Connection reset by peer]
skryking has quit [Client Quit]
fuzzface has joined #ruby
AJA4351 has quit [Ping timeout: 246 seconds]
<brool>
in a sinatra modular app, can i access the app object's fields from a template?
<brool>
or do i have to pass them into :locals somehow
AJA4350 has joined #ruby
skryking has joined #ruby
moei has quit [Quit: Leaving...]
<adam12>
brool: Can you share some of your code? I'm not sure what an app object's fields are...
<brool>
1 sec
<adam12>
brool: The template (view) is rendered in the scope of the request. If you assign an instance variable, that will be available as well (instead of using locals). Using locals is more explicit tho and can be nicer in teams to know what's available in a view.
queip has quit [Ping timeout: 245 seconds]
fuzzface has quit [Quit: Leaving]
AJA4350 has quit [Ping timeout: 244 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<brool>
ok i was putting my instance variable assignment in the wrong scope
<brool>
i had it outside of any method
AJA4350 has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
Thenekofell has joined #ruby
leitz has joined #ruby
jenrzzz has joined #ruby
<leitz>
I'm building a gem that runs a sinatra app. The program uses data files. How do I arrange the gem install location so the program can find the data files?
<leitz>
Newbie question, I know. Happy to have a pointer to something to read.
Averna has joined #ruby
agent_white has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Averna has quit [Client Quit]
Thenekofell has quit [Ping timeout: 258 seconds]
oncall-pokemon has quit [Quit: Connection closed for inactivity]