havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
cnsvc has joined #ruby
thegeekinside_ has quit [Ping timeout: 256 seconds]
markoong has quit [Ping timeout: 260 seconds]
mossplix has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
alexherbo2 has quit [Ping timeout: 256 seconds]
mossplix has quit [Remote host closed the connection]
andremedeiros has quit [Quit: ZNC 1.8.1 - https://znc.in]
andremedeiros has joined #ruby
<havenwood> mnathani: It's a Windows-specific thing to help you compile C-extensions for gems that have them.
<havenwood> mnathani: A fair number of gems do have some C.
<havenwood> mnathani: If you're using Windows Installer, you likely want DevKit too.
<havenwood> They go together.
comet23 has joined #ruby
jenrzzz has joined #ruby
imode has quit [Ping timeout: 272 seconds]
oddp has quit [Ping timeout: 240 seconds]
<r3m> -include ##r3m /print -core irc.freenode.#ruby
<havenwood> r3m: huh?
Eiam has quit [Quit: (╯°□°)╯︵ ǝpouǝǝɹɟ]
imode has joined #ruby
imode has quit [Ping timeout: 256 seconds]
mossplix has joined #ruby
greypack has joined #ruby
mossplix has quit [Ping timeout: 260 seconds]
greypack has quit [Ping timeout: 265 seconds]
imode has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SeepingN has joined #ruby
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<r3m> havenwood: sorry was testing something in weechat and the command is -include=#channel not -include #channel so i amsg al the chan, kind of embarassing ;)
LtHummus has joined #ruby
<mnathani> is it possible to have a " within a string?
gell5 has joined #ruby
<havenwood> mnathani: Yeah, you can have any character supported by the encoding in a String.
<havenwood> &>> puts '"'
<rubydoc> # => "... check link for more (https://carc.in/#/r/9ek1)
<havenwood> &>> puts "\""
<mnathani> name = "mnathani\" here" ?
<rubydoc> # => "... check link for more (https://carc.in/#/r/9ek2)
<mnathani> wout that work?
<havenwood> mnathani: It's a String with a double quote in it, if that's what you mean?
<havenwood> &>> "mnathani\" here"
<rubydoc> # => "mnathani\" here" (https://carc.in/#/r/9ek3)
<havenwood> mnathani: When you wonder, try in IRB.
<havenwood> ?irb mnathani
<havenwood> irb is "interactive ruby", it is part of ruby. You can run ruby code and see results immediately. it's useful for testing code. Also see ?pry, a gem which is a popular alternative to irb.
<havenwood> mnathani: IRB ships with Ruby. Type "irb" from your command line.
<mnathani> &>> "mnathani"here"
<rubydoc> stderr: -e:4: syntax error, unexpected local variable or method, expecting `end'... check link for more (https://carc.in/#/r/9ek4)
<mnathani> &>> puts "mnathani\"here"
<rubydoc> # => mnathani"here... check link for more (https://carc.in/#/r/9ek5)
<havenwood> mnathani: Try in your local IRB though, not in the channel unless you're demonstrating.
<havenwood> &>> 'mnathani"here'
<rubydoc> # => "mnathani\"here" (https://carc.in/#/r/9ek6)
<mnathani> ok, I can do that
gell5 has quit [Ping timeout: 272 seconds]
greypack has joined #ruby
ChmEarl has quit [Quit: Leaving]
greypack has quit [Ping timeout: 256 seconds]
cliluw has quit [Ping timeout: 258 seconds]
cliluw has joined #ruby
gix has quit [Ping timeout: 256 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
sagax has joined #ruby
greypack has joined #ruby
cthu| has quit [Ping timeout: 240 seconds]
greypack has quit [Ping timeout: 264 seconds]
mossplix has joined #ruby
mossplix has quit [Ping timeout: 258 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
wymillerlinux has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
bruce_lee has quit [Ping timeout: 260 seconds]
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
gell5 has joined #ruby
gorsuch has quit [Ping timeout: 272 seconds]
redlegion has quit [Ping timeout: 260 seconds]
itok has quit [Ping timeout: 246 seconds]
redlegion has joined #ruby
gorsuch has joined #ruby
itok has joined #ruby
gell5 has quit [Ping timeout: 264 seconds]
orbyt_ has joined #ruby
donofrio has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 240 seconds]
greypack has joined #ruby
jenrzzz has joined #ruby
gell5 has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
BSaboia has joined #ruby
jenrzzz has joined #ruby
gell5 has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
polishdub has joined #ruby
imode has quit [Ping timeout: 246 seconds]
imode has joined #ruby
<mnathani> I came across this URL = URI.parse("https://domain.com")
alfiemax has joined #ruby
<mnathani> whats URI?
<EvanR> a top level module
<mnathani> whats a good way to differentiate a top level module from a variable?
alfiemax has quit [Ping timeout: 256 seconds]
<EvanR> personally, use a convention where top level modules and classes start with an uppercase letter and local variables start with lower case
bocaneri has joined #ruby
<mnathani> json.each do |hash|
<mnathani> what does the | | mean?
mossplix has joined #ruby
baojg_ has quit [Remote host closed the connection]
baojg has joined #ruby
renich has quit [Quit: renich]
mossplix has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
schne1der has joined #ruby
leah2 has quit [Ping timeout: 256 seconds]
alexherbo2 has joined #ruby
wake_of_ship has joined #ruby
_aeris_ has quit [Ping timeout: 240 seconds]
_aeris_ has joined #ruby
itok has quit [Ping timeout: 256 seconds]
integral has quit [Ping timeout: 256 seconds]
comet23 has quit [Ping timeout: 256 seconds]
Iambchop has quit [Ping timeout: 256 seconds]
leah2 has joined #ruby
itok_ has joined #ruby
integral has joined #ruby
Iambchop has joined #ruby
comet23 has joined #ruby
Benett has quit [Ping timeout: 256 seconds]
Benett has joined #ruby
_whitelogger has joined #ruby
polishdub has quit [Remote host closed the connection]
<havenwood> mnathani: You can ask Ruby about whether it's a class or variable in a variety of ways.
<havenwood> defined? URI #=> "constant"
<havenwood> URI.class #=> Module
<havenwood> Module.const_source_location 'URI' #=> ["/path/to/uri.rb, 42]
Industrial has joined #ruby
<havenwood> mnathani: Constants, including class and module names, must start with an uppercase.
<havenwood> mnathani: By convention, SCREAMING_SNAKE_CASE are constant variables and CamelCase are modules or classes.
<havenwood> mnathani: Local variables are snake_case. Methods are too, typically.
gell5 has joined #ruby
schne1der has quit [Ping timeout: 256 seconds]
gell5 has quit [Ping timeout: 256 seconds]
mniip has joined #ruby
BenDover has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
plutes has joined #ruby
plutes has quit [Max SendQ exceeded]
mossplix has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
comet23 has quit [Quit: Connection closed for inactivity]
apteryx is now known as Guest54769
apteryx has joined #ruby
Guest54769 has quit [Ping timeout: 240 seconds]
Industrial has quit [Ping timeout: 256 seconds]
wake_of_ship has quit [Remote host closed the connection]
mossplix has quit [Ping timeout: 260 seconds]
imode has quit [Ping timeout: 272 seconds]
_whitelogger has joined #ruby
gell5 has joined #ruby
Industrial has joined #ruby
baojg has quit [Remote host closed the connection]
baojg_ has joined #ruby
mossplix has joined #ruby
gell5 has quit [Ping timeout: 265 seconds]
baojg_ has quit [Remote host closed the connection]
baojg has joined #ruby
mossplix has quit [Ping timeout: 256 seconds]
BSaboia has quit [Quit: This computer has gone to sleep]
cliluw has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
RiPuk has quit [Quit: ZNC 1.8.1 - https://znc.in]
RiPuk has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
arcaos has quit [Read error: No route to host]
arcaos has joined #ruby
jenrzzz has joined #ruby
alfiemax has joined #ruby
RiPuk_ has joined #ruby
RiPuk has quit [Ping timeout: 256 seconds]
alfiemax has quit [Ping timeout: 246 seconds]
RiPuk_ has quit [Quit: ZNC 1.8.1 - https://znc.in]
RiPuk has joined #ruby
oddp has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
prestorium has quit [Quit: prestorium]
<rapha> hola rubyistas
cliluw has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
cliluw has quit [Ping timeout: 260 seconds]
jenrzzz_ has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
gell5 has joined #ruby
<phaul> rapha: hola
gell5 has quit [Ping timeout: 246 seconds]
gg4dawae has joined #ruby
gg4dawae has left #ruby [#ruby]
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
<phaul> &>> require 'ripper'; Ripper.sexp('-3')
<rubydoc> # => [:program, [[:unary, :-@, [:@int, "3", [1, 1]]]]] (https://carc.in/#/r/9ekw)
<phaul> seems to be a lie
<phaul> &asm>> -3
<rubydoc> I have disassembled your code, the result is at https://carc.in/#/r/9eky
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
TCZ has joined #ruby
ur5us has joined #ruby
markoong has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
NGC3982 has quit [Ping timeout: 258 seconds]
gell5 has joined #ruby
jenrzzz has joined #ruby
ur5us has quit [Ping timeout: 256 seconds]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
leitz has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
wymillerlinux has joined #ruby
prestorium has joined #ruby
gix has joined #ruby
gell5 has quit [Ping timeout: 256 seconds]
Industrial has quit [Ping timeout: 256 seconds]
mheld has joined #ruby
leitz has quit [Quit: Leaving]
alfiemax has joined #ruby
jenrzzz has joined #ruby
alfiemax has quit [Ping timeout: 258 seconds]
lucasb has joined #ruby
TCZ has quit [Quit: Leaving]
Guest48 has joined #ruby
howdoi has joined #ruby
Guest48 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest48 has joined #ruby
Guest48 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MrCrackPot has joined #ruby
MrCrackPot has quit [Client Quit]
Industrial has joined #ruby
Industrial has quit [Ping timeout: 256 seconds]
troulouliou_dev has quit [Quit: Leaving]
donofrio has joined #ruby
gell5 has joined #ruby
gell5 has quit [Ping timeout: 256 seconds]
Industrial has joined #ruby
troulouliou_dev has joined #ruby
markong has joined #ruby
markoong has quit [Ping timeout: 258 seconds]
chalkmonster has joined #ruby
Esa__ has joined #ruby
gell5 has joined #ruby
gell5 has quit [Ping timeout: 246 seconds]
<mnathani> This statment is confusing me:
<mnathani> The local variable is created when the parser encounters the assignment, not when the assignment occurs
Esa__ has quit []
<apotheon> I'm guessing that's some kind of documentation of parsing and execution.
<mnathani> its from section https://docs.ruby-lang.org/en/2.4.0/syntax/assignment_rdoc.html : Local Variables and Methods
Esa__ has joined #ruby
<apotheon> The parser might be checking the syntax of the program and taking note of specific things that need handling, such as creating a variable, then after doing that sort of thing in a wave or two it might go back and assign values.
<apotheon> . . . so upon first parsing it, it just sets aside the storage for the variable, then later (when evaluating whatever produces the value to be assigned to the variable) actually sticks something in that storage space.
<apotheon> I say this without actually looking at that page, though, so maybe I'm mistaken.
<al2o3-cr> apotheon: that's pretty much correct.
<apotheon> thanks for confirmation
<al2o3-cr> as soon as the ruby parses an expression with an assignment a local variable is created, whether that expression evaluted to true or false.
<mnathani> a = 10 vs if a < 10 ?
<al2o3-cr> mnathani: one is an assignment the other is a condition.
<mnathani> what would a good example for an expression look like
<al2o3-cr> mnathani: both are expressions.
<apotheon> 10 is an expression that evaluates to 10, actually.
<apotheon> a = 10 is a more complex expression (and also evaluates to 10)
<mnathani> so this part still gets me : ` not when the assignment occurs `
<apotheon> a < 10 evaluates to either true or false, unless a doesn't exist, in which case you get a nice error
<al2o3-cr> operands and operators.
arzWZM has quit [Ping timeout: 265 seconds]
<mnathani> whats the difference between encountering an assignment vs an assignment occuring
<apotheon> mnathani: On the first pass when it finds `a = 10`, it sets aside storage for a local variable.
<apotheon> mnathani: On a later pass when it evaluates the `10` part, it assigns the results to that storage.
arzWZM has joined #ruby
<apotheon> This is when the parsing and execution occurs behind the scenes. The Ruby interpreter/VM is doing this stuff; it doesn't correlate directly to the way we humans read the code.
<mnathani> its like minute details? not to be concerned about for beginners?
<apotheon> pretty much
<mnathani> good to know. Thank you
<apotheon> I've never read that page of documentation.
kinduff has joined #ruby
<apotheon> mnathani: glad to help
<al2o3-cr> mnathani: just be mindful of precedence when assigning
<mnathani> bedmas type stuff?
<al2o3-cr> &>> x = 3 && false; x
<rubydoc> # => false (https://carc.in/#/r/9elj)
<al2o3-cr> &>> x = 3 and false; x
<rubydoc> # => 3 (https://carc.in/#/r/9elk)
<al2o3-cr> that's because = has higer precedence than and
wake_of_ship has joined #ruby
<al2o3-cr> *higher
<mnathani> cant seem to find a rubydoc that describes &&
<mnathani> thanks
<al2o3-cr> mnathani: `&&` is a control flow operator `and` is a keyword
<al2o3-cr> basically `and` is short-circuit boolean
<al2o3-cr> lower than `&&`
troulouliou_dev has quit [Quit: Leaving]
<al2o3-cr> what would call && a control flow op or logical op?
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
hiroaki has joined #ruby
gell5 has joined #ruby
hiroaki has quit [Remote host closed the connection]
hiroaki has joined #ruby
gell5 has quit [Ping timeout: 272 seconds]
dviola has joined #ruby
<mnathani> sorry .. not sure what you are asking?
cacheerror has quit [Quit: WeeChat 2.8]
wake_of_ship has quit [Ping timeout: 246 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
ChmEarl has joined #ruby
<adam12> mnathani: Kinda like bedmas I guess.
<adam12> mnathani: My suggestion is to try to prefer && and || almost always, `and` and `or` infrequently.
<adam12> mnathani: At least until you understand the difference in precedence.
<apotheon> Bedmas?
<apotheon> Is that the celebration of the birth of Bed?
<adam12> lol
<apotheon> I prefer "and" and "or", probably because I don't often find myself operating directly on the result of a conjunction or disjunction like that, but I do sometimes need to perform some operation after seeing how a previous operation works out.
<apotheon> also probably because I like the English-language-ness of them
<adam12> apotheon: I think it's fine if you're experienced but if you're learning it can add some confusion.
troulouliou_dev has joined #ruby
<apotheon> I think the "new user" guidance might better be something like "Use parentheses around conjunction/disjunction expressions."
<apotheon> (then delete them later when you're more comfortable with the language)
<adam12> apotheon: Maybe.
<phaul> mnathani: it might be subtle but you can write code that shows that this can effect observable program behaviour https://gist.github.com/phaul/98200c3752fe4a0f00fecc4c510c2704
<al2o3-cr> be nice if `and` and `or` be made operators.
<phaul> mnathani: here foo seems to magically switch between two values
<apotheon> phaul: That's insidious.
<apotheon> well played
<phaul> hehe :)
alfiemax has joined #ruby
<apotheon> How does one create a periodic meatspace interest group gathering at a public place that people can reasonably stumble onto, express intent to attend, and attend, without using or relying on Meetup or Facebook?
alfiemax has quit [Ping timeout: 264 seconds]
Emmanuel_Chanel has quit [Quit: Leaving]
<mnathani> does a return statement leave the method it was executed in?
<leah2> yes
<mnathani> whats the difference between segmenting code within a begin / end block within a method definition, and just skipping the begin / end portion?
<leah2> usually begin/end is used with rescue
<leah2> (but there is an implicit begin/end actually)
<leftylink> second most common place one would see begin/end is probably with ||=
<leah2> or begin..end until ...
cliluw has joined #ruby
<leah2> leftylink: i'd use () there probably
<leftylink> nice
<leftylink> in fact, I think I had not thought of doing that...
<leftylink> I will have to keep this in mind as a possibility
<leftylink> mind has been expanded today
Emmanuel_Chanel has joined #ruby
LtHummus has quit [Quit: ZNC 1.8.1 - https://znc.in]
Guest48 has joined #ruby
LtHummus has joined #ruby
gell5 has joined #ruby
gell5 has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 258 seconds]
wake_of_ship has joined #ruby
wake_of_ship has quit [Client Quit]
hiroaki has quit [Ping timeout: 272 seconds]
Guest48 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leitz has joined #ruby
jenrzzz has joined #ruby
gell5 has joined #ruby
orbyt_ has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
gell5 has quit [Ping timeout: 256 seconds]
oneeggeach has joined #ruby
oneeggeach has quit [Client Quit]
Industrial has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 258 seconds]
prestorium has quit [Ping timeout: 258 seconds]
wymillerlinux has quit [Ping timeout: 256 seconds]
alfiemax has joined #ruby
wymillerlinux has joined #ruby
gell5 has joined #ruby
Industrial has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
gell5 has quit [Ping timeout: 260 seconds]
chalkmonster has joined #ruby
gell5 has joined #ruby
zapata has joined #ruby
Esa__ has quit [Ping timeout: 258 seconds]
gell5 has quit [Client Quit]
jenrzzz has joined #ruby
cnsvc has joined #ruby
prestorium has joined #ruby
coniptor has quit [Ping timeout: 256 seconds]
alfiemax has quit [Remote host closed the connection]
arcaos_ has joined #ruby
DTZUZU has quit [Quit: WeeChat 2.8]
coniptor has joined #ruby
alfiemax has joined #ruby
DTZUZU has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
greypack has quit [Ping timeout: 264 seconds]
greypack has joined #ruby
imode has joined #ruby
Industrial has quit [Ping timeout: 264 seconds]
TCZ has joined #ruby
Industrial has joined #ruby
ogs has joined #ruby
Benett has quit [Quit:  ]
Benett has joined #ruby
BenDover has quit [Remote host closed the connection]
arzWZM has quit [Ping timeout: 256 seconds]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
arzWZM has joined #ruby
jetchisel has joined #ruby
alfiemax has quit [Ping timeout: 272 seconds]
TCZ has quit [Quit: Leaving]
FetidToot has quit [Quit: The Lounge - https://thelounge.chat]
hiroaki has joined #ruby
alfiemax has joined #ruby
jenrzzz has joined #ruby
leitz has quit [Quit: Leaving]
greypack has quit [Ping timeout: 256 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZU_ has joined #ruby
DTZUZU has quit [Ping timeout: 258 seconds]
ogs has quit [Quit: WeeChat 2.8]
alfiemax has quit [Ping timeout: 256 seconds]
hiroaki has quit [Ping timeout: 272 seconds]
greypack has joined #ruby
Industrial has quit [Ping timeout: 246 seconds]
jetchisel has quit [Ping timeout: 246 seconds]
jetchisel has joined #ruby
troulouliou_dev has joined #ruby
troulouliou_dev has quit [Max SendQ exceeded]
troulouliou_dev has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
DTZUZU has joined #ruby
DTZUZU_ has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
greypack has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
troulouliou_dev has quit [Quit: Leaving]
Xiti has quit [Quit: Leaving]
Xiti has joined #ruby
jenrzzz has joined #ruby
alexherbo2 has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ruby
cliluw has quit [Ping timeout: 256 seconds]
sagax has quit [Read error: Connection reset by peer]
wymillerlinux has quit [Ping timeout: 272 seconds]
FetidToot has joined #ruby
oddp has quit [Ping timeout: 256 seconds]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]