Browse Source

refactor rubymine docs

pull/2996/head
Carolyn 1 month ago
parent
commit
294d918c3a
  1. 21
      .run/core.run.xml
  2. 31
      docs/setup.md

21
.run/core.run.xml

@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="core" type="RailsRunConfigurationType" factoryName="Rails">
<module name="submit-social-housing-lettings-and-sales-data" />
<predefined_log_file enabled="true" id="RUBY_RAILS_SERVER" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
<EXTENSION ID="BundlerRunConfigurationExtension" BUNDLE_MODE="AUTO" bundleExecEnabled="true" />
<EXTENSION ID="org.jetbrains.plugins.ruby.rails.run.RailsRunConfigurationExtension" SCRATCH_USE_RAILS_RUNNER="false" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="SCRIPT_ARGS" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="PORT" VALUE="3000" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="IP" VALUE="127.0.0.1" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="DUMMY_APP" VALUE="test/dummy" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="RAILS_SERVER_TYPE" VALUE="default" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="ENVIRONMENT_TYPE" VALUE="development" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="LAUNCH_JS" VALUE="false" />
<method v="2" />
</configuration>
</component>

31
docs/setup.md

@ -147,7 +147,7 @@ Also ensure you have firefox installed
bundle exec rake db:seed bundle exec rake db:seed
``` ```
5. For Ordinance Survey related functionality, such as using the UPRN, you will need to set OS_DATA_KEY in your .env file. This key is shared across the team and can be found in AWS Secrets Manager. 5. For Ordinance Survey related functionality, such as using the UPRN, you will need to set `OS_DATA_KEY` in your .env file. This key is shared across the team and can be found in AWS Secrets Manager.
6. For email functionality, you will need a GOV.UK Notify API key, which is individual to you. Ask an existing team member to invite you to the "CORE Helpdesk" Notify service. Once invited, sign in and go to "API integration" to generate an API key, and set this as `GOVUK_NOTIFY_API_KEY` in your .env file. 6. For email functionality, you will need a GOV.UK Notify API key, which is individual to you. Ask an existing team member to invite you to the "CORE Helpdesk" Notify service. Once invited, sign in and go to "API integration" to generate an API key, and set this as `GOVUK_NOTIFY_API_KEY` in your .env file.
## Running Locally ## Running Locally
@ -192,17 +192,24 @@ You can also insert a new user row using SQL, but you will need to generate a co
### Debugging ### Debugging
You can use `binding.pry` to pause the execution of the code at that line and open an interactive console. Add the line `binding.pry` to the code to pause the execution of the code at that line and open a powerful interactive console for debugging.
More details on Pry are available at https://pry.github.io/ . More details on Pry are available at <https://pry.github.io/> .
RubyMine also offers built-in debugger functionality. RubyMine also offers built-in debugging functionality, with the ability to manage breakpoints in the IDE.
Add a Rails run configuration for the project to RubyMine (the default setup should just work) and you can choose between running the project using the play icon to run it normally or using the bug icon to run with the debugger attached. To use this:
You can also run tests with the debugger attached from the spec files. - To run the app with debugger: select the "core" Rails run configuration for the project in the top right, then click the bug icon to run with the debugger attached
When running any code in RubyMine with the debugger attached, click the line numbers to place a breakpoint. - To run tests with debugger: use the arrows in the margin of spec files beside a section or an individual test
Right click a breakpoint for advanced options like setting conditions for the breakpoint to trigger. - To run anything else with debugger: go to `Run > Edit Configurations` and add the task you want to debug - options include Rails, Rake, Rspec, Ruby
When the breakpoint is hit, code execution pauses and you can evaluate expressions, step through the code, and see the values of variables in the current scope.
You can "watch" important expressions to see their values change as you step through the code. Click a line number to place a breakpoint. Right click a breakpoint for advanced options on when to trigger and what to log. You can view all breakpoints, toggle them and configure them from the `View Breakpoints...` menu.
More details on debugging in RubyMine can be found at https://www.jetbrains.com/help/ruby/debugging-code.html .
When the running code reaches a breakpoint, the debugger pauses execution and the debug panel can be used to:
- View the call stack and the values of variables in the current scope
- Evaluate and watch expressions
- Step through the code line by line
- Mute all breakpoints, resume, restart, etc
More details on debugging in RubyMine can be found at <https://www.jetbrains.com/help/ruby/debugging-code.html> .
### Tests ### Tests

Loading…
Cancel
Save