adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.2, 2.7.4, 2.6.8: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
bsliger has joined #ruby
Inline has quit [Quit: Leaving]
Inline has joined #ruby
lunarkitty has joined #ruby
vit has quit [Ping timeout: 264 seconds]
menace has joined #ruby
menace has quit [Changing host]
menace has joined #ruby
mdemo has joined #ruby
jetchisel has quit [Ping timeout: 268 seconds]
waagrr has quit [Ping timeout: 260 seconds]
jetchisel has joined #ruby
Inline has quit [Remote host closed the connection]
Inline has joined #ruby
waagrr has joined #ruby
Inline has quit [Remote host closed the connection]
dohtem has quit [Quit: Connection closed for inactivity]
lunarkitty has quit [Quit: Connection closed for inactivity]
Inline has joined #ruby
dohtem has joined #ruby
michigan has quit [Quit: Connection closed for inactivity]
bsliger has quit [Quit: leaving]
ralu has quit [Ping timeout: 260 seconds]
reset has joined #ruby
ralu has joined #ruby
Rounin has quit [Ping timeout: 250 seconds]
jpw has joined #ruby
mdemo has quit [Quit: The Lounge - https://thelounge.github.io]
weyhmueller has quit [Quit: ZNC 1.8.2 - https://znc.in]
Inline has quit [Ping timeout: 264 seconds]
weyhmueller has joined #ruby
weyhmueller has quit [Client Quit]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
jetchisel has joined #ruby
weyhmueller has joined #ruby
swaggboi has quit [Quit: C-x C-c]
hololeap has quit [Remote host closed the connection]
shokohsc86 has joined #ruby
hololeap has joined #ruby
niv has quit [Quit: Powered by LunarBNC: https://LunarBNC.net]
swaggboi has joined #ruby
niv has joined #ruby
weyhmueller has quit [Quit: ZNC 1.8.2 - https://znc.in]
weyhmueller has joined #ruby
vit has joined #ruby
sam113101 has quit [Quit: WeeChat 3.2]
niv has quit [Quit: Powered by LunarBNC: https://LunarBNC.net]
cybniv has joined #ruby
ur5us has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
berkhan has joined #ruby
dohtem has quit [Quit: Connection closed for inactivity]
<leftylink> hmm...
<leftylink> sometimes it's illegal to use modifier rescue without parentheses in a place where I would have thought it'd be fine
<leftylink> pandabot: rb p(raise ?X rescue nil)
<pandabot> stderr: -e:2: syntax error, unexpected `rescue' modifier, expecting ')' - exit 1 - https://carc.in/#/r/c91w
<leftylink> pandabot: rb p((raise ?X rescue nil))
<pandabot> nil - 1 more lines - https://carc.in/#/r/c91x
<leftylink> actually, I can see why it'd be illegal there
<leftylink> because am I asking for raise (?X rescue nil), or (raise ?X) rescue nil
<leftylink> but wait
<leftylink> parenthesising the whole thing (raise ?X rescue nil) does nothing to answer that question
<leftylink> only knowing precedence will save you
<leftylink> okay in that case that is not the reason why omitting the parentheses is illegal in this position
<leftylink> then what!
_ht has joined #ruby
JSharp has quit [Ping timeout: 264 seconds]
itok_ has quit [Ping timeout: 256 seconds]
JSharp has joined #ruby
caleb has quit [Ping timeout: 256 seconds]
itok_ has joined #ruby
Liothen has quit [Ping timeout: 264 seconds]
JayDoubleu has quit [Ping timeout: 256 seconds]
keyvan has quit [Ping timeout: 256 seconds]
keyvan has joined #ruby
Liothen has joined #ruby
r0bby has quit [Ping timeout: 256 seconds]
caleb has joined #ruby
pusewic|away_ has quit [Ping timeout: 256 seconds]
josephl has quit [Ping timeout: 264 seconds]
r0bby has joined #ruby
JayDoubleu has joined #ruby
r0bby has quit [Max SendQ exceeded]
josephl has joined #ruby
pusewic|away_ has joined #ruby
r0bby has joined #ruby
<nakilon> > n = 100; n = n + (n = n * 2; 1); n # => 101
<nakilon> > n = 100; n = (n = n * 2; 1) + n; n # => 201
ur5us has quit [Ping timeout: 264 seconds]
berkhan has quit [Ping timeout: 260 seconds]
berkhan has joined #ruby
sam113101 has joined #ruby
ur5us has joined #ruby
shokohsc86 has quit [Read error: Connection reset by peer]
<nakilon> leftylink it's not about precedence but that those are two different parentheses
<nakilon> the function call () are a different thing from the precedence ones
<nakilon> I mean from the ones that wrap code
shokohsc86 has joined #ruby
<nakilon> at least that's how I understand it
<nakilon> not sure though why putting a space between p and ( does not fix it
<nakilon> p (raise ?X rescue nil), 1 # => error
<nakilon> p 1, (raise ?X rescue nil) # => 1 nil
<leftylink> the saddest place you can't use modifiers without parentheses is in lists
<leftylink> now you cannot write a nice validation function without parentheses
<leftylink> pandabot: rb def validation_errors(num); [:must_be_positive unless num > 0, :must_be_odd unless num.odd?].compact end
<pandabot> stderr: -e:2: syntax error, unexpected `unless' modifier, expecting ']' - exit 1 - https://carc.in/#/r/c920
<leftylink> pandabot: rb def validation_errors(num); [(:must_be_positive unless num > 0), (:must_be_odd unless num.odd?)].compact end
<pandabot> :validation_errors - https://carc.in/#/r/c921
<leftylink> now you must write it like that
<leftylink> pandabot: rb def validation_errors(num); [(:must_be_positive unless num > 0), (:must_be_odd unless num.odd?)].compact; [validation_errors(-2), validation_errors(2)] end
<pandabot> :validation_errors - https://carc.in/#/r/c922
<leftylink> pandabot: rb def validation_errors(num); [(:must_be_positive unless num > 0), (:must_be_odd unless num.odd?)].compact; end [validation_errors(-2), validation_errors(2)]
<pandabot> stderr: -e:2:in `[]': no implicit conversion of Array into Integer (TypeError) - exit 1 - https://carc.in/#/r/c923
<leftylink> pandabot: rb def validation_errors(num); [(:must_be_positive unless num > 0), (:must_be_odd unless num.odd?)].compact end; [validation_errors(-2), validation_errors(2)]
<pandabot> [[:must_be_positive, :must_be_odd], [:must_be_odd]] - https://carc.in/#/r/c924
Bounga has joined #ruby
Bounga has quit [Ping timeout: 260 seconds]
parv has joined #ruby
berkhan has quit [Ping timeout: 268 seconds]
jetchisel has quit [Ping timeout: 264 seconds]
jetchisel has joined #ruby
Inline has joined #ruby
Rounin has joined #ruby
_ht has quit [Ping timeout: 260 seconds]
_ht has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
_ht has quit [Ping timeout: 256 seconds]
_ht has joined #ruby
foxxx0 has quit [Quit: foxxx0]
foxxx0 has joined #ruby
Inline has quit [Quit: Leaving]
dohtem has joined #ruby
Inline has joined #ruby
parv has quit [Quit: parv]
Guest56 has joined #ruby
Guest56 has quit [Quit: Client closed]
berkhan has joined #ruby
BSaboia has joined #ruby
jhawthorn_ has quit [Quit: ZNC 1.8.2 - https://znc.in]
jhawthorn has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
berkhan has quit [Ping timeout: 264 seconds]
BSaboia has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
BSaboia has joined #ruby
BSaboia has quit [Client Quit]
ox1eef_ is now known as ox1eef
eldritch_ has quit [Quit: bye]
eldritch_ has joined #ruby
<libsys> hello people... I'm playing with Rack to build a minimal MVC application
Pixi has quit [Quit: Leaving]
<libsys> I've been looking for ways to share the scope of the controller into the view, but haven't been able to find a way
<libsys> of course if I execute the view within the controller that would work, but I'd like to do it by default without having to write it on the controller
prahal has joined #ruby
<prahal> hi, is this a bug that "bundle install --local" without a Gemfile.lock bring in development gems dependencies even with "bundle config set --local without 'development test'" ?
<libsys> maybe I could simply request to always execute a render function within the controller, still I'm curious
BSaboia has joined #ruby
BSaboia has quit [Client Quit]
<prahal> github rubygems bundler repository is read only , should I still report issues to this repository ?
Pixi has joined #ruby
<prahal> nvm I found it by cheer luck, rubygems/rubygems seems to now host bundler
prahal has quit [Quit: prahal]
BSaboia has joined #ruby
eldritch_ is now known as eldritch
lembron has joined #ruby
<lembron> hi, using Sequel - table apps: primary :id, String :name -- first i do a semi-manual db.insert(:id=>1, name=>'mo')
<lembron> then i start the manager, and "the first time it tries to insert a apps: line it fails as Key (id)=(1) already exists" -- clicking that very same button to create another in the UI again 'then works' tho
<lembron> is there anything i have to "trigger" - i guess my "direct id write" skips the autoincrement-logic or such?
<adam12> lembron: Database?
<adam12> lembron: That should normally work fine. It sounds like a database issue.
<lembron> postgres
<adam12> lembron: What is the line that is causing the error? db.insert?
<adam12> Oh. I actually misread this.
<adam12> lembron: Do you know what version of postgres? This might be a postgres question and not a Sequel question. For newer versions of Postgres, they use a different type of identity column and I wonder if that's the issue.
<adam12> lembron: Sometimes you can change the sequence, but I don't think you should mix and match. Either always provide the PK or let the db do it for you.
<lembron> just Application.new() and then just a .save on this - Sequel model handels that all to what i understand...
<lembron> "sequence" sounds about right, ive just found SELECT last_value FROM applications_id_seq; what prints "1"
<adam12> You can restart it, but again, it's risky.
<adam12> Something like `alter sequence applications_id_seq restart with 2` or something.
<adam12> I'd definitely ask in the postgresql IRC channel.
<lembron> hm.. appears as if 1 is correct anyhow...
<lembron> booted, checked prints 1, tried creating (http-500), still prints 1, tried creating again now thi magically worked
<lembron> hm and that "1" seems to be fully correct - when ry the table in empty state i still get "last_value=1, start_value=1 - only viible change is log_cnt jumps to 32 and is_called goes from f to t
<lembron> oh and pg9.4 (in an attempt to run it with what the readme asked for)
random-jellyfish has joined #ruby
shokohsc867 has joined #ruby
shokohsc86 has quit [Ping timeout: 264 seconds]
shokohsc867 is now known as shokohsc86
_ht has quit [Remote host closed the connection]
<lembron> managed to fix it by manually reforcing that seuence - creepy but k :P
<lembron> now on how to make Sequel spit out a: SELECT setval('apps_id_seq', (SELECT MAX(id)+1 from apps), false);
<lembron> little strange that a "SELECT * from apps_id_seq" showed the same number values before and after when it wasnt functioning, but well...
jpw has quit [Remote host closed the connection]
<lembron> Gemfile, can i do something in the line of: gem 'something', ((ruby.version>=3)? '>=2' : '<=1')
<lembron> :platforms seems to get close, but i want a version only, not a platform+version
nmollerup has quit [Quit: Leaving]
<weaksauce> lembron install_if probably can do it
<lembron> well not with the syntax i tried from the docs :/
<weaksauce> install_if -> { RUBY_VERSION >= 3 } do gem "something", "2" end
<weaksauce> or something like that
<lembron> There was an error parsing `Gemfile`: comparison of String with 3 failed. Bundler cannot continue.
<weaksauce> to_i
<weaksauce> perhaps
<weaksauce> actually that's not something that you can do
random-jellyfish has quit [Ping timeout: 256 seconds]
<lembron> anbd last - the thing also does `Refrigerator.freeze_core(:except=>['BasicObject']) unless dev` - trying that with production blows up with a "`require': can't modify frozen #<Class:Object>: Object (FrozenError)" --- is it kinda safe to asume that the author never made it prod-able? or i that maybe to blame on ruby-version? (script originally for 1.9, running on 3.0 right now)
ur5us has joined #ruby
random-jellyfish has joined #ruby
ur5us has quit [Ping timeout: 245 seconds]
<weaksauce> i don't think frozen objects have ever been just a warning
vit has quit [Ping timeout: 245 seconds]
<weaksauce> so probably a buggy gem
<weaksauce> yeah looking back at object for 1.9.1 object#freeze will raise an error