This has been helpful to me:
require 'rbconfig'
require 'yaml'
y RbConfig::CONFIG
--
[email protected] |
https://groups.google.com/d/forum/ruby-talk-google?hl=en
---
You received this message because you are subscribed to the Google Groups
"ruby-talk-google" grou
http://appjs.org/
--
[email protected] |
https://groups.google.com/d/forum/ruby-talk-google?hl=en
---
You received this message because you are subscribed to the Google Groups
"ruby-talk-google" group.
To unsubscribe from this group and stop receiving emails from it, send an em
On Wednesday, February 6, 2013 4:48:36 AM UTC-5, Jon Cairns wrote:
>
> Hi everyone, I've got a question about the existence or potential
> usefulness of a particular gem.
>
> The situation is this: all gems have a gemspec file that defines various
> properties about the gem. When creating a ne
While on the topic, I have a related question about this Symbol DOS attack
vector: Can't an upper limit be put on the size of the symbols table, and
if it is exceeded, then an error is raised? Wouldn't that alone be
sufficient to neuter such an attack?
--
[email protected] |
h
First stab:
def deflate(a)
a.inject([]){ |c,e| (Array === e ? (Array === e.first ? c.concat(e)
: c << e) : c << e); c }
end
Doesn't handle deeper nestings though.
--
[email protected] |
https://groups.google.com/d/forum/ruby-talk-google?hl=en
---
You received t
On Saturday, January 26, 2013 1:04:55 PM UTC-5, robert lengu wrote:
>
> Hi
> I am trying to marge 3 hash : hash1["errors"] ,hash2["errors"],hash3
>
> so what i am doing this
>
> p hash1["errors"].zip(hash2["errors"],hash3).flatten.compact
>
> Which works fine when hash1["errors"] has at l
Was it yanked?
--
[email protected] |
https://groups.google.com/d/forum/ruby-talk-google?hl=en
Refinements were altered (pretty much at the last moment) to be *file*
scoped. So that's why `using` only makes sense at toplevel.
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
ruby-talk-goo...@googlegro
On Thursday, January 10, 2013 8:55:17 AM UTC-5, Xavier Noria wrote:
>
>
> Exactly, dependencies.rb does the same as a know trade-off.
>
> The second bit const_missing lacks is the resolution algorithm that
> failed to find the constant.
>
> Point is, while resolving X in
>
> module M
>
Thanks Xavier. I realize implementation differs. Clearly I can't tap into
the underlying constant resolution with pure Ruby. But I expected that I
should be able to emulate it effectively with const_missing --I would think
it would possible to get essentially the same results.
The only differen
I was able to implement a hack:
# if module has no name, try to parse out a namespace from #insepct.
# (yes, this is a hack!)
unless parent
if name.nil?
if /#/ =~ self.inspect
parent = Object.const_get($1) rescue nil
end
end
end
That seems to
Finally accepting the fact that autoload will never be fixed (i.e. there it
no way to override require to effect autoload's behavior) I decided to
try re-implementing autoload in Ruby itself.
So here's what I arrived at:
https://github.com/rubyworks/autoload/blob/master/lib/autoload.rb
I t
On Saturday, January 5, 2013 4:00:02 PM UTC-5, Jan E. wrote:
>
> How is that contradictory? Are you sure you got the return values of
> respond_to_missing? right? Because I guess you want to return *true* for
> :to_ary?
>
> respond_to? first checks if the method is actually, physically there. I
Thank you Jan and Sandor. That is basically what I thought, but I had
recently become confused b/c of this:
https://bugs.ruby-lang.org/issues/5759
If you read toward the bottom of this thread, there is a case that seems
contradictory. I still don't get it.
-- You received this message becau
One thing I would like Ruby to have is a concise literal notation for
pathnames. So maybe Ruby could have a literal notation as follows:
/foo/bar#=> #
./foo/bar #=> #
../foo/bar #=> #
and/or
/"foo/bar"#=> #
./"foo/bar" #=> #
../"foo/bar" #=> #
So, `/`, `./
Can anyone explain `#respond_to_missing?`.
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsubscribe from this group, send email
to ruby-talk-google+unsubscr...@goog
Try something like:
if RUBY_PLATFORM =~ /(win|ming)/
...
else
...
end
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsubscribe from this gr
>
> The world at large really needs to discover YAML.
>
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsubscribe from this group, send email
to ruby-talk-google+un
Thanks, Florian. I thought there was I just couldn't remember how it was
done.
Follow-up question... Do you have any idea if this sets a flag that can be
accessed from Ruby code?
I'm working on a project that can be configured to omit GEM_PATH from it's
searches. I was thinking that maybe I c
Is there are way to run ruby the old fashioned way -- without RubyGems?
Thanks.
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsubscribe from this group, send email
And English gem.
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsubscribe from this group, send email
to [email protected]. For more opt
Just released HTMLFilter 1.3.0.
This release provides a fairly comprehensive set of RELAXED html
tags/attributes and allowed html entities. All thanks to David Wright. It
also adds basic command line interfaces, `htmlfilter` and `cssfilter`.
https://github.com/rubyworks/htmlfilter
-- You recei
Just released YAML Command v0.1.0. It is a command line tool for working
with YAML files.
As there doesn't seem to be any other "Shell-based API" for YAML, I thought
it might be a good idea to devise one.
https://github.com/rubyworks/yaml_command
Appreciate any feedback.
(Note that the very f
On Tuesday, December 11, 2012 6:55:32 AM UTC-5, Robert Klemme wrote:
>
>
> > Oh, and nice use of polymorphism using #[] for both proc and hash
> retrieval!
>
> Thank you! :-)
>
Well, everything went well except for one thing, which was a bit irritating
actually -- I couldn't find a way to co
On Monday, December 10, 2012 7:22:17 AM UTC-5, Robert Klemme wrote:
>
> On Sun, Dec 9, 2012 at 7:19 PM, Intransition >
> wrote:
> > The note `TODO: Improve Hash#rekey code!!!` has been in my docs for too
> > long. I could use other's insights and thought others m
The note `TODO: Improve Hash#rekey code!!!` has been in my docs for too
long. I could use other's insights and thought others might enjoy the
challenge. So here's the code:
require 'facets/na'
class Hash
# Rekey a hash:
#
# rekey()
# rekey(from_key => to_key, ...)
#
>
>
> irb(main):013:0> ["foo"].push(*"abc".chars)
> => ["foo", "a", "b", "c"]
>
>
A bit beside the point though. I was wondering if #concat should be able to
handle an Enumerator.
But I didn't know push could take more than one argument, so that's
something learned today. Thanks!
-- You r
>
>
> How did you go about it exactly? How does this differ from say, running
`pry` and `include FileUtils` at toplevel?
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected].
>
> Consider creating a separate gem for the C extension. Then maybe it would
> be easier to limit it's installation as a dependency. At the very worst you
> can just tell 1.9.2 users that they need to install the extension
> gem separately.
-- You received this message because you are subscri
Shouldn't this work?
[].concat("abc".chars)
Seems extraneous that one would have to do:
[].concat("abc".chars.to_a)
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected].
I created a stackoverflow question for this:
http://stackoverflow.com/questions/13550754/what-project-files-belong-in-a-gem-package
I am especially curious as to people's opinions about whether a gem should
be an almost complete image the project folder, or just include minimum
files needed
On Saturday, December 1, 2012 8:08:03 PM UTC-5, Eric Hodel wrote:
>
>
> Multiple gems at once. At the top level you can type to filter on
> installed gems.
>
Awesome!
>
> Currently it uses the darkish generator. Due to lack of time I haven't
> investigated alternate output templates. Allowi
>
>
> Notable feature additions are markdown support and an WEBrick servlet that
> can
> serve HTML from an ri store. (This means that RubyGems 2.0+ no longer
> needs
> to build HTML documentation when installing gems.)
>
Nice! I had a gem that did that, but it was quite the hack, so it was
On Thursday, November 29, 2012 8:46:48 PM UTC-5, Doug Jolley wrote:
>
> I am running Ruby v. 1.8.7 and I have installed the orderedhash gem. I
> know that the purpose of orderedhash is to preserve the order of
> creation. However, what I'd really like to do is, after the hash has
> been create
I am going to discontinue my management of the google group mirror of
the rubygems-developers mailing-list[1]. If any one would like to take
over this task, please let me know. There is really nothing to it as the
list barely registers any actively these days, but someone has to be the
"owner"
Hashery 2.1.0 (Golden Retriever) has been released.
The major change of this release is to switch to `Hash#fetch` as the
fundamental CRUD read method in place of the `#read` core extension (an
alias of `#[]`). This is a pretty fundamental change which required
modification of a number of classe
Did you find a solution?
I did not know on Windows you had to copy the .dll to bin yourself. That
seems odd.
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsub
>
> Probably only if you need computation. If it's just plain data then
> something like YAML might work just as well, and be less error prone.
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
ruby-talk-go
If it is a personally written unique post for a Ruby-specific job, then it
won't be a problem. But if it is a cookie-cutter recruiting post for tech
jobs, it will be spam filtered and you may get kicked off the list.
-- You received this message because you are subscribed to the Google Groups
r
How does Ruby get the information for RUBY_PLATFORM?
On my machine the value is `x86_64-linux`. I can use a shell command `arch`
to get "x86_64". Where does is get the "linux" part?
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to t
On Thursday, August 2, 2012 5:16:34 PM UTC-4, Robert Klemme wrote:
>
>
> So it's *not* the user deciding on the API version! That's a
> different situation. Or does the user present the loaded YAML file?
> Can you be a bit more specific about your usage scenario?
>
Well ultimately the user c
On Thursday, August 2, 2012 12:14:27 PM UTC-4, Robert Klemme wrote:
>
> On Thu, Aug 2, 2012 at 4:47 PM, Intransition wrote:
>
> > Yes, that's the traditional factory approach. I actually would not want
> to
> > use "MainFactory", as don't want it
On Thursday, August 2, 2012 10:47:19 AM UTC-4, Intransition wrote:
>
>
>> It splits things up into maintainable files quite nicely, and also has
>> less parsing (for what that's worth.) However it wouldn't work if you
>> need two different versions of Ma
On Monday, July 30, 2012 9:28:04 PM UTC-4, Matthew Kerwin wrote:
>
>
> For what it's worth, I kind of like this solution, but I get the
> feeling there's something not quite right about it.
Same here, but it's probably just b/c its unusual --its not something you
can really do in any other la
Any recommendations on the management of API versions. I have a case in
which it is important that my library support all versions.
For example, currently I am basically doing:
module MyLib
module V0
module Main
...
end
end
class Main
def initialize(versi
On Monday, July 23, 2012 5:09:43 PM UTC-4, Ryan Davis wrote:
>
> Well known fact: "Recipes" was used in the Perl Cookbook (get it?) long
> before Baker came around. According to Amazon, the 1st Edition was
> published in August 1, 1998 and I bought my first copy on September 4,
> 1998.
>
And
On Monday, July 9, 2012 11:05:22 AM UTC-4, Robert Klemme wrote:
How would you compare this to lazy,rb?
http://moonbase.rydia.net/software/lazy.rb/
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
ruby-tal
Ok. I'm banning from Google group, and filing this post as spam. Thanks.
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsubscribe from this group, send email
to rub
Is this spam?
On Friday, July 6, 2012 3:04:55 PM UTC-4, akshay jangid wrote:
>
> Akshay Jangid wrote in post #1051602:
> > hi
>
> Attachments:
> http://www.ruby-forum.com/attachment/7573/stuff_for_future_intw.jpg
>
>
> --
> Posted via http://www.ruby-forum.com/.
>
>
-- You received this mes
On Thursday, July 5, 2012 5:52:22 AM UTC-4, Robert Klemme wrote:
>
> On Thu, Jul 5, 2012 at 11:41 AM, Soichi Ishida
> wrote:
> > Hi. Could anyone help me understand the following? I am reading a
> > piece of code that someone else wrote.
> >
> >
> > class RegexAlternation < Array
> >
On Wednesday, July 4, 2012 4:39:01 PM UTC-4, Robert Klemme wrote:
>
> On Wed, Jul 4, 2012 at 6:15 PM, Intransition wrote:
> > A draft blog post I just wrote:
> >
> >
> https://github.com/trans/trans.github.com/wiki/2012-07-04-crossing-the-assets-divide
>
>
A draft blog post I just wrote:
https://github.com/trans/trans.github.com/wiki/2012-07-04-crossing-the-assets-divide
In short, I need to split assets between design and content assets, and I
am trying to figure out good names for the two directories. Any suggestions?
-- You received this messag
On Monday, June 25, 2012 10:53:51 AM UTC-4, Michel Demazure wrote:
>
> Arrays are ordered, sets are not. Sampling an array should give random
> elements in the good order. But :
>
> irb(main):001:0> (0..10).to_a.sample(5)
> => [8, 10, 4, 6, 7]
>
> Today's Array#sample actually is Set#sample,
>
> On Monday, June 25, 2012 12:00:01 PM UTC-4, Robert Klemme wrote:
And what's the use case for *that* method?
>
>
To convert an Enumerable to a Hash. Sorry, I should have specified that.
> I have no name for it yet, so call it #h.
>> >
>> > # Convert an Enumerable object to a Hash.
>>
On Monday, June 25, 2012 2:38:48 AM UTC-4, Robert Klemme wrote:
> What's the use case for this?
>
In my case it's supplemental to another method I am working on. I have no
name for it yet, so call it #h.
# Convert an Enumerable object to a Hash.
#
# [:a, 1, :b, 2].h
# #=> {:a=>1, :
Have a look:
module Enumerable
# Take an associative array and unassociate it.
#
# [[:a,1], [:b,2]].unassociate.to_a #=> [:a, [1], :b, [2]]
# [[:a,1], [:b,2]].unassociate(1).to_a #=> [:a, 1, :b, 2]
#
def unassociate(index = 1..-1)
return to_enum(:unassocia
On Thursday, June 21, 2012 8:40:48 PM UTC-4, Roger Pack wrote:
>
> Hello all. I would like to wish happy birthday to my simple_gui_creator
> gem.
>
> Basically it allows you to design your window layout using
> (opinionated) ASCII art-like text:
>
> ---My Window Title
On Wednesday, June 20, 2012 6:35:10 PM UTC-4, Harpreet Singh wrote:
>
> *Hello,
>
> **Hope you are doing fine!!*
> *Please review the requirement and if you are interested then reply back
> with your updated resume ,contact details and rate ASAP to
> [email protected]
> * POSITION: Reports D
Have you heard of `Enumerable#every`? It lets you apply a method call to
all elements of an enumerable. Check it out...
[1,2,3].every + 3 #=> [4,5,6]
[1,2,3].every * 3 #=> [3,6,9]
words = ["hello", "world"]
words.every.upcase!
words #=> ["HELLO", "WORLD"]
Essentially every is a co
I wonder if it would been better if we had gone another route with the
whole `#require_relative` thing. Instead of a special require method, we
could have a method that adds the current file's directory to the top of
the $LOAD_PATH temporarily while a block executes.
For example, lets say we ha
On Wednesday, June 13, 2012 9:20:34 AM UTC-4, Jams wrote:
>
>
> you might have better luck emailing ruby-core if you're interested in this
> an can't work it out.
>
> Have you looked through the ruby-lang archives? The first hit I found for
> require_relative was this: http://www.ruby-forum.co
Would you agree that Ruby shouldn't lack for a syntax highlighting library
as good as any that exists for other dynamic languages? I do. But as it
stands Ruby lags well behind Python's Pygments (http://pygments.org/). This
should not stand!
Ruby has a pretty good library in CodeRay (http://code
On Wednesday, June 13, 2012 10:40:08 AM UTC-4, Bartosz DziewoĆski wrote:
>
> What for? This is needlessly munging a global variable. Also, if one
> of the required scripts also happen to require something, it will
> become a relative require, too. (Unless you add some magical guard
> code for
On Thursday, June 14, 2012 10:39:55 AM UTC-4, Ralf Mueller wrote:
>
> On 06/14/2012 04:07 PM, Intransition wrote:
> > Would you agree that Ruby shouldn't lack for a syntax highlighting
> library as good as any that exists for
> > other dynamic languages? I do. But a
On Thursday, June 14, 2012 2:49:42 AM UTC-4, Den Srv wrote:
>
> Hello.
> How, i can integrate to my Ramaze project, CoffeeScript?
> I have replace my JS files on CoffeeScript files, but a don't undestand
> how it :(
> Thanks.
>
I don't think Ramaze has any special support for coffeescript.
On Wednesday, May 9, 2012 3:50:21 AM UTC-4, Ralf Mueller wrote:
>
> On 04/15/2012 10:38 AM, Trans wrote:
> > Other then Rails, what do you think the greatest Ruby app/library/gem
> is?
> >
> Rake,facets
>
That last one must be flattery ;-) But I'll take it! Lord, knows there
isn't often a
66 matches
Mail list logo