436874-437138

436664-436892 subjects 437080-437305

Improve a piece of code
436874 [ruby@e- ol t] class Testing
+ 436875 [damiansimonp] I think you can simply set @name = °∆Guest°« in the constructor that way @name has a default value of °∆Guest'
+ 436876 [damiansimonp] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
+ 436877 [damiansimonp] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
  436878 [ruby@e- ol t] 1/ Set the name
  436879 [matthew@ke w] 1. initialise the name to "Guest"
  436882 [ruby@e- ol t] Thank you very much Matthew, i was wrong from the beginning :)
  436885 [aamaxworks@g] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

String.new what is default encoding?
436888 [space.ship.t] When preparing for immutable strings by default, I changed my code from
436890 [shortcutter@] I'd go with
436893 [ialexxei@gm ] Isn't it mode convenient to use
436894 [sebastien.pu] Just if you want to keep the string empty. Otherwise, you will not be able

[ANN] kramdown 1.13.1 released
436891 [t_leitner@gm] ## About kramdown

random numbers
436895 [mickyscandal] trying different things out and ended  up coming across this. if I do
436896 [ruby-talk.li] It's doing exactly what you told it to do, not what you *meant*.
+ 436897 [mickyscandal] thank you that really clears things up. after I posted that I thought about
| 436898 [matthew@ke w] some_big_slow_expensive_function_that_I_only_want_to_calculate_once()
+ 436899 [m-guelker@ph] This is such a great definition that I'm going to quote your post the

case statement with arguments?
436900 [mickyscandal] def seek_foreward(amt = 3)
436901 [matthew@ke w] Do you mean you want to be able to match a string that starts with 'SEEKF'
436902 [mickyscandal] ahh, I think that just might work! the method also has a default value for
436903 [shortcutter@] input = gets
436906 [mickyscandal] I was wondering when someone was going to notice that! I'm assuming you're
436913 [shortcutter@] $ find -type f -name '*.rb' -exec sed -i.bak -e

rb_funcall and explicit method cache
436904 [space.ship.t] I'm implementing some code that calls the same method multiple times
436907 [ryand-ruby@z] You can use rb_obj_method (just like you would use #method in pure ruby).

[ANN] Trenni - a gem for fast templating and parsing
436905 [space.ship.t] It now includes C parsers generated by Ragel to improve both

Review code, refactoring
436908 [ruby@e- ol t] Is it possible to do this simpler ?
+ 436909 [ialexxei@gm ] First thing that can be noticed is to replace
| 436910 [keystonelemu] You don't need a class for this. Just use an until loop.
| + 436911 [maximhedrovi] class name need to write in CamelCase
| | + 436912 [matthew@ke w] On 30 November 2016 at 17:25, Maxim Hedrovich <maximhedrovich@gmail.com>
| | + 436914 [fluido@fl id] No!!
| |   436916 [Andy.Jones@j] 1. According to "the" Ruby Style Guide (https://github.com/bbatsov/ruby-style-guide#naming), you should use CamelCase for classes.
| + 436915 [martindemell] result = while true do
|   436917 [ruby@e- ol t] Many thanks for all that reply to my question.
|   + 436918 [mike@st k. a] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
|   + 436919 [martindemell] It's saying that you shouldn't use the "while true do ... end" construct if
+ 436931 [shortcutter@] If this is some kind of REPL you could do

Ruby vs Python: Blowfish ECB encryption
436920 [pedrib@gm il] I'm trying to understand why there is a difference between Ruby and
+ 436921 [bascule@gm i] Tony Arcieri
| 436922 [pedrib@gm il] I don't that's the case... if you look closely you will see I'm setting
| 436923 [bascule@gm i] Oh, sorry, I glanced over the "send :encrypt" (BTW that's a rather odd way
| 436929 [pedrib@gm il] To be honest, I just did some copy paste of that code.
+ 436932 [botpena@gm i] try,
  436933 [pedrib@gm il] Thanks for the help botp. Your answer put me in the right track.
  436934 [botpena@gm i] imho, ruby follows standard behaviour by padding  (padding=1),

[ANN] oedipus_lex 2.5.0 Released
436924 [ryand-ruby@z] oedipus_lex version 2.5.0 has been released!

[ANN] debride 1.7.0 Released
436925 [ryand-ruby@z] debride version 1.7.0 has been released!

[ANN] minitest 5.10.0 Released
436926 [ryand-ruby@z] minitest version 5.10.0 has been released!

[ANN] ruby2ruby 2.3.2 Released
436927 [ryand-ruby@z] ruby2ruby version 2.3.2 has been released!

[ANN] path_expander 1.0.1 Released
436928 [ryand-ruby@z] path_expander version 1.0.1 has been released!

[ANN] minitest 5.10.1 Released
436930 [ryand-ruby@z] minitest version 5.10.1 has been released!

[ANN] olddoc 1.3.0 - old-fashioned RDoc generator
436935 [ e@80 24 or ] olddoc contains old-fashioned document generators for those who do not

largest number in an array below a given value
436936 [mickyscandal] Return the first number from an Array that is less than a particular number
+ 436937 [guillaume.hi] find is a method you can use on an Enumerable. An Array is an Enumerable. The docs indicates that find accept a block and "Returns the first entry for which block is not false."
| 436938 [mickyscandal] OH! I must have missed that when I read through the docs. I was under the
| 436939 [guillaume.hi] Be careful, array.sort returns a new array, and will not gives you what you want.
| 436940 [mickyscandal] That's almost exactly what I have except mine's on two lines. does that
| + 436941 [bruce@ru y. ] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| + 436942 [matthew@ke w] That's almost exactly what I have except mine's on two lines. does that
+ 436943 [shortcutter@] That is a different problem to solve than the one described in the
  436944 [mickyscandal] huh... it looks like I was confusing myself and doing way more work than I
  436945 [matthew@ke w] An array (even outside of programming) is "a systematic or ordered
  436946 [Andy.Jones@j] def first_under(array, limit)
  436947 [shortcutter@] No, this does not work reliably (e.g. when there are only negative
  436950 [Andy.Jones@j] Array.max_by{|x| x < limit ? x : nil }
  436954 [shortcutter@] irb(main):016:0> Array.max_by{|x| x < limit ? x : nil }
  436957 [Andy.Jones@j] Outlook habitually capitalises the first character in every line.  I missed one. You know very well from the previous context we were talking about a parameter name, not a class.
  436960 [shortcutter@] This will fail for the quite common case that there is at least one

DRY it up bro (same instance & class method)
436948 [terry.raimon] I am willing to DRY up some code, I have the same code for an instance and
+ 436949 [sebastienpuy] the instance method and use ` delegate :tag_list, to: 'self.class' `
+ 436951 [wyhaines@gm ] def self.tag_list
  436952 [ialexxei@gm ] def self.tag_list
  436953 [terry.raimon] The point is `self.tag_types` and `instance.tag_types` won't return the
  + 436955 [shortcutter@] module TagAlgorithms
  + 436956 [wyhaines@gm ] If the expected return value is different between the class and the

Excellent Ruby code to read?
436958 [leamhall@gm ] I keep seeing suggestions to read excellent Ruby code. Best suggestions
+ 436959 [amiralles.ne] I guess ruby's std library will be a good place to start.
+ 436965 [pmckibbin@gm] There is a project called exercism.io that allows peer reviewing of code. I

Use yaml
436961 [ruby@e- ol t] I need to store datas in a file, with add, remove, rotation (3 records
436962 [matthew@ke w] Like it says on the tin: you put a string into
+ 436963 [Andy.Jones@j] I need to store datas in a file, with add, remove, rotation (3 records max) features.
+ 436966 [sto.mar@we .] I'd like to point out YAML:Store, if you do not care about

any active projects that succeeds opengl gem in ruby?
436964 [hakehuang@gm] anyone knows this?

[ANN] packetgen initial release
436967 [sylvain.daub] packetgen 0.1.0 has been released.

[ANN] active_record_doctor 1.3.0 released
436968 [contact@gr g] Hey!

bug in ruby's prime module?
436969 [mickyscandal] so I was just working on an exorcize using the Prime module and on one test
+ 436970 [james.pachec] Looks to me like an array of arrays, which makes me think that it's
+ 436971 [ken@jo s. rg] Rule of thumb: when you think you've found a bug in a language, try to
+ 436972 [echristopher] What do you mean by "worked just fine"? For instance, is the result [[2,
  436973 [mickyscandal] I would have see the code you're using to really know..
  436974 [botpena@gm i] that line is confusing (to me). just get the value, no need to delete something.

Refactoring
436975 [ruby@e- ol t] 18   def view_score
+ 436976 [pitinofabio@] how about this solution? Refactoring in general can bring you to different
+ 436977 [shortcutter@] I noticed one odd thing: you create a new Scoreboard instance, then

JSON woes
436978 [Andy.Jones@j] This is all kinds of annoying. JSON will apparently encode a String but not=
+ 436979 [botpena@gm i] ri JSON
| 436980 [Andy.Jones@j] First thing I did.
| 436981 [botpena@gm i] i see : )
+ 436982 [ialexxei@gm ] Try to use quirks_mode
  436983 [Andy.Jones@j] Try to use quirks_mode
  436984 [botpena@gm i] playing devils adv here

[ANN] packetgen 0.2.0 released
436986 [sylvain.daub] packetgen 0.2.0 has been released.

<DKIM> [ANN] packetgen 0.3.0 released
436987 [sylvain.daub] packetgen 0.3.0 has been released.

mangled string
436988 [inform@di -o] maybe this question suits better for an encrytpion or math mailing list,
436989 [felipetavres] Seems base64 for me
+ 436990 [reddel20@ya ] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| 436991 [reddel20@ya ] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| 436992 [inform@di -o] it's private. These are urls for a radio-stream, I want to get.
| 436993 [reddel20@ya ] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| 436994 [inform@di -o] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| 436995 [reddel20@ya ] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| 436996 [reddel20@ya ] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
| 436997 [matthew@ke w] Dude, please stop. This is a public mailing list, lots of people are
| 436999 [echristopher] To be fair, this whole thread is off-topic.
| 437000 [matthew@ke w] On 12 December 2016 at 09:14, Eric Christopherson <echristopherson@gmail.com
+ 436998 [matthew@ke w] 0000-0010:  2a 23 18 47-6b 59 1d 0a-37 35 07 07-32 39 12 51  *#.GkY..

Singleton public methods
437001 [subtileos@gm] I would like retrieve a full list of singleton public methos for a `Foo`
437002 [Andy.Jones@j] Maybe you°«d better spell out exactly what you mean by °»singleton methods°….  It°«s not a term I tend to use because people use it in different ways, I think?
437003 [subtileos@gm] Andy, http://ruby-doc.org/core-2.3.0/Object.html#method-i-singleton_methods
437004 [Andy.Jones@j] I was just looking at that.  I°«m not °»struggling°… with anything (although the example clearly shows four very different types of method, with either two or three of them being singleton, depending°ń room for confusion there in my opinion).
437005 [subtileos@gm] Maybe there is a space for a new feature request then?
437006 [Andy.Jones@j] I°«m completely with you on the idea of contracts.  Technically, I suppose you are right that protected methods are exposed to other objects and therefore part of the contract.

Re: How to do AES Encrypted in Ruby
437007 [felipetavres] Try using a standar key derivation function on both sides (Java and Ruby)
437008 [zlx.star@gm ] Yes, I think It's the best choice.
437009 [sylvain.daub] This is avery bad idea to use ECB mode. You should use CBC or CTR mode
437010 [zlx.star@gm ] Actually I find the warning about ECB mode from Ruby document.
437011 [ishaan.malhi] Or if you want to use the java implementation, consider using jRuby.
437012 [zlx.star@gm ] Now I found the java implementation is so bad because it use random number

Review a small Ruby Project
437013 [ruby@e- ol t] I'm learning Ruby, i just done a small RubyGame to apply what i learned.
+ 437014 [peterhickman] Well the code is readable and all that even if it seems quite long for a
+ 437015 [subtileos@gm] The executable should be under a bin or exe folder. Bundled documentation
+ 437016 [ruby@e- ol t] Thank you very much for your reply.

Help re: self-referencing models
437017 [jtsengorg@gm] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
437018 [rhys.m.stans] Is it not that you need to specify the foreign_key and class_name options

str
437019 [inform@di -o] Where from is this .str ?
+ 437020 [ialexxei@gm ] Are you sure it works?
| 437021 [ialexxei@gm ] But if you define str method for main:Object it will work
+ 437022 [inform@di -o] [1,2,3].map(&to_s)    # does not work??????
  437023 [ialexxei@gm ] In irb we are in context of main:Object.
  437024 [inform@di -o] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
  437025 [mike@st k. a] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

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

[ANN] kgio 2.11.0 - legacy I/O for legacy Ruby + Unix
437027 [ e@80 24 or ] kgio provides non-blocking I/O methods for Ruby without raising

gem mmap fails
437028 [inform@di -o] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
437029 [ e@80 24 or ] rubyio.h is Ruby 1.8-only
437031 [inform@di -o] Good infos, thanks!
437033 [martyn.jago@] Can you use SQLite ? Parallel reads from a single file (not parallel write)

[ANN] packetgen 1.0.0 released
437030 [sylvain.daub] packetgen 1.0.0 has been released.
437032 [king.sabri@g] Waw, that's awesome, Do you've a plan to make it protocol aware like *scapy* in

Re: <DKIM> Re: [ANN] packetgen 1.0.0 released
437034 [sylvain.daub] All binary protcols may be included. For now, i have plan to add ESP/IKE
437038 [king.sabri@g] That's cool, I hope you can make it a modular base like ppl can add a new

Subclass options available to Class#inherited
437035 [d.lakehammon] I'm pretty sure what I want to do isn't possible, but I thought I'd ask
437039 [shortcutter@] "Isn't possible" does not exist in Ruby. ;-)
+ 437040 [ryand-ruby@z] For years I've wanted class_opened/closed hooks in order to manage some things cleaner and easier. inherited is nice, but it is severely lacking.
| 437041 [shortcutter@] I have never felt the need for that. Now I am curios what use cases
+ 437042 [d.lakehammon] If you think about it for a moment this is the only way it can be,

[ANN] packetgen 1.0.1 released
437036 [sylvain.daub] packetgen 1.0.1 has been released.

New Advanced Ruby Course
437037 [matugm@gm il] Hey,

[ANN] RbNaCl 4.0.0: a modern cryptography for Ruby, now with ChaCha20Poly1305 and Argon2 support
437043 [bascule@gm i] RbNaCl is a Ruby FFI binding to NaCl/libsodium, one of the best modern

Pry json problem with Ruby 2.4
437044 [gvimrc@gm il] Could not find 'json' (~> 1.8) - did find: [json-2.0.2]
437046 [thomas@ch rb] Hey

Introducing FossGit -- a new CLI tool for conveniently mirroring Fossil to Git.
437045 [code@ap th o] - Dr. Farnsworth

Re: [ANN] minitest 5.10.0 Released
437047 [ e@80 24 or ] I cloned https://github.com/seattlerb/minitest.git
437050 [fxn@ha hr f.] Same feedback here.

[ANN] nokogiri 1.7.0 Released
437048 [mike.dalessi] nokogiri version 1.7.0 has been released!

Contribute Ruby Organisation
437049 [vineshbattul] Dear Sir/Madam
437052 [ferdinandros] and fixing issues or implementing new features. you can also submit them as
437053 [the.codefoli] They provide financial support for RubyGems and Bundler, among other

[ANN] ruby-oci8 2.2.3
437051 [kubo@ji ba .] Ruby-oci8 2.2.3 is released. This is the Oracle module using OCI8 API.

[ANN] packetgen 1.1.0 released
437054 [sylvain.daub] packetgen 1.1.0 has been released.

Try to use openssl gem with ruby 2.3
437055 [sylvain.daub] I am trying to use openssl gem 2.0.2 with ruby 2.3.
437057 [sto.mar@we .] OpenSSL has several version constants, maybe you did mean
437058 [sylvain.daub] $ gem install --user-install openssl

[ANN] nio4r 2.0.0: cross-platform asynchronous I/O primitives for Ruby
437056 [bascule@gm i] nio4r is a set of low-level asynchronous I/O primitives with multiple
437059 [bascule@gm i] I've been planning on doing another release of Celluloid soon. I might look

Umlauts
437060 [inform@di -o] puts 220.char    # shows nonsense ("") 65533
437061 [abejideayode] #=> ""
437062 [matthew@ke w] puts 220.char    # shows nonsense ("") 65533

Re: sorting
437063 [inform@di -o] Wow!
437064 [sto.mar@we .] Please do not switch the subject in a thread,

Adding custom default Gem search path to Ruby 2.3.3
437065 [ruby-talk@ml] I would like to add a default search path for gems without setting

[ANN] Giving up maintenance of ruby-xz gem
437066 [m-guelker@ph] I give up the maintenance of the `ruby-xz' RubyGem[1][2] with effect
+ 437069 [odesk.irfan@] I would like to express my interest in becoming a maintainer of this
| + 437070 [snood1205@gm] I noted that there are about half a million downloads. Are there any large
| + 437079 [m-guelker@ph] First I'll wait what happens in this thread. But good to know someone is
+ 437071 [ e@80 24 or ] Just curious why you do not use it anymore, it seems very
  437077 [m-guelker@ph] I am actually surprised that it is. I never received any real feedback

Re: sorting array
437067 [inform@di -o] ok, and how do I write it? (tried many things, but don't know how to use
+ 437068 [joe.gain@gm ] Why don't you instantiate DateTime objects? What do you mean by efficient?
| 437073 [inform@di -o] <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
+ 437072 [snood1205@gm] Just go map{|i| i.split(?:)} and then use a sort_by. This seems pretty off
| 437074 [inform@di -o] that was just an example. I want to sort by $2 and then $1, so it has to
| 437075 [joe.gain@gm ] I missed the start of this thread, but if I wanted to sort some strings
+ 437076 [sto.mar@we .] "I tried many things" doesn't really help us; what did you try?

Re: Projects using ruby-xz (was: Giving up maintenance of ruby-xz gem)
437078 [m-guelker@ph] I would be interested in this also, as I never received any feedback as
437133 [oz@cy ri .n ] This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
437137 [m-guelker@ph] Very interesting. I didn't know that it had such a facility. Thanks for
437138 [Andy.Jones@j] Definitely one of "those" gems, IMO.
threads.html
top