MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
blackmesa1 has quit [Ping timeout: 260 seconds]
cow[moo] has joined #ruby
blackmesa has quit [Quit: WeeChat 3.1]
venmx has joined #ruby
code_zombie has joined #ruby
istrasci has quit [Quit: Connection closed]
centrx has joined #ruby
cd has joined #ruby
arwn has joined #ruby
<arwn>
It's my first day using ruby and I'm trying to set up a new project. I ran bundle exec MyProject && bundle install. now how do I run it? The bundler website is unclear on how to use bundle exec.
vondruch has quit [Read error: Connection reset by peer]
<jla>
welcome, arwn 'bundle exec ' may look for a ruby gem ...
<arwn>
i'm just reading about rake right now but I think this is a bit too much to worry about. Is it a bad idea to just `irb main.rb` and forget about bundler and rake?
<jla>
may i suggest to have a look at how to build your own Ruby based blog in oder to taste ruby gems - bundler workflow ?
<adam12>
I really want to deep dive into the parser that Samuel built since I think it would be a neat compliment to view components.
<adam12>
He calls them xnodes I think.
<arwn>
im utterly confused now. can't I just do something like `bundle new project && run project`? am I thinking about this the wrong way?
blackmesa has joined #ruby
<adam12>
havenwood: I’m bullish on Hanami 2 (there’s been a ton of progress on it lately and I think a new alpha should drop soon), but I’ve also been secretly working on my own internal framework. A side effect of that tho has been to deep dive into older frameworks like Merb, which has been super fascinating. A lot of stuff from Merb was very
<adam12>
forward facing. I wish it didn’t die.
<havenwood>
arwn: If you have an existing app, you typically do `bundle && bundle exec ruby ...`.
<havenwood>
arwn: I haven't looked at Hanami 2 at all!
<havenwood>
adam12: ^
<havenwood>
arwn: What is `bundle new` supposed to do?
<micah>
how is a jamstack site not just... a static site?
<adam12>
arwn: I guess it depends on what you expect `bundle new project` to produce. It ships a `bin/console` which might be what you want?
<havenwood>
arwn: Are you meaning to create a gem or Gemfile or what?
<adam12>
micah: Well, nobody owns a trademark for _static site_.. ;P
<adam12>
s/patent/trademark (please don’t hurt me mr havenwood)
<havenwood>
®
iheartcoffee has left #ruby [#ruby]
<adam12>
arwn: The folder structure of a gem is fairly consistent, at least at the beginning. If `bundle gem` creates `lib/foo.rb`, (whatever you named your project), that could technically be your entry point. `ruby -rbundler/setup -Ilib lib/foo` could be your command to run it.
centrx has quit [Ping timeout: 276 seconds]
<havenwood>
arwn: You can also just install the gem to get it in your load path.
<havenwood>
arwn: rake install
<havenwood>
It's handy to know how to run it like adam12 said.
<havenwood>
adam12: I was almost sad for SCOTUS ruling correctly in Google v. Oracle since it means we don't get so much pain that abolishing software patents becomes viable.
<adam12>
havenwood: Maybe we’ll get lucky with the patent defense funds that CloudFlare/etc are doing.
<micah>
adam12: :D
<havenwood>
adam12: yeah, a great start to tap it down while we wait on critical mass to just fix the broken
<adam12>
havenwood: Not that I agree with software patents, but frivilous software parents definitely chap my ass. So it’s nice to see some pushback there, especially if patents are being invalidated.
<adam12>
CloudFlare alone has like 120 patents? I’m surprised to think there’s enough unique problems to patent. Which is in some ways bothersome.
<havenwood>
"In this manner, the user is kept informed of the status of a task being performed without resorting to language sensitive messages such as "Now processing object number 12 of 100" ."
<havenwood>
A progress bar is the universal translator of completion!
<havenwood>
Quick, patent 12%.
<havenwood>
By affixing a percent sign, this novel design technique achieves universal translation.
<adam12>
O_O
<adam12>
Failure for not using 42.
arwn has quit [Quit: Connection closed]
JaredCE has quit [Ping timeout: 268 seconds]
JaredCE has joined #ruby
oleksandry has quit [Ping timeout: 268 seconds]
wallacer has quit [Ping timeout: 250 seconds]
JaredCE has quit [Ping timeout: 265 seconds]
Axy has joined #ruby
wallacer has joined #ruby
Mia has quit [Ping timeout: 240 seconds]
hiroaki has quit [Ping timeout: 260 seconds]
sphex has joined #ruby
<micah>
×This request has been rejected due to the violation of Fair Use policy
howdoi has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 252 seconds]
gix has joined #ruby
Axy has quit [Read error: Connection reset by peer]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
jla has quit [Ping timeout: 265 seconds]
alexherbo2 has joined #ruby
Xiti` has joined #ruby
<alexherbo2>
hello
cow[moo] has quit [Read error: Connection reset by peer]
<alexherbo2>
I get an error after updating to Ruby 3. I have `def initialize(**attributes, &block)` and call `Pokemon.new(index: 25, name: 'Pikachu')` which works, but when using hashes, in my `def self.all` it doesn't. how can I fix it?
Xiti has quit [Ping timeout: 252 seconds]
<alexherbo2>
I heard about Ruby introducing method overloading, so maybe I can define 2 initializers, one using `**attributes` and the other `attributes` as the single argument for hash.
<alexherbo2>
not sure what is the correct approach
<adam12>
alexherbo2: Do you have a stack trace? That might help.
oleksandry has joined #ruby
<alexherbo2>
`/home/taupiqueur/root/projects/active-record.rb/chapters/04-active-record-basics/lib/active-record/base.rb:96:in `initialize': wrong number of arguments (given 1, expected 0) (ArgumentError)`
<adam12>
alexherbo2: There’s no real method overloading, so that wouldn’t work.
<adam12>
alexherbo2: On Ruby 2.7 does your code warn?
<alexherbo2>
in Ruby 2.7 my code worked, I could pass as named argument or as a hash
<alexherbo2>
with `**attributes`
<alexherbo2>
no, on ruby 2.7, it works fine
Mia has quit [Read error: Connection reset by peer]
<alexherbo2>
I'm sure it is because `**attributes` are optional and expect 0 positional argument (the hash I'm passing in `.all`)
<adam12>
alexherbo2: Show source of self.all. Can you put all of this together in a gist or paste? source code, stacktrace (full, not just 1 line), etc.
<adam12>
alexherbo2: You could try splatting the hash in .all, **hash
<alexherbo2>
I have a repo but I have to force push
<adam12>
Seeing the whole picture and not just fragments will help. There should of been a warning on 2.7 tho.