<sydbarret>
havenwood I dont want to interact with ruby. Just keep the MS Access front end but the backend move it to a remote server and perhaps put and retrieve data using API
NODE has joined #ruby
Inline has quit [Quit: Leaving]
Nahra has quit [Ping timeout: 240 seconds]
fphilipe has joined #ruby
sydbarret has left #ruby ["Closing Window"]
sydbarret has joined #ruby
cthulchu has quit [Read error: Connection reset by peer]
sydbarret has left #ruby ["Closing Window"]
cthulchu has joined #ruby
fphilipe has quit [Ping timeout: 245 seconds]
<TzilTzal>
Hi
<havenwood>
TzilTzal: hi
<TzilTzal>
I'm running a script using rvm & bundle: rvm 2.6 do bundler exec ruby <my script>
<TzilTzal>
<my script> launches another <other script> using %x but I think it doesn't run in the context of bundle...
<TzilTzal>
Is there a way to check or fix this?
<TzilTzal>
I installed all my bundle gems locally (using --path vendor/bundle)
<havenwood>
TzilTzal: Can you just add bundle exec to the %x commands or you want to abstract that away?
_phaul has quit [Ping timeout: 250 seconds]
<TzilTzal>
preferably abstract that away... I want it to run in the context of the launching program, I'd say.
<TzilTzal>
I'm new to Ruby, so not sure if there's a standard way of handling this.
<havenwood>
TzilTzal: Normally you don't shell out to run Ruby from Ruby.
<havenwood>
TzilTzal: Have a specific example where you're doing it?
<TzilTzal>
Alas, it's some code I can't really change.
<havenwood>
TzilTzal: Typically, you'd require a Ruby library and use it from Ruby rather than using a command line interface.
<havenwood>
TzilTzal: I don't get why there's a path to java in front of the path to ruby, but does it work as you'd like if you add `bundle exec` in front of `#{exe}`?
<havenwood>
TzilTzal: It seems you don't want the output, so I'd use #system.
<havenwood>
TzilTzal: system java_home, 'bundle', 'exec', exe, "#{app_path}#{command}.rb", args
_phaul has quit [Ping timeout: 250 seconds]
<TzilTzal>
havenwood: it's an export for JAVA_HOME
<TzilTzal>
it's really weird...
<TzilTzal>
I don't think anyone ever ran it using a more local environment like bundle
fig-le-deunch has quit [Quit: Konversation terminated!]
<havenwood>
TzilTzal: You can't just?: load "#{app_path}#{command}.rb"
<TzilTzal>
will try...
<TzilTzal>
apparently the run ruby script is also meant to run as a stand-alone script.. and takes an argument from ARGV
<havenwood>
TzilTzal: Ah, right.
<TzilTzal>
Anyway, thanks for the help!
NODE has quit [Quit: changing servers]
<havenwood>
TzilTzal: Can you look at that script and just pass the arguments like it does?
<havenwood>
TzilTzal: It's *usually* possible to use a Ruby command line app as a library instead. Anyway, good luck!
NODE has joined #ruby
<TzilTzal>
havenwood: cheers. I'll try to change those so it can be done like you suggested!
<havenwood>
If it's a complicated command line utility, and args come for that for some reason, maybe it makes sense to use the executable? Hard to say.
<Bish>
i hate libraries that pollute the namespace for that exact reason
<Bish>
i always thought that's a ruby feature
<al2o3-cr>
rdoc as activesupport as a dependncy
<Bish>
is that the official doc gem?
<al2o3-cr>
and http gem
_phaul has joined #ruby
<Bish>
http gem?
<Bish>
net/http is certainly default isn't it
<al2o3-cr>
yes
<al2o3-cr>
run this
<al2o3-cr>
gem dep --local | grep -A 20 activesupport
<al2o3-cr>
see what installed it on your system
<Bish>
aws gems
<Bish>
hngg
_phaul has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
QuakePhil has joined #ruby
<al2o3-cr>
just had a good clean out ;)
jenrzzz has quit [Ping timeout: 265 seconds]
za1b1tsu has quit [Remote host closed the connection]
<QuakePhil>
i installed red-parquet but now trying to figure out how to use it beyond .load() and .save()... I know in parquet I can write a multidimensional array to a parquet file like this https://pastebin.com/59Xd3xPQ ... can someone please suggest some clues in ruby how to do the same?
<ruby[bot]>
QuakePhil: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<QuakePhil>
and it consists of dealing with existing parquet files which i don't yet have...
<QuakePhil>
i like all code 8)
vondruch has quit [Quit: vondruch]
_phaul has quit [Ping timeout: 250 seconds]
akem has quit [Quit: Bye]
akem has joined #ruby
akem has quit [Excess Flood]
AJA4350 has joined #ruby
drincruz_ is now known as drincruz
_phaul has joined #ruby
arw82 has quit [Remote host closed the connection]
_phaul has quit [Ping timeout: 246 seconds]
arup_r has quit []
_phaul has joined #ruby
<adam12>
QuakePhil: An interesting project. I'm not familiar, but you might try some of the other docs. It looks like red-parquet builds on red-arrow? https://rubydoc.info/gems/red-arrow
<adam12>
QuakePhil: red-parquet is near empty in terms of code. I'm presuming you'll need to look elsewhere for actual implementation details.
<TzilTzal>
Hi
TCZ has quit [Quit: Bye Bye]
<TzilTzal>
Is it possible to get %x to inherit the executing environment? (i.e. environment variables, etc...) I get a completely new environment/shell
SeepingN has joined #ruby
<adam12>
TzilTzal: You might need to look at using Kernel.spawn directly, which lets you control the environment.
_phaul has quit [Ping timeout: 246 seconds]
<TzilTzal>
There's no standard or easy way to do this?
andikr has quit [Remote host closed the connection]
_phaul has joined #ruby
hutch1 has quit [Ping timeout: 268 seconds]
<adam12>
TzilTzal: What are you trying to achieve exactly?
cthulchu has joined #ruby
_phaul has quit [Ping timeout: 252 seconds]
_phaul has joined #ruby
conta1 has joined #ruby
whiis has joined #ruby
<whiis>
Hi all! I'm learning RoR via a Udemy course right now. The course covers rails 5, but I have rails 6 on my system. Should I downgrade the version of rails I'm using/learning with or just keep going with 6?
davidw has joined #ruby
davidw has quit [Changing host]
davidw has joined #ruby
_phaul has quit [Ping timeout: 240 seconds]
jacksoow has joined #ruby
<Mrbuck>
whiis:there is #rubyonrails too but i would learn 6
SeepingN has quit [Quit: The system is going down for reboot NOW!]
* whiis
oh cool, thank you!
_phaul has joined #ruby
Spaceman77 has joined #ruby
<Spaceman77>
Hello! Each year i try to learn a new programming language. Last year around this time i started learning Ruby, and i fell in love with it :). What language would you recommend me learning next?
<al2o3-cr>
Spaceman77: Lua
mwlang_ has joined #ruby
_phaul has quit [Ping timeout: 240 seconds]
xco has joined #ruby
<mwlang_>
Is it possible to write my own typecasts similar to how Ruby core does for Integer, Float, Array, etc? e.g. Integer(“25”) => 25; Array(“a”) => [“a”]
<adam12>
mwlang_: Those are just methods on Kernel. Go ahead and define your own, but obviously beware conflicts with other constants.
dostoyevsky has quit [Quit: leaving]
<mwlang_>
looking to implement the same behavior that if given the type I’m converting to, I just get it back unchanged. e.g. Integer(25) => 25; Array([“a”]) => [“a”]
dostoyevsky has joined #ruby
<mwlang_>
Oh! Now I get it.
<mwlang_>
did not even think of the fact that these would be Kernel methods.
<adam12>
mwlang_: Yeah it's a neat trick.
<adam12>
mwlang_: This might be more suited to the class of object you're creating. Ie. Date.parse(value) could just return value if is_a?(Date). If you know what I mean.
_phaul has joined #ruby
<mwlang_>
yeah, a utility function could do it as well.
clemens3 has quit [Quit: WeeChat 1.6]
_phaul has quit [Ping timeout: 252 seconds]
_phaul has joined #ruby
sameerynho has joined #ruby
thecoffemaker has quit [Ping timeout: 268 seconds]
_phaul has quit [Ping timeout: 246 seconds]
thecoffemaker has joined #ruby
_phaul has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
_phaul has quit [Ping timeout: 240 seconds]
lalitmee has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
_phaul has joined #ruby
_phaul has quit [Ping timeout: 240 seconds]
<havenwood>
Spaceman77: Elixir
<Spaceman77>
I see quite a lot of ruby people move on to elixir
<Spaceman77>
I'm curious why
<havenwood>
Spaceman77: It's made by a Rubyist, has a lot of flexibility and elegance, and would be an intro into functional programming.
<havenwood>
Spaceman77: Or Clojure.
<Spaceman77>
Well, currently i can't decide between Java, Clojure, Haskell and Go
jenrzzz has joined #ruby
<Spaceman77>
Java - used a lot in industry, it's in the top3 languages for almost all problem domains, but the potential for boilerplate puts me off.
<Mrbuck>
once I get a job I will start with lisp
<Spaceman77>
Clojure - It's a lisp on JVM, nuff said
_phaul has joined #ruby
<Spaceman77>
Haskell - if i'm to learn a functional programming language, i might as well go all the way
<havenwood>
Spaceman77: If you want to delve into types.
<havenwood>
Spaceman77: And the maths.
<Mrbuck>
even clojure also functional
<Mrbuck>
but dynamic
<Spaceman77>
Go - seems interesting to me. It is boilerplaty, but scripty at the same time. Seems like a very practical language.
<Spaceman77>
I only recently learned and understood what monads are, so i'm quite eager to see them in action
Mrbuck has quit [Quit: WeeChat 2.7]
_phaul has quit [Ping timeout: 268 seconds]
<Spaceman77>
Probably sounds like i can't decide. And i really can't :(
i9zO5AP has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
Ai9zO5AP has quit [Ping timeout: 250 seconds]
_phaul has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
<AndroidKitKat>
https://dpaste.org/AqdU something like this, i could go through and manually copy everything from one to the other hash but i figured there would be some method to do it
DTZUZO has joined #ruby
_phaul has joined #ruby
dionysus69 has quit [Quit: dionysus69]
cthu| has joined #ruby
_phaul has quit [Ping timeout: 250 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
<drnerdius>
Behold, a task that seems complicated but really shouldn't be! So, I'm trying to write a script that does transliteration between two alphabets. One of them is latin. The problem is that there are multiple de-facto standards of transliteration in one of the alphabets (some are more official, some are more casual/urban) so one latin letter can correspond with multiple letters or sequences of two or three letters. The input is a simple dictionary with
<drnerdius>
each word/phrase on a single line. The output should be all the possible transliterations that can be produced (I know many possible combinations may take more time, but I can control that part); each new word or variation of the same word on a new line. The rules of the processing is provided through a hash like this: {"ა" => ["a"], "ბ" => ["b"], ..., "ც" => ["ts", "c"], ... "ჰ" => ["h"]}. So, as you can see, if you look at the middle part,
<drnerdius>
each letter can correspond with multiple variations. This means, if a word contains this letter, it should create multiple words that cover all the possible variations. Here's the problem: I can treat the input as string and get the individual letters via indexes, but that way I'll need to do a loop which might slow down the process, and performacne really matters for me in this case. The second solution might be to use a method that can deal with this
<drnerdius>
without much interpreted code, logic, and loops, like gsub. Of course, the problem with gsub is that even though it can take hash map as a second argument, it's purpose is to do just the replacements, so you can't really give it a hash that maps keys with arrays with multiple values. I thought about converting that hash with multiple hashes with unique values — separating them by the array values — and then processing the text spep-by-step, but this
<drnerdius>
splution is more complicated and I don't know if it'll make my code any faster. There got to be a better and more elegant solution. Is there a better method I can use for this task? Is there a better way to solve this problem?
cthulchu has quit [Ping timeout: 250 seconds]
_phaul has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
TzilTzal has quit [Quit: Leaving.]
wallace_mu has quit [Read error: Connection reset by peer]
wallace_mu has joined #ruby
_phaul has quit [Ping timeout: 240 seconds]
Swyper has quit [Remote host closed the connection]
cthu| has quit [Read error: Connection reset by peer]
cthu| has joined #ruby
_phaul has joined #ruby
howdoi has joined #ruby
_phaul has quit [Ping timeout: 240 seconds]
cthu| has quit [Read error: Connection reset by peer]
cthu| has joined #ruby
Swyper has joined #ruby
_phaul has joined #ruby
<AndroidKitKat>
can anyone help me figure out how to use byebug? I was looking at some ways to use it, but i'm not sure it's doing what i want, i thought there was a way to add break points but I can't seem to figure it out
<AndroidKitKat>
i've been trying to get to an interactive version but i'm not sure what im doing wrong
_phaul has quit [Ping timeout: 268 seconds]
<nofxx>
AndroidKitKat, just add 'byebug' anywhere, that's the breakpoint
<nofxx>
run the code, you'll get an irb like session on that point
gix has joined #ruby
<nofxx>
you can add as many as you want
<AndroidKitKat>
Yeah I did that, but even when i run my program with 'byebug program.rb < input.txt'
<AndroidKitKat>
i still get kicked out to my bash prompt
<AndroidKitKat>
all it does is it seems to spit out some information about the loop it's in
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
<nofxx>
AndroidKitKat, strange.... you don't even need to run byebyg <script> , could be just ruby <script> and it'll work
<drnerdius>
Nvm my problem above; I figuered out a really elegant solution (if anybodu cares :) ).
<nofxx>
did you install the gem? there's no error about it?
<AndroidKitKat>
yeah i can run the script to problem
<nofxx>
AndroidKitKat, you need to require 'byebug' too btw
<leftylink>
in that case, doesn't the array already have << defined on it?
<havenwood>
Scriptonaut: Array already defines Array#<< (the shovel operator).
<adam12>
So your options are define << on that array, or use a delegator / proxy object in the middle.
<havenwood>
Scriptonaut: Show a bit of surrounding code?
<Scriptonaut>
so file_names is basically a string of comma separated values. It acts like an array though. When you call file_names, it fetches an internal value called file_names, that is a string, and splits it into an array
<Scriptonaut>
ok
<adam12>
I'd probably create a standin object.
howdoi has quit [Quit: Connection closed for inactivity]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_phaul has joined #ruby
<Scriptonaut>
thanks, ya I could have added a class for the file list but it might have been a bit overkill
fphilipe has joined #ruby
_phaul has quit [Ping timeout: 250 seconds]
_phaul has joined #ruby
fphilipe has quit [Ping timeout: 250 seconds]
Nahra has quit [Quit: leaving]
william1 has quit [Ping timeout: 240 seconds]
cthulchu has quit [Read error: Connection reset by peer]
cthulchu has joined #ruby
_phaul has quit [Ping timeout: 268 seconds]
_phaul has joined #ruby
_phaul has quit [Ping timeout: 265 seconds]
_phaul has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
_phaul has quit [Ping timeout: 250 seconds]
skywalker has joined #ruby
<skywalker>
hey. i am running an application, and it is returning "ignoring *name of the gem*, because its extensions are not built, try gem pristine". but as the gems are installed by rpm packages, i cannot use the pristine (i suppose).
<skywalker>
how could i manually build those extensions?
<skywalker>
or check what extensions are those
_phaul has joined #ruby
brool has joined #ruby
<skywalker>
disclaimer: i am actually building rpm packages, and i don't know very much of ruby - sorry
_phaul has quit [Ping timeout: 265 seconds]
_phaul has joined #ruby
drincruz has quit [Ping timeout: 268 seconds]
_phaul has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
_phaul has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
AJA4350 has joined #ruby
_phaul has quit [Ping timeout: 250 seconds]
cliluw has quit [Read error: Connection reset by peer]