436664-436892

436470-436985 subjects 436874-437138

Ruby project curriculum
436664 [mickyscandal] curriculum for ruby? I'm not really looking for a book or tutorial, I've
+ 436665 [dummey@gm il] Have you tried going through http://rubykoans.com/ which are more like
+ 436667 [matt@te hn r] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| 436669 [leland.krych] I'm also going to plug the Ruby path on exercism.io
| 436673 [sathors@fr e] I would also recommend exercism.io. I have found the review of others to
| 436675 [p-dev@ou lo ] I would suggest The Odin Project: http://www.theodinproject.com/courses?ref=
+ 436671 [karthikeyan@] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

[ANN] JRuby 9.1.6.0 Released
436670 [tom.enebo@gm] The JRuby community is pleased to announce the release of JRuby 9.1.6.0

Generate the core Ruby documentation
436674 [ruby@e- ol t] I use rbenv 1.0.0 with MacOs 10.12.1, and have ruby 2.3.1p112.
436686 [ruby@e- ol t] Sorry for the noise, forget this thread.

[ANN] minitest-coverage 1.0.0.b1 Released
436676 [ryand-ruby@z] minitest-coverage version 1.0.0.b1 has been released!
436688 [michael@sc w] The link to rdoc http://docs.seattlerb.org/minitest-coverage is not working!?

"if x == x = 1 || x = 2 || x = 3" WTF?!
436677 [ruby-talk.li] New post (finally!) on Attack of the Codosaurus, about what happens
436678 [terry.raimon] I think you can write "if x == x = 1" instead of "if x == x = 1 || x = 2 ||
+ 436679 [zoneiva@gm i] Definitely!
| 436683 [Andy.Jones@j] Slightly off topic: does anyone else shy away from the following as potentially very confusing?
+ 436685 [ruby-talk.li] Correct.  The "x = 1" would return a truthy value and therefore
  436692 [matthew@ke w] That's a bad way of testing it, as 'x = y' would leave 'y' undefined
  436693 [ruby-talk.li] Good point.  I was agreeing with the right result, but suggesting the

assignments in conditionals (was: "if x == x = 1 || x = 2 || x = 3" WTF?!)
436684 [ruby-talk.li] Please don't hijack threads.  When you change the subject, change the Subject.
+ 436689 [fxn@ha hr f.] I personally prefer the assingment in conditional, because in this case I
| + 436690 [shortcutter@] But you typically only reap reasonable gains in case of loop
| + 436691 [matthew@ke w] So never run a Rails app with warnings enabled.
+ 436719 [Andy.Jones@j] Nice to see I'm not alone here.

time
436694 [inform@di -o] I#m a bit confused: time is in stdlib and core?  - How do I distinguish
436696 [aj.santos128] I did some reading, and according to this
436697 [inform@di -o] Yes, I tried that already -
436698 [aj.santos128] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
436699 [inform@di -o] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
436700 [peterwawood@] Peter
436702 [thomas@ch rb] Indeed +500 is not a valid timezone offset in ISO 8601, but +0500, +05:00
+ 436703 [inform@di -o] Oh, its the 0 ! +0500 is fine
+ 436704 [inform@di -o] Its not fine that

share a ruby-session
436695 [inform@di -o] how can I share a ruby-process?
+ 436701 [michael.luts] you can try DRb <http://ruby-doc.org/stdlib-2.3.1/libdoc/drb/rdoc/DRb.html>,
| 436705 [bar.hofesh@s] Just note , it has really poor performance and when we tried to use it for =
| + 436706 [fluido@fl id] Mah. I now mostly use Mruby. When I used MRI, DRb was often involved,
| + 436709 [shortcutter@] How did you use it? How can we know the issue was in DRb and not in your code?
+ 436707 [pbayford@ta ] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| 436711 [matthew@ke w] peer.
| 436716 [pbayford@ta ] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
+ 436710 [wyhaines@gm ] Take a look at pry-remote.

[ANN] Ruby-GNOME2 3.1.0
436708 [cedlemo@gm .] The gems of the Ruby-GNOME2 project are updated to the version 3.1.0.

Checksum Algorithm
436712 [mickyscandal] is having me output a checksum with a given algorithm on several arrays of
436713 [matthew@ke w] Just one pointer, to get you started: this is calculating the modulus, but
436714 [mickyscandal] oh wow! I didn”Ēt even notice that! alright, with that changed, I get the

Unknown key: :order
436715 [welcome.to.e] I have been learning Rails by working through Carneiro and Barazi's
+ 436717 [zimbatm@zi b] By googling: has_many rails order
| 436731 [welcome.to.e] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
+ 436733 [ryand-ruby@z] This is really a rails question. Please direct your question over to the appropriate list/forum.

What to do when object has lots of attributes?
436724 [leamhall@gm ] N00bie question. I'm working on a Class that has lots of attributes that
436725 [fxn@ha hr f.] N00bie question. I'm working on a Class that has lots of attributes that
436726 [leamhall@gm ] I'm in the middle of adding another large number of attributes, and will
436727 [rajsahae@gm ] If this is for a game, the characters traits could be broken up into sub
436729 [pbayford@ta ] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

[ANN] yahns 1.14.0 -_- sleepy app server for Ruby
436730 [ e@80 24 or ] A Free Software, multi-threaded, non-blocking network

signal:noise much improved!
436732 [ryand-ruby@z] *deep sigh*

Ruby 2.3.2 and 2.2.6 Released
436734 [usa@ga ba ec] We've just released Ruby 2.3.2 and 2.2.6.
+ 436736 [se3.roland@g] Great news....
| 436737 [se3.roland@g] How can I contribute in an open source community.
| 436740 [ryand-ruby@z] You start by starting your own threads instead of hijacking others.
+ 436756 [inform@di -o] compiling sprintf.c
| 436778 [ryand-ruby@z] Please file on bugs.ruby-lang.org to get proper tracking
+ 436763 [inform@di -o] Running tests (bootstraptest): test_io.rb fails !
| 436779 [ryand@ze sp ] Please file on bugs.ruby-lang.org to get proper tracking
+ 436844 [ e@80 24 or ] No announcement for 2.3.3?
  436846 [inform@di -o] Nice to get this info,

Whitewidow self promotion
436735 [thomas.perki] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
436750 [Andy.Jones@j] Whitewidow is an open source automated SQL vulnerability scanner, that is capable of running through a file list, or can scrape Google for potential vulnerable websites.

converting data types in arrays with multiple data types
436738 [mickyscandal] [["+", "609"], ["*", "48"], ["+", "345"]]
+ 436739 [abejideayode] [["+", "609"], ["*", "48"], ["+", "345"]].map { |x| x.map { |y| y.to_i == 0
| + 436741 [mickyscandal] alright, thank you very much! that definitely works, I don't really
| | + 436742 [mickyscandal] oh... wait... is it because if i were to try to convert the symbols to
| | + 436743 [thomas.perki] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| | + 436744 [baole6989@gm] Yep, that's a ternary if-else statement. Before the "?" Is the off
| |   436745 [baole6989@gm] Sorry correction for a typo, "before the '?' Is the IF statement,..."
| |   436746 [thomas.perki] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| |   436747 [mickyscandal] alright, i definitely got it now. I figured out what was really confusing
| |   436752 [m-guelker@ph] There is a method that raises an exception if you try to convert
| + 436748 [shortcutter@] Since we seem to know the structure this seems overly complex. What about
|   + 436755 [baole6989@gm] I really like this solution.
|   + 436757 [mickyscandal] irb(main):002:0> a.map {|x,y| [x, Integer(y)]}
|     436773 [michael.luts] I would go with this
|     436776 [botpena@gm i] joining the fxnal fun : ),
|     436777 [thomas.perki] That's a really broad rescue clause..
|     + 436785 [michael.luts] That's Kernel#Integer method is awesome! Could be reduced to
|     + 436797 [botpena@gm i] indeed. recursion is heavy  and so is exception handing.
+ 436749 [botpena@gm i] $ file=sample.txt ; cat $file ; ruby -lne 'BEGIN{a=[]};
  436751 [shortcutter@] Nice and condensed but I prefer to be a bit more verbose

delete vars
436753 [inform@di -o] is there any method call (metaprogramming?) to remove a var-name (so it
436754 [paul.christo] This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
436758 [inform@di -o] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
+ 436759 [thomas.perki] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
+ 436806 [ryand-ruby@z] 3559 % irb

Ruby-version
436760 [inform@di -o] How can I get the Ruby-version if running irb ?
+ 436761 [matthew@ke w] irb(main):001:0> RUBY_VERSION
+ 436762 [thomas.perki] puts RUBY_VERSION

lines containing regex
436764 [inform@di -o] How can I emulate a short form similar to (the non-existing)
436769 [botpena@gm i] do you mean
436774 [tinglenxan@g] "sample"[/\d+/]
436786 [inform@di -o] Thank you!
436789 [shortcutter@] This will not return the whole string though unless the regex matches
436792 [inform@di -o] Yes -  so the whole string has to match the regex (vice versa :))
436795 [shortcutter@] That is not a reply to my question though. I wondered why you asked
436842 [inform@di -o] your question in the first place (see at thread start). What do you need
436843 [shortcutter@] This typically involves Ruby's command line options -e and -n or -p. A few ways
436845 [inform@di -o] Thank you!
+ 436847 [shortcutter@] Ruby's syntax _is_ fixed.
+ 436848 [matthew@ke w] If you prefer 'then', use 'then'. That's the beauty of not having a
  436849 [inform@di -o] Thanks!

Is it possible to make your own String Encoding?
436765 [space.ship.t] I'd like to define an encoding which is a derivative of UTF-8 but
+ 436766 [thomas.perki] new_string = old_string.encoding!(<your encoding name>)
| 436767 [space.ship.t] Yeah, it would be awesome if I could make some encodings, e.g.
| 436768 [space.ship.t] Right now, I'm using a set of wrapper classes... but it doesn't seem
| 436770 [iarunkant@gm] While I don't know your use case, it seems that you are trying to represent
| 436775 [shortcutter@] I agree. Having this in String instances seems backward. There are
| 436814 [space.ship.t] It was more of an exploratory, "is this possible?". Whether or not
+ 436772 [m-guelker@ph] It is not possible in Ruby code, but since each of the existing

[ANN] zenweb 3.10.1 Released
436771 [ryand-ruby@z] zenweb version 3.10.1 has been released!

[ANN] graphics 1.0.0b6 Released
436780 [ryand-ruby@z] graphics version 1.0.0b6 has been released!

ruby sdl, audio playback
436781 [mickyscandal] I need some help working with sdl. At this point all I'm trying to do is
+ 436783 [pbayford@ta ] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| 436784 [pbayford@ta ] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
+ 436801 [ryand@ze sp ] I don't have any working examples for this, but my graphics gem has sdl-mixer already hooked up. You can either pilfer from it or feel free to switch to it. I'm actively working on it (not the audio part, yet, but I'm totally happy to take a PR with an example using it).
  436807 [mickyscandal] I'll definitaly take a look at your gem, what's it called? I noticed
  436809 [ryand@ze sp ] the gem name IS 'graphics'

[ANN] hoe 3.15.3 Released
436782 [ryand-ruby@z] hoe version 3.15.3 has been released!

include/s, contain/s
436787 [inform@di -o] I would appreciate to add includes? and contains?,
436788 [Andy.Jones@j] This has always bugged me, too, and for once I did the sensible thing and looked to see if anyone had raised an issue for it.
436791 [inform@di -o] I thought Ruby allows "many ways" ?
436793 [Andy.Jones@j] Click here to view Company Information and Confidentiality Notice.<http://www.jameshall.co.uk/index.php/small-print/email-disclaimer>

string-indices
436790 [inform@di -o] "a"[1]        # nil
436794 [sto.mar@we .] "Element Reference --- If passed a single index, returns a substring
+ 436796 [shortcutter@] One could argue though that these two should return the same because
+ 436798 [inform@di -o] => 0
  + 436800 [matthew@ke w] When slicing a single char, it's as you imagine -- you get the
  + 436803 [ryand-ruby@z] Because you didn't read the documentation first. This isn't the first time that your first response is a copy/paste from the doco. I've done it myself. PLEASE start there. `ri String.[]` is quick and easy and accurate.

How to make ruby detect .rb files
436799 [king.sabri@g] Is there anyway to make the ruby commandline detects the .rb files like
436802 [ryand-ruby@z] No clue what this means...
436804 [ken@jo s. rg] What he *probably* means is that he's on Windows, and wants to just type
436805 [dogatana@gm ] RubyInstaller for Windows does through setup if a checkbox is enabled.
436811 [king.sabri@g] I'm sorry for being not so clear in my question.
436812 [ken@jo s. rg] Ah! That's very interesting -- I'd never noticed that before, which is
436813 [king.sabri@g] Thanks @ken

ri
436808 [michael.luts] finds the documentation? I saw the rdoc/ri/paths.rb, but it is not the
436810 [ryand-ruby@z] 3577 % ri --help

rubocop errors
436815 [ruby@e- ol t] ***ISSUE 1
436816 [thomas.perki] Rubocop is just a style analyst. Your code will work, it's just contradicting ruby style guide
436817 [ruby@e- ol t] Ok, i'm looking also for best practice.
436818 [ialexxei@gm ] Rubocop is the best code analyst =)
436819 [fabian.zitte] def a_winner?(turn)
436839 [ruby@e- ol t] Thank you very much for your explanations Fabian, i understand better.

playing music with ruby
436820 [mickyscandal] and at least from what I've read if you want music in your app you have to
436821 [thomas.perki] Why not just system call the music and thread it so that it'll play while the program runs on a superset thread? This could potentially cause problems when one thread crashes
436822 [mickyscandal] %x(mpg123 -q file.mp3) just call the file like: %(file.mp3)? will that
436823 [peterhickman] Perhaps Ruby and SDL rather than an external application
436824 [mickyscandal] That's actually what I've been trying to do. But honestly I think sdl is a
+ 436826 [thomas.perki] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| + 436827 [mickyscandal] Now you got me a little bit confused... Isn't shoes just a GUI tool kit?
| + 436829 [thomas.perki] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
+ 436828 [peterhickman] It's been a while since I did any SDL but this looks like a good place to
  436830 [mickyscandal] Thank you Peter! I don't know how I missed that when I was going through
  436831 [mickyscandal] Thomas, thanks for that info. I didn't realize shoes supports audio/video.
  436832 [mickyscandal] I'm looking through the (not very good) documentation for Audite. so far
  436833 [mickyscandal] so I decided for learning purpuses, I'm not going to use the audite gem for
  436834 [mickyscandal] I should really do some more poking around before I ask a question. I made
  + 436835 [erikbc.b@gm ] Have you looked into the Ruby bindings for OpenAL or FMOD? That”Ēs the
  + 436837 [m-guelker@ph] #fork creates a new process. Thread.new creates a new thread within a

How to spawn a PTY in one line
436825 [king.sabri@g] Is there any pure and native ruby way to spawn an interactive shell in *one
436838 [m-guelker@ph] Since process spawning is an inherently OS-specific operation, there
436840 [king.sabri@g] Yes, I meant native.
436841 [shortcutter@] Please,

[ANN] kramdown 1.13.0 released - new man page converter and GFM enhancements
436836 [t_leitner@gm] ## About kramdown

Ruby 2.3.3 Released (was Re: Ruby 2.3.2 and 2.2.6 Released)
436850 [usa@ga ba ec] I heard that chikanaga-san (Ruby 2.3 maitainer) could not send

Permanent job in Tokyo, Japan
436851 [jamesbtobin@] fulfil a permanent DevOps-type position at their office in Tokyo.

[ANN] crypt-isaac 1.2.0 Released
436852 [wyhaines@gm ] crypt-isaac 1.2.0 has been released!
436855 [michael.luts] Maybe you mean https://github.com/wyhaines/crypt-isaac (without "t")
436856 [wyhaines@gm ] On Nov 22, 2016 9:15 AM, "Michael Lutsiuk" <michael.lutsiuk@gmail.com>

Unable to set digest mode
436853 [karthikeyan@] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

[ANN] loofah-activerecord 2.0.0 Released
436854 [mike.dalessi] loofah-activerecord version 2.0.0 has been released!

Rake tasks/subclassing/decentralisation help?
436857 [jdickey@se e] arrying around in Rakefiles on several projects. I=E2=80=99d really like =

(none)
436858 [tyuruta@za .] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

ipv6 validator
436859 [leamhall@gm ] Any good ways of improving this as an ipv6 validator? Calling scripts
+ 436860 [ken@jo s. rg] #!/usr/bin/ruby
+ 436861 [chneukirchen] It parses 1::1::1 which is invalid.
  436862 [leamhall@gm ] Christian, thanks! I missed that test.
  436863 [ken@jo s. rg] Well, it just reminded me of the whole, "I want to parse HTML; what

Help wanted with REXML
436864 [rdm@cf l. om] I'm having some trouble making sense out of REXML's behavior. Help?
+ 436867 [ryand-ruby@z] I'd recommend stopping immediately and switching to nokogiri. The API is much more usable and it is a lot faster, esp with larger documents.
| 436869 [shortcutter@] But it incurs a larger overhead when loading. For small scripts and
+ 436868 [shortcutter@] Since you are using a pastie already, could you post a real document

curses vs. ncurses?
436865 [mickyscandal] hey, everyone. need a little clarification. what exactly is the difference
+ 436866 [ken@jo s. rg] I don't claim to know the definitive answer, but I believe that one is
+ 436870 [michael.luts] You can just run 'man ncurses', it has much useful information
  436884 [mickyscandal] You can just run 'man ncurses', it has much useful information
  436886 [michael.luts] You can read it on the web https://linux.die.net/man/3/ncurses
  436887 [mickyscandal] Oh, maybe that is the case. I just went back to look, and this is the
  436889 [echristopher] I think an important point that has been overlooked in this conversation
  436892 [mickyscandal] That's pretty much what I was thinking. and based on that thought I figured

empty value
436871 [ruby@e- ol t] Is there a better way to test if a variable|instance is empty ?
+ 436872 [michael.luts] Depends on your assumptions on what value this variable can hold. If it is
+ 436873 [Andy.Jones@j] I generally use something like
  436880 [shortcutter@] I think that highlights that using #empty? to detect "unset" is just
  436881 [Andy.Jones@j] Well, sure.  But if you are capturing the state from somewhere else then you don't get to make that assumption.  For example, if you are entering it on the command line with `gets()` (the simplest example), if the user presses return you will get an empty string, not nil.
  436883 [shortcutter@] But you surely would not process user input without validation, would you?
threads.html
top