Skip to content

Commit

Permalink
Added some readme documentation, and some dev support items for local…
Browse files Browse the repository at this point in the history
… debugging (#903)

* Added some readme documentation, and some dev support items for local debugging

* Fix build error

* Fix build error take 2

* Sorbet is fun

* Update spring.rb

More fun with sorbet.

* Update spring.rb

Even more Sorbet fun
  • Loading branch information
jmather-c authored Nov 23, 2022
1 parent 20637d7 commit 3dbae69
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore Jetbrains Files.
.idea
IlluminatedCloud
/coverage

# Ignore bundler config.
/.bundle

Expand Down Expand Up @@ -38,4 +43,4 @@ irb.log
test/reports/
.DS_Store
/vendor/bundle
node_modules
node_modules
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ group :test do
gem 'mocha', '~> 1.15'
gem 'rack-test', '~> 2.0.2'
gem 'database_cleaner', '~> 1.7.0'
gem 'simplecov', '~> 0.21.2'
end

group :test, :development do
Expand Down
15 changes: 10 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ GEM
crass (1.0.6)
database_cleaner (1.7.0)
debug_inspector (1.1.0)
docile (1.4.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.8.1)
Expand Down Expand Up @@ -191,7 +192,6 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0901)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
minitest (5.16.3)
minitest-ci (3.4.0)
minitest (>= 5.0.6)
Expand All @@ -214,9 +214,6 @@ GEM
ruby2_keywords (~> 0.0.1)
netrc (0.11.0)
nio4r (2.5.8)
nokogiri (1.13.9)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.13.9-arm64-darwin)
racc (~> 1.4)
nokogiri (1.13.9-x86_64-darwin)
Expand Down Expand Up @@ -383,6 +380,12 @@ GEM
concurrent-ruby (~> 1.0, >= 1.0.2)
sequel (5.61.0)
simple_structured_logger (1.0.2)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sinatra (2.2.2)
mustermann (~> 2.0)
rack (~> 2.2)
Expand All @@ -404,6 +407,7 @@ GEM
sorbet-runtime (0.5.10477)
sorbet-static (0.5.10477-universal-darwin-20)
sorbet-static (0.5.10477-universal-darwin-21)
sorbet-static (0.5.10477-universal-darwin-22)
sorbet-static (0.5.10477-x86_64-linux)
spring (4.1.0)
sprockets (4.1.1)
Expand Down Expand Up @@ -438,9 +442,9 @@ GEM

PLATFORMS
arm64-darwin-21
ruby
x86_64-darwin-20
x86_64-darwin-21
x86_64-darwin-22
x86_64-linux

DEPENDENCIES
Expand Down Expand Up @@ -497,6 +501,7 @@ DEPENDENCIES
sentry-ruby (~> 5.4.2)
sequel (= 5.61.0)
simple_structured_logger (~> 1.0.2)
simplecov (~> 0.21.2)
sorbet (~> 0.5.10477)
sorbet-rails (~> 0.7.34)
sorbet-runtime (~> 0.5.10477)
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# Required Software

| Package | URL / Install command |
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Postgres 14.5 | [https://www.enterprisedb.com/downloads/postgres-postgresql-downloads](https://www.enterprisedb.com/downloads/postgres-postgresql-downloads) |
| Redis | `brew install redis && brew services restart redis` |
| SFDX | [https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm) |
| Node v14.18.1 | [https://nodejs.org/download/release/latest-v18.x/](https://nodejs.org/download/release/latest-v18.x/) |
| Ruby 2.7.6 | `rbenv install 2.7.6 && rbenv global 2.7.6 && rbenv local 2.7.6` |

# Environment Setup

1. From `<project_dir>` run `bundle exec sequel -E -m migrations postgres://postgres:[email protected]:5432/stripeforce`
2. From `<project_dir>` run `bundle exec sequel -E -m migrations postgres://postgres:[email protected]:5432/test_stripeforce`
3. From `<project_dir>/sfdx` run `./bin/generate-cpq-scratch-org $(whoami)-scratch`
4. From `<project_dir>` run `bundle exec ruby scripts/refresh-tokens.rb $(whoami)-scratch`
5. From `<project_dir>` run `bundle exec rails test "test/integration/test_translate_order.rb" -n "/integrates a standard subscription order/"`

# Installation Links

Production Package Install:
Expand Down
9 changes: 9 additions & 0 deletions config/spring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@
Spring.after_fork do
Sequel::DATABASES.each(&:disconnect)
end
Spring.after_fork do
rubylib_path = ENV['DEBUGGER_STORED_RUBYLIB'] || ''
if rubylib_path
rubylib_path.split(File::PATH_SEPARATOR).each do |path|
next unless path =~ /ruby-debug-ide/
load path + '/ruby-debug-ide/multiprocess/starter.rb'
end
end
end

0 comments on commit 3dbae69

Please sign in to comment.