Re: How to see the all keys of "RbConfig::CONFIG" ?

2013-02-11 Thread Intransition
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

Re: The "ruby way" to do desktop applications?

2013-02-11 Thread Intransition
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

Re: Expanding gemspecs

2013-02-06 Thread Intransition
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

Re: Symbol.defined?

2013-02-06 Thread Intransition
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

Re: How to increase flexibility of #flatten

2013-02-05 Thread Intransition
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

Re: Combine 3 hash into one

2013-01-26 Thread Intransition
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

Re: Rulog - Prolog in Ruby?

2013-01-13 Thread Intransition
Was it yanked? -- [email protected] | https://groups.google.com/d/forum/ruby-talk-google?hl=en

Re: Refinements. Am I doing Something wrong?

2013-01-10 Thread Intransition
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

Re: Re-implementing Autoload

2013-01-10 Thread Intransition
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 >

Re: Re-implementing Autoload

2013-01-10 Thread Intransition
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

Re: Re-implementing Autoload

2013-01-08 Thread Intransition
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

Re-implementing Autoload

2013-01-08 Thread Intransition
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

Re: respond_to_missing?

2013-01-06 Thread Intransition
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

Re: respond_to_missing?

2013-01-05 Thread Intransition
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

Literal notation for Pathnames

2013-01-03 Thread Intransition
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, `/`, `./

respond_to_missing?

2013-01-03 Thread Intransition
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

Re: Cross-platform gems / conditional loading of gems

2013-01-03 Thread Intransition
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

Re: numeric?

2012-12-28 Thread Intransition
> > 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

Re: How to deactivate RubyGems?

2012-12-28 Thread Intransition
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

How to deactivate RubyGems?

2012-12-28 Thread Intransition
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

Re: Word Pluralization and Conversions from Numbers like 1,2,3,4,5

2012-12-26 Thread Intransition
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

[ANN] HTMLFilter 1.3.0

2012-12-13 Thread Intransition
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

[ANN] YAML Command v0.1.0

2012-12-12 Thread Intransition
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

Re: Help me improve Hash#rekey

2012-12-11 Thread Intransition
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

Re: Help me improve Hash#rekey

2012-12-10 Thread Intransition
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

Help me improve Hash#rekey

2012-12-09 Thread Intransition
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, ...) #

Re: Array#concat Enumerator

2012-12-09 Thread Intransition
> > > 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

Re: [ANN] Chitin 1.0.3

2012-12-09 Thread Intransition
> > > 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].

Re: How to create a gem which conditionally compiles/installs a C extension?

2012-12-07 Thread Intransition
> > 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

Array#concat Enumerator

2012-12-06 Thread Intransition
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].

Files to include .gem package?

2012-12-03 Thread Intransition
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

Re: [ANN] rdoc 4.0.0.preview2

2012-12-03 Thread Intransition
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

Re: [ANN] rdoc 4.0.0.preview2

2012-12-01 Thread Intransition
> > > 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

Re: Ordered Hash (v. 1.8)

2012-11-30 Thread Intransition
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

Take over google group mirror of rubygems-developers mailing list

2012-11-25 Thread Intransition
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"

[ANN] Hashery 2.1.0 (Golden Retriever)

2012-11-25 Thread Intransition
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

Re: mysql drama!

2012-11-25 Thread Intransition
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

Re: Using DSL miniprograms as a data store

2012-11-25 Thread Intransition
> > 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

Re: Are jobs allowed?

2012-08-30 Thread Intransition
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

The source of RUBY_PLATFORM

2012-08-07 Thread Intransition
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

Re: Supporting multiple versions of an API

2012-08-07 Thread Intransition
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

Re: Supporting multiple versions of an API

2012-08-02 Thread Intransition
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

Re: Supporting multiple versions of an API

2012-08-02 Thread Intransition
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

Re: Supporting multiple versions of an API

2012-08-02 Thread Intransition
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

Supporting multiple versions of an API

2012-07-30 Thread Intransition
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

Re: Anyone interested in a Package Manager in Ruby?

2012-07-25 Thread Intransition
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

Re: Lambdaification of Method Calls

2012-07-10 Thread Intransition
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

Re: Ruby Future in coming years

2012-07-07 Thread Intransition
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

Re: Ruby Future in coming years

2012-07-06 Thread Intransition
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

Re: self.clone.replace(super)?

2012-07-05 Thread Intransition
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 > >

Re: Splitting assets in two and what to call them?

2012-07-05 Thread Intransition
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 > >

Splitting assets in two and what to call them?

2012-07-04 Thread Intransition
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

Re: Array#sample is Set#sample and not Array#sample !

2012-06-25 Thread Intransition
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,

Re: Enumerable#unassociate

2012-06-25 Thread Intransition
> > 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. >>

Re: Enumerable#unassociate

2012-06-25 Thread Intransition
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, :

Enumerable#unassociate

2012-06-24 Thread Intransition
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

Re: [ANN] simple_gui_creator 0.1.3 released

2012-06-22 Thread Intransition
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

Re: POSITION: Reports Developer (Business Objects Enterprise XI) LOCATION: Trenton NJ DURATION: 6-12 Months

2012-06-22 Thread Intransition
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

Enumerable#every, the Functor and Ruby support for HOM

2012-06-19 Thread Intransition
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

require_relative? why didn't we "relative do"

2012-06-14 Thread Intransition
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

Re: require_relative? why didn't we "relative do"

2012-06-14 Thread Intransition
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

Syntax Highlighter

2012-06-14 Thread Intransition
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

Re: require_relative? why didn't we "relative do"

2012-06-14 Thread Intransition
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

Re: Syntax Highlighter

2012-06-14 Thread Intransition
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

Re: Ramaze + CoffeeScript

2012-06-14 Thread Intransition
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.

Re: Great Ruby Apps/Libraries

2012-05-17 Thread Intransition
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