irdr_ has quit [Remote host closed the connection]
irdr has joined #ruby
<mkroman>
jeez, applying a consistent style in Ruby is actually quite difficult
<orbyt_>
lint?
<mkroman>
I mean because different parts have different syles
<mkroman>
styles
v01d4lph4 has quit [Remote host closed the connection]
<mkroman>
like, `puts` I wouldn't use parentheses with, because it's in Kernel, so it's almost like a keyword
<mkroman>
but what if it's an instance method? like Logger#puts?
<mkroman>
I guess I'd use parantheses then
<havenwood>
mkroman: rubocop suggests a reasonable style
<havenwood>
mkroman: i just don't use parens
<havenwood>
(unless it breaks the interpreter)
<mkroman>
then there's gemspecs - in the official rubygems docs, in the Gem::Specification.new block, they don't use parentheses, does that only apply to the gemspec? or does that apply to anything that resembles a DSL?
<mkroman>
havenwood: yeah, I avoided it as much as possible aswell
<mkroman>
as well
<havenwood>
mkroman: "Seattle style" is to use no parens.
valadares has joined #ruby
<mkroman>
also, rubocop doesn't suggest a reasonable style
<mkroman>
executables/blur:6:1: C: Style/MethodCallWithArgsParentheses: Use parentheses for method calls with arguments.
<mkroman>
require 'optparse'
<mkroman>
No. just No.
octos has quit [Remote host closed the connection]
<havenwood>
mkroman: That's not a default style is it these days?
<mkroman>
oh, wait a minute
<mkroman>
yeah, you're right, I was using `rubocop --only Style/MethodCallWithArgsParentheses` intentionally, and apparently that doesn't derive from defaults
<mkroman>
that's unexpected
Inline has quit [Quit: Leaving]
<mkroman>
sadly, as I have been growing older, I have come to the decision that the occasional ambiguity of my no-parentheses-style is not worth the awesomeness that is reading a line of code literally
<mkroman>
havenwood: what about when you're passing blocks?
<mkroman>
do you parentheses then?
<mkroman>
+use
<havenwood>
mkroman: no
asphyxia has joined #ruby
<havenwood>
mkroman: not with an arg before `do`, if that's what you mean?
<havenwood>
mkroman: granted, I follow the style of the repo I'm coding in when it's not just my own code
<havenwood>
i just very seldom think parens help me read the code
<mkroman>
havenwood: no, I mean passing a proc/lambda/w/e as an argument, like instance.method(&callback)
<havenwood>
mkroman: i sometimes follow strict Seattle style, where I omit those
<mkroman>
err, guess I should've said an instance of a block
<mkroman>
i c
<havenwood>
there are better things to get hung up on than parens, but I definitely err on the side of too few
sauvin has joined #ruby
<mkroman>
I think I've been on the side of being my own little snowflake for too long and now I just want to be like everyone else heh
<mkroman>
I don't want someone who's used to reading “standard” Ruby code to read my code and get even slightly confused by the lack of parentheses
<mkroman>
but then there's developers like you, who might read it slower just because you're used to the “Seattle style”
<mkroman>
le hmm.
marmotini_ has joined #ruby
coderphive has quit [Ping timeout: 240 seconds]
coderphive has joined #ruby
r29v has quit [Quit: r29v]
<mkroman>
are there any “success” stories with the 2.6 JIT-compiler?
coderphive has quit [Remote host closed the connection]
coderphive has joined #ruby
ItsAVortex has quit [Remote host closed the connection]
<mkroman>
but since it's essentially a block that is evaluated, and the only code that happens to be before the Blur::Script(name, &block) is usually `require` - how much should I care about dataraces?
<liya>
i have this doubt...
<mkroman>
when a script does a require, the code loaded is not expected to be reloaded until the process is restarted
<liya>
since Object is a class
<liya>
and a Class itself is an Object
<phaul>
not what you are asking, but better stay away from class variables
<liya>
Object also is an Object
<phaul>
mkroman: ^
<mkroman>
phaul: what's the alternative?
<phaul>
instance variable of singleton class?
<mkroman>
doesn't that just move the problem?
<phaul>
no. @@ is sonsidered to be broken and might be removed from ruby 3.0
<mkroman>
ah, ok
<mkroman>
what about an instance variable declared in a class?
<mkroman>
wouldn't that essentially be a class variable? is that also broken?
<liya>
<phaul> liya: everything is an Object except BasicObject :)
<phaul>
the BasicObject class is an Object as it's a class
<phaul>
&>> BasicObject.new.is_a? Object
<rubydoc>
# => undefined method `is_a?' for #<BasicObject:0x00005604fd0239f8> (NoMethodError) (https://carc.in/#/r/66zr)
<liya>
ah.. i get it
reber has quit [Remote host closed the connection]
za1b1tsu has quit [Ping timeout: 240 seconds]
nowhere_man has joined #ruby
nowhere_man has quit [Ping timeout: 240 seconds]
paranoicsan has quit [Quit: paranoicsan]
<phaul>
to clarify, the statement "everything is an object" probably predates BasicObject, from the times when you couldn't avoid having Object among your ancestors. Now if you are explicitly inherit from BasicObject you also avoid having Object. If you don't say any superclass, new classes implicitly inherit from Object
silent_freak has joined #ruby
aqd_ has joined #ruby
paranoicsan has joined #ruby
silent_freak has quit [Remote host closed the connection]
v01d4lph4 has joined #ruby
v01d4lph4 has quit [Remote host closed the connection]
v01d4lph4 has joined #ruby
v01d4lph4 has quit [Read error: Connection reset by peer]
v01d4lph4 has joined #ruby
<mkroman>
where can I ask my question about “relatively” reloadable user code other than here? or should I just ask at another time?
valadares has quit [Read error: Connection reset by peer]
<mkroman>
havenwood: I dunno how to explain it, but it feels like I'm trying to trap kiddies into my van when I write code that's like if respond_to? name; __send__ name, network, message; end vs. if respond_to?(name); __send__(name, network, message) end
valadares has joined #ruby
v01d4lph4 has quit [Ping timeout: 250 seconds]
Guest16678 has joined #ruby
blackmesa1 has quit [Ping timeout: 264 seconds]
Guest16678 has quit [Ping timeout: 246 seconds]
blackmesa1 has joined #ruby
asphyxia has quit [Ping timeout: 244 seconds]
RougeR has joined #ruby
<RougeR>
finally threw in the towel with RVM
<RougeR>
what a piece of shit, RbEnv is so much better
<RougeR>
rbenv uses shims and path, rvm edits cd and hooks itself in...with no error handling
blackmesa has joined #ruby
blackmesa1 has quit [Ping timeout: 264 seconds]
catbusters has joined #ruby
<mkroman>
RougeR: agreed
AJA4350 has joined #ruby
<RougeR>
mkroman, yah :) just got it all setup now
<RougeR>
very happy with it so far
<mkroman>
even for Python, the rbenv clone - pyenv - is so much better than virtualenv/whateverthefuck
<RougeR>
yeah i use pyenv too, but didnt realise there was a ruby equiv
<mkroman>
hah, funny
<mkroman>
I'm pretty confident rbenv is the predecessor of pyenv
<RougeR>
ironically my boss is trying to get me to move to windows....even though i do 90% ruby dev
<RougeR>
i dont get it
<mkroman>
:x
<RougeR>
mkroman, hm interesting
<RougeR>
yeah, the only time i have issues in ubuntu is shitty propietary software or when remoting into windows machines
<mkroman>
that said, scheduling jobs via cronjob or w/e for a specific version can be quite painful
<RougeR>
in rbenv?
<mkroman>
yeah.
<RougeR>
mmm not too much of an issue there, its just for my local dev work. most of my code i test in docker containers
Swyper has joined #ruby
<mkroman>
I use zsh as my shell and making any cronjob script that uses `ruby` is kind of out of the question - not sure how it works, but I think it defaults to bash and .bash_profile
<RougeR>
yeah i would think it does.
<RougeR>
ah okay yeah i just use bourne
<mkroman>
I'd eval "$(rbenv init -)" but rbenv might not be in the PATH at that point, and it'd add to the cronjob line, which is precious.
<RougeR>
can you not specify the path in the script?
<mkroman>
you can theoretically do the “export PATH=\"${HOME}/.rbenv/bin:${PATH}\"; eval \"$(rbenv init -)\"" in a cronjob
asphyxia has joined #ruby
Swyper has quit [Ping timeout: 246 seconds]
<mkroman>
provided it's a bash shell or whatever rbenv requires
<mkroman>
but.
Swyper has joined #ruby
<mkroman>
I *have* run several scripts using a cronjob script path a la ~/.rbenv/versions/2.4.1/bin/ruby script.rb
<mkroman>
and it does work as long as that version is installed for the cronjob user
<RougeR>
yeah i would think thats the case
Swyper has quit [Ping timeout: 268 seconds]
<RougeR>
as long as the user has permissions and its installed, there is likely a work around
<RougeR>
no one ever wrote tests for our api....and i refactored it all last week
<RougeR>
i aint releasing it without tests....
<RougeR>
i aint guna be the one who gets fucked when there's a bug
silent_freak has joined #ruby
paranoicsan has quit [Quit: paranoicsan]
<mkroman>
heh
<mkroman>
don't be overzealous
BH23 has quit [Ping timeout: 268 seconds]
akem__ has quit [Read error: Connection reset by peer]
akem__ has joined #ruby
xrexeon has quit [Remote host closed the connection]
stryek has joined #ruby
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
BH23 has joined #ruby
BH23 has quit [Remote host closed the connection]
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
BH23 has joined #ruby
lwwwr has joined #ruby
lwwwr has quit [Remote host closed the connection]
nfk has joined #ruby
roshanavand has joined #ruby
silent_freak has quit [Quit: My mac has gone to sleep zzz..]
zapata has quit [Read error: Connection reset by peer]
v01d4lph4 has joined #ruby
zapata has joined #ruby
lucasb has joined #ruby
troulouliou_div2 has joined #ruby
v01d4lph4 has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 240 seconds]
FastJack has quit [Remote host closed the connection]
blackmesa has joined #ruby
makara has quit [Ping timeout: 268 seconds]
marmotini_ has quit [Ping timeout: 245 seconds]
bruul has joined #ruby
<RougeR>
mkroman, i just want 100% coverage for the api and resque tasks
<RougeR>
thats my goal
<RougeR>
at the moment total coverage has got to be under 10%
<phaul>
RougeR: have you tried deep-cover? It's really good
<RougeR>
ive heard the name
<RougeR>
let me have a look
<RougeR>
phaul, looks very interesting given than i want coverage of certain areas too
Swyper has joined #ruby
<phaul>
I am playing with it currently and I like it
<RougeR>
mmm i think its worth investigating
<mkroman>
RougeR: sure, but if you have to rely on rbenv, it's kind of a half-assed assertion of the ruby standards (imo - i.e. executables in your PATH aren't guaranteed) and you might be better off testing against a docker image than rbenv scripts
<RougeR>
ill have a play with it tomorrow afternoon (dev free time)
<RougeR>
mkroman, yes i agree with that
<RougeR>
and i dont use any kind of ruby versioning in production
<RougeR>
think we run 2.4.1 pretty widely
<mkroman>
did you have a testing environment prior to you joining?
FastJack has joined #ruby
asphyxia has quit [Ping timeout: 268 seconds]
<RougeR>
we have one, weve got a pipeline etc
<RougeR>
but testing was never done well and was an afterthought. my first job as a dev was to test all the core task logic
nowhere_man has joined #ruby
<RougeR>
only 3 guys in our department and no way either of them are spending time writing test cases
<RougeR>
so ill do it lol
<RougeR>
ive put it off for a few months, while i learnt the codebase better
<RougeR>
theres also the 'threat' of us moving to .net core, which puts people off testing this code
planigan has quit [Ping timeout: 240 seconds]
conta has quit [Ping timeout: 246 seconds]
nowhere_man has quit [Ping timeout: 246 seconds]
paulscoder has quit [Quit: paulscoder]
status402 has joined #ruby
AJA4351 has joined #ruby
rippa has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
planigan has joined #ruby
ams__ has joined #ruby
gnufied has joined #ruby
BH23 has quit [Ping timeout: 240 seconds]
polishdub has joined #ruby
despai has joined #ruby
<despai>
hey people
<despai>
hello
<despai>
quick question
<despai>
how can I package a ruby application as a binary using the ruby jit compiler?
<kevinsjoberg>
Both Hash and Symbol implement `#to_proc`, both procs return an arity of `-1`. Why is this? They clearly only accept one argument. Calling `{a: 1}.to_proc.call(1, 2, 3)` raises an ArgumentError about unexpected number of argument.
<despai>
I want to distribute the executable as binary
Tempesta has quit [Read error: Connection reset by peer]
<kevinsjoberg>
Calling `:upcase.to_proc.call("asd", "asd", "asd")` will raise an ArgumentError about too many options.
Tempesta has joined #ruby
<despai>
(yarv mjit)
renich has joined #ruby
AKPWD has quit [Quit: じゃね。]
APK has joined #ruby
b6b has quit [Ping timeout: 250 seconds]
<RougeR>
despai, i dont think you can
foxxx0 has quit [Ping timeout: 250 seconds]
trif has quit [Ping timeout: 250 seconds]
b6b has joined #ruby
<despai>
RougeR why not? it actually precompiles to binary
<despai>
why shouldn't it be possible to export to file?
<despai>
and distribute?
trif has joined #ruby
foxxx0 has joined #ruby
Swyper has quit [Remote host closed the connection]
volkov has joined #ruby
<uplime>
wouldn't it precompile to some intermediary the vm generates? if it precompiled to native code there wouldn't be any reason to JIT it
<RougeR>
despai, yeah you can. but its not really the same thing
<RougeR>
have a look
<RougeR>
we would like to do a similar thing where i work
<Iambchop>
to distribute a program look at things like traveling ruby or ruby packer
valadares has quit [Read error: Connection reset by peer]
valadares has joined #ruby
spacesuitdiver has joined #ruby
fanta7531 has joined #ruby
conta has joined #ruby
regedit has joined #ruby
aupadhye has quit [Ping timeout: 250 seconds]
conta has quit [Remote host closed the connection]
conta has joined #ruby
conta has quit [Ping timeout: 246 seconds]
volkov has quit [Remote host closed the connection]
<headius>
RougeR: unfortunately despair left, but in theory a JIT could be used to precompile a whole program, especially one as minimal as the Ruby JIT
<headius>
despai
conta has joined #ruby
aufi has quit [Ping timeout: 244 seconds]
<phaul>
I'm curious to see how do you compile eval(gets) without embeding a full ruby interpreter
<phaul>
or at that point what't the point
conta has quit [Ping timeout: 240 seconds]
<lupine>
simplifies deployment
<phaul>
right but that's for ruby packer and alike. packaging is not compilation
<lupine>
I don't find a useful distinction TBH. you have a file that the environment interprets, and somewhere in that file is binary data representing your ruby code, surrounded by the full ruby executable + runtime
<lupine>
whether that's a .msi or .deb or an executable with mruby + your script, it's all the same
conta has joined #ruby
status402 has quit [Quit: status402]
<headius>
phage: well, eval always will limit AOT compilation
<phaul>
I think the distinction is the goal. you want a distributable thing, mjit wants to run ruby faster. Those goals are different
<headius>
if you need it you'd have to include the parser and interpreter too
<headius>
well, look at mruby
<headius>
it does a single binary...by serializing the Ruby instructions directly into C code
<headius>
is that AOT?
<headius>
JRuby 9.x AOT actually does the same thing, rather than precompiling to JVM bytecode
<headius>
single binary but it's not really compiled to "native"
lucasb has quit [Quit: Connection closed for inactivity]
krawchyk has joined #ruby
<Iambchop>
headius: I've never used the newer JRuby AOT stuff, but custom jruby-complete jars (and wars) to distribute programs (internally) improved my life; thanks for that :-)
marmotini_ has joined #ruby
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #ruby
<Iambchop>
I've used mruby to compile (simple) nagios check scripts, that's worked well
hiroaki has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
valadares has quit [Read error: Connection reset by peer]
valadares has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
bruul has quit [Ping timeout: 240 seconds]
renich has quit [Ping timeout: 245 seconds]
conta has quit [Quit: conta]
akem__ is now known as akem
hiroaki has joined #ruby
roshanavand_ has joined #ruby
bruul has joined #ruby
roshanavand_ has quit [Remote host closed the connection]
roshanavand has quit [Remote host closed the connection]
roshanavand_ has joined #ruby
xrexeon has joined #ruby
xrexeon has quit [Max SendQ exceeded]
xrexeon has joined #ruby
blackmesa has quit [Ping timeout: 250 seconds]
d10n-work has joined #ruby
<headius>
lambarena: ah yeah, basically the same thing...when people claim they want ahead-of-time compliation most of the time what they really want is just an all-in-one binary
marmotini_ has quit [Ping timeout: 245 seconds]
<headius>
oops lambchop
<headius>
who left
<headius>
😩
xrexeon has quit [Ping timeout: 246 seconds]
blackmesa has joined #ruby
jinie_ has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
marmotini_ has joined #ruby
jinie has quit [Ping timeout: 246 seconds]
jinie_ is now known as jinie
marmotini_ has quit [Ping timeout: 245 seconds]
BH23 has joined #ruby
<RougeR>
does anyone know how to test methods inside a block with minitest
<RougeR>
and i want to call expectations on the job
\void has joined #ruby
za1b1tsu has joined #ruby
fanta7531 has quit [Quit: fanta7531]
xrexeon has joined #ruby
blackmesa has joined #ruby
xrexeon has quit [Max SendQ exceeded]
nowhere_man has joined #ruby
blackmesa1 has joined #ruby
xrexeon has joined #ruby
catbusters has quit [Quit: Connection closed for inactivity]
agent_white has joined #ruby
blackmesa has quit [Ping timeout: 268 seconds]
troulouliou_div2 has quit [Remote host closed the connection]
AJA4350 has quit [Ping timeout: 246 seconds]
nowhere_man has quit [Ping timeout: 240 seconds]
r3m has quit [Quit: WeeChat 2.4-dev]
r29v has joined #ruby
<RougeR>
found away
r3m has joined #ruby
<RougeR>
:transaction is also a class method
<RougeR>
so in this scenario i think i can do Job.transaction { }
<RougeR>
and it should be identical
v01d4lph4 has joined #ruby
orbyt_ has joined #ruby
jmcgnh has quit [Quit: Bye for now!]
Dbugger has joined #ruby
jwr has joined #ruby
orbyt_ has quit [Ping timeout: 250 seconds]
maryo has joined #ruby
v01d4lph4 has quit [Ping timeout: 250 seconds]
valadares has quit [Read error: Connection reset by peer]
valadares has joined #ruby
<jwr>
I installed ruby 2.6.1 and I see that it has it's own built-in bundler (v 1.17.2). I need to install bundler 1.17.3, which I did, but 1.17.2 is still there and is still the default (as reported by gem list | grep bundler). And if I try something like bundle exec rails c, it crashes because "You have already activated bundler 1.17.2, but your Gemfile requires 1.17.3.
<jwr>
Anybody have an idea how I can either install ruby without the built in bundler gem, or how I can make 1.17.3 the default?
jmcgnh has joined #ruby
<havenwood>
jwr: Did you add bundler to your Gemfile and run?: bundle
<havenwood>
jwr: What command are you running that's resulting in the error?
<havenwood>
Ah you said.
<havenwood>
jwr: Being a "default" gem doesn't mean that's the version you're going to get.
<jwr>
havenwood: Yes, bundler is a dependency in my Gemfile.lock, which also has "BUNDLED WITH: 1.17.3". I can do `bundle install` and it installs correctly. but then commands like `./bin/bundle exec rake` or `./bin/bundle exec rails` both crash with the above error.
<havenwood>
jwr: You could try?: bundle _1.17.2_ exec rake
APK is now known as AKPWD
RougeR has quit [Ping timeout: 246 seconds]
krawchyk has quit [Ping timeout: 240 seconds]
houhoulis has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
AJA4350 has joined #ruby
Nicmavr has joined #ruby
marmotini_ has joined #ruby
maryo has quit [Ping timeout: 250 seconds]
marmotini_ has quit [Ping timeout: 244 seconds]
marmotini_ has joined #ruby
aqd has joined #ruby
maryo has joined #ruby
elcontrastador has joined #ruby
conta has joined #ruby
jmcgnh has quit [Remote host closed the connection]
conta has quit [Ping timeout: 272 seconds]
akem__ has joined #ruby
akem has quit [Read error: Connection reset by peer]
code_zombie has joined #ruby
jmcgnh has joined #ruby
blackmesa1 has quit [Ping timeout: 250 seconds]
kapil____ has quit [Quit: Connection closed for inactivity]
<jwr>
Iamchop: `gem list | grep bundler` is the exact same output that I have. and `bundle -v` does also return 1.17.3. All of my troubleshooting with bash commands points to 1.17.3 being the version to be used. Except `./bin/bundle exec rake|rails` throws errors saying that 1.17.2 is activated.
bruul has quit [Ping timeout: 268 seconds]
xrexeon has quit [Remote host closed the connection]
regedit has quit [Quit: Connection closed for inactivity]
blackmesa1 has joined #ruby
SeepingN has joined #ruby
themsay has quit [Ping timeout: 268 seconds]
<Iambchop>
your ./bin/bundle is from bundler binstub? added rake to my Gemfile and used bundle binstub: https://dpaste.de/nqyV
valadares has quit [Read error: Connection reset by peer]
valadares has joined #ruby
marmotini_ has quit [Ping timeout: 244 seconds]
maryo has quit [Read error: Connection reset by peer]
BH23 has quit [Ping timeout: 250 seconds]
renich has joined #ruby
wilbert has joined #ruby
sauvin has quit [Remote host closed the connection]
gix has joined #ruby
marmotini_ has joined #ruby
orbyt_ has joined #ruby
conta has joined #ruby
lxsameer has joined #ruby
conta has quit [Ping timeout: 245 seconds]
Inline has joined #ruby
marmotini_ has quit [Remote host closed the connection]