[#405180] How to translate the following sqlite3 insert statement into equivalent mysql insert statement — "Yu W." <lists@...>
sqlite3 insert statement:
[#405195] Is it possible to use OptionParser with short options such as -oo? — "Shareef J." <lists@...>
Hi there,
[#405201] Why class returns `null` but the definition not when their description ended in IRB? — "Kumar R." <lists@...>
The below class description returns its last evaluated expression :
Because that's how it is implemented.
[#405207] Does `self` and `scope(local)` operate parallels? — "Kumar R." <lists@...>
I am heavily confused with the topic when thinking `self` and `local
Just to help experts out there I am clearing my statement once again
"Kumar R.": "YAATSGFY"
Michel wrote in post #1099829:
Hey, I am repeatedly saying that not to do this on my thread. But you
[#405217] Sequel vs. RDBI vs. DBI — Jim Hranicky <jfh@...>
So it looks like RDBI hasn't been touched in a while and DBI
[#405222] How differs `Private` methods from `singleton methods`? — "Kumar R." <lists@...>
Can anyone help me to understand the difference between `private
[#405242] Confusion in instance method calls of super class from subclass — "Kumar R." <lists@...>
I was just playing to see the instance method calls from the subclass
YOU DID NOT READ WHAT I WAS WRITTEN:
Hans Mackowiak wrote in post #1099900:
Ryan Davis wrote in post #1099902:
Am 03.03.2013 11:06, schrieb Kumar R.:
[#405245] ruby 1.8.7 Accessing files with non-latin names — Bart Els <lists@...>
Hello Forum,
[#405250] Extending Ruby. Little help or guidance if you are willing! — Cliff Rosson <cliff.rosson@...>
Hi Folk,
I've tried to do some reading but some of this is a bit over my head.
Haven't been able to touch this in a week but I had a few minutes to look
On Sun, 10 Mar 2013 04:41:32 +0100, Cliff Rosson <cliff.rosson@gmail.com> wrote:
Got ya. So it doesn't really matter if I convert things to ID and compare
Rereading this, I suspect that you might have mis-analyzed the issue. I
On Tue, Mar 12, 2013 at 12:28 AM, Josh Cheek <josh.cheek@gmail.com> wrote:
On Tue, Mar 12, 2013 at 4:05 PM, tamouse mailing lists <
On Tue, Mar 12, 2013 at 4:35 PM, Josh Cheek <josh.cheek@gmail.com> wrote:
Am Sun, 3 Mar 2013 10:31:25 +0900
Thanks Quintus. I'll get around to playing with this today.
Hi Cliff,
So I am slowly stumbling my way through this. I know I've got quite a bit
On Tue, 05 Mar 2013 06:25:50 +0100, Cliff Rosson <cliff.rosson@gmail.com> wrote:
[#405271] Confusion with Ruby's "case/when" block statement — "Kumar R." <lists@...>
Ruby uses `===` operator on the `case/when` type execution style.Now It
Actually the below paragraph made me confused: from the link :
On Mon, Mar 4, 2013 at 6:41 PM, Kumar R. <lists@ruby-forum.com> wrote:
[#405297] Can't get If statement right — Kat VS <lists@...>
mainMenu = "Main Menu:
Okay, thanks! Now it is working. I figured it was thinking they were
I was wondering if I should switch to a case statement.. But, I am way
[#405310] How `next` works in ruby with `unless` ? — "Kumar R." <lists@...>
The `next` statement is used to skip a part of the loop and continue
Learn what semicolons do in Ruby.
What Joel said.
Matthew Kerwin wrote in post #1100097:
People are so incredibly brash on this forum sometimes. Makes for a cold
What do you think the only possible order of execution would be? It's not
John W Higgins wrote in post #1100104:
Kumar R. wrote in post #1100105:
Am 05.03.2013 19:18, schrieb Kumar R.:
On Tue, Mar 5, 2013 at 7:23 PM, <sto.mar@web.de> wrote:
Robert Klemme wrote in post #1100233:
On Tue, Mar 5, 2013 at 7:38 PM, Hans Mackowiak <lists@ruby-forum.com> wrote:
[#405323] YourLanguageSucks — Kiswono Prayogo <kiswono@...>
Hi, i found this link.. https://wiki.theory.org/YourLanguageSucks
if only people with this much energy for complaining could channel it into
On Mon, Mar 4, 2013 at 7:39 PM, Kiswono Prayogo <kiswono@gmail.com> wrote:
On Tue, 05 Mar 2013 07:12:05 +0100, Josh Cheek <josh.cheek@gmail.com> wrote:
On Tue, Mar 5, 2013 at 8:57 AM, Bartosz Dziewo=F1ski <matma.rex@gmail.com> =
[#405334] Inconsistent Array#slice behavior? — "Jack R." <lists@...>
Given x = [],
[#405371] ruby 1.9.3 rpms — Matt Lawrence <matt@...>
Is there a good source for ruby 1.9.3 rpms for CentOS 6? The base
[#405376] When can one call themselves a “Rubyist”? — Rafal Chmiel <lists@...>
I was wondering what that term even meant. Is it something to do with
I think a Rubyist is just anyone who writes in Ruby. Reading anything
I remember reading this on a blog somewhere, but the stages of rubyism was
[#405383] Use html appearance without any gem — Ebru Akagunduz <lists@...>
Hi, i provide html appearance with ruby-gtk-webkit gem. Can i provide
[#405400] Bignum-Fixnum-Numeric confusion — Pritam Dey <lists@...>
Hi,
From the doc: http://ruby-doc.org/core-1.9.3/Fixnum.html
[#405414] Persisting and loading objects trhough Marshal problem — "Damián M. González" <lists@...>
Hello people. Today I've found a bug in my source code, been around for
Good question. See, I marshal them in differents times. Because I don't
[#405426] Compare Zulu time — robert lengu <lists@...>
Hi
[#405427] Numbers and groups. — "Andrew l." <lists@...>
Hello everybody i am a new ruby user and i learn best by doing. so i am
[#405436] Resolv class caching /etc/hosts entries — Timur Alperovich <timur.alperovich@...>
Hey guys,
[#405444] Question regarding automating some Outlook/IMAP and pdf parsing functions w/ ruby? — Ed Zimmerman <lists@...>
Hello,
In that case the 271st email in your inbox is an object which doesn't
Am 10.03.2013 19:17, schrieb Joel Pearson:
Am 10.03.2013 19:26, schrieb sto.mar@web.de:
[#405476] methods in subclasses — john rxjmo <lists@...>
Hi,
[#405477] Compiling Ruby 2.0, problem with OpenSSL — "Piotr P." <lists@...>
Trying to compile Ruby 2.0 from source, having problem with it, getting
Managed to solve the problem with compiling openssl like this:
[#405495] RubyExcel class. Useful? — Joel Pearson <lists@...>
I've managed to create a (relatively) stable data-processing class which
Aha! I have learned how to use Github.
Uh oh, I think I've backed myself into a corner...
[#405499] RbNaCl 1.0.0: Cryptography for Ruby that doesn't suck — Tony Arcieri <tony.arcieri@...>
I'm happy to announce the first public release of RbNaCl, a Ruby binding to
[#405512] Serif version 0.3.1 released — Adam Prescott <adam@...>
Serif is a file-based blogging engine with an optional admin interface
[#405534] Segmentation fault while compiling ruby 1.9.3p392 with OpenSSL 1.0.1e installed — "Piotr P." <lists@...>
I'm trying to have my Rails website running on my fresh installation of
Hi,
[#405538] type casting and connversion in ruby — "Kumar R." <lists@...>
In programming world type casting and type conversion has completely
[#405570] Confusion with block local variable declaration with block variable declaration within the pipe `|` — Love U Ruby <lists@...>
Why are we not allowed to create local variables or new object with
Your first example does not work for me in any version of Ruby. But this
[#405597] Confusion with empty block printing — Love U Ruby <lists@...>
When I typed the below in my IRB:
i mean the blocks you used in http://www.ruby-forum.com/topic/4411871
here I am making my confusions are more specific:
[#405608] Access values for JSON.parse response — Nicole Villette <lists@...>
Hello, Does anyone know who to get the values from a nested hash in
Nicole Villette wrote in post #1101133:
By the way, I corrected this on the forum but it's still wrong in
Joel Pearson wrote in post #1101386:
[#405626] Is it possible to run Tcl from Ruby? — "Ishaan B." <lists@...>
Is it possible to integrate Ruby with Tcl such that Tcl frontend and Tk
[#405630] Confusion with some Module methods. — Love U Ruby <lists@...>
Can anyone help me to understand how the below module methods works?
[#405634] no such file to load -- yaml (LoadError) — "Mitesh S." <lists@...>
Hello
[#405642] Confusion — Robert Klemme <shortcutter@...>
http://www.discogs.com/Electric-Light-Orchestra-The-Confusion-Last-Train-To-London/release/1229906
[#405647] Question about using an automated date stamp for an abbreviation in the SciTE Editor Abbreviations File — Harry Truax <htruax@...>
Hello,
On Tue, Mar 12, 2013 at 6:14 PM, Harry Truax <htruax@stf.com> wrote:
[#405656] Confusion with Strings — Love U Ruby <lists@...>
From the book I read a line about string :
Are you really saying that you don't understand the concept of one
@Scott.
Language problems here. Not worth getting worked up over imho.
[#405695] ideas on how to determine tag — Wayne Brissette <wbrisett@...>
I'm working on a script that examines a DITA XML file and tries to =
[#405719] Difference of Module#included and Module#extended and Module#prepended — Love U Ruby <lists@...>
Can anyone help me to understand the below 3 methods about their
[#405720] cannot get blocks working — Aashish Kiran <lists@...>
Hi,
[#405754] Singleton method — Love U Ruby <lists@...>
C:\>ruby -v
[#405762] Understanding Ruby Classes, Objects and Methods. — Kedar Mhaswade <lists@...>
Dear Rubyists,
On Wed, Mar 13, 2013 at 11:20 PM, Kedar Mhaswade <lists@ruby-forum.com> wro=
Thanks, Robert!
On Thu, Mar 14, 2013 at 1:57 PM, Kedar Mhaswade <lists@ruby-forum.com> wrote:
>>> abc is an instance of String
On Thu, Mar 14, 2013 at 2:42 PM, Kedar Mhaswade <lists@ruby-forum.com> wrote:
Robert Klemme wrote in post #1101602:
On Thu, Mar 14, 2013 at 3:14 PM, Kedar Mhaswade <lists@ruby-forum.com> wrote:
[#405770] Tool Database — "Andrew l." <lists@...>
Hello everybody back again and still very confused, I need to know if
[#405804] No form name in page - Ruby Mechanize — Rochit Sen <lists@...>
Hi All,
[#405807] confusion with singleton method call — Love U Ruby <lists@...>
C:\>irb --simple-prompt
Can anyone help me here?
[#405820] Selenium. catching Body class value — "Mattias A." <lists@...>
I have a site where my script changes language on the site. To verify
[#405828] Retrieves the count for the list of entries - not working — "Syed H." <lists@...>
def get_entry_count(type)
[#405844] IO buffering problem — Andrew Wagner <wagner.andrew@...>
All,
Hi Andrew,
[#405854] RubyVM::InstructionSequence compiling and loading — Mike Owens <mikeowens@...>
I recently came across "An Amateur Smalltalk User's Observations on
[#405855] combine two regular expressions — Ken Paul <lists@...>
Hi there,
[#405869] control the concurrent thread numbers — Ken Paul <lists@...>
Hi,
On Sat, Mar 16, 2013 at 12:13 PM, Ken Paul <lists@ruby-forum.com> wrote:
"Jes=C3=BAs Gabriel y Gal=C3=A1n" wrote in post #1101925:
[#405883] Ruby-GNOME2 1.2.3 — Kouhei Sutou <kou@...>
Hi,
Testing on Windows 7, Ruiby 2.0.0
[#405884] Confusion with `nil` output from the method Symbol#<=> — Love U Ruby <lists@...>
Symbol#<=> ->
[#405893] Ruby-2.0.0-rc2 on Windows under Cygwin. Cannot run IRB, gem, rake, etc — Wins Lin <lists@...>
Hello.
[#405897] Re: confusion with singleton method call — "plugatariov@..." <plugatariov@...>
IAoKU2VudCBmcm9tIG15IEhUQwoKLS0tLS0gUmVwbHkgbWVzc2FnZSAtLS0tLQpGcm9tOiAiTG92
[#405907] forked child processes — Ken Paul <lists@...>
Hi,
[#405928] Copy-on-write — Ken Paul <lists@...>
Hi,
[#405931] Finding one's way with 'super' in define_method/alias_emthod — Marcin Rzeźnicki <marcin.rzeznicki@...>
Hi all!
On Mon, Mar 18, 2013 at 5:50 PM, Marcin Rze=C5=BAnicki
Robert Klemme wrote in post #1102151:
On Mon, Mar 18, 2013 at 8:39 PM, Marcin R. <lists@ruby-forum.com> wrote:
Robert Klemme wrote in post #1102170:
On Tue, Mar 19, 2013 at 2:46 PM, Marcin R. <lists@ruby-forum.com> wrote:
Robert Klemme wrote in post #1102288:
On Thu, Mar 21, 2013 at 11:31 AM, Marcin R. <lists@ruby-forum.com> wrote:
Robert Klemme wrote in post #1102581:
[#405941] Multiple environments in a single process — Tim Mahoney <lists@...>
I'm using the Ruby C API to execute Ruby scripts, and I need each script
I believe this can be done. We can enclose all the VM state variables
[#405947] Cisco Ruby pexpect equivalent — Steve Jarvis <lists@...>
Hi All,
On Tue, Mar 19, 2013 at 1:14 AM, Steve Jarvis <lists@ruby-forum.com> wrote:
[#405948] Error in method call - need help to understand — Pritam Dey <lists@...>
I was trying to call a method as below:
[#405954] Algorithmic complexity — "Rotar D." <lists@...>
Hi,
[#405975] DCell 0.13.0: actor-based distributed objects for Ruby — Tony Arcieri <tony.arcieri@...>
DCell 0.13.0 is out!
[#405980] library sdl (cannot load such file) — Deniz Po <lists@...>
Why i have always:
Subject: library sdl (cannot load such file)
Hey, can you post more information? Do you have any file that is requiring
Subject: Re: library sdl (cannot load such file)
[#405986] Ruby tainting on primitives — "Nicolas V." <lists@...>
Hi there,
[#405987] Why was the object_id for true and nil changed in ruby2.0? — Bharadwaj Srigiriraju <lists@...>
irb(main):001:0> true.object_id
hm the forumtopic i linked was in english ...
Hans Mackowiak wrote in post #1102451:
your question was already answered at stackoverflow:
[#405991] Confusion with has object creation. — Love U Ruby <lists@...>
I know we create Hash object with Hash.new,it calls `initialize` method.
[#406007] Can't run sudo under ssh.exec! — Tim Ash <lists@...>
Hi,
[#406015] fixedpnt 0.0.1: Binary Fixed Point Calculations — Axel Friedrich <lists@...>
https://github.com/Axel2/fixedpnt.rb
On 03/20/2013 07:25 AM, Axel Friedrich wrote:
> A random api suggestion... consider using #[]= as an alias for #assign,
[#406039] Need to change loudness of a mp3 file using ruby script — chandan mallik <lists@...>
I need to change the loudness of a mp3 file using mp3gain.I am toatally
Subject: Need to change loudness of a mp3 file using ruby script
Carlo E. Prelz wrote in post #1102552:
Subject: Re: Need to change loudness of a mp3 file using ruby script
Thanks Carlo. BTW I found the solution and have successfully
[#406091] Differences between Ruby 1.9.2 and 1.9.3 — "Dusan D." <lists@...>
Hi,
[#406106] Replacement for webdriver-user-agent (use with watir-webdriver) — tamouse mailing lists <tamouse.lists@...>
I notice that the gem pointed to in the watir documentation that
[#406110] Need to parse a list of checkboxes - ruby mechanize — Rochit Sen <lists@...>
Hi All,
[#406118] Writing a game, trying to make dynamic loops — "Nick G." <lists@...>
Hey there,
[#406141] Confusion with Array#map — Love U Ruby <lists@...>
Hi could anyone help me how does the below concept helped to produce the
map iterates through the given array and collects the results with the a
[#406146] Choice of methods/implementation (was: Writing a game, trying to make dynamic loops) — tamouse mailing lists <tamouse.lists@...>
Since otherwise I'd be hijacking, I'm starting a new thread on this:
On Mon, Mar 25, 2013 at 7:55 PM, tamouse mailing lists
[#406155] Need help on Kernel#eval — Love U Ruby <lists@...>
From the link -> http://www.ruby-doc.org/core-2.0/Binding.html
[#406184] Nokogiri help parsing HTML — Paul Mena <lists@...>
I'm relatively new to Ruby (and therefore Nokogiri) and am trying to
[#406192] Need help on ARGF#skip — Pritam Dey <lists@...>
from the doc: http://www.ruby-doc.org/core-2.0/ARGF.html#method-i-skip
[#406217] Arbitrary end of a string by using Nullbyte's symbol (Ruby 1.9.3p194) — "Preth H." <lists@...>
A couple of days ago I was doing a dummy app using RoR 3.2.12 and ruby
On Wed, Mar 27, 2013 at 6:53 PM, Preth H. <lists@ruby-forum.com> wrote:
[#406225] undefined local variable or method 'math' — Don Pick <lists@...>
I am learning Ruby.
[#406251] Windows ruby.exe association with .rb — Regis d'Aubarede <lists@...>
Hello,
[#406252] Ruby 2.0 bytecode export / import — Andras Horvath <lists@...>
Hi Everyone!
[#406254] Find usb properties/details using ruby-dbus and udisk — sundar sundar <lists@...>
I am doing project in which i need to detect all available usb drives
[#406255] Confusion with setter method — Love U Ruby <lists@...>
C:\>irb --simple-prompt
[#406258] Translation Project — Jeremy Henderson <lists@...>
Hello all! This is my first post! I started learning Ruby about 3 weeks
Yes, I love how compressed it is. Like Regis' though, it can't handle
[#406259] Chris Pine Leap Year — "Phil H." <lists@...>
This one is stumping me because of all the variables needed. Only thing
[#406261] clear the STDIN — Love U Ruby <lists@...>
C:\>irb --simple-prompt
[#406291] Hash with default — Harry Kakueki <list.push@...>
I would like to make a hash like h2 with the default described by h in one
[#406312] Nil or enter with no input — "Phil H." <lists@...>
How can I tell if someone has enter nothing in a gets prompt, they only
[#406316] Ruby Typing? — "John n/a" <lists@...>
Hi everyone. I'm very new to ruby development. I coming form .Net side
[#406332] reconsidered 0.9.2 Released — Jim Wise <jwise@...>
[#406368] Grasping methods like "to_s"? — "Rafal C." <lists@...>
Hi, I'm posting here to quickly ask you: how is one able to do something
On Sat, Mar 30, 2013 at 4:49 PM, Rafal C. <lists@ruby-forum.com> wrote:
Or perhaps just
On Sat, Mar 30, 2013 at 11:30 PM, Peter Hickman <
[#406375] Ruby Gotchas presentation slides — Dave Aronson <rubytalk2dave@...>
I recently made available the slides for a presentation I did
On Sat, Mar 30, 2013 at 6:55 PM, Dave Aronson <rubytalk2dave@davearonson.com
On Sun, Mar 31, 2013 at 2:36 AM, Josh Cheek <josh.cheek@gmail.com> wrote:
[#406378] installing ruby 2.0 -- no checksum error — 7stud -- <lists@...>
$ rvm install ruby-2.0.0-p0
[#406387] Private setters can be called by self, why not getters? — Josh Cheek <josh.cheek@...>
class Counter
You have to define setters and getters in ruby more carefully, when you
[#406389] uninitialized constant ActiveRecord (NameError) — jonathan kav <lists@...>
Hallo
[#406396] respond_to? vs include? — Edoardo Rossi <edd.rossi@...>
Hi everybody...
Your benchmark looks okay. I added a comment to your Gist about a fork
On Mon, Apr 1, 2013 at 12:07 AM, Adam Prescott <adam@aprescott.com> wrote:
Re: YourLanguageSucks
On Mon, Mar 4, 2013 at 7:39 PM, Kiswono Prayogo <kiswono@gmail.com> wrote:
> Regular expressions are always in multi-line mode
> >> ?
>
>
Was this ever true? It hasn't been since I've been using Ruby (about 5
years), unless I was just too noob when I started to realize it.
> No real support for arbitrary keyword arguments (key=value pairs in
> function definitions are positional arguments with default values)
> >> ?
>
>
Deprecated as of Ruby 2.0
> The documentation is not versioned.
> >> is it?
>
>
It is:
http://ruby-doc.org/core-2.0/
http://ruby-doc.org/core-1.9.3/
http://ruby-doc.org/downloads/
Although, it's not obvious how to switch between versions at other docs
sites.
Using @ and @@ to access instance and class members can be unclear at a
> glance.
> >> no!
>
>
Frankly, I'm of the opinion that @@ should be removed altogether, it makes
no sense and is dangerous.
> There are no smart and carefully planned changes that can't break
> compatibility; even minor releases can break compatibility: See
> "Compatibility issues" and "fileutils". This leads to multiple
> recommended stable versions: both 1.8.7 and 1.9.1 for Windows. Which
> one to use?
> >> deprecated
>
>
I don't think this is deprecated, there is nothing that I know of which
enforces this. Though people typically try to follow standards such as
http://semver.org/ to mitigate the issue.
Experimental and (known to be) buggy features are added to the
> production and "stable" releases: See "passing a block to a Proc".
> >> ?
>
>
I don't really know what this means, beyond maybe something like `lambda {
|&block| block.call }.call { 'whatever' }` in which case, I've never hit
the bug (and I do a lot of stuff like this).
> Ruby allows users to modify the built in classes, which can be useful,
> but limited namespace means addons can conflict. Experienced
> programmers know to add functionality through modules rather than
> monkey patching the built in classes, but is still prone to abuse.
> This has been promised to be resolved in ruby 2.0
> >> deprecated
>
>
Not really deprecated, there are refinements, but they're experimental, and
polarizing. There are lots of libs which litter the core classes, sadly
(I'm of the opinion that you should never do it in library code, and
generally avoid it everywhere).
> Mutable strings in a dynamic language! This means e.g. when a string
> is passed to a setter it should copy the string so the object can be
> sure that it won't change unexpectedly.
> >> ?
>
>
People complain about things like this a lot, but I've only ever ran into
issues with it once or twice so I'm not sure what they're concerned about.
Maybe I'm just more conscientious about things like this?
Mutable types like arrays are still hashable. This can cause a hash to
> contain the same key twice, and return a random value (the first?)
> when accessing the key.
> >> ?
>
>
This is true, but how frequently do you use mutable keys (and also mutate
them?) I don't think I've ever been hit by this one.
> Omitting parenthesis in function calls enable you to
> implement/simulate property setter, but can lead to ambiguities.
> >> ?
>
>
This is true, e.g.
class A
attr_accessor :value
def initialize
value = 1
end
end
A.new.value # => nil
Really, though, this is caused by the ambiguity between initialization and
assignment. What this person is complaining about here, I actually consider
a feature (it encapsulates implementation details from code that invokes
those methods, consider an alternative like JavaScript, where if you switch
from an attribute to a method, then you have to go update everything that
uses it).
> Minor ambiguities between the hash syntax and blocks (closures), when
> using curly braces for both.
> >> ?
>
>
This is still true, but pretty rare. Only really comes up for me when doing
things like RSpec let blocks, which I might have defined to return a hash
of initialization params.
> Suffix-conditions after whole blocks of code, e.g. begin ... rescue
> ... end if expr You are guaranteed to miss the if expr if there are a
> lot of lines in the code block.
> >> ?
>
>
This is true, but pretty uncommon.
> The unless keyword (=if not) tends to make the code harder to
> comprehend instead of easier.
> >> no, i guess not
>
>
I don't find this to be the case.
Difference between unqualified method calls and access of local
> variables is not obvious. This is especially bad in a language that
> does not require you to declare local variables and where you can
> access them without error before you first assign them.
> >> ?
>
>
Already addressed: I consider this a feature
> "Value-leaking" functions. The value of the last expression in an
> function is implicitly the return value. You need to explicitly write
> nil if you want to make your function "void" (a procedure).
> >> just adding nil would be find right?
>
>
This is true, but only a problem if you code in a way that I would consider
peculiar (I guess I code in such a way that things like this are just not a
problem, e.g. I minimize my public api, often to just a #call method, and
anything which leaks such a value is clearly a command and not intended to
have a return value).
> pre-1.9: No way to get stdout, stderr and the exit code (all of them
> at once) of a sub process.
> >> deprecated?
>
>
This isn't true, but it's an understandable oversight. For this, you use
the open3 stdlib (
http://ruby-doc.org/stdlib-2.0/libdoc/open3/rdoc/Open3.html), not
system/backtix/%x
> `` syntax with string interpolation for running sub processes. This
> makes shell injection attacks easy.
> >> ?
>
>
Just don't put user submitted code in backticks. It can be a little
cumbersome, but if you're passing it as an argument, you just don't
interpolate it into the string (e.g. system "ls", user_submitted_filename),
and if you do need to interpolate for some reason, there is the shellwords
stdlib for this (
http://ruby-doc.org/stdlib-2.0/libdoc/shellwords/rdoc/Shellwords.html)
Regular expressions magically assign variables: $1, $2, ...
> >> ?
>
>
This is true. I believe it comes from Perl. It's a bit awkward, but I don't
really see a problem with it.
> Standard containers (Array, Hash) have a very big interfaces that make
> them hard to emulate.
> >> emulate for what reason?
>
>
I have found this to be true, e.g.
https://github.com/JoshCheek/seeing_is_believing/blob/496c5350c1e641d9d26213af1a3ebc56b1e38205/lib/seeing_is_believing/line.rb#L12-18
> Symbols and strings are both allowed and often used as keys in hashes,
> but "foo" != :foo, which led to inventions like
> HashWithIndifferentAccess.
> >> i believe this is fine
>
>
I think this person is completely correct here, I have lost many hours to
issues stemming from this. There's even multiple implementations of
"indifferent access" hashes, which try to mitigate the issue, but really
just make it easy to lose track of what type the keys should be.
Parser errors could be more clear. "syntax error, unexpected kEND,
> expecting $end" actually means "syntax error, unexpected keyword
> 'end', expecting end of input"
> >> ?
>
>
This particular example is better in newer Rubies: "syntax error,
unexpected keyword_end", but in general, I totally agree. For example, I
think that errors like "`exit': wrong number of arguments (3 for 1)
(ArgumentError)" could be much more helpful. In one of my libs, I show the
signature if the method is incorrectly invoked
https://github.com/JoshCheek/surrogate/blob/master/lib/surrogate/argument_errorizer.rb#L16I
should probably also add the arguments.
Anyway, a pretty read. We should pay attention to things like this, it's
relevant feedback as it highlights things we've grown accustomed to, but
that stick out to newcomers.
-Josh