activerecord-multi-tenant 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/active-record-multi-tenant-tests.yml +80 -0
  3. data/.gitignore +6 -0
  4. data/.readthedocs.yaml +15 -0
  5. data/.rspec +0 -0
  6. data/.rubocop.yml +51 -0
  7. data/Appraisals +0 -0
  8. data/CHANGELOG.md +6 -0
  9. data/Gemfile +3 -1
  10. data/LICENSE +0 -0
  11. data/README.md +2 -1
  12. data/Rakefile +1 -1
  13. data/activerecord-multi-tenant.gemspec +28 -22
  14. data/docker-compose.yml +24 -18
  15. data/docs/.gitignore +3 -0
  16. data/docs/Makefile +28 -0
  17. data/docs/api-reference.sh +10 -0
  18. data/docs/requirements.in +4 -0
  19. data/docs/requirements.txt +62 -0
  20. data/docs/source/_static/api-reference/ActiveRecord/Associations/Association.html +285 -0
  21. data/docs/source/_static/api-reference/ActiveRecord/Associations/ClassMethods.html +255 -0
  22. data/docs/source/_static/api-reference/ActiveRecord/Associations.html +117 -0
  23. data/docs/source/_static/api-reference/ActiveRecord/ConnectionAdapters/SchemaStatements.html +232 -0
  24. data/docs/source/_static/api-reference/ActiveRecord/ConnectionAdapters.html +126 -0
  25. data/docs/source/_static/api-reference/ActiveRecord/QueryMethods.html +336 -0
  26. data/docs/source/_static/api-reference/ActiveRecord/SchemaDumper.html +121 -0
  27. data/docs/source/_static/api-reference/ActiveRecord.html +130 -0
  28. data/docs/source/_static/api-reference/MultiTenant/ArelTenantVisitor.html +755 -0
  29. data/docs/source/_static/api-reference/MultiTenant/ArelVisitorsDepthFirst.html +208 -0
  30. data/docs/source/_static/api-reference/MultiTenant/BaseTenantEnforcementClause.html +462 -0
  31. data/docs/source/_static/api-reference/MultiTenant/Context.html +659 -0
  32. data/docs/source/_static/api-reference/MultiTenant/ControllerExtensions.html +202 -0
  33. data/docs/source/_static/api-reference/MultiTenant/CopyFromClient.html +186 -0
  34. data/docs/source/_static/api-reference/MultiTenant/CopyFromClientHelper.html +362 -0
  35. data/docs/source/_static/api-reference/MultiTenant/Current.html +124 -0
  36. data/docs/source/_static/api-reference/MultiTenant/DatabaseStatements.html +366 -0
  37. data/docs/source/_static/api-reference/MultiTenant/FastTruncate.html +226 -0
  38. data/docs/source/_static/api-reference/MultiTenant/MigrationExtensions.html +554 -0
  39. data/docs/source/_static/api-reference/MultiTenant/MissingTenantError.html +124 -0
  40. data/docs/source/_static/api-reference/MultiTenant/ModelExtensionsClassMethods.html +492 -0
  41. data/docs/source/_static/api-reference/MultiTenant/QueryMonitor.html +257 -0
  42. data/docs/source/_static/api-reference/MultiTenant/Table.html +419 -0
  43. data/docs/source/_static/api-reference/MultiTenant/TenantEnforcementClause.html +148 -0
  44. data/docs/source/_static/api-reference/MultiTenant/TenantIsImmutable.html +135 -0
  45. data/docs/source/_static/api-reference/MultiTenant/TenantJoinEnforcementClause.html +310 -0
  46. data/docs/source/_static/api-reference/MultiTenant/TenantValueVisitor.html +239 -0
  47. data/docs/source/_static/api-reference/MultiTenant.html +1454 -0
  48. data/docs/source/_static/api-reference/MultiTenantFindBy.html +180 -0
  49. data/docs/source/_static/api-reference/Sidekiq/Client.html +302 -0
  50. data/docs/source/_static/api-reference/Sidekiq/Middleware/MultiTenant/Client.html +217 -0
  51. data/docs/source/_static/api-reference/Sidekiq/Middleware/MultiTenant/Server.html +219 -0
  52. data/docs/source/_static/api-reference/Sidekiq/Middleware/MultiTenant.html +126 -0
  53. data/docs/source/_static/api-reference/Sidekiq.html +126 -0
  54. data/docs/source/_static/api-reference/_index.html +399 -0
  55. data/docs/source/_static/api-reference/class_list.html +51 -0
  56. data/docs/source/_static/api-reference/css/common.css +1 -0
  57. data/docs/source/_static/api-reference/css/full_list.css +58 -0
  58. data/docs/source/_static/api-reference/css/style.css +497 -0
  59. data/docs/source/_static/api-reference/file.README.html +167 -0
  60. data/docs/source/_static/api-reference/file_list.html +56 -0
  61. data/docs/source/_static/api-reference/frames.html +17 -0
  62. data/docs/source/_static/api-reference/index.html +167 -0
  63. data/docs/source/_static/api-reference/js/app.js +314 -0
  64. data/docs/source/_static/api-reference/js/full_list.js +216 -0
  65. data/docs/source/_static/api-reference/js/jquery.js +4 -0
  66. data/docs/source/_static/api-reference/method_list.html +715 -0
  67. data/docs/source/_static/api-reference/top-level-namespace.html +126 -0
  68. data/docs/source/_templates/.gitignore +4 -0
  69. data/docs/source/api-reference.rst +8 -0
  70. data/docs/source/appendix.rst +26 -0
  71. data/docs/source/changelog.rst +8 -0
  72. data/docs/source/community-and-support.rst +26 -0
  73. data/docs/source/conf.py +30 -0
  74. data/docs/source/contributing.rst +70 -0
  75. data/docs/source/getting-started.rst +37 -0
  76. data/docs/source/guides-and-tutorials.rst +129 -0
  77. data/docs/source/index.rst +54 -0
  78. data/docs/source/introduction.rst +33 -0
  79. data/docs/source/license.rst +22 -0
  80. data/docs/source/troubleshooting.rst +41 -0
  81. data/docs/source/usage-guide.rst +59 -0
  82. data/lib/activerecord-multi-tenant/arel_visitors_depth_first.rb +183 -174
  83. data/lib/activerecord-multi-tenant/controller_extensions.rb +15 -4
  84. data/lib/activerecord-multi-tenant/copy_from_client.rb +4 -0
  85. data/lib/activerecord-multi-tenant/fast_truncate.rb +4 -2
  86. data/lib/activerecord-multi-tenant/habtm.rb +50 -0
  87. data/lib/activerecord-multi-tenant/migrations.rb +18 -8
  88. data/lib/activerecord-multi-tenant/model_extensions.rb +78 -37
  89. data/lib/activerecord-multi-tenant/multi_tenant.rb +40 -21
  90. data/lib/activerecord-multi-tenant/query_monitor.rb +21 -5
  91. data/lib/activerecord-multi-tenant/query_rewriter.rb +111 -80
  92. data/lib/activerecord-multi-tenant/sidekiq.rb +31 -20
  93. data/lib/activerecord-multi-tenant/version.rb +1 -1
  94. data/lib/activerecord-multi-tenant.rb +3 -12
  95. data/lib/activerecord_multi_tenant.rb +12 -0
  96. data/spec/activerecord-multi-tenant/associations_spec.rb +21 -0
  97. data/spec/activerecord-multi-tenant/controller_extensions_spec.rb +3 -2
  98. data/spec/activerecord-multi-tenant/fast_truncate_spec.rb +8 -6
  99. data/spec/activerecord-multi-tenant/model_extensions_spec.rb +233 -153
  100. data/spec/activerecord-multi-tenant/multi_tenant_spec.rb +15 -13
  101. data/spec/activerecord-multi-tenant/query_rewriter_spec.rb +60 -59
  102. data/spec/activerecord-multi-tenant/record_callback_spec.rb +0 -0
  103. data/spec/activerecord-multi-tenant/record_finding_spec.rb +11 -11
  104. data/spec/activerecord-multi-tenant/record_modifications_spec.rb +4 -4
  105. data/spec/activerecord-multi-tenant/sidekiq_spec.rb +10 -10
  106. data/spec/database.yml +0 -0
  107. data/spec/schema.rb +20 -2
  108. data/spec/spec_helper.rb +46 -17
  109. data/spec/support/format_sql.rb +20 -0
  110. metadata +130 -25
  111. data/.github/workflows/CI.yml +0 -47
  112. data/gemfiles/.bundle/config +0 -2
  113. data/gemfiles/active_record_6.0.gemfile +0 -8
  114. data/gemfiles/active_record_6.1.gemfile +0 -8
  115. data/gemfiles/active_record_7.0.gemfile +0 -8
  116. data/gemfiles/rails_6.0.gemfile +0 -8
  117. data/gemfiles/rails_6.1.gemfile +0 -8
  118. data/gemfiles/rails_7.0.gemfile +0 -8
  119. data/lib/activerecord-multi-tenant/with_lock.rb +0 -15
  120. data/spec/activerecord-multi-tenant/schema_dumper_tester.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15ad19bf20781129dc1bd57d4e4b8eb8731044cea3b89f29a62789d0f5a45aee
4
- data.tar.gz: 0f76290b00a7d540495972ab5a9de09d3abbb1dde11758d58b08493bf743b5da
3
+ metadata.gz: ba7796208980393ca21739d24fa0ac384f0c63ab814041cf46e0216d22eef539
4
+ data.tar.gz: 107cea123278629ce9492b15eb6e168549eac4c155fe9a906e57e1695414faf7
5
5
  SHA512:
6
- metadata.gz: 17f7b912ecc314e5462affd74daf2e1b79239f8f65bfa30c8896f4acb9e1d787c240aeefe8cb09045b34ab2772d46aab4c42bb8cdb3374df247f1131a08758d0
7
- data.tar.gz: 713df8fdefb6cd50b2c02408a9763da39e532b957d176fe5a8a6e1fbe265d2cf79457ae4d196d0e6ddfdf8effe0ca370c0297ea7186a5ce145717e4a93772be1
6
+ metadata.gz: c184c2db6316a82d4b092dfdaff1cb69cde80319837302822b7fe8ae387bf627fa6e8670f828d980636e448761e51629c38c53d42dbb505d094f1a2b5eba4b54
7
+ data.tar.gz: c021571f18b6072a98bbe0793607077b785a3a989e3365cd45cd7c0d94fb89f5ed30f3129b35199d88aeab653d6c656d20028a84a5ce74bedbaf2a3c6d36c5b6
@@ -0,0 +1,80 @@
1
+ name: Active Record Multi-Tenant Tests
2
+
3
+ env:
4
+ CI: true
5
+ on:
6
+ push:
7
+ branches:
8
+ - "**"
9
+ pull_request:
10
+ types: [ opened, reopened, synchronize ]
11
+
12
+ jobs:
13
+
14
+ static-checks:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: 3.2
20
+ bundler-cache: true
21
+ - uses: actions/checkout@v3
22
+ - name: Rubocop static code analysis
23
+ run: |
24
+ gem install rubocop
25
+ rubocop
26
+ doc_checks:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/setup-python@v4
30
+ with:
31
+ python-version: 3.9
32
+ - uses: actions/checkout@v3
33
+ - name: Install python dependencies
34
+ run: |
35
+ pip install -r docs/requirements.txt
36
+ - name: Documentation Checks
37
+ run: |
38
+ cd docs
39
+ sphinx-build -W -b html source builds
40
+
41
+ build:
42
+ runs-on: ubuntu-latest
43
+ strategy:
44
+ fail-fast: false
45
+ matrix:
46
+ ruby:
47
+ - '3.0'
48
+ - '3.1'
49
+ - '3.2'
50
+ appraisal:
51
+ - rails-6.0
52
+ - rails-6.1
53
+ - rails-7.0
54
+ - active-record-6.0
55
+ - active-record-6.1
56
+ - active-record-7.0
57
+ citus_version:
58
+ - '10'
59
+ - '11'
60
+
61
+ name: Ruby ${{ matrix.ruby }}/${{ matrix.gemfile }} / Citus ${{ matrix.citus_version }}
62
+ env:
63
+ APPRAISAL: ${{ matrix.appraisal }}
64
+ CITUS_VERSION: ${{ matrix.citus_version }}
65
+ steps:
66
+ - uses: actions/checkout@v3
67
+
68
+ - name: Start Citus Database environment
69
+ run: docker-compose up -d
70
+
71
+ - uses: ruby/setup-ruby@v1
72
+ with:
73
+ ruby-version: ${{ matrix.ruby }}
74
+ bundler-cache: true
75
+
76
+ - name: Execute tests
77
+ run: bundle exec rake spec
78
+
79
+ - name: Upload coverage reports to Codecov
80
+ uses: codecov/codecov-action@v3
data/.gitignore CHANGED
@@ -4,3 +4,9 @@ pkg/
4
4
  *.*~
5
5
  Gemfile.lock
6
6
  *.gemfile.lock
7
+ .idea/
8
+ .vagrant/
9
+ Vagrantfile
10
+ coverage/
11
+ docs/build/
12
+ .yardoc/
data/.readthedocs.yaml ADDED
@@ -0,0 +1,15 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: "ubuntu-22.04"
5
+ tools:
6
+ python: "3.11"
7
+
8
+ # Build from the docs/ directory with Sphinx
9
+ sphinx:
10
+ configuration: docs/source/conf.py
11
+
12
+ # Explicitly set the version of Python and its requirements
13
+ python:
14
+ install:
15
+ - requirements: docs/requirements.txt
data/.rspec CHANGED
File without changes
data/.rubocop.yml ADDED
@@ -0,0 +1,51 @@
1
+ # This is an example RuboCop configuration file with some commonly used options.
2
+
3
+ # Run RuboCop on all Ruby files, except those in `vendor` and `node_modules` directories
4
+ AllCops:
5
+ Exclude:
6
+ - 'vendor/**/*'
7
+ - 'node_modules/**/*'
8
+ - 'Vagrantfile'
9
+ TargetRubyVersion: 3.0
10
+
11
+ Style/FrozenStringLiteralComment:
12
+ Enabled: false
13
+
14
+ Style/Documentation:
15
+ Exclude:
16
+ - '**/*.rb'
17
+ Enabled: false
18
+
19
+ Lint/ConstantDefinitionInBlock:
20
+ Enabled: false
21
+
22
+ Style/ClassAndModuleChildren:
23
+ Enabled: false
24
+
25
+ Metrics/BlockLength:
26
+ Max: 650
27
+
28
+ Metrics/MethodLength:
29
+ Max: 150
30
+
31
+ Metrics/ClassLength:
32
+ Max: 200
33
+
34
+ Metrics/ModuleLength:
35
+ Max: 200
36
+
37
+ Metrics/AbcSize:
38
+ Enabled: false
39
+
40
+ Metrics/PerceivedComplexity:
41
+ Enabled: false
42
+
43
+ Metrics/CyclomaticComplexity:
44
+ Enabled: false
45
+
46
+ Metrics/BlockNesting:
47
+ Enabled: false
48
+
49
+ Naming/FileName:
50
+ Exclude:
51
+ - 'lib/activerecord-multi-tenant.rb'
data/Appraisals CHANGED
File without changes
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
1
  # Changelog
2
+ ## 2.3.0 2023-06-05
3
+ * Adds has_and_belongs_to_many feature with tenant (#193)
4
+ * Removes eol ruby versions
5
+ * Adds documentation in ReadTheDocs platform (#196)
6
+ * Organizes badges in documentation and README.md (#197)
7
+ * Wrap ActiveRecord::Base with ActiveSupport.on_load (#199)
2
8
 
3
9
  ## 2.2.0 2022-12-06
4
10
  * Handle changing tenant from `nil` to a value [#173](https://github.com/citusdata/activerecord-multi-tenant/pull/173)
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
5
4
  gem 'appraisal'
5
+ gem 'rubocop', require: false, group: 'test'
6
+ gem 'simplecov'
7
+ gem 'simplecov-cobertura'
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # activerecord-multi-tenant [ ![](https://img.shields.io/gem/v/activerecord-multi-tenant.svg)](https://rubygems.org/gems/activerecord-multi-tenant) [ ![](https://img.shields.io/gem/dt/activerecord-multi-tenant.svg)](https://rubygems.org/gems/activerecord-multi-tenant)
1
+ # activerecord-multi-tenant
2
+ [![Build Status](https://github.com/citusdata/activerecord-multi-tenant/actions/workflows/active-record-multi-tenant-tests.yml/badge.svg)](https://github.com/citusdata/activerecord-multi-tenant/actions/workflows/active-record-multi-tenant-tests.yml) [![codecov](https://codecov.io/gh/citusdata/activerecord-multi-tenant/branch/master/graph/badge.svg?token=rw0TsEk4Ld)](https://codecov.io/gh/citusdata/activerecord-multi-tenant) [ ![Gems Version](https://img.shields.io/gem/v/activerecord-multi-tenant.svg)](https://rubygems.org/gems/activerecord-multi-tenant)[ ![Gem Download Count](https://img.shields.io/gem/dt/activerecord-multi-tenant.svg)](https://rubygems.org/gems/activerecord-multi-tenant) [![Documentation Status](https://readthedocs.org/projects/activerecord-multi-tenant/badge/?version=latest)](https://activerecord-multi-tenant.readthedocs.io/en/latest/?badge=latest)
2
3
 
3
4
  Introduction Post: https://www.citusdata.com/blog/2017/01/05/easily-scale-out-multi-tenant-apps/
4
5
 
data/Rakefile CHANGED
@@ -4,4 +4,4 @@ require 'bundler/gem_tasks'
4
4
 
5
5
  require 'rspec/core/rake_task'
6
6
  RSpec::Core::RakeTask.new(:spec)
7
- task :default => :spec
7
+ task default: :spec
@@ -1,28 +1,34 @@
1
- $:.push File.expand_path('../lib', __FILE__)
1
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
2
2
  require 'activerecord-multi-tenant/version'
3
3
 
4
- Gem::Specification.new do |s|
5
- s.name = 'activerecord-multi-tenant'
6
- s.version = MultiTenant::VERSION
7
- s.summary = 'ActiveRecord/Rails integration for multi-tenant databases, in particular the Citus extension for PostgreSQL'
8
- s.description = ''
9
- s.authors = ['Citus Data']
10
- s.email = 'engage@citusdata.com'
4
+ Gem::Specification.new do |spec|
5
+ spec.name = 'activerecord-multi-tenant'
6
+ spec.version = MultiTenant::VERSION
7
+ spec.summary = 'ActiveRecord/Rails integration for multi-tenant databases, '\
8
+ 'in particular the Citus extension for PostgreSQL'
9
+ spec.description = ''
10
+ spec.authors = ['Citus Data']
11
+ spec.email = 'engage@citusdata.com'
12
+ spec.required_ruby_version = '>= 3.0.0'
11
13
 
12
- s.files = `git ls-files`.split("\n")
13
- s.test_files = `git ls-files -- {spec}/*`.split("\n")
14
- s.require_paths = ['lib']
15
- s.homepage = 'https://github.com/citusdata/activerecord-multi-tenant'
16
- s.license = 'MIT'
14
+ spec.files = `git ls-files`.split("\n")
15
+ spec.test_files = `git ls-files -- {spec}/*`.split("\n")
16
+ spec.require_paths = ['lib']
17
+ spec.homepage = 'https://github.com/citusdata/activerecord-multi-tenant'
18
+ spec.license = 'MIT'
17
19
 
18
- s.add_dependency 'rails', '>= 6'
20
+ spec.add_dependency 'rails', '>= 6'
19
21
 
20
- s.add_development_dependency 'rspec', '>= 3.0'
21
- s.add_development_dependency 'rspec-rails'
22
- s.add_development_dependency 'pg'
23
- s.add_development_dependency 'rake'
24
- s.add_development_dependency 'sidekiq'
25
- s.add_development_dependency 'thor'
26
- s.add_development_dependency 'pry'
27
- s.add_development_dependency 'pry-byebug'
22
+ spec.add_development_dependency 'anbt-sql-formatter'
23
+ spec.add_development_dependency 'codecov'
24
+ spec.add_development_dependency 'pg'
25
+ spec.add_development_dependency 'pry'
26
+ spec.add_development_dependency 'pry-byebug'
27
+ spec.add_development_dependency 'rake'
28
+ spec.add_development_dependency 'rspec', '>= 3.0'
29
+ spec.add_development_dependency 'rspec-rails'
30
+ spec.add_development_dependency 'rubocop'
31
+ spec.add_development_dependency 'sidekiq'
32
+
33
+ spec.add_development_dependency 'thor'
28
34
  end
data/docker-compose.yml CHANGED
@@ -2,25 +2,31 @@ version: '2.1'
2
2
 
3
3
  services:
4
4
  master:
5
- image: 'citusdata/citus:7.5.1'
6
- ports: ['5600:5432']
7
- labels: ['com.citusdata.role=Master']
8
- volumes: ['/var/run/postgresql']
9
- manager:
10
- container_name: "${COMPOSE_PROJECT_NAME:-citus}_manager"
11
- image: 'citusdata/membership-manager:0.1.0'
12
- volumes: ['/var/run/docker.sock:/var/run/docker.sock']
13
- depends_on: { master: { condition: service_healthy } }
5
+ container_name: "${COMPOSE_PROJECT_NAME:-citus}_master"
6
+ image: 'citusdata/citus:${CITUS_VERSION:-11.2}'
7
+ ports: [ '5600:5432' ]
8
+ labels: [ 'com.citusdata.role=Master' ]
9
+ environment:
10
+ - POSTGRES_HOST_AUTH_METHOD=trust
11
+ command: -c fsync=off -c full_page_writes=off
14
12
  worker1:
15
- image: 'citusdata/citus:7.5.1'
16
- labels: ['com.citusdata.role=Worker']
13
+ image: 'citusdata/citus:${CITUS_VERSION:-11.2}'
14
+ ports: [ '5601:5432' ]
15
+ labels: [ 'com.citusdata.role=Worker' ]
17
16
  depends_on: { manager: { condition: service_healthy } }
17
+ environment:
18
+ - POSTGRES_HOST_AUTH_METHOD=trust
19
+ command: -c fsync=off -c full_page_writes=off
18
20
  worker2:
19
- image: 'citusdata/citus:7.5.1'
20
- labels: ['com.citusdata.role=Worker']
21
+ image: 'citusdata/citus:${CITUS_VERSION:-11.2}'
22
+ ports: [ '5602:5432' ]
23
+ labels: [ 'com.citusdata.role=Worker' ]
21
24
  depends_on: { manager: { condition: service_healthy } }
22
- healthcheck:
23
- image: busybox
24
- depends_on:
25
- worker1: { condition: service_healthy }
26
- worker2: { condition: service_healthy }
25
+ environment:
26
+ - POSTGRES_HOST_AUTH_METHOD=trust
27
+ command: -c fsync=off -c full_page_writes=off
28
+ manager:
29
+ container_name: "${COMPOSE_PROJECT_NAME:-citus}_manager"
30
+ image: 'citusdata/membership-manager:0.2.0'
31
+ volumes: [ '/var/run/docker.sock:/var/run/docker.sock' ]
32
+ depends_on: { master: { condition: service_healthy } }
data/docs/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ # Ignore everything in this directory
2
+ .yardoc/*
3
+
data/docs/Makefile ADDED
@@ -0,0 +1,28 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # New target that executes the bash script before calling the original target
18
+ build-docs: pre-build # Change 'html' to the target you want to execute
19
+
20
+ pre-build:
21
+ # Execute your bash script here
22
+ bash api-reference.sh
23
+
24
+ # Catch-all target: route all unknown targets to Sphinx using the new
25
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
26
+ html:
27
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
28
+
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+
3
+ # This script is used to generate the API reference documentation for the
4
+ # project. It is intended to be run from the root of the project directory.
5
+ # It requires the following tools to be installed:
6
+ # - yard (gem install yard)
7
+ echo "Generating API reference documentation..."
8
+ echo "Pwd: $(pwd)"
9
+ cd ..
10
+ yard doc --output-dir docs/source/_static/api-reference
@@ -0,0 +1,4 @@
1
+ sphinxnotes-strike
2
+ sphinx
3
+ sphinx_rtd_theme
4
+ readthedocs-sphinx-search
@@ -0,0 +1,62 @@
1
+ #
2
+ # This file is autogenerated by pip-compile with Python 3.10
3
+ # by the following command:
4
+ #
5
+ # pip-compile requirements.in
6
+ #
7
+ alabaster==0.7.13
8
+ # via sphinx
9
+ babel==2.12.1
10
+ # via sphinx
11
+ certifi==2023.5.7
12
+ # via requests
13
+ charset-normalizer==3.1.0
14
+ # via requests
15
+ docutils==0.18.1
16
+ # via
17
+ # sphinx
18
+ # sphinx-rtd-theme
19
+ idna==3.4
20
+ # via requests
21
+ imagesize==1.4.1
22
+ # via sphinx
23
+ jinja2==3.1.2
24
+ # via sphinx
25
+ markupsafe==2.1.2
26
+ # via jinja2
27
+ packaging==23.1
28
+ # via sphinx
29
+ pygments==2.15.1
30
+ # via sphinx
31
+ readthedocs-sphinx-search==0.3.1
32
+ # via -r requirements.in
33
+ requests==2.31.0
34
+ # via sphinx
35
+ snowballstemmer==2.2.0
36
+ # via sphinx
37
+ sphinx==6.2.1
38
+ # via
39
+ # -r requirements.in
40
+ # sphinx-rtd-theme
41
+ # sphinxcontrib-jquery
42
+ # sphinxnotes-strike
43
+ sphinx-rtd-theme==1.2.1
44
+ # via -r requirements.in
45
+ sphinxcontrib-applehelp==1.0.4
46
+ # via sphinx
47
+ sphinxcontrib-devhelp==1.0.2
48
+ # via sphinx
49
+ sphinxcontrib-htmlhelp==2.0.1
50
+ # via sphinx
51
+ sphinxcontrib-jquery==4.1
52
+ # via sphinx-rtd-theme
53
+ sphinxcontrib-jsmath==1.0.1
54
+ # via sphinx
55
+ sphinxcontrib-qthelp==1.0.3
56
+ # via sphinx
57
+ sphinxcontrib-serializinghtml==1.1.5
58
+ # via sphinx
59
+ sphinxnotes-strike==1.2
60
+ # via -r requirements.in
61
+ urllib3==2.0.2
62
+ # via requests