<havenwood>
Curting: What seems to be the problem? Just general refactor or a specific issue?
phinxy has joined #ruby
phinxy has quit [Changing host]
phinxy has joined #ruby
<Curting>
havenwood Sorry I didn't clarify. I just updated the link with the challenge description.
<Curting>
havenwood: My issue is that when my orange tree is @age == 3, it should have @orangeCount == 5. But no matter the @age, it has @orangeCount == 0
uZiel has quit [Ping timeout: 248 seconds]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jackjackdripper has joined #ruby
jackjackdripper has quit [Client Quit]
jackjackdripper has joined #ruby
<Curting>
Any help would really be appreciated! :)
zssshhh has left #ruby [#ruby]
sarmiena_ has quit [Quit: sarmiena_]
hotpanca_ has quit [Remote host closed the connection]
rahult has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hotpancakes has joined #ruby
__Yiota has joined #ruby
<Curting>
I'll go to bed. Have a nice evening everyone! :-)
<ljarvis>
talking about a functional version of tap is misleading, matthewd mentioned what you want in that link
<ljarvis>
(nothing exists in current ruby versions though)
<alex``>
I’m just caring about the number in the link
<judofyr>
haven't been following ruby-core for years. any other new things I've missed?
<alex``>
I need to get the last page index
<ljarvis>
judofyr: probably 10391 more aliases
<judofyr>
"Added by alexeymuranov (Alexey Muranov) about 5 years ago". wow it's actually a really old issue
<ljarvis>
still: GIL
<judofyr>
I see tenderlove is doing some GC work?
<matthewd>
While "functional" and "inscrutable" can definitely overlap, they don't actually *have* to mean the same thing. I'd just use a variable. ¯\_(ツ)_/¯
hoangtg has joined #ruby
Terens has joined #ruby
<morfin60>
i think i should try debug that bad code
<Terens>
hello
<judofyr>
hi Terens
vuoto has quit [Remote host closed the connection]
<alex``>
ljarvis: yield self :OOO
<Terens>
If you have a class and at some point X thing happens. So it calls after_X_happened method.
<Terens>
Like a callback. I have an argument that this is bad because after_X_happened doesnt describe what actually happens
<elomatreb>
Personally I'd leave the _happened off, but that's just taste
<ljarvis>
after_X_happened should call methods that are more descriptive about what's happening
<ljarvis>
but hooks are a thing and it's fine
<elomatreb>
Normally you pass an object to a handler that gives more detailed informations about the event, if necessary
<judofyr>
if I'm in full control of the class and don't expect any subclass shenanigans I would probably drop the hook-method and invoke properly named methods directly
ledestin has joined #ruby
<judofyr>
once you have inheritance/composition in the picture it can be quite useful to have generic hook methods
aupadhye has joined #ruby
<judofyr>
but hey, once you have inheritance in the picture everything is a mess anyway :)
hahuang65 has joined #ruby
pandaant has quit [Remote host closed the connection]
<judofyr>
okay. I need help naming something.
<judofyr>
it's like a function
<judofyr>
you can call it
<judofyr>
but it always creates an object
<judofyr>
so "constructor" kinda makes sense
<judofyr>
but "constructor" is already taken
<elomatreb>
Like a factory?
<judofyr>
(this is a language where objects are not everything. so there is a point that this constructs an *object*)
<judofyr>
hm
<judofyr>
yeah, I haven't thought about that point of view
hotpancakes has joined #ruby
hahuang65 has quit [Ping timeout: 248 seconds]
Beams has joined #ruby
<Bish>
generator?
mim1k has joined #ruby
coenraad has quit [Ping timeout: 240 seconds]
hotpancakes has quit [Ping timeout: 246 seconds]
lxsameer has joined #ruby
impermanence has joined #ruby
impermanence has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
bronson has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
Siyfion has joined #ruby
mfaeh has joined #ruby
camilasan has joined #ruby
z0mbee has joined #ruby
eightlimbed has quit [Ping timeout: 260 seconds]
marr has joined #ruby
umaaji has quit [Quit: Leaving...]
coenraad has joined #ruby
vee_ has quit [Ping timeout: 248 seconds]
postmodern has quit [Quit: Leaving]
judofyr has quit [Remote host closed the connection]
judofyr has joined #ruby
nhhc has quit [Remote host closed the connection]
astrobunny has quit [Remote host closed the connection]
eightlimbed has joined #ruby
hightower2 has quit [Ping timeout: 240 seconds]
judofyr has quit [Ping timeout: 240 seconds]
<Bish>
what is a good way to spread/execute code over files
<Bish>
i wrote something that comes close to a cronjob handler
<Bish>
and i want my rules seperate in files
<Bish>
code inside the file should look like
<Bish>
with_interval(:often) { puts "something" }
<Bish>
now, do i wrap that stuff in a method&module?
<Bish>
do i put each of these rules in one big ass module and call all its methods?
judofyr has joined #ruby
<Bish>
cool would be something like eval but in not dirty ;;
<elomatreb>
I'd put them in seperate files in a subdirectory if they're at least a little more comlicated
<elomatreb>
With a method on your class/module that registers a task
<Bish>
sure, i did that
<Bish>
thats the issue im having
<Bish>
right not the whole files only consists of the rules
<Bish>
i could File.read and eval them
<Bish>
which would be essentially what i want
<Bish>
but doesnt feel right
<Bish>
so i would wrap them in a method, inside a module, and call this methods
<Bish>
these*
<dminuoso>
If only Ruby has a functional package/module system...
<dminuoso>
require is just misnamed eval_once...
stamina has joined #ruby
<matthewd>
*load_once
dionysus69 has quit [Ping timeout: 240 seconds]
<dminuoso>
matthewd: Oh. Yeah.
<judofyr>
a proper module system would be amazing
BSAlb has quit [Quit: Leaving]
<judofyr>
not sure if it's possible to bolt on top
<dminuoso>
bolting things ontop is what ruby developers have become exceedingly good at.
<judofyr>
I find it interesting that because JS is so limited, they have ended up with a great compiler/transpiler ecosystem
<dminuoso>
judofyr: Actually the way that JS modules work would be patched into Ruby with ease.
<dminuoso>
*could
someuser has joined #ruby
<dminuoso>
Well. actually no.
<judofyr>
hehe
<dminuoso>
Stupid global namespace of Ruby. :(
<judofyr>
well, couldn't you still introduce `export class Foo` ?
<elomatreb>
I bet you could do some really funky hackery with const_missing to achieve that
<matthewd>
dminuoso: I think it could -- just use locals instead of constants
<judofyr>
matthewd: but locals don't cross method definitions
<Bish>
so, i basicially have it to like that?
<matthewd>
Ah, yeah.. so you'd have to go all-in on define_method etc
<Bish>
since ruby doesnt have a great module system
<matthewd>
Bish: I don't think you actually want a module system here... I think you want to do read+instance_eval, using separate instances of some appropriate class for each file
<elomatreb>
Bish: You may want to take a look at how Rake implements its support for task directories
tvw has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Bish>
bleh that shit depresses me
eightlimbed has quit [Read error: Connection reset by peer]
eightlimbed has joined #ruby
sleepee has quit [Quit: Leaving]
eightlimbed has quit [Read error: Connection reset by peer]
nowhere_man has quit [Quit: Konversation terminated!]
nowhere_man has joined #ruby
workmad3 has joined #ruby
ych has joined #ruby
f1ro has joined #ruby
ych is now known as Guest30859
<judofyr>
the JS ecosystem has the advantage of compiling it down so that it doesn't have any runtime dependencie
<Bish>
self.instance_eval(&module.method(:run))
<Bish>
that sounds about right ;;
<dminuoso>
judofyr: The issue is that it's more object oriented. When you define a class in Ruby it directly infests global namespace.
<Guest30859>
hi, i'm tryign to upload to s3 with aws-ruby-sdk, it fails after 12hours (almost exactly) i tried to look for a configuration parameter of timeout or anything but couldn't find any. anybody familliar?
<judofyr>
dminuoso: not in the gist I posted?
<judofyr>
12 hours? you sure are patient…
<dminuoso>
judofyr: And what if the module monkey patches String?
agent_white has quit [Ping timeout: 240 seconds]
<dminuoso>
by using `class String; def magic; end; end`
nowhere_man has quit [Quit: Konversation terminated!]
eightlimbed has quit [Ping timeout: 260 seconds]
<elomatreb>
Can't you do something similar in JS (at least in browser context) if you fiddle with e.g. window?
nowhere_man has joined #ruby
<judofyr>
dminuoso: yeah, then you can do that. it's similar in Node/JS as well
Rodya_ has quit [Remote host closed the connection]
<dminuoso>
judofyr: You can, that's what `import "foo"` is for.
<dminuoso>
judofyr: importing just for the sake of side-effects, as bad as it sounds like.
* Bish
always writes get_const instead of const_get
<dminuoso>
Though in reality it's used for things like custom loaders in webpack
Rodya_ has joined #ruby
<judofyr>
dminuoso: I don't quite understand your point? the idea here is that plain classes can live in their own namespace. you are still free to monkey-patch if you'd like
bronson has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Bish>
? does instance_eval emit a parameter?
<dminuoso>
emit a parameter?
hotpancakes has quit [Ping timeout: 240 seconds]
<judofyr>
Bish: yeah, it yields self
<Bish>
oh.
<dminuoso>
Bish: *pass an argument
<Bish>
pass argument sounds syntaktik to me
sarbs has quit [Ping timeout: 255 seconds]
<Bish>
while parameter in runtime would be sent?
<Bish>
i dont know if that makes sense
<dminuoso>
Bish: argument is what you pass, parameter is the variable arguments are put in.
<dminuoso>
foo(1) // 1 is the argument
<dminuoso>
def foo(arg) // arg is the parameter
<Bish>
okey, thanks
sarbs has joined #ruby
<elomatreb>
Great stuff to be pedantic about, friends/coworkers will love you
eightlimbed has joined #ruby
<dminuoso>
I dont have friends.
<Bish>
neither i do
<Bish>
do i*
bronson has quit [Ping timeout: 248 seconds]
<judofyr>
elomatreb: that's quite a good argument
jackjackdripper has joined #ruby
<Bish>
but my instance_eval does not work :(, could it be because the method is bound?
<judofyr>
Bish: yes
<Bish>
it seems like the "self" of the method does not get changed
<Bish>
well, what do i do?
<dminuoso>
Well either way. JavaScript has ended up with quite an elegant module system that is fairly controllable.
<dminuoso>
I'm jealous.
<matthewd>
Bish: I'm unclear what you're doing at the moment (e.g., the fact you're not passing a string from a file)
<judofyr>
Bish: is the method defined in a class or a module?
* Bish
is frustrated because there is not THE programming language
<dminuoso>
It just sucks how the implementation of JavaScript is completely fragmented by partially running on node, partially running inside webpack/rollup/etc., and partially running inside the browser
<Bish>
judofyr: it's defined like "def self.run" inside a module
<Bish>
and im getting each submodule of a module and instance_eval its run method
<alex``>
is there a difference between yield and block.call?
<Bish>
to get my hacky module system
<judofyr>
Bish: if you change it to "def run" you should be able to do this:
<alex``>
to my point of view `block` is explicit, and yield hidden from method declaration
<dminuoso>
alex``: Precisely.
<alex``>
def foo
<judofyr>
Radar: why are you special? :((
<dminuoso>
alex``: That's why I prefer explicitly binding blocks to procs.
<alex``>
yield 2
<alex``>
end
<alex``>
def foo &block
<Radar>
judofyr: /whois Radar probably has something to do with it.
<alex``>
block.call 2
<alex``>
end
<dminuoso>
alex``: Consider things like block_given? and yield as tools for libraries that want to avoid unnecessary overhead.
<Radar>
alex``: You could write that on one line ;)
<Bish>
if i call .bind on a method, will it change/move the original method
<Bish>
or do something like that?
<alex``>
thus I prefer `block` rather than `yield`
<elomatreb>
You can still call a method that has an explicit block parameter without the block though, right? As in, it will only error when it tries to call the block?
<judofyr>
Bish: copied? nope
<dminuoso>
alex``: I also prefer lambda over proc/block
<alex``>
but how do the same for `block_given?`?
<dminuoso>
Because.. `return`
<Bish>
judofyr: so, the method vanishes from the original owner?
<judofyr>
Bish: no. it's still there. a Method is just a reference to an UnboundMethod + an owner
<alex``>
would `if block` work?
<alex``>
def foo &block
<dminuoso>
alex``: i.e. foo(-> { |arg| .... }) over foo() { |arg| }
<alex``>
if block
<alex``>
block.call
<matthewd>
alex``: Please stop with the multi-line code
<alex``>
oki
<dminuoso>
alex``: But only because I've been writing JavaScript so much, that the value of treating these freaking functions as objects is more than the elegance of blocks.
<Bish>
judofyr: but.. there have to be at least something twice if the original stays intact
<elomatreb>
Yes it would, block is nil if you didn't pass a block
<matthewd>
Bish: Please start with the [gist of] code
coenraad has quit [Ping timeout: 255 seconds]
<alex``>
so to resume, we can replace
<Bish>
my questions regarding the code are already finished, just want to know the ruby behaviour now
<judofyr>
Bish: well, yeah, the Method instance is copied, but it doesn't actually contain the code or anything
<alex``>
yield -> block.call
<Bish>
judofyr: great, thanks
<alex``>
block_given? -> block
<alex``>
?
<dminuoso>
alex``: Yes.
<alex``>
Cool
<Bish>
so same method, 2 times information about the owner
<dminuoso>
alex``: Or like me, avoid blocks entirely whenever possible!
<Radar>
Bish: Please just show us some code that you're asking about rather than talking about it.
<alex``>
dminuoso: why?
<Bish>
Radar: im done already :> thanks
<elomatreb>
But it's not the general convention, many people prefer to use yield/block_given? wherever possible
<Radar>
Bish: Ok. Remember this for next time then
<ruby[bot]>
dminuoso: # => wrong number of arguments (given 1, expected 0) (ArgumentError) ...check link for more (https://eval.in/834442)
<judofyr>
Bish: you can't do it on other instance methods
<Bish>
too bad.
<judofyr>
Bish: and singleton methods are just instance methods on the singleton class
<Bish>
but my code works now, thanks
<dminuoso>
elomatreb: This whole monstreous hack of blocks just for the sake of avoiding object creation leaks in the language and leads to brittle code design.
<judofyr>
it's because it doesn't make sense to Integer.instance_method(:+).bind("Hello")
<elomatreb>
I do agree, but I would like it to behave like blocks do now. Avoiding the both performance and mental overhead of creating lambdas for everything
* Bish
wrote his own cron-job, and wheel
<dminuoso>
elomatreb: Do you know what the price is?
<dminuoso>
Because I do.
<dminuoso>
lambdas are cheap as fuck.
<judofyr>
Bish: it's actually a recent change regarding the module instance method. previously you could only bind it to an object which included the module
<elomatreb>
Performance is less of a concern for me, but it's what people usually cite when advocating yield over explicit block calling/lambdas
<dminuoso>
elomatreb: Micro-optimizations. It's fine if the standard library does it, because it can't make assumptions whether it will be in hotspots or not.
<dminuoso>
Or for general libraries.
<Bish>
i always used instance_eval() and expected the called method thinks self is the receiver of instance_eval
<Bish>
amd somehow it always worked
<Bish>
didn't know i couldnt method use completely like procs
<judofyr>
Bish: hm. Method#to_proc creates a proc which basically ignores `self` and always uses the bound receiver
<Bish>
i did that, and self. stayed on the owner
<Bish>
confused the fuck out of m
<dminuoso>
elomatreb: The price of creating a lambda over a block is essentially just a single C function `rb_data_typed_object_zalloc`
<elomatreb>
I agree on it being a often pointless microoptimization
eightlimbed has quit [Ping timeout: 260 seconds]
<judofyr>
often? how about always?
<Bish>
microoptimizing ruby
<Bish>
*laughs*
<ljarvis>
never, always microoptimize
naprimer is now known as cherry-pick
<matthewd>
Yeah, I'll agree that while I normally care about it, average app code needn't
<Bish>
ruby is slow af no matter what you do </opinion>
<judofyr>
elomatreb: yes, if you're just calling the same method over and over again without doing *anything* else
hightower2 has joined #ruby
<judofyr>
once you actually start doing real work, the difference in yield/block.call won't matter anymore
<elomatreb>
As I said, "often"
<matthewd>
Tricky micro-opts are best reserved for especially hot spots, but "free" gains have broader value in widely-used libraries
<dminuoso>
elomatreb: ^- that. The problem with that is the main cost stems from the GC.
<dminuoso>
elomatreb: I you avoid any object creations, the GC wont interfere with you at all.
<ljarvis>
ehm
* ljarvis
opens book "how to prove anything anyone says about Ruby wrong"
<dminuoso>
ljarvis: What do you mean?
<Bish>
chapter 1-9 GC
<judofyr>
in what use case do you repeatedly call a method with a block, without doing any other memory- or CPU-bound work?
<matthewd>
The one I've never actually investigated is when a block gets passed down through say 10 method calls
astrobunny has joined #ruby
<ljarvis>
dminuoso: just kidding
<matthewd>
If they all use &block, you pay the allocation/blockification once -- vs a bunch of calls with { |a,b| yield a, b } blocks
ferr has joined #ruby
astrobunny has quit [Ping timeout: 260 seconds]
<dminuoso>
matthewd: I think that is an interesting point. Especially if you pre-construct the lambda once, such as `predicate = -> { |a| a.odd? }` and then pass it in, it disappears.
<dminuoso>
The overhead I mean.
ur5us has quit [Remote host closed the connection]
<matthewd>
Yeah, that variant's less interesting to me, just because the outermost call is normally in user code, but it would also have a relevant impact
hahuang65 has joined #ruby
tvon_ has quit [Remote host closed the connection]
tvon has joined #ruby
eightlimbed has joined #ruby
hahuang65 has quit [Ping timeout: 248 seconds]
tvon has quit [Ping timeout: 248 seconds]
nowhere_man has quit [Ping timeout: 248 seconds]
pandaant has joined #ruby
mfaeh has quit [Remote host closed the connection]
mfaeh has joined #ruby
mfaeh has quit [Remote host closed the connection]
mfaeh has joined #ruby
stamina has quit [Quit: WeeChat 1.9]
ltem has joined #ruby
ElFerna has joined #ruby
ElFerna has quit [Client Quit]
Hunter1 has quit [Remote host closed the connection]
Hunter1 has joined #ruby
hotpancakes has joined #ruby
sagax has joined #ruby
bronson has joined #ruby
<sagax>
hi all
<sagax>
how to use ruby[bot] ?
doublemalt_ has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
<elomatreb>
>> "hello world" # sagax
<ruby[bot]>
elomatreb: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
Rodya_ has quit [Remote host closed the connection]
hutch34 has quit [Ping timeout: 246 seconds]
Rodya_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
rgtk has quit [Ping timeout: 276 seconds]
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
jphase has quit [Changing host]
jphase has joined #ruby
<dminuoso>
matthewd: In JS it's often not noticeable to create tons of functions in hot spots, but then again v8 has some pretty nifty techniques to optimize highly dynamic code paths away.
<dminuoso>
matthewd: I think if we had a proper JIT it might be even less relevant in Ruby.
milardovich has joined #ruby
<dminuoso>
Dunno how truffle/graalvm handles such cases, perhaps chrisseaton is around?
camilasann has joined #ruby
jphase has quit [Ping timeout: 258 seconds]
camilasan has quit [Ping timeout: 260 seconds]
Guest30859 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
t-recx has joined #ruby
synthroid has joined #ruby
livcd has quit [Remote host closed the connection]
bronson has joined #ruby
judofyr has quit [Remote host closed the connection]
judofyr has joined #ruby
Rodya_ has quit [Remote host closed the connection]
hotpancakes has joined #ruby
bronson has quit [Ping timeout: 248 seconds]
apparition has joined #ruby
judofyr has quit [Ping timeout: 260 seconds]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hotpancakes has quit [Ping timeout: 255 seconds]
belmoussaoui_ has quit [Read error: Connection reset by peer]
belmoussaoui has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
belmoussaoui__ has joined #ruby
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has joined #ruby
belmoussaoui has quit [Ping timeout: 255 seconds]
nanoz has joined #ruby
nanoz has quit [Read error: Connection reset by peer]
apparition47 has joined #ruby
belmoussaoui__ has quit [Read error: Connection reset by peer]
belmoussaoui has joined #ruby
ledestin has joined #ruby
Beams has quit [Quit: .]
astrobunny has joined #ruby
mim1k has joined #ruby
judofyr has joined #ruby
take5 has joined #ruby
ledestin has quit [Ping timeout: 240 seconds]
astrobunny has quit [Ping timeout: 260 seconds]
judofyr has quit [Ping timeout: 248 seconds]
<Bish>
i often ecapsulate my logic into many modules
milardovich has quit [Remote host closed the connection]
Beams has joined #ruby
<Bish>
i always tend to do class << self;def handle;end;end;
<Bish>
and in the dispatcher something like handler.handle(job)
milardovich has joined #ruby
<Bish>
should i step back from those singleton functions?
<Bish>
and rather have instance methods which i call? or even use .new on each handler?
milardovich has quit [Remote host closed the connection]
sepp2k has joined #ruby
milardovich has joined #ruby
<matthewd>
Bish: I think I'd need more context to have a coherent opinion, but... maybe?
hahuang65 has joined #ruby
<matthewd>
Bish: Ultimately, it's up to whatever you find most pleasant to work with, though
<Bish>
well its a pretty general question of you have some sort of work to be done
<Bish>
and 12831823 ways to do it
<Bish>
like a database event that can be handled and u have a shitton handlers for that
<Bish>
right now im having modules with a singleton handle method
<Bish>
if they need to capsulate complexity, they can have classes on their own
<Bish>
that was my argumentation there
shiru has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
belmoussaoui has quit [Ping timeout: 246 seconds]
<matthewd>
I think I'd generally default to something involving instance methods
pandaant has quit [Remote host closed the connection]
shiru has quit [Remote host closed the connection]
<Bish>
hm
<matthewd>
For something closer to what you described, I'd make the common method `call` instead of `handle`, so simpler ones can just be a Proc
<Bish>
hm, that'd be clever
<Bish>
can i has instance_eval without yielding self?
apparition47 has quit [Quit: Bye]
<matthewd>
On the "instance methods" front, I think circumstances would dictate a choice between `send("handle_#{event_type}", event)` and `Handlers[event_type].new(event).call`, say
<Bish>
i even encapsulated each event in its own module
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
coenraad_ has joined #ruby
bkxd has joined #ruby
coenraad has quit [Ping timeout: 267 seconds]
astrobunny has joined #ruby
hotpancakes has joined #ruby
brent__ has joined #ruby
aufi has quit [Quit: Leaving]
brent__ has quit [Remote host closed the connection]
guardianx has quit []
brent__ has joined #ruby
bkxd_ has joined #ruby
astrobunny has quit [Ping timeout: 248 seconds]
jaruga has quit [Quit: jaruga]
jaruga has joined #ruby
bkxd has quit [Ping timeout: 255 seconds]
bkxd_ has quit [Ping timeout: 268 seconds]
bruno- has quit [Ping timeout: 248 seconds]
phinxy has quit [Read error: Connection reset by peer]
phinxy has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has quit [Ping timeout: 248 seconds]
perniciouscaffei has joined #ruby
mikecmpb_ has joined #ruby
cam27 has quit [Quit: cam27]
bruno- has joined #ruby
doublemalt_ has quit [Ping timeout: 240 seconds]
cherry-pick-2 has joined #ruby
usr_share has joined #ruby
tau has joined #ruby
cherry-pick has quit [Ping timeout: 240 seconds]
<usr_share>
So i have this little situation on a shell server, where ruby itself is installed in the standard location, but the header files (which should be in /usr/lib/ruby/include/ruby.h) are in a different spot. i figured out that their location can be set with an rbconfig variable named "rubyhdrdir". How do I set its value?
<usr_share>
is it an environment variable or is there a config file somewhere?
Luyt has joined #ruby
enterprisey has quit [Remote host closed the connection]
digitalnomad has joined #ruby
synthroid has quit [Remote host closed the connection]
coenraad_ has quit [Ping timeout: 248 seconds]
bronson has joined #ruby
cdg has joined #ruby
troulouliou_dev has joined #ruby
psychicist__ has joined #ruby
enterprisey has joined #ruby
bronson has quit [Ping timeout: 255 seconds]
rundor has quit [Remote host closed the connection]
npgm has joined #ruby
cdg_ has joined #ruby
synthroid has joined #ruby
cdg has quit [Ping timeout: 260 seconds]
belmoussaoui has quit [Ping timeout: 255 seconds]
belmoussaoui has joined #ruby
InfinityFye has quit [Ping timeout: 255 seconds]
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roshanavand has quit [Ping timeout: 248 seconds]
digitalnomad has joined #ruby
oliv_____ has quit [Remote host closed the connection]
oliv_____ has joined #ruby
nebiros has joined #ruby
nebiros has left #ruby ["Be back later..."]
psychicist__ has quit [Quit: leaving]
kobain has quit [Ping timeout: 255 seconds]
InfinityFye has joined #ruby
roshanavand has joined #ruby
shinnya has quit [Ping timeout: 248 seconds]
haylon has joined #ruby
tvw has quit [Remote host closed the connection]
<haylon>
Anyone have troubles with Rake saying there was an issue with teh create_shell_runner when executing a shell command, however, I can execute other shell commands just fine. When I reun the erroring shell command by hand, it works.
kies has quit [Ping timeout: 260 seconds]
z3uS has quit [Ping timeout: 276 seconds]
sysvalve has quit [Quit: Leaving]
hotpancakes has quit [Remote host closed the connection]
polishdub has joined #ruby
astrobunny has joined #ruby
sarmiena_ has joined #ruby
sekmo has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
ferr has quit [Quit: WeeChat 1.9]
mikecmpb_ has quit [Ping timeout: 240 seconds]
t-recx has joined #ruby
astrobunny has quit [Ping timeout: 260 seconds]
cagomez has joined #ruby
SteenJobs has joined #ruby
hahuang65 has joined #ruby
al2o3-cr has quit [Ping timeout: 255 seconds]
gothicsouth has joined #ruby
pecan has quit [Quit: WeeChat 1.6]
ElFerna has quit [Ping timeout: 255 seconds]
troulouliou_dev has quit [Quit: Leaving]
SteenJobs has quit [Ping timeout: 246 seconds]
gloscombe has joined #ruby
hotpancakes has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
ltem has quit [Quit: Leaving]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rundor has joined #ruby
gr33n7007h has joined #ruby
__Yiota has joined #ruby
rundor_ has joined #ruby
Beams has quit [Quit: .]
roshanavand has quit [Ping timeout: 276 seconds]
rundor has quit [Ping timeout: 255 seconds]
lxsameer has quit [Quit: WeeChat 1.7]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
z3uS has joined #ruby
marxarelli|afk is now known as marxarelli
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
cyfr0n1 has joined #ruby
Miron has left #ruby [#ruby]
Miron has joined #ruby
romankapitonov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
cyfr0n1 has left #ruby [#ruby]
dstrunk has joined #ruby
renchan has quit [Quit: Leaving...]
peter1 has joined #ruby
frmendes has quit [Ping timeout: 240 seconds]
alex`` has quit [Quit: WeeChat 1.9]
TomyLobo2 has joined #ruby
peter1 is now known as pecan
oliv_____ has quit [Remote host closed the connection]
jordanm has quit [Quit: Konversation terminated!]
bronson has joined #ruby
cagomez has quit [Remote host closed the connection]
oliv_____ has joined #ruby
cagomez has joined #ruby
TomyLobo has quit [Ping timeout: 255 seconds]
sekmo has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 255 seconds]
oliv_____ has quit [Ping timeout: 248 seconds]
cornfeedhobo has joined #ruby
cagomez has quit [Ping timeout: 268 seconds]
antgel has quit [Ping timeout: 240 seconds]
jordanm has joined #ruby
<cornfeedhobo>
hello. is it possible to split a string up while interpolating?
<apeiros>
cornfeedhobo: not sure I understand what you want to do, can you make an example?
cschneid_ has joined #ruby
<cornfeedhobo>
a more complete question would be: I have a string "foo,bar,baz" and I would like to turn it into an array
<ruby[bot]>
kkiero_: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
GodFather has quit [Quit: Ex-Chat]
<kkiero_>
it's just simple script
crankharder has joined #ruby
GodFather has joined #ruby
ElFerna has joined #ruby
<havenwood>
kkiero_: do you need to support all accents?
<havenwood>
kkiero_: a limited list of languages or?
hutch34 has joined #ruby
<kkiero_>
i think polish is ok for now
<kkiero_>
maybe german and spanish later too
ElFerna has quit [Client Quit]
<havenwood>
kkiero_: for just Polish i'd maintain a Hash with the conversion.
<havenwood>
if that starts creeping you might consider an ActiveSupport gem dependency with cherry picking multibyte or just a smaller gem for the same purpose
hahuang65 has quit [Quit: WeeChat 1.9]
<havenwood>
it's nice you can do it in latest stable Ruby now!
<kkiero_>
ok, but what's wrong with this mb_chars from link?
<havenwood>
kkiero_: That's ActiveSupport. That's what I'm saying.
<havenwood>
kkiero_: You're free to use it. Have a gem dependency on ActiveSupport and: require 'active_support/core_ext/string/multibyte'
<havenwood>
Then use away.
<kkiero_>
I see
<havenwood>
kkiero_: That method is defined by the ActiveSupport gem. It's available in Rails because Rails already requires it.
<kkiero_>
ok, I didn't understand you previously
<havenwood>
you can cherry pick, that is just load that part of ActiveSupport, not the whole thing
<havenwood>
if a gem dependency is allowed
kkiero_ is now known as kkiero
AxelAlex has joined #ruby
nadir has joined #ruby
mikecmpbll has joined #ruby
username_ has joined #ruby
<kkiero>
is it fix in newer version of ruby?
__Yiota has joined #ruby
<kkiero>
upcase of specific letter
<havenwood>
kkiero: yes, it **just works** in Ruby 2.4.0+
hutch34 has quit [Ping timeout: 246 seconds]
<havenwood>
kkiero: it works in latest stable Ruby 2.4.1
<kkiero>
I see
<kkiero>
so I guess the best solution here will be with Hash as you wrote
milardovich has joined #ruby
<kkiero>
so it won't require any dependencies
mim1k has joined #ruby
claw has joined #ruby
take5 has quit [Remote host closed the connection]
__Yiota has quit [Client Quit]
cschneid_ has quit [Remote host closed the connection]
aclark has quit [Remote host closed the connection]
ascarter has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
hotpancakes has quit [Remote host closed the connection]
hahuang65 has joined #ruby
scorphus has quit [Ping timeout: 260 seconds]
username_ has quit [Quit: Lost terminal]
shinnya has quit [Client Quit]
<kkiero>
I have 2.4 from rbenv
<kkiero>
the point is macOS system ruby version
<Radar>
so don't use it?
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
hotpancakes has joined #ruby
im0nde has joined #ruby
cats has quit [Quit: BURN HIS HOUSE DOWN]
olivi____ has joined #ruby
alveric1 has joined #ruby
wilbert has quit [Ping timeout: 276 seconds]
cats has joined #ruby
cats is now known as Guest29598
alveric4 has quit [Ping timeout: 248 seconds]
hutch34 has quit [Ping timeout: 255 seconds]
tau is now known as pytau
Guest29598 has quit [Client Quit]
Renich has joined #ruby
<kkiero>
Radar: unfortunatelly in mac automator I have to use it :<
<Radar>
You can't call "rbenv use 2.4" in automator, but you can call Ruby scripts? huh?
olivi____ has quit [Ping timeout: 260 seconds]
<kkiero>
automator runs script with /usr/bin/ruby
<havenwood>
kkiero: you can have /usr/bin/ruby symlink point wherever you want
<Radar>
^ ^ ^ ^ ^
<kkiero>
I tried this
<kkiero>
but not /usr/bin is read only
<kkiero>
*now
<Radar>
sudo?
<kkiero>
doesn't work
<Radar>
?didntwork
<ruby[bot]>
What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
<kkiero>
firstly I wanted to backup system binary
<kkiero>
mv: rename /usr/bin/ruby to /usr/bin/system_ruby: Operation not permitted
troulouliou_dev has quit [Quit: Leaving]
<Radar>
ok, that doesn't work on my machine either with sudo.
<kkiero>
I read that this is due to System Integrity Protection (SIP)
troulouliou_dev has joined #ruby
dstrunk has quit [Remote host closed the connection]
<havenwood>
kkiero: how about a hack like: alias /usr/bin/ruby="~/.rubies/ruby-2.4.1/bin/ruby"
<havenwood>
i'm not familiar with how automator's script-running rules
frmendes has quit [Read error: Connection reset by peer]
frmendes has joined #ruby
ElFerna has quit [Ping timeout: 240 seconds]
troulouliou_dev has quit [Client Quit]
<Radar>
kkiero: what's stopping you running the shell script as /bin/bash and then calling "rbenv use 2.4" in that shell script, then calling "ruby /path/to/script.rb" to actually run the script?
digitalnomad has joined #ruby
enterprisey has joined #ruby
davidmichaelkarr has joined #ruby
knight33 has joined #ruby
<kkiero>
that makes sense
<kkiero>
i'm coming to this solution with every step