[#390749] Why are there so many similar/identical methods in core classes — Kassym Dorsel <k.dorsel@...>

Let's look at the Array class and start with method aliases.

14 messages 2011/12/02

[#390755] Inverse Operation of Module#include — Su Zhang <su.comp.lang.ruby@...>

Hi list,

21 messages 2011/12/02
[#390759] Re: Inverse Operation of Module#include — Ryan Davis <ryand-ruby@...> 2011/12/02

[#390764] Re: Inverse Operation of Module#include — Isaac Sanders <isaacbfsanders@...> 2011/12/02

I would suggest an Adapter pattern use here. IF there is something that has

[#390876] black magical hash element vivification — Chad Perrin <code@...>

Ruby (1.9.3p0 to be precise, installed with RVM) is not behaving as I

12 messages 2011/12/05

[#390918] WEB SURVEY about Ruby Community — Intransition <transfire@...>

Did any one else get this survey request?

14 messages 2011/12/07

[#390976] Confusing results from string multiplication — Rob Marshall <robmarshall@...>

Hi,

19 messages 2011/12/08

[#391019] How can I do h["foo"] += "bar" if h["foo"] does not exist? — "Andrew S." <andrewinfosec@...>

Hi there,

13 messages 2011/12/09

[#391027] reading from file without end-of-lines — Janko Muzykant <umrzykus@...>

hi,

20 messages 2011/12/09
[#391028] Re: reading from file without end-of-lines — Gavin Sinclair <gsinclair@...> 2011/12/09

> i'm trying to read a few text values from single file:

[#391031] Re: reading from file without end-of-lines — Robert Klemme <shortcutter@...> 2011/12/09

On Fri, Dec 9, 2011 at 9:58 AM, Gavin Sinclair <gsinclair@gmail.com> wrote:

[#391042] Re: reading from file without end-of-lines — Gavin Sinclair <gsinclair@...> 2011/12/09

On Fri, Dec 9, 2011 at 8:18 PM, Robert Klemme

[#391135] I need advice on what to do next. — Nathan Kossaeth <system_freak_2004@...>

I am new to programming. I read the ebook "Learn to Program" by Chris

23 messages 2011/12/12

[#391216] perf optimization using profile results — Chuck Remes <cremes.devlist@...>

I need some help with optimizing a set of libraries that I use. They are ffi-rzmq, zmqmachine and rzmq_brokers (all up on github).

13 messages 2011/12/13
[#391218] Re: perf optimization using profile results — Chuck Remes <cremes.devlist@...> 2011/12/13

On Dec 13, 2011, at 9:57 AM, Chuck Remes wrote:

[#391234] Re: perf optimization using profile results — Charles Oliver Nutter <headius@...> 2011/12/14

A couple quick observations.

[#391238] Re: perf optimization using profile results — Chuck Remes <cremes.devlist@...> 2011/12/14

On Dec 13, 2011, at 7:03 PM, Charles Oliver Nutter wrote:

[#391324] ruby 1.9 threading performance goes non-linear — Joel VanderWerf <joelvanderwerf@...>

12 messages 2011/12/16
[#391325] Re: ruby 1.9 threading performance goes non-linear — Eric Wong <normalperson@...> 2011/12/16

Joel VanderWerf <joelvanderwerf@gmail.com> wrote:

[#391420] Accessing class instance variables from an instance? — "Shareef J." <shareef@...>

Hi there,

26 messages 2011/12/20
[#391454] Re: Accessing class instance variables from an instance? — Khat Harr <myphatproxy@...> 2011/12/21

Actually, now that I'm thinking about it the existing behavior sort of

[#391456] Re: Accessing class instance variables from an instance? — Josh Cheek <josh.cheek@...> 2011/12/21

On Tue, Dec 20, 2011 at 9:42 PM, Khat Harr <myphatproxy@hotmail.com> wrote:

[#391545] Kernel#exit raises an exception? — Khat Harr <myphatproxy@...>

While I was working on embedding an interpreter I wrote a function to

13 messages 2011/12/24

[#391618] rvmsh: An easy installer for RVM — Bryan Dunsmore <dunsmoreb@...>

I have recently begun work on a project called [rvmsh]

12 messages 2011/12/29

[#391783] Mailspam — Gunther Diemant <g.diemant@...>

Is there a way to stop this mailspam of Luca (Mail)?

12 messages 2011/12/29

[#391790] What’s the standard way of implementing #hash for value objects in Ruby? — Nikolai Weibull <now@...>

Hi!

23 messages 2011/12/29
[#391792] Re: What’s the standard way of implementing #hash for value objects in Ruby? — Gunther Diemant <g.diemant@...> 2011/12/29

I think you can't access instance variables from a class method, so

[#391793] Re: What’s the standard way of implementing #hash for value objects in Ruby? — Nikolai Weibull <now@...> 2011/12/29

On Thu, Dec 29, 2011 at 15:52, Gunther Diemant <g.diemant@gmx.net> wrote:

[#391811] Re: What’s the standard way of implementing #hash for value objects in Ruby? — Robert Klemme <shortcutter@...> 2011/12/29

On Thu, Dec 29, 2011 at 4:06 PM, Nikolai Weibull <now@bitwi.se> wrote:

[#391812] Re: What’s the standard way of implementing #hash for value objects in Ruby? — Nikolai Weibull <now@...> 2011/12/29

On Fri, Dec 30, 2011 at 00:26, Robert Klemme <shortcutter@googlemail.com> w=

[#391816] Re: What’s the standard way of implementing #hash for value objects in Ruby? — Josh Cheek <josh.cheek@...> 2011/12/30

On Thu, Dec 29, 2011 at 5:47 PM, Nikolai Weibull <now@bitwi.se> wrote:

[#391833] Re: What’s the standard way of implementing #hash for value objects in Ruby? — Robert Klemme <shortcutter@...> 2011/12/30

On Fri, Dec 30, 2011 at 12:47 AM, Nikolai Weibull <now@bitwi.se> wrote:

Re: I: rvmsh: An easy installer for RVM

From: Bryan Dunsmore <dunsmoreb@...>
Date: 2011-12-29 17:24:44 UTC
List: ruby-talk #391795
Chad Perrin wrote in post #1038527:
> I would like to see it use sh/.profile instead of bash/.bashrc,
> actually.

I would implement this, but there is no use if RVM needs bash anyways.

Peter Vandenabeele wrote in post #1038701:
> I was trying to use it for single user installation on Ubuntu (10.04)
> and
> had
> to make a few tweaks to make it work in single mode. Full code at
> https://github.com/petervandenabeele/rvmsh

That's strange, it works for me in single mode.

> Assuming this script is intended for quick/easy installs of rvm for
> users,
> I prefer to have the current stable version of ruby as the default
> install.

Good point, I'll change this on the main branch.

> For a single user install and with a "new" script, I prefer not to give
> sudo
> rights to the user. So, when a package is missing, I prefer to let me
> know,
> and then I will go in manually and install it with sudo from my main
> account.

Good point.  I'll probably implement this as a switch instead of making
it the default, though.

>
> @@ -41,11 +42,15 @@
>  echo "$installer" | grep -P "(apt-get|apt)" &> /dev/null
>  if [ "$?" = "0" ]; then
>   for app in build-essential openssl libreadline6 libreadline6-dev
> zlib1g
> zlib1g-dev \
>             libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3
> libxml2-dev \
> -           libxslt-dev autoconf libc6-dev ncurses-dev automake libtool
> bison; do
> - which $app &> /dev/null
> +           libxslt1-dev autoconf libc6-dev libncurses5-dev automake
> libtool bison; do
> +                # which $app &> /dev/null
> +                # ONLY works on Debian derived distro's
> +                # TODO similar for yum
> + dpkg -l $app | grep ^ii &> /dev/null
>
> This seems a significant bug. I wonder how this passed your testing on
> Debian/Ubuntu.

I tested this on Fedora 16 and it worked on there...

> You use `which <command>` to see if a package is installed. But ... e.g.
> for the package
> 'build-essential' there is no 'build-essential' command that is
> installed
> (at least not on
> Ubuntu 10.04).

Good point, thank you for pointing that out.

> My solution DEBIAN ONLY is to check with dpkl -l | grep ^ii
>
> I did not test the yum side, maybe a similar fix is required there ?

This works on the yum side, but I'll try to find a similar fix with RPM
to make sure this kind of problem never occurs.

> Also, on a recent Ubuntu, the installed packages are installed as
> alternatives,
> so, 'ncurses-dev' becomes 'libncurses5-dev'. For better robustness, we
> need
> to find a way that checks for either one of the packages (or use the
> dpkg
> system to discover in a more fundamental way if the ncurses-dev
> dependencies
> are met). Same for libxslt-dev.

I just grabbed these requirements from the RVM site, but I see where you
are coming from.

> @@ -99,8 +104,8 @@
>  case "$mode" in
>   touch ~/.bashrc
>   fi
>
> - echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"'
>>>
> ~/.bashrc
> - source ~/.bashrc
> +        # do the load here, since the return in top of bash made this
> fail
> + [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
>   ;;
>
>
> I presume(??), this is the tricky known issue where the line [ref A]
>
> # If not running interactively, don't do anything
> [ -z "$PS1" ] && return
>
> returns for non interactive shells and this fails to load rvm. So, as a
> quick hack,
> I simply ran the line straight from rvmsh.
>
> Also, don't add that line yourself.

Good point.  I'm going to keep the line that adds RVM to `~/.bashrc`
though as I have had to do that every time.

> Rvm already adds the line. And also,
> when running
> rvmsh multiple times, it added the line everytime again.

I'll make sure to check for that line before adding it.

>
> @@ -126,15 +131,16 @@ if [ "$mode" = "single" ]; then
>  fi
>
>  # Test if RVM is installed.
> -which rvm &> /dev/null
> +echo "rvm is installed here:"
> +which rvm
>
> I prefer to actually see where rvm is installed.

Okay, seems like a reasonable default.

> -if [ "$?" = "0" ]; then
> +if [ "$?" = "1" ]; then
>   echo "There was an error installing RVM!"
>   exit
>  fi
>
> This seems like a hard bug. You want to bail out when the rvm _failed_,
> do
> you,
> and not when it succeeded ? I presume, it actually never passed in your
> tests
> (because the rvm loading never really happened because of the return in
> the
> top of .bashrc, see [ref A] above). Bailing out on failure seems more
> correct to
> me, but I may be wrong.

I got you Mr. Sarcastic :P.  That is a typo though.

>  # Offer to install latest ruby.
> -latest="https://raw.github.com/dunsmoreb/rvmsh/master/ruby/latest"
> +latest="https://raw.github.com/petervandenabeele/rvmsh/master/ruby/latest"
>  version=$(curl -s $latest)
>
> I prefer the latest stable version. Rvm will automatically select the
> latest stable
> version (the one with the [-pxxx] at the end).

Good point, I've always used the `head` branch and never though anything
of other users wanting to have something more stable :P.

> Still this method has a flow that we need to update manually when
> Ruby/rvm
> upgrades
> and eventually we will forget. An automatic method would be better ...
> Maybe rvm has
> a proper way to inform us of the latest stable MRI ruby (sorry I didn't
> look it up now).

I may add that in the future.  Sounds more like a cron job though,
running a separate script every three or two months.

> +echo "run 'source ~/.bashrc' now to activate rvm"
>
> Inside the script, rvm got loaded (with my hack of executing the load
> line
> directly), but
> outside of the script, rvm seems not be loaded yet. So, I add a message
> to
> inform the
> user about that.

I'm going to check for that return on interactive mode and if that is
present I will display the message.

> My patches are certainly hackish, but it works and thanks again for this
> useful script.

Your welcome and let me thank you for your feedback.  There was
certainly a lot of bugs as this was the first shell script I've ever
written.

Bryan Dunsmore
<dunsmoreb@gmail.com>

-- 
Posted via http://www.ruby-forum.com/.

In This Thread