Lytol has quit [Remote host closed the connection]
<marz_d`ghostman>
expect_any_instance_of(Kernel).to receive(:`).with(mirror.pre_cmd) doesn't seem to cut it
arkaros has quit [Ping timeout: 252 seconds]
rishispeets has quit [Quit: WeeChat 1.9.1]
rspades has joined #ruby
MoritaShinobu has joined #ruby
dinfuehr_ has quit [Ping timeout: 246 seconds]
dinfuehr has joined #ruby
reber has joined #ruby
akem has quit [Remote host closed the connection]
akem has joined #ruby
helpa has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
arkaros has joined #ruby
tfitts_ has quit [Quit: Connection closed for inactivity]
elphe has joined #ruby
venmx has joined #ruby
ta_ has joined #ruby
sauvin has joined #ruby
ta_ has quit [Remote host closed the connection]
aupadhye has joined #ruby
Sup3rLurk has joined #ruby
SuperL4g_ has joined #ruby
pabs has quit [Ping timeout: 244 seconds]
SuperLag has quit [Ping timeout: 245 seconds]
SuperL4g has quit [Ping timeout: 268 seconds]
DTZUZO has joined #ruby
faitswulff has joined #ruby
aufi_ has joined #ruby
DTZUZO has quit [Ping timeout: 272 seconds]
maufart__ has joined #ruby
faitswulff has quit [Ping timeout: 240 seconds]
Freshnuts has quit [Quit: Leaving]
aufi_ has quit [Ping timeout: 245 seconds]
moei has quit [Read error: Connection reset by peer]
moei has joined #ruby
duderonomy has joined #ruby
maufart__ has quit [Ping timeout: 268 seconds]
duderonomy has quit [Client Quit]
aufi has joined #ruby
edwardly has quit [Quit: ??????????]
arkaros has quit [Ping timeout: 272 seconds]
edwardly has joined #ruby
aufi_ has joined #ruby
aufi has quit [Ping timeout: 252 seconds]
arkaros has joined #ruby
venmx has quit [Ping timeout: 268 seconds]
arkaros has left #ruby [#ruby]
clemens3 has quit [Ping timeout: 244 seconds]
<marz_d`ghostman>
I have this test: http://termbin.com/tpcy but it seems to pass whether I put expect_any_instance_of(DB).to receive(:update_sync_result_status) or expect_any_instance_of(DB).not_to receive(:update_sync_result_status)
duderonomy has joined #ruby
aufi_ has quit [Read error: Connection reset by peer]
dinfuehr has quit [Quit: ZNC 1.6.3+deb1ubuntu0.1 - http://znc.in]
dinfuehr has joined #ruby
schneider has joined #ruby
tdy has joined #ruby
schneider has quit [Quit: WeeChat 2.0.1]
rspades has quit [Ping timeout: 252 seconds]
rspades has joined #ruby
dbz has joined #ruby
d^sh_ has quit [Ping timeout: 246 seconds]
d^sh has joined #ruby
TomyLobo has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
tdy has quit [Ping timeout: 268 seconds]
wojnar has joined #ruby
faitswulff has joined #ruby
VladGh has joined #ruby
mzo has joined #ruby
rspades_ has joined #ruby
rspades has quit [Ping timeout: 252 seconds]
wojnar has quit [Quit: Leaving]
AJA4350 has joined #ruby
[spoiler] has joined #ruby
[spoiler] has quit [Client Quit]
[spoiler] has joined #ruby
rwb has quit [Ping timeout: 245 seconds]
nowhere_man has quit [Ping timeout: 268 seconds]
bkxd has quit [Ping timeout: 244 seconds]
DTZUZO has joined #ruby
bmurt has joined #ruby
faitswulff has quit [Remote host closed the connection]
faitswulff has joined #ruby
mzo has quit [Quit: b-bye :3]
nowhere_man has joined #ruby
<z64>
marz_d`ghostman: the receiver of methods defined with module_function is the class; `expect(MyClass).to receive(foo)` would expect that `MyClass.foo` is called
<z64>
*`receive(:foo)`
<za1b1tsu>
How would you name a module that contains methods for file manipulation?
<za1b1tsu>
FileLib?
McSoFake has quit [Ping timeout: 252 seconds]
bkxd has joined #ruby
dmitch has joined #ruby
nickjj has quit [Read error: Connection reset by peer]
snickers has quit [Ping timeout: 252 seconds]
nickjj has joined #ruby
faitswulff has quit [Remote host closed the connection]
tdy has joined #ruby
sheepman has quit [Read error: Connection reset by peer]
sheepman has joined #ruby
rwb has joined #ruby
pulgolino has quit [Remote host closed the connection]
faitswulff has joined #ruby
chouhoulis has joined #ruby
rspades_ has quit [Ping timeout: 252 seconds]
faitswulff has quit [Ping timeout: 252 seconds]
vondruch has joined #ruby
tdy has quit [Ping timeout: 252 seconds]
Rapture has joined #ruby
pskosinski_ has joined #ruby
apparition has joined #ruby
pskosinski has quit [Read error: Connection reset by peer]
hays has quit [Read error: Connection reset by peer]
hays_ has joined #ruby
jtdowney has quit [Quit: Ping timeout (120 seconds)]
pskosinski_ is now known as pskosinski
zenspider has quit [Ping timeout: 260 seconds]
gsingh93 has quit [Ping timeout: 260 seconds]
Scient has quit [Ping timeout: 260 seconds]
jtdowney has joined #ruby
zenspider has joined #ruby
Scient has joined #ruby
gsingh93 has joined #ruby
faitswulff has joined #ruby
mike11 has quit [Quit: Leaving.]
DTZUZO has quit [Ping timeout: 240 seconds]
krawchyk has joined #ruby
krawchyk has quit [Client Quit]
aupadhye has quit [Quit: Leaving]
queelius has quit [Quit: Leaving]
aufi has quit [Ping timeout: 250 seconds]
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
rspades_ has joined #ruby
AllenTristan has joined #ruby
conta1 has joined #ruby
nowhere_man has quit [Ping timeout: 245 seconds]
AllenTristan has left #ruby [#ruby]
snickers has joined #ruby
conta1 has quit [Remote host closed the connection]
openstruct has joined #ruby
openstruct has quit [Quit: Page closed]
troys has joined #ruby
faitswulff has quit [Remote host closed the connection]
elphe has quit [Ping timeout: 268 seconds]
Puffball has quit [Remote host closed the connection]
orbyt_ has joined #ruby
cd has joined #ruby
orbyt_ has quit [Client Quit]
apparition has quit [Quit: Bye]
tdy has joined #ruby
faitswulff has joined #ruby
[spoiler] has quit [Quit: Cheers!]
[spoiler] has joined #ruby
[spoiler] has quit [Client Quit]
[spoiler] has joined #ruby
yohji has quit [Remote host closed the connection]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akem has quit [Remote host closed the connection]
akem has joined #ruby
<TheNet>
what's an elegant way to handle boolean env vars in a rails config?
<sonne>
i usually consider any nonempty value as true
nofxx has quit [Read error: Connection reset by peer]
<sonne>
the only boolean thing about env vars is being set or not being set, so i adopt that - not necessarily the best thing to do though
nofxx_ has joined #ruby
<TheNet>
sonne: I don't think FOO=false is that uncommon
ivanskie has joined #ruby
tdy has quit [Ping timeout: 252 seconds]
<TheNet>
my rails is slow due to stdout backpressure—if I reduce logging or hide my rails terminal pane I get a significant performance boost. anyone have any details on this?
weaksauce has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<TheNet>
hmm, can I increase the stdout buffer
tdy has joined #ruby
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
dbz has joined #ruby
troulouliou_div2 has quit [Read error: Connection reset by peer]
akem has quit [Remote host closed the connection]
akem has joined #ruby
doubledup has joined #ruby
chouhoulis has quit [Remote host closed the connection]
dviola has joined #ruby
TACTICALNEURALIM has joined #ruby
<TACTICALNEURALIM>
Quick question
<TACTICALNEURALIM>
how do I get a controller to render existing json?
mike11 has joined #ruby
<TACTICALNEURALIM>
render :json foo tries to JSONify foo. Foo is already JSON. I cannot remember how this is done and my searches keep finding irrelevant stuff
nowhere_man has joined #ruby
<TACTICALNEURALIM>
oops wrong channel. My mistake
nofxx_ has quit [Remote host closed the connection]
nofxx_ has joined #ruby
sameerynho has joined #ruby
nofxx_ has quit [Read error: Connection reset by peer]
nofxx has joined #ruby
dreamthese has quit [Remote host closed the connection]
dreamthese has joined #ruby
TACTICALNEURALIM has quit [Quit: Page closed]
dviola has quit [Quit: WeeChat 2.2]
dviola has joined #ruby
nofxx has quit [Ping timeout: 252 seconds]
nofxx has joined #ruby
fluxAeon has joined #ruby
Puffball has joined #ruby
fredlinhares has joined #ruby
SeepingN has joined #ruby
dbz_ has joined #ruby
istrasci has quit [Ping timeout: 256 seconds]
dbz has quit [Ping timeout: 252 seconds]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ivanskie has joined #ruby
dellavg_ has joined #ruby
dbz_ has quit [Remote host closed the connection]
dbz has joined #ruby
dbz_ has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
RougeR has joined #ruby
mike11 has quit [Quit: Leaving.]
elphe has joined #ruby
sauvin has quit [Remote host closed the connection]
za1b1tsu has quit [Ping timeout: 252 seconds]
elphe has quit [Ping timeout: 252 seconds]
weaksauce has joined #ruby
sgen has joined #ruby
postmodern has joined #ruby
nowhere_man has quit [Ping timeout: 272 seconds]
agent_white has joined #ruby
sgen has quit [Ping timeout: 240 seconds]
MoritaShinobu has quit [Quit: Leaving]
cliluw has quit [Read error: Connection reset by peer]
leafyleong has quit [Ping timeout: 252 seconds]
cliluw has joined #ruby
za1b1tsu has joined #ruby
dbz_ has quit [Ping timeout: 272 seconds]
chouhoulis has joined #ruby
johnny56 has quit [Ping timeout: 272 seconds]
chouhoulis has quit [Ping timeout: 245 seconds]
<cthu|>
so folks
<cthu|>
I had this issue yesterday
<cthu|>
when I can't open a file for reading
<cthu|>
and Ruby says the file doesn't exist
<cthu|>
although if I do byebug right before I open it for reading and check if it exists, it does
<cthu|>
I use the exact same path expression to check and to open
<cthu|>
hell, Ruby, why are you not smart enough to understand whether the path is relative or absolute on your own?
<cthu|>
Hint: if it starts from / or ~, it's absolute
<cthu|>
oh, no, it's different
<cthu|>
Ruby doesn't expand path
<cthu|>
that's what I'm having
<cthu|>
I need to ask it to do so explicitly
pulgolino has joined #ruby
<cthu|>
see? I also can help someone on this channel
<cthu|>
kek
nofxx_ has quit [Ping timeout: 245 seconds]
nofxx has joined #ruby
nofxx_ has joined #ruby
sgen has quit [Ping timeout: 252 seconds]
nofxx has quit [Ping timeout: 260 seconds]
sgen has joined #ruby
Xiti has quit [Quit: Xiti]
leafyleong has joined #ruby
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<cthu|>
yes, that was the reason
ruurd has joined #ruby
Xiti has joined #ruby
<zenspider>
glad you had this conversation...
nowhere_man has joined #ruby
<cthu|>
always yours
<cthu|>
spreading wisdom
<zenspider>
I'm not so sure about that part...
<cthu|>
sure you're not
<cthu|>
how would you know
<cthu|>
no, the world for you has to seem too stupid
<zenspider>
to clarify, File.open and File.exist? use whatever you give them, whether that's releative or absolute, they don't care. File.expand_path, by definition, results with an absolute path. So, you need to either use it on both or neither to have an apples-to-apples comparison
<baweaver_away>
likely not something you want to... Na, nevermind.
baweaver_away is now known as baweaver
<zenspider>
don't push it...
<cthu|>
okay
<cthu|>
...
<cthu|>
so it is smart enough to parse the path and know whether it's absolute or relative?]
<zenspider>
nope. it just uses whatever string you hand it
<cthu|>
errr
<cthu|>
and it uses it as what?
<cthu|>
as relative path, I believe
<baweaver>
Does it start with a / ?
<cthu|>
just like require does
<cthu|>
which is why we have require_relative
<zenspider>
as a path
<cthu|>
so require is not smart enough to know whether the path is absolute or relative
<zenspider>
File.open opens a path
<zenspider>
it doesn't parse anything
<cthu|>
errr
<cthu|>
as local path
<zenspider>
as path
<cthu|>
you really don't make any sense
<baweaver>
cthu| Does it start with a slash?
<baweaver>
Yes: Absolute path. No: Relative path
<cthu|>
baweaver, it doesn't
<zenspider>
baweaver: doesn't matter. File.open and File.exist? don't parse anything
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<zenspider>
they just make system calls to do the thing
<cthu|>
baweaver, thanks
<cthu|>
that's what I thought
<zenspider>
path is a path
<cthu|>
consistent with require
<SeepingN>
you do have a "current working directory" and you can change it
<cthu|>
I do
<zenspider>
and it is NOT consistent with require...
<cthu|>
what does it change?
<SeepingN>
your current working directory. lol
<cthu|>
and?
<SeepingN>
where relative things are telative to
<cthu|>
indeed
<SeepingN>
just like the command line
<cthu|>
but that is not the question
<cthu|>
the question is whether the argument is relative or absolute
<SeepingN>
but it is fundumental to understanding wtf is going on
<SeepingN>
it is absolute if the string starts with a /
<cthu|>
ok, I know that
<cthu|>
okay?
<SeepingN>
so there you go
<zenspider>
and the answer is and has been: it doesn't matter. it's a path
<cthu|>
no, you didn't get the question
<zenspider>
I get it just fine
<cthu|>
the question is whether the function expects the relative or the absolute path
<zenspider>
you don't get the ramifications of what I'm saying
<zenspider>
I've answered that. three times
<SeepingN>
if the path is "somefolder/somesubfolder/x" the aboslute path is $cwd/somefolder/somesubfolder/x
<zenspider>
you're inability to listen to my answer is beside the point
<cthu|>
SeepingN, it's not the answer
<cthu|>
SeepingN, oh
<cthu|>
so it's smart enough to parse it
<SeepingN>
no
<zenspider>
FFS
<cthu|>
and use different behavior depending on whether there is a / or no
<zenspider>
no no and no
<cthu|>
zenspider, feel free to quit repeating same stuff over and over. it's not helpful
<cthu|>
SeepingN, why no?
<zenspider>
I could say the same to you. My inability to distinguish you from a basic troll right now isn't helping your case to get help
<SeepingN>
if it doesn't start with / or ~, prepend your current path to get "the absolute path". that may or may nto lead to a valid file or directory depending on where you are. So ok sure, it's smart enough to do that.
<cthu|>
zenspider, just ignore me. you don't seem to be able to help.
<baweaver>
cthu| Oi
<baweaver>
Uncalled for.
<cthu|>
very called
<zenspider>
!kick cthu|
<cthu|>
like I'm a problem here, right?
* baweaver
checks watch
* baweaver
stares at bot
<zenspider>
wtf bot
<cthu|>
SeepingN, thank you
<cthu|>
that's what I wanted to find out
<cthu|>
zenspider, you actually were misleading
<baweaver>
!kick cthu|
<zenspider>
nope. I actually wasn't.
<SeepingN>
you need to read up on the File dox
<baweaver>
Hrm, doesn't like me either for the moment
<cthu|>
SeepingN, I'm aware about working directory
<zenspider>
well... it was... looks like rubygems rewrote it?
<SeepingN>
$LOAD_PATH
<zenspider>
if you do a relative path for require, you need to supply the extension as well
<SeepingN>
oops. $LOAD_PATH is where it looks when you don't give it a file path and just a 'name'
<cthu|>
I ended up not using require at all
<cthu|>
I use require_relative all the time.
<cthu|>
I honestly don't understand why it's not flipped
<cthu|>
it should be require and require_absolute
sgen has quit [Ping timeout: 272 seconds]
<SeepingN>
may be best if you're tinkering and don't have a "real official server environemnt" set up / defined
<cthu|>
in what world would you want explicitly absolute require. It's a bit weird
<cthu|>
SeepingN, but that's very beginning
johnny56 has joined #ruby
<SeepingN>
I suspect most requires dont have paths at all
<cthu|>
oh, right
<cthu|>
cuz they require from gems
<SeepingN>
√
dviola has quit [Quit: WeeChat 2.2]
<cthu|>
I think require is just a question of legacy
<cthu|>
or maybe it's fixed in newer versions
<cthu|>
I'm on 2.2 still
<havenwood>
cthu|: On modern Ruby, "." isn't in $LOAD_PATH.
<zenspider>
heh. where "modern" is the last... what... 10+ years?
* havenwood
tries to remember back as far as 1.8
<zenspider>
1.8 had "."... 1.9 did not iirc
elphe has joined #ruby
<havenwood>
Yeah, that's my recollection as well.
<zenspider>
broke some of my stuff. 1.9 was a disaster in so many ways
SuperL4g_ is now known as SuperLag
<za1b1tsu>
what do you folks recommend for a light object return object: BasicObject, Hash, OpenStruct, or custom Object with just some attributes?
<zenspider>
tho I wish they'd still do the shim thing for upcoming versions
<SeepingN>
we went from 1.8.6 to 1.8.7 and even that was a nightmare for my handful of scripts
<havenwood>
za1b1tsu: Struct
<havenwood>
za1b1tsu: But really, say more about what you're doing.
<cthu|>
what . are you talking about?
<SeepingN>
. = current directory
<cthu|>
oh, right
<zenspider>
za1b1tsu: what are your goals?
<havenwood>
cthu|: In your REPL, take a look at: $LOAD_PATH
<za1b1tsu>
havenwood: I sending data from a function to a function, I would like to use good practices. I am using yard for documentation and I was having problem with docuemnting @return Hash. After some reading it seems returning Hashes is not a good practice.
rwb has quit [Ping timeout: 272 seconds]
<zenspider>
za1b1tsu: use real / ordinary objects wherever possible.
<zenspider>
I wouldn't recommend struct for normal use. They have too many gotchas
sgen_ has quit [Remote host closed the connection]
<zenspider>
I use struct for quick prototyping... and avoid it otherwise
sgen_ has joined #ruby
<havenwood>
cthu|: You'll see there's not a "." by default in $LOAD_PATH in Ruby 1.9+.
<havenwood>
cthu|: So "." isn't one of the places #require is checking.
<za1b1tsu>
zenspider: what about a BasicObject with just some attributes implementations?
<zenspider>
za1b1tsu: to what end? what are you trying to avoid?
<za1b1tsu>
bloat
elphe has quit [Ping timeout: 245 seconds]
<zenspider>
it doesn't matter if your object subclasses BasicObject or Object. They'll hold onto whatever you make them hold onto. That's not bloat, that's need. If you don't make them hold onto superfluous stuff, and nothing extra holds onto them (like closures), they'll be fine
<zenspider>
stick to the simplest thing that could possibly work, until you have evidence/measurements that say you should do otherwise
<havenwood>
cthu|: Note, I'm using `__dir__` not `Dir.pwd`.
<za1b1tsu>
good advice zenspider, cheers
<zenspider>
za1b1tsu: one way to look is to try something like this: /usr/bin/time -l ruby -e 't0 = Time.now; 10_000_000.times do BasicObject.new end; p Time.now - t0'
<zenspider>
on my laptop, on battery, I take just about 1 second to produce 10m objects whether it is BasicObject or Object. The maximum resident set size doesn't change either.
<SeepingN>
havenwood: nice
roshanavand has joined #ruby
<za1b1tsu>
zenspider: wow, Hashes are way slower then Object
<za1b1tsu>
when I do class Something. It inherits from Object correct? So it should be faster then Hashes
<zenspider>
hash literals need to be copied on every instantiation, but they shouldn't be that slow
<zenspider>
doing the above cmdline replacing Object.new with {} results in it being 60% faster
<zenspider>
but adding stuff to the hash? makes it not an apples-to-apples comparison. It slows down to ~3.7 seconds on my side
<za1b1tsu>
ahh I was using Hash.new
<havenwood>
za1b1tsu: BasicObject is a bit too basic for most use. I'd start thinking from Object.
<zenspider>
za1b1tsu: Hash.new is a const lookup + method call... takes 4.19 seconds on my side. {} is a static hash in the bytecode + dup
<havenwood>
za1b1tsu: Structs are a nice way to prototype, and they keep arbitrary keys from getting in the mix.
<zenspider>
Hash.new will be closer to reality as you'll make some class of your own and instantiate on it
<zenspider>
havenwood: and have nasty gotchas like to_a
<zenspider>
really really really dislike that. it's bit me on many occasions
<zenspider>
I want a superclass BasicStruct that is pretty much just initialize + attr_accessor
<zenspider>
I'd use the fuck out of that
<za1b1tsu>
can't that be made from BasicObject?
<zenspider>
it can... but it won't have the C speeds I want :P
<zenspider>
well... and no. I don't want it off of BasicObject... that's TOO basic
<zenspider>
BasicObject is for when you want something that's not really object-like... usually proxy objects and the like
dviola has joined #ruby
clemens3 has joined #ruby
ta_ has joined #ruby
ta_ has quit [Ping timeout: 252 seconds]
nowhere_man has quit [Ping timeout: 252 seconds]
DTZUZO has joined #ruby
sgen_ has quit [Ping timeout: 240 seconds]
weaksauce has quit [Read error: Connection reset by peer]
snickers has quit [Read error: Connection reset by peer]
tdy has quit [Ping timeout: 245 seconds]
<Eiam>
zenspider: OpenStruct?
<zenspider>
Eiam: oooonly for rapid prototyping. And I will use Struct 99% of the time for that. OpenStruct is overly magical
<Eiam>
rubyist generally love magic tho
* Eiam
tosses out rainbows
wojnar has quit [Remote host closed the connection]
rwb has joined #ruby
tdy has joined #ruby
tag has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
ta_ has joined #ruby
<zenspider>
Eiam: Some certainly do. And in general, their code is bloated and slow.
chouhoulis has joined #ruby
doubledup has quit [Remote host closed the connection]