bradleyprice has quit [Remote host closed the connection]
Swyper has joined #ruby
bambanxx has joined #ruby
bambanx has quit [Ping timeout: 272 seconds]
cerulean has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
cerulean has quit [Ping timeout: 248 seconds]
amjam has joined #ruby
<amjam>
Hi ruby. I just tried to install two gems (bundler and vimgolf) -- both were successful, but I can't seem to locate them in my path. Am i doing something wrong?
<ruby[bot]>
amjam: 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
StarLord__ has joined #ruby
<SeepingN>
should vimgolf be a full executable??
<SeepingN>
you're installing a gem, but looking for a *nix executable
a7d7p7 has joined #ruby
bambanxx has quit [Ping timeout: 248 seconds]
wallace_mu has quit [Ping timeout: 248 seconds]
wallace_mu has joined #ruby
CCDelivery has joined #ruby
<adam12>
amjam: Did you look in /home/f/.gem/ruby/2.4.0/bin ?
cerulean has joined #ruby
Swyper has quit [Remote host closed the connection]
AJA4350 has quit [Ping timeout: 245 seconds]
Swyper has joined #ruby
cerulean has quit [Ping timeout: 248 seconds]
FernandoB has quit [Ping timeout: 252 seconds]
Swyper has quit [Remote host closed the connection]
fphilipe has joined #ruby
a7d7p7 has quit [Quit: a7d7p7]
fphilipe has quit [Ping timeout: 248 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<amjam>
adam12: thank you! that did the trick.
<amjam>
I added $HOME/.gem/ruby/2.4.0/bin to my $PATH and we're all good to go now.
Swyper has joined #ruby
<amjam>
SegFaultAX: vimgolf is an executable.
Swyper has quit [Remote host closed the connection]
DaRock has joined #ruby
<DaRock>
Hey guys
<DaRock>
I'm having some trouble with test::unit
<adam12>
amjam: Great news.
ur5us has quit [Remote host closed the connection]
<DaRock>
I'm a newb to ruby and testing, and I'm trying to debug these test I've written
ur5us has joined #ruby
<DaRock>
I've tried using ruby-debug, but that appears to be deprecated, I've tried with byebug, but that also isn't working - it can't import the module or something
<adam12>
DaRock: Did you choose test::unit for a reason?
<DaRock>
It seems to have issue in one of my switch cases
<DaRock>
but I can't figure out what exactly as the code works normally
<DaRock>
it seemed logical? I don't know - wikipedia books had a good example for it. Why?
<adam12>
DaRock: Don't quote me on it, but I don't know how maintained it is. Most people have moved on to minitest or rspec... so I was curious if it was chosen for a specific reason.
<DaRock>
All I'm getting in the test runs is: NoMethodError: undefined method `include?' for nil:NilClass
<adam12>
DaRock: That said. The easiest thing to do is to paste the backtrace/error you get, and the code that's erroring. Use Github Gist preferably but any paste tool is fine.
<DaRock>
and I can't seem to just do a puts to output a quick debug output
jenrzzz has joined #ruby
<adam12>
DaRock: Maybe puts is working, but because it's nil you're getting no output.
ur5us has quit [Ping timeout: 248 seconds]
<DaRock>
no, puts is in the test itself - I'm trying to figure out if the code I'm testing is getting all the right arguments
<adam12>
DaRock: Share some code. Anything else we'll just be speculating.
<DaRock>
Ideally some form of debug is really going to help here, but the testing framework doesn't seem to allow it
ur5us has joined #ruby
<adam12>
DaRock: If you're on a recent version of Ruby, put binding.irb before the line you're getting an error on, and it should drop you into a REPL that will let you poke at some of the variables.
<adam12>
DaRock: If you're not, install the `pry` gem and use binding.pry instead.
<DaRock>
agreed. But what I'd really like to know is how to accurately debug in the test framework, so any ideas along that line would be a good idea - as in what devs are using themselves in this situation
dbugger__ has joined #ruby
<DaRock>
what docs are there on binding?
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
<adam12>
DaRock: Byebug should just work fine, tho I'll admit I normally just use binding.pry and the REPL it provides.
<adam12>
DaRock: Binding is a context for all things in Ruby. pry and irb are methods on that context, and going into the detail on why those methods are on binding is likely more than you need to know at this point.
AJA4350 has joined #ruby
_dbugger has quit [Ping timeout: 248 seconds]
<adam12>
DaRock: If you're curious why I suggested pry and binding.pry, there are some good videos on the Pry website that explain it. It's not a real debugger, but it gives you a breakpoint at the place you insert the call, and let's you poke around inside the context of the call.
<adam12>
comet23: You have an issue with case. You check if 'Gosh' is in the curse word list but it's not, because it's actually in the list as 'gosh'.
<comet23>
thanks
<comet23>
i spotted the error :/
<comet23>
sometimes i can't code
esp32_prog has quit [Ping timeout: 248 seconds]
cloaked1 has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
laaron- has joined #ruby
amjam has quit [Quit: leaving]
laaron has quit [Ping timeout: 256 seconds]
<adam12>
comet23: is that homework or something else?
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
<adam12>
comet23: I rewrote it in 7 lines, if you want' to see it. But I don't want to spoil homework.
Talion has joined #ruby
jenrzzz has joined #ruby
laaron- has quit [Remote host closed the connection]
tdy has joined #ruby
duderonomy has joined #ruby
code_zombie has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 272 seconds]
laaron has joined #ruby
Swyper has joined #ruby
laaron has quit [Remote host closed the connection]
Swyper has quit [Remote host closed the connection]
bradleyprice has quit [Remote host closed the connection]
Swyper has joined #ruby
wallace_mu has quit [Remote host closed the connection]
exmortus has quit [Remote host closed the connection]
wallace_mu has joined #ruby
laaron has joined #ruby
Swyper has quit [Remote host closed the connection]
<comet23>
holy smokes adam12
<comet23>
i bet i can get it down to 7 lines, but i don't feel like thinking that hard lol
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
Swyper has joined #ruby
wallace_mu has quit [Remote host closed the connection]
exmortus has joined #ruby
staticx has joined #ruby
wallace_mu has joined #ruby
exmortus has quit [Remote host closed the connection]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
Swyper has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Ping timeout: 245 seconds]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
&>> words = %w[gosh darn shoot]; 'Gosh darn it'.gsub(/#{words.join('|')}/i) { |match| match.gsub /[aeiou]/, '*' }
bambanxx has quit [Remote host closed the connection]
bambanxx has joined #ruby
bambanxx has quit [Read error: Connection reset by peer]
bambanxx has joined #ruby
bambanxx has quit [Ping timeout: 248 seconds]
bambanx has joined #ruby
matthewd has quit [Ping timeout: 248 seconds]
matthewd has joined #ruby
andikr has joined #ruby
esp32_prog has joined #ruby
xco has joined #ruby
esp32_prog has quit [Ping timeout: 248 seconds]
deepreds1 has quit [Ping timeout: 248 seconds]
dellavg_ has quit [Ping timeout: 272 seconds]
bambanxx has joined #ruby
bambanx has quit [Ping timeout: 248 seconds]
marz_d`ghostman has joined #ruby
tj_ has joined #ruby
<marz_d`ghostman>
I'm storing a set in redis and wants to add/remove a value from the set every now and then. The set is quite big, is set.delete() the best way to pop a value/element from the set? or is there a more efficient way to do it?
rippa has joined #ruby
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
bradleyprice has quit [Ping timeout: 248 seconds]
aupadhye has joined #ruby
wallace_mu has joined #ruby
hightower2 has joined #ruby
wallace_mu has quit [Ping timeout: 248 seconds]
dminuoso has joined #ruby
<dminuoso>
Im on nix and I have a bundle application picking up gems from `/home/dminuoso/.gem/...` which I cant figure out why.
<dminuoso>
GEM_PATH is set correctly. What controls where ruby looks up gems?
<marz_d`ghostman>
dminuoso: echo $GEM_PATH
<marz_d`ghostman>
It may contain multiple paths separated by ':'
<dminuoso>
Like I said, GEM_PATH is set correctly, it doesn't list the above path.
bambanxx has quit [Remote host closed the connection]
<havenwood>
dminuoso: Is path set?: bundle config list
<dminuoso>
havenwood: Nope
<havenwood>
dminuoso: Or is BUNDLE_PATH set?: printenv BUNDLE_PATH
bambanxx has joined #ruby
<dminuoso>
havenwood: Also nope.
<havenwood>
dminuoso: ruby -e "p Gem.dir"
<dminuoso>
havenwood: That prints the wrong directory indeed.
<havenwood>
dminuoso: Do you have path.system (BUNDLE_PATH__SYSTEM) set?
<dminuoso>
havenwood: Mmm no, but I probably *should* use it.
<havenwood>
dminuoso: Do you have $GEM_HOME set?
<dminuoso>
havenwood: Nope.
<dminuoso>
Let me ask this differently.
<dminuoso>
If I want to perfectly sandbox this application, no strings attached to global directories in `~/.gem` etc
<dminuoso>
What's the canonical way?
bambanxx has quit [Ping timeout: 258 seconds]
<havenwood>
dminuoso: You want to vendor gems in your app directory? Or you mean you want them in your home directory?
<dminuoso>
havenwood: I want them in some directory. Say the app directory.
<dminuoso>
havenwood: Assume I have no global gem installed whatsoever.
<havenwood>
dminuoso: Bundler has a "remembered" --path flag.
<havenwood>
dminuoso: --path: Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine
<dminuoso>
havenwood: How exactly is it "remembered"?
<dminuoso>
Does it emit some local file?
<havenwood>
dminuoso: In a config file.
<havenwood>
Yes.
<dminuoso>
Ah
<havenwood>
dminuoso: .bundle/config
Furai has quit [Remote host closed the connection]
<dminuoso>
havenwood: Mmm, how much breakage would deleting all of ~/.gem cause?
<havenwood>
dminuoso: You can: gem uninstall --all
<dminuoso>
havenwood: No I actually mean deleting that directory ;)
<marz_d`ghostman>
havenwood: Is there a way for me to define a Set that doesn't get garbage collected? I want it to exist as long as my app is running.
<dminuoso>
marz_d`ghostman: keep a reference to it.
<havenwood>
marz_d`ghostman: If you keep a reference to the set, it wont get garbage collected. Why do you want it to exist, unreferenced?
<dminuoso>
marz_d`ghostman: Once an element is unreachable, you might as well delete it because you cant refer to it anyway
wallace_mu has quit [Ping timeout: 244 seconds]
esp32_prog has joined #ruby
<havenwood>
marz_d`ghostman: Say more about what you're wanting to do?
<marz_d`ghostman>
I'm playing around redis, instead of a database(postgres, mysql, etc.). I'm trying to store my data as hashes in redis. But I have to manually keep an index for all data like having a set "Customers" "#{comma separated ids}".
<dminuoso>
havenwood: Deleting the directory would have been faster..
mayurvpatil has joined #ruby
<dminuoso>
But it matters not.
<marz_d`ghostman>
So I want to have a persistent set to add and remove the ids instead of invoking redis each time an id gets added or removed.
<dminuoso>
havenwood: Okay, so deleting all gems seems to have improved the situation. invoking bundle brings it into an unkillable state now.
<dminuoso>
This is even more interesting now.
<havenwood>
marz_d`ghostman: Ruby's GC will note that the Set has been around a while and check it less often. There's nothing special you need to do to make sure it won't get GCed. It wont.
<dminuoso>
havenwood: Is there a way to install a gem locally without bundler?
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cerulean has joined #ruby
jasmin has joined #ruby
cerulean has quit [Ping timeout: 272 seconds]
prestorium has joined #ruby
bradleyprice has joined #ruby
a7d7p7 has joined #ruby
dh3 has joined #ruby
bradleyprice has quit [Ping timeout: 258 seconds]
dhollin has quit [Ping timeout: 244 seconds]
meinside has joined #ruby
mayurvpatil_ has joined #ruby
mayurvpatil has quit [Ping timeout: 248 seconds]
<marz_d`ghostman>
With inheritance, how do I force all subclasses to set a value to inherited attributes?
<dminuoso>
marz_d`ghostman: What?
jasmin has quit [Read error: Connection reset by peer]
<dminuoso>
marz_d`ghostman: I do not understand the question. Please rephrase.
<marz_d`ghostman>
dminuoso: Say I have a class named Animal. Then I have a subclass Dog. Dog inherits from Animal. Animal has an attribute :name, which will be inherited by Dog. I want force Dog to set a value to :name or raise an error when it doesn't
<dminuoso>
marz_d`ghostman: What do you mean by "when it doesn't"?
ellcs has joined #ruby
<marz_d`ghostman>
dminuoso: hmm, say when an instance of Dog is created, but the inherited :name attribute isn't set.
<dminuoso>
marz_d`ghostman: In my experience its best to not rely on this behavior.
<marz_d`ghostman>
In Java, there's this mechanism where at compile time, it throws an error because an inherited method or attribute isn't defined.
<dminuoso>
marz_d`ghostman: Have the initialize of Dog require everything needed.
<dminuoso>
marz_d`ghostman: Ah I see what you mean.
<dminuoso>
marz_d`ghostman: Ruby has no compile time mechanisms telling you that your code is bad, other than a grammar check.
<dminuoso>
You have to encode it into runtime checks and/or tests.
<marz_d`ghostman>
dminuoso: I see. It's a bit of work to require everything inside initialize() when there's a couple of subclasses already. Hmmm, should look into Mixins, perhaps I could set it there with: https://gist.github.com/marzdgzmn/5e6771bcf4f44451c854ed3ada018bca
Bish has joined #ruby
<Bish>
can i make nokogiri NOT encode node attributes?
clemens3 has joined #ruby
esp32_pr1g has joined #ruby
matchaw has quit [Ping timeout: 248 seconds]
apparition has joined #ruby
esp32_prog has quit [Ping timeout: 248 seconds]
salerace has quit [Ping timeout: 246 seconds]
wallace_mu has joined #ruby
esp32_pr1g has quit [Ping timeout: 272 seconds]
esp32_prog has joined #ruby
salerace has joined #ruby
bradleyprice has joined #ruby
wallace_mu has quit [Ping timeout: 248 seconds]
bradleyprice has quit [Ping timeout: 252 seconds]
clemens3 has quit [Quit: WeeChat 1.6]
jasmin has joined #ruby
Jonopoly has joined #ruby
bradleyprice has joined #ruby
bradleyprice has quit [Ping timeout: 248 seconds]
jasmin has quit [Remote host closed the connection]
mayurvpatil_ has quit [Quit: This computer has gone to sleep]
mhlei has joined #ruby
<mhlei>
hello
mayurvpatil_ has joined #ruby
<mhlei>
anyone who used the RSpec to do unit test. Is there some document for introduce it. as the official website hasn't a integral manual。
ljarvis has quit [Quit: WeeChat 2.4]
BH23 has joined #ruby
tj_ has quit [Quit: Leaving]
_joes_ has joined #ruby
jasmin has joined #ruby
_joes_ has quit [Client Quit]
jasmin has quit [Read error: Connection reset by peer]
andikr has quit [Remote host closed the connection]
jasmin has joined #ruby
conta has quit [Ping timeout: 248 seconds]
ellcs has quit [Ping timeout: 246 seconds]
lord4163 has joined #ruby
Ai9zO5AP has joined #ruby
AJA4350 has joined #ruby
bradleyprice has joined #ruby
dellavg_ has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
<marz_d`ghostman>
What minitest hook does a code get triggered after every test, not after every suite? def after; code end doesn't seem to be invoked every after test
Nicmavr has joined #ruby
conta has joined #ruby
bradleyprice has quit [Ping timeout: 248 seconds]
<Bish>
(s="accca").gsub(/a(.*)a/) { "{#{$1}}" }
<Bish>
why isn't this working as i expected :o
<Bish>
do i get the return value of the block?
<Bish>
no doesn't seem like it
ruslan has joined #ruby
mayurvpatil_ has quit [Quit: This computer has gone to sleep]
mahlon has quit [Read error: Connection reset by peer]
yurii has joined #ruby
hays has quit [Quit: No Ping reply in 180 seconds.]
dionysus69 has quit [Remote host closed the connection]
rippa has quit [Read error: Connection reset by peer]
aupadhye has quit [Ping timeout: 248 seconds]
r3m has quit [Ping timeout: 248 seconds]
hays has joined #ruby
dionysus69_ is now known as dionysus69
r3m has joined #ruby
bradleyprice has quit [Ping timeout: 252 seconds]
aupadhye has joined #ruby
yuriii has quit [Ping timeout: 248 seconds]
Inline has joined #ruby
esrse has quit [Ping timeout: 272 seconds]
yurii has quit [Quit: Konversation terminated!]
mozzarella has joined #ruby
leitz has quit [Quit: Leaving]
BH23 has quit [Ping timeout: 244 seconds]
wallace_mu has joined #ruby
wallace_mu has quit [Ping timeout: 248 seconds]
Swyper has quit [Remote host closed the connection]
cerulean has joined #ruby
jcalla has joined #ruby
Swyper has joined #ruby
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
cerulean has quit [Ping timeout: 252 seconds]
bradleyprice has joined #ruby
Swyper has quit [Remote host closed the connection]
bradleyprice has quit [Ping timeout: 250 seconds]
Swyper has joined #ruby
octos has quit [Remote host closed the connection]
octos has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
agrecascino has quit [Ping timeout: 264 seconds]
conta has quit [Ping timeout: 272 seconds]
agrecascino has joined #ruby
AJA4350 has joined #ruby
bradleyprice has joined #ruby
bradleyprice has quit [Ping timeout: 248 seconds]
iffraff has joined #ruby
<iffraff>
Hello, I know nothing about ruby :( but my question is, is there a command for bundler that will look at what is installed and look at the gem list, and update, rmove and add, the diff while not installing all the things that are already there?
<iffraff>
Or does it do this by default :)
hightower2 has quit [Ping timeout: 246 seconds]
dbugger__ has quit [Quit: Leaving]
m27frogy has quit [Ping timeout: 272 seconds]
iNs has quit [Remote host closed the connection]
laaron has quit [Remote host closed the connection]
iNs has joined #ruby
salerace has quit [Quit: salerace]
wallace_mu has joined #ruby
laaron has joined #ruby
m27frogy has joined #ruby
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
wallace_mu has quit [Ping timeout: 272 seconds]
<mhlei>
iffraff, `gem list` command can work.
<iffraff>
I don't know but is sounds like that will just list the gems?
Inline_ has joined #ruby
queip has quit [Ping timeout: 248 seconds]
<mhlei>
bundle show --paths
<mhlei>
can this work ?
Inline has quit [Ping timeout: 264 seconds]
<iffraff>
so I don't want to do it manually :) I wonder if there is a command that can just update to current gem file.
mhlei has quit [Quit: Leaving]
<iffraff>
or christ at least make it multi threaded, this install takes like 8 minutes!
<iffraff>
aha there is! I want to test it out but I don't want to stop the current install damn it! well, nothing ventured nothing gained
matchaw_ has joined #ruby
<adam12>
iffraff: bundler supports the --jobs (or -j) argument to do things in parallel.
<iffraff>
yes I'm trying that now. I wonder what a reasonable upper limit would be
<adam12>
iffraff: If you're on Linux, sometimes `bundle install -j $(nproc)` can give you a bit of speed bump.
<iffraff>
what's -j do?
<adam12>
iffraff: You can configure it as a global option too, to always use a number of jobs.
<adam12>
iffraff: It's the short version of --jobs, which is how many things to do in parallel.
queip has joined #ruby
<iffraff>
and nproc list how many procs are available? or are running or something?
matchaw has quit [Ping timeout: 248 seconds]
<iffraff>
I just set it to 8 and am hoping for the best. but I can tell you, just watching it it doesn't seem any faster
cornfeedhobo has joined #ruby
<iffraff>
do you/anybody, use ruby in docker? that's my issue, I have to rebuild the ruby container whenever the gems change which means between branch changes and everything
<cornfeedhobo>
I am probably going to ask this incorrectly, but is there a way to get all possible modules available for 'require'?
<iffraff>
well, yes that was abit faster.
<iffraff>
cornfeedhobo: is there a require in ruby ( i'm ruby noob but I know node)
<cornfeedhobo>
np. i'm coming from python and completely lost right now
<adam12>
iffraff: I don't use Docker, but if you're using ADD during development maybe you want VOLUME. It allows you to bind-mount instead of copy.
laaron- has joined #ruby
laaron has quit [Remote host closed the connection]
<iffraff>
ya, I know, in node I find that to be a very bad practive, because it makes what's on your local machine trump what's in the container. so it may still "works on my machine"
<adam12>
cornfeedhobo: No easy way. You can iterate through $LOAD_PATH which is where require looks for files. What are you trying to achieve?
mayurvpatil_ has quit [Quit: This computer has gone to sleep]
mayurvpatil_ has joined #ruby
mayurvpatil_ has quit [Remote host closed the connection]
bradleyprice has joined #ruby
<adam12>
iffraff: It sucks but I'm not sure of anything better :\
wallace_mu has joined #ruby
Esa_ has joined #ruby
jasmin has quit [Read error: Connection reset by peer]
iffraff has quit [Ping timeout: 258 seconds]
iffraff has joined #ruby
bradleyprice has quit [Ping timeout: 252 seconds]
mcgee-io has quit []
aupadhye has quit [Remote host closed the connection]
Inline_ has quit [Quit: Leaving]
jeremycw has joined #ruby
Inline has joined #ruby
queip has quit [Ping timeout: 248 seconds]
miskatonic has joined #ruby
AJA4351 has joined #ruby
wallace_mu has quit [Read error: Connection reset by peer]
wallace_mu has joined #ruby
AJA4350 has quit [Ping timeout: 248 seconds]
AJA4351 is now known as AJA4350
queip has joined #ruby
iffraff has quit [Remote host closed the connection]
weteamsteve has joined #ruby
bradleyprice has joined #ruby
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
ryakh has quit [Ping timeout: 248 seconds]
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
hutch has joined #ruby
charon77 has joined #ruby
ryakh has joined #ruby
dysp has joined #ruby
cthulchu_ has joined #ruby
dar123 has joined #ruby
bradleyprice has quit [Remote host closed the connection]
queip has quit [Ping timeout: 272 seconds]
DaRock has quit [Quit: No Ping reply in 180 seconds.]
DaRock has joined #ruby
iffraff has joined #ruby
queip has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iffraff has quit [Remote host closed the connection]