List Info

Thread: Better diagnostics for gen




Better diagnostics for gen
user name
2006-04-25 19:26:26
Welcome Gabriele,

On 4/25/06, gabriele renzi <surrender_ityahoo.it> wrote:
> Maybe there could be a more explanative message, i.e.
>
> begin
>    path="gen/#/gen.rb"
>    require path
> rescue LoadError =>e
>    if e.message[/#$/]
>     reason=  %{\tno such generator
"#"}
>    else
>      reason= %{\tunmet dependency loading
"#":\n\t#{e.message}}
>    end
>    puts "Cannot load the specified
generator!"
>    puts reason
>    exit 1
> end
>

That does seem nicer. The load error messages from gems can
be rather
unhelpful. Is this what you used to debug your friends
problem? Just
want to know how much of a beating to give it for testing
purposes. 

> I think spitting out the available generators is not
meaningful as of
> now, but if Brian's suggestion of model/scaffold
generators is going to
> be applied I think it would be nice to also show the
list in the first
> case.
>

That's a nice idea too. If/when we get any more generators.

Thanks,

Bryan

--
"Never tell people how to do things. Tell them what to
do and they
will surprise you with their ingenuity." —General
George S. Patton

_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
Better diagnostics for gen
user name
2006-04-25 20:12:33
Bryan Soto ha scritto:

> That does seem nicer. The load error messages from gems
can be rather
> unhelpful. Is this what you used to debug your friends
problem?

well, no, I just commented out the rescue..
Anyway this was just a suggestion and this is the reason
I've not 
provided it as a patch+tests, but it /seem/ to work with the
sources 
from repo.nitroproject.org:

$ ruby gen/bin/gen app foo
Cannot load the specified generator!
         unmet dependency loading gen/app/gen.rb:
         Could not find RubyGem facets (= 1.0.3)

$ gem install facets
<snip>

$ruby gen/bin/gen app

NAME
      gen app - Nitro application generator.
<snip>

$ ruby gen/bin/gen ap
Cannot load the specified generator!
         no such generator "ap"

and withouth -rubygems

$ ruby gen/bin/gen app
Cannot load the specified generator!
         unmet dependency loading gen/app/gen.rb:
         no such file to load -- facet/dir/self/recurse


> Just
> want to know how much of a beating to give it for
testing purposes. 

Oh, please be hard with it, I just quickly tested on a win32
box, which 
is Evil(TM)

_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )