Support for executable in Rubygems

View: New views
5 Messages — Rating Filter:   Alert me  

Support for executable in Rubygems

by Chauk-Mean :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

I'm developing several gems that include executables i.e. ruby scripts that are installed in the ruby installation bin directory during the installation of the gems.
Typically, these ruby scripts do not have extension and Rubygems creates automatically wrapper scripts for each platform (a bat file for Windows, a shell script for Unix). This results in actual executable files (i.e. the wrapper scripts) that are named as other executable files.

Currently :
1- Netbeans does not create automatically or optionnally the bin folder.
As a workaround, I create manually this bin folder and I specify it as a "Source Folder" labelled "Executable Files" in the Project properties.
2- Syntax highlighting does not work for these executable files as they have no extension. This is more annoying as I haven't found a workaround. It would be really great if the file type can be specified according to the container folder in addition to the file extension.

Thanks.

Chauk-Mean.

Re: Support for executable in Rubygems

by Martin Krauskopf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Chauk,

Chauk-Mean wrote:
[...]
> Currently :
> 1- Netbeans does not create automatically

that's true. It should be done for bin folder, since it is often used in
the Ruby projects. Can you file RFE into Issuezilla in ruby/projects?

> As a workaround, I create manually this bin folder and I specify it as a
> "Source Folder" labelled "Executable Files" in the Project properties.

It's the right way.

> 2- Syntax highlighting does not work for these executable files as they have
> no extension. This is more annoying as I haven't found a workaround.

You do not need a workaround, if a Ruby file has right Shebang line, e.g.:

   #!/usr/bin/env ruby

Ruby MimeType resolver detects the shebang and marks the file as Ruby
file. Otherwise there is no chance for IDE to detect this, other than to
parse content of each file to found out whether it looks like as Ruby
file which might become performance problem with e.g. thousand files.
Shebang line detection is still performance wise.

 > It
> would be really great if the file type can be specified according to the
> container folder in addition to the file extension.

Not sure if this is a good idea. Then when you put some other file into
the folder, the detection would fail. The Shebang approach should work.

        m.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Support for executable in Rubygems

by Chauk-Mean :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Martin,

>> 1- Netbeans does not create automatically

>that's true. It should be done for bin folder, since it is often used in
>the Ruby projects. Can you file RFE into Issuezilla in ruby/projects?

Done : Issue #145127.

>> 2- Syntax highlighting does not work for these executable files as they have
>> no extension. This is more annoying as I haven't found a workaround.

>You do not need a workaround, if a Ruby file has right Shebang line, e.g.:

>   #!/usr/bin/env ruby

That's great. I didn't know this way for specifying file type.
But this does not work completely :
- the navigator works (i.e. it shows defined functions, variables ...)
- but there is no syntax highlighting in the editor. Curiously, syntax errors are indicated if any.

My configuration : Netbeans 6.5 beta on Windows.
Should I file a bug report ?

Chauk-Mean.



Re: Support for executable in Rubygems

by Martin Krauskopf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chauk-Mean wrote:
> Hi Martin,
>
>>> 1- Netbeans does not create automatically
>
>> that's true. It should be done for bin folder, since it is often used in
>> the Ruby projects. Can you file RFE into Issuezilla in ruby/projects?
>
> Done : Issue #145127.

Thanks.

[...]

>>   #!/usr/bin/env ruby
>
> That's great. I didn't know this way for specifying file type.
> But this does not work completely :
> - the navigator works (i.e. it shows defined functions, variables ...)
> - but there is no syntax highlighting in the editor. Curiously, syntax
> errors are indicated if any.
>
> My configuration : Netbeans 6.5 beta on Windows.
> Should I file a bug report ?

Does it work after restart of NetBeans? If yes, it is bug as well, so
please file against ruby/editing in any case.

Thanks,
        m.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Support for executable in Rubygems

by Chauk-Mean :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Martin Krauskopf wrote:
>Does it work after restart of NetBeans? If yes, it is bug as well, so
>please file against ruby/editing in any case.

For my first file, restarting Netbeans makes syntax highlighting work for this file.

But I tried to create other files and this does not work even after a restart.
I filed the Issue #145157.

I don't know how I have been able to make my first file recognized by Netbeans as a Ruby file.

Chauk-Mean.
LightInTheBox - Buy quality products at wholesale price!