Running Ruby programs from subdirectories of a project

Hello,

I am writing a meta-gem that contains many gems inside. Right now, whenever I try to run anything from RubyMine, it always executes the command in the top level directory. This is a problem since things like rake tasks, specs, whatever, are all defined inside the subdirectories containing the gems inside the meta-gem. Just to give you an idea about how the project is structured.

<pre>
mygem/
    mygem.gemspec
    Rakefile
    lib/
        mygem/
            version.rb
            stack_info.rb
    mygem-gem1/
        mygem-gem1.gemspec
        Rakefile
        lib/
            mygem/
                gem1.rb
        spec/
            spec_helper.rb
    mygem-gem2/
        mygem-gem2.gemspec
        Rakefile
        lib/
            mygem/
                gem2.rb
        spec/
            spec_helper.rb
</pre>

When I right click the folder mygem-gem1 and click "Run all specs," it would be great if it only ran the specs for that gem. Instead, it tries to run the specs for "mygem", which doesn't have any specs and doesn't even depend on any type of testing framework.

Thanks for the help.

2 comments
Comment actions Permalink

Hi,

you can run all specs in directory, perhaps this is what you want.
Though I's suggest to create projects for every gem and open several projects in one window  this way you will have access to all rake commands and other "per-project" actions (e.g. bundler's commands)

Regards, Oleg.

0
Comment actions Permalink

That seems to have worked like a charm. Since one project contained all the other projects, I added the sub-directories as excluded directories in the outer project and then added each sub-directory as its own project.

0

Please sign in to leave a comment.