Skip to content

Conversation

@p0deje
Copy link
Member

@p0deje p0deje commented Nov 30, 2022

Few simple steps to configure RubyMine to be more aware of Bazel.

@p0deje p0deje requested a review from titusfortner November 30, 2022 15:45
@p0deje
Copy link
Member Author

p0deje commented Nov 30, 2022

It would be nice if you could just somehow store RubyMine configuration in the repo so it works automatically. I've found a way to keep RSpec configuration in a file:

$ cat .run/Template\ RSpec.run.xml
<component name="ProjectRunConfigurationManager">
  <configuration default="true" type="RSpecRunConfigurationType" factoryName="RSpec">
    <module name="rb" />
    <predefined_log_file enabled="true" id="RUBY_RSPEC" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-I ../bazel-bin/rb/lib" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
    <EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
    <EXTENSION ID="RubyCoverageRunConfigurationExtension" runner="rcov">
      <COVERAGE_PATTERN ENABLED="false">
        <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
      </COVERAGE_PATTERN>
    </EXTENSION>
    <EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATHS" VALUE="" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
    <RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
    <method v="2" />
  </configuration>
</component>

But I'm not sure if it's safe to commit it and new RubyMine projects will pick it up.

I also haven't found a way to automatically configure interpreter.

@diemol
Copy link
Member

diemol commented Dec 1, 2022

I think it is a good idea to add this, there is already an IntelliJ config in the repository.

@p0deje
Copy link
Member Author

p0deje commented Dec 1, 2022

@diemol I'm not sure how RubyMine picks those files up - it might be possible that developer still needs to configure manually.

@diemol
Copy link
Member

diemol commented Dec 1, 2022

Maybe @titusfortner knows. But even if some manual work is needed, it still would be better than the current state.

@p0deje p0deje merged commit 55dad42 into trunk Dec 2, 2022
@p0deje p0deje deleted the rubymine-instructions branch December 2, 2022 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants