<adam12>
Anybody remember if 2.5 had an issue with net/http and byte truncating? or was that just 2.6.0?
yuesbeez has joined #ruby
<yuesbeez>
Does bundler share installed gems with other users in a multi user system?
jenrzzz has joined #ruby
<adam12>
yuesbeez: Depends. If you run it as root, I believe so.
jenrzzz has quit [Ping timeout: 252 seconds]
sphex has quit [Ping timeout: 240 seconds]
evdubs_ has joined #ruby
<yuesbeez>
adam12: If bundler can install multiple versions of a gem, where do the different versions install to?
<yuesbeez>
This says "In the usual development setup they are installed where they would be when you install a gem "normally" (by running gem install foo) and bundler won't reinstall gems that are already there. This location depends on how rubygems itself is configured." https://stackoverflow.com/a/11635148/6643845
<adam12>
yuesbeez: They are partitioned by name-version. ie. sequel-5.3.1 or something.
<yuesbeez>
adam12: Does that mean they are only compatible with bundler and bundler gems are not natively compatible with non-bundler projects?
evdubs__ has quit [Ping timeout: 268 seconds]
<adam12>
yuesbeez: No. A gem is a gem. But bundler can install gems _anywhere_, and while possible with `gem`, it’s not as easy/obvious.
<yuesbeez>
My end goal is to standardize the configuration of servers used for ruby development. I am having trouble understanding the interaction between rbenv, bunder, ruby, and gems
<adam12>
yuesbeez: You basically have two things going on: GEM_HOME and `bundle install —path`. Bundler and gem will honour GEM_HOME for a destination for gems, UNLESS bundle install receives —path which in that case it takes priority.
<adam12>
yuesbeez: rbenv will just be setting GEM_HOME (and maybe GEM_PATH).
<adam12>
ruby doesn’t care about which; it will use what rubygems cares about (GEM_HOME / GEM_PATH)
<adam12>
yuesbeez: rbenv will set GEM_HOME to something for a shared ABI. Where as Ruby 2.7.1 might prefer 2.7.1 for an install dir, rbenv might prefer 2.7 for _all_ versions. So rbenv will share versions of gems across the same major/minor ABI.
<yuesbeez>
But if someone is developing without bundler, and then tries to use an environment where each gem is suffixed by its version number because it was installed with bundler, wont this make their project incompatible without bundler
<adam12>
yuesbeez: No. Maybe if they use the vendor feature; I can’t speak to that.
<adam12>
yuesbeez: But there’s ongoing work to merge bundler and gems. So in theory, `gem install -g Gemfile` would work just fine and be fine.
<yuesbeez>
So will ruby use the latest version by default if theyre not using bundler?
<adam12>
yuesbeez: Bundler uses `gem` bits to do the install. They are all gems. It’s just the vendor option that’s weird.
<adam12>
yuesbeez: Yes, at least unless it needs an older version because of the `gem` statement or another dependency has a lower requirement.
felipec has joined #ruby
jenrzzz has joined #ruby
<yuesbeez>
If I want to keep non bundler gems up to date automatically how is that handled? Some gems installed with bundler need to stay on their version but the others need to be updated
Iarfen has quit [Remote host closed the connection]
<felipec>
Surely there's a simpler way to do this: while cond do func(enumerable.first) end
<adam12>
yuesbeez: Bundler would manage everything. It can use system gems but if they are not available, bundler will just install them.
<adam12>
yuesbeez: If this is for development work, you only need to focus on bundler. It was created precisely for this purpose.
<adam12>
felipec: Have a non pseudo-code example?
<yuesbeez>
Is GEM_HOME the system gems or the bundler gems?
<yuesbeez>
Can bundle install to the GEM_HOME?
<adam12>
yuesbeez: There’s no difference, other than the fact that GEM_HOME can be anything.
<adam12>
yuesbeez: If you apt-get install ruby; you probably have a GEM_HOME owned by root. So bundler will install there if you use root to install, but as a user, you cannot.
sphex has joined #ruby
<adam12>
yuesbeez: So as a user, you’d either set your own GEM_HOME (or use a tool that does it like rbenv), or provide a —path to bundler.
<weaksauce>
all bundler does in the background is manipulate paths
<weaksauce>
really
<yuesbeez>
How does bundler keep everything up to date if I only want to keep certain packages on a specific version
<weaksauce>
bundler doesn't
<yuesbeez>
so when gem update runs how does it detect which gems are not to be updated
<weaksauce>
it installs gems that satisfy the requirements of the gemfile and then updates the paths to use those gems
<weaksauce>
multiple gems can be installed at the same time
<weaksauce>
s/gems/versions of the same gem
<weaksauce>
yuesbeez you provide the string for each gem
<weaksauce>
specifying versions
<yuesbeez>
If bundler is installing its gems to the same location as ruby, then how does ruby know which gems to keep up to date and which to keep on a specific version
<adam12>
yuesbeez: Multiple versions can exist. So ruby might update ones that bundler manages, but the ones bundler wants are presumably still there.
<weaksauce>
i suggest you open up the $GEM_HOME and poke around
<weaksauce>
in general if you aren't using bundler but relying on some ruby gem version to be correct it's probably a mistake
<yuesbeez>
I want a system where some gems will be kept up to date, and others can have multiple versions installed. So theres bundler update and gem update, I still dont understand how these two commands wont conflict if they are sharing the same gems
<weaksauce>
specifically which gems don't you want updated?
<yuesbeez>
The ones which I want to keep at a specific version
<weaksauce>
no shit
<felipec>
yuesbeez: bundler installs to GEM_HOME by default
<weaksauce>
specifically
<yuesbeez>
Cocoapods
<weaksauce>
as long as cocoapods isn't in a gemfile anywhere you are fine
<weaksauce>
use bundler for cocoapods and you are good to go
<yuesbeez>
Ok so how can I keep multiple versions of cocopods installed, and keep the latest version of it installed so that whatever the needs of the users are they can pick whatever cocoapods version they want
<yuesbeez>
weaksauce: The users do not have access to install anything with bundler so I need to setup the environment to support a wide variety of projects
<weaksauce>
just have whatever versions of cocoapods installed that you want and let them decide in the gemfile yuesbeez
<weaksauce>
if the dependency is satisfied the users should be able to use bundle install fine
<weaksauce>
which creates the gemfile.lock
<weaksauce>
felipec any reason you are doing it that way?
<weaksauce>
that's not very idiomatic ruby
<felipec>
weaksauce: define "that way"
<yuesbeez>
weaksauce: If I have multiple versions of cocapods installed, what does gem update do when it sees they arent the latest version?
<weaksauce>
felipec all of it really, global variable mutated via a closure in a while loop using block.call
<felipec>
weaksauce: that is not what I'm doing, I was asked for an example
<weaksauce>
yuesbeez not sure i use bundler
<weaksauce>
not gem update
<weaksauce>
felipec i see
<yuesbeez>
weaksauce: does bundler update keep and gems that were already installed up to date as well?
<weaksauce>
bundle update *only* adds or keeps gems unless maybe you specify it to clean house
<felipec>
weaksauce: this is the actual code: while @buffer.length < @buffer.line_number + $curwin.height * 2 do @block.call(@buffer, @enumerable.first) end
<weaksauce>
ah that makes more sense
<felipec>
I simplified it to have 3 elements: a condition, a block, and an enumerable
neshpion has quit [Remote host closed the connection]
neshpion has joined #ruby
rogergilmour has quit [Remote host closed the connection]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 240 seconds]
neonloop has quit [Quit: Bridge terminating on SIGTERM]
neonloop has joined #ruby
<leftylink>
ah too bad
<leftylink>
since calling the block could ostensibly affect the condition
<leftylink>
if it were independent, it would be an opportunity to use take_while
ur5us__ has quit [Remote host closed the connection]
ua_ has quit [Read error: Connection reset by peer]
jla has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz_ has quit [Ping timeout: 260 seconds]
ua_ has joined #ruby
konsolebox has quit [Ping timeout: 260 seconds]
teclator has joined #ruby
felipec has quit [Quit: Leaving]
robotbee has joined #ruby
TomyWork has joined #ruby
konsolebox has joined #ruby
DaRock has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
hiroaki_ has quit [Ping timeout: 260 seconds]
pyra has quit [Ping timeout: 250 seconds]
pyra has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jla has joined #ruby
hiroaki_ has joined #ruby
jenrzzz has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
MalkbabY has joined #ruby
hkais has quit [Ping timeout: 252 seconds]
sphex has quit [Ping timeout: 268 seconds]
robotbee has quit [Ping timeout: 240 seconds]
MalkbabY_ has quit [Ping timeout: 240 seconds]
gearnode has joined #ruby
dpl has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
pyra has quit [Ping timeout: 245 seconds]
pyra has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
teclator has quit [Ping timeout: 246 seconds]
teclator has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hkais has joined #ruby
AndreYuhai has joined #ruby
jenrzzz has joined #ruby
queip has quit [Ping timeout: 240 seconds]
jenrzzz_ has quit [Ping timeout: 260 seconds]
al2o3-cr has joined #ruby
<jhass>
whyMe: defined? has its usecases but is generally a red flag, yes. I'm not sure I understand what you need to do. Btw I can generally recommend to spell out variable names and not use abreviations, acronyms or generic names like x,y,z a lot. Code is generally write once, read often
<jhass>
also good to name variables after what the value represents rather than what it is. number doesn't tell much, ok, it's a number but what does it represent? count is already better, something is being counted, but what is counted? dogs_count is great, we're counting dogs! I can get an idea what the program does without even looking at the logic yet
postmodern has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 240 seconds]
ur5us__ has joined #ruby
Rudd0 has quit [Read error: Connection reset by peer]
Rudd0^ has joined #ruby
r3my has quit [Ping timeout: 246 seconds]
clinth has quit [Ping timeout: 258 seconds]
afisher has quit [Ping timeout: 246 seconds]
r3my has joined #ruby
clinth has joined #ruby
pyra has quit [Quit: Konversation terminated!]
afisher has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
wallacer has quit [Ping timeout: 245 seconds]
queip has joined #ruby
jla has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 265 seconds]
<LACampbell>
adam12: that works really well, thanks
jetchisel has joined #ruby
splud is now known as BubbaFett
wallacer has joined #ruby
elcuervo has joined #ruby
cuerbot has quit [Read error: Connection reset by peer]
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
Rudd0^ has quit [Remote host closed the connection]
jenrzzz has joined #ruby
RandomArcher has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
RandomArcher has quit [Ping timeout: 265 seconds]
mtsd has joined #ruby
DaRock has joined #ruby
mtsd_ has joined #ruby
mtsd has quit [Read error: Connection reset by peer]
mtsd_ has quit [Ping timeout: 240 seconds]
jla has quit [Ping timeout: 240 seconds]
nyuszika7h has quit [Ping timeout: 250 seconds]
nyuszika7h has joined #ruby
linoge has joined #ruby
jenrzzz has joined #ruby
<AndreYuhai>
I've got a rails project where I use binding.irb to debug and etc.
<AndreYuhai>
However sometimes irb doesn't recognize my keystrokes. I don't know what would be the better word to explain that :D
<AndreYuhai>
Basically I want to type something but it doesn't on irb console, I have to press a key like 5 times to see it on the console
<AndreYuhai>
it doesn't appear*
<AndreYuhai>
Any idea why would that be?
jetchisel has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
<jhass>
but there's no disappearance of things
<jhass>
?
<jhass>
like previous line or the prompt disappearing until you hit enter
jla has joined #ruby
<AndreYuhai>
Sometimes irb gets weird as well
<AndreYuhai>
Weird characters get input to the console and etc
<AndreYuhai>
Or the order of the lines get mixed
<AndreYuhai>
All kinds of weird things happen when using irb :D
<jhass>
well it's hard to tell what's happening. Maybe you're inside some tool that constantly rewrites the screen (for example the rspec progress bar formatter)
<jhass>
maybe something prints control characters and your terminal settings get borked (blindly typing system("reset") could help there)
<AndreYuhai>
Next time I will try system("reset"), not sure what triggers that but probably as you mentioned maybe some change on my terminal
jetchisel has joined #ruby
ChmEarl has joined #ruby
howdoi has joined #ruby
lockweel has joined #ruby
iNs_ has quit [Remote host closed the connection]
iNs has joined #ruby
<adam12>
AndreYuhai: You probably need to configure your app server to run 1 thread or worker during development.
hsmath has joined #ruby
prestorium has quit [Quit: prestorium]
linoge has quit []
jla has quit [Ping timeout: 260 seconds]
dpl has quit [Remote host closed the connection]
dpl has joined #ruby
prestorium has joined #ruby
jla has joined #ruby
AndreYuhai has quit [Quit: leaving]
AndreYuhai has joined #ruby
jetchisel has quit [Ping timeout: 265 seconds]
AndreYuhai has quit [Client Quit]
jetchisel has joined #ruby
DaRock has quit [Ping timeout: 252 seconds]
Rudd0 has joined #ruby
AndreYuhai has joined #ruby
dpl has quit [Ping timeout: 240 seconds]
AndreYuhai has quit [Quit: leaving]
MalkbabY has joined #ruby
MalkbabY_ has quit [Ping timeout: 240 seconds]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
TomyWork has quit [Remote host closed the connection]
ua_ has quit [Ping timeout: 260 seconds]
jla has quit [Ping timeout: 240 seconds]
FrostCandy has joined #ruby
duderonomy has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
hsmath has quit [Quit: Connection closed for inactivity]
nertzy_ has quit [Ping timeout: 250 seconds]
safetypin has quit [Quit: ZZZzzz…]
moldorcoder7 has quit [Quit: %bye mirc%]
nertzy has joined #ruby
nertzy has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
gix has joined #ruby
ua has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
<banisterfiend>
Anyone else have a macbook pro struggle to push 2 external 4k monitors ? is it worth it to replace them with 1 super-wide 4k monitor instead? does that improve performance?
moldorcoder7 has joined #ruby
feriman has joined #ruby
DTZUZU has quit [Read error: Connection reset by peer]
<adam12>
LACampbell: Those are both instance and class methods. The difference is the character before the method name. `::` is a class method, `#` is an instance method. `File` subclasses `IO` so you need to look there for methods too.
<LACampbell>
ahhh. OK that makes sense
swaggboi has joined #ruby
<LACampbell>
(though actually in retrospect, I should probably just use `sed`. right tool for the job and all that