my_api_client 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +8 -7
  3. data/.rubocop.yml +7 -4
  4. data/.ruby-version +1 -0
  5. data/CHANGELOG.md +71 -0
  6. data/Gemfile.lock +95 -81
  7. data/README.jp.md +2 -2
  8. data/README.md +2 -2
  9. data/example/api_clients/my_error_api_client.rb +1 -1
  10. data/example/api_clients/my_header_api_client.rb +1 -1
  11. data/example/api_clients/my_pagination_api_client.rb +2 -2
  12. data/example/api_clients/my_rest_api_client.rb +10 -10
  13. data/example/api_clients/my_status_api_client.rb +1 -1
  14. data/gemfiles/rails_7.1.gemfile +15 -0
  15. data/gemfiles/rails_7.2.gemfile +15 -0
  16. data/lib/my_api_client/base.rb +1 -1
  17. data/lib/my_api_client/error_handling.rb +1 -1
  18. data/lib/my_api_client/errors/network_error.rb +1 -1
  19. data/lib/my_api_client/errors.rb +1 -1
  20. data/lib/my_api_client/exceptions.rb +1 -1
  21. data/lib/my_api_client/params/params.rb +1 -1
  22. data/lib/my_api_client/params/request.rb +8 -8
  23. data/lib/my_api_client/request/basic.rb +2 -2
  24. data/lib/my_api_client/request/executor.rb +1 -1
  25. data/lib/my_api_client/request/pagination.rb +1 -3
  26. data/lib/my_api_client/request.rb +5 -5
  27. data/lib/my_api_client/rspec/matcher_helper.rb +3 -3
  28. data/lib/my_api_client/rspec/matchers/request_to.rb +1 -1
  29. data/lib/my_api_client/version.rb +1 -1
  30. data/my_api/Gemfile +1 -1
  31. data/my_api/Gemfile.lock +83 -71
  32. data/my_api/app/controllers/error_controller.rb +1 -1
  33. data/my_api/app/controllers/pagination_controller.rb +1 -1
  34. data/my_api/app/controllers/rest_controller.rb +4 -4
  35. data/my_api/app/controllers/status_controller.rb +1 -1
  36. data/my_api/spec/controllers/error_controller_spec.rb +4 -4
  37. data/my_api/spec/controllers/status_controller_spec.rb +3 -3
  38. data/my_api_client.gemspec +2 -1
  39. data/rails_app/rails_6.1/Gemfile.lock +73 -71
  40. data/rails_app/rails_7.0/Gemfile.lock +78 -76
  41. data/rails_app/rails_7.1/.dockerignore +31 -0
  42. data/rails_app/rails_7.1/.rspec +1 -0
  43. data/rails_app/rails_7.1/Dockerfile +55 -0
  44. data/rails_app/rails_7.1/Gemfile +16 -0
  45. data/rails_app/rails_7.1/Gemfile.lock +241 -0
  46. data/rails_app/rails_7.1/README.md +24 -0
  47. data/rails_app/rails_7.1/Rakefile +8 -0
  48. data/rails_app/rails_7.1/app/controllers/application_controller.rb +4 -0
  49. data/rails_app/rails_7.1/app/controllers/concerns/.keep +0 -0
  50. data/rails_app/rails_7.1/app/models/application_record.rb +5 -0
  51. data/rails_app/rails_7.1/app/models/concerns/.keep +0 -0
  52. data/rails_app/rails_7.1/bin/bundle +122 -0
  53. data/rails_app/rails_7.1/bin/docker-entrypoint +8 -0
  54. data/rails_app/rails_7.1/bin/rails +6 -0
  55. data/rails_app/rails_7.1/bin/rake +6 -0
  56. data/rails_app/rails_7.1/bin/setup +35 -0
  57. data/rails_app/rails_7.1/config/application.rb +46 -0
  58. data/rails_app/rails_7.1/config/boot.rb +5 -0
  59. data/rails_app/rails_7.1/config/credentials.yml.enc +1 -0
  60. data/rails_app/rails_7.1/config/database.yml +25 -0
  61. data/rails_app/rails_7.1/config/environment.rb +7 -0
  62. data/rails_app/rails_7.1/config/environments/development.rb +58 -0
  63. data/rails_app/rails_7.1/config/environments/production.rb +74 -0
  64. data/rails_app/rails_7.1/config/environments/test.rb +56 -0
  65. data/rails_app/rails_7.1/config/initializers/cors.rb +17 -0
  66. data/rails_app/rails_7.1/config/initializers/filter_parameter_logging.rb +10 -0
  67. data/rails_app/rails_7.1/config/initializers/inflections.rb +17 -0
  68. data/rails_app/rails_7.1/config/locales/en.yml +31 -0
  69. data/rails_app/rails_7.1/config/puma.rb +46 -0
  70. data/rails_app/rails_7.1/config/routes.rb +12 -0
  71. data/rails_app/rails_7.1/config.ru +8 -0
  72. data/rails_app/rails_7.1/db/seeds.rb +10 -0
  73. data/rails_app/rails_7.1/lib/tasks/.keep +0 -0
  74. data/rails_app/rails_7.1/public/robots.txt +2 -0
  75. data/rails_app/rails_7.1/spec/rails_helper.rb +13 -0
  76. data/rails_app/rails_7.1/spec/spec_helper.rb +13 -0
  77. data/rails_app/rails_7.1/storage/.keep +0 -0
  78. data/rails_app/rails_7.1/tmp/.keep +0 -0
  79. data/rails_app/rails_7.1/tmp/pids/.keep +0 -0
  80. data/rails_app/rails_7.1/tmp/storage/.keep +0 -0
  81. data/rails_app/rails_7.1/vendor/.keep +0 -0
  82. data/rails_app/rails_7.2/.dockerignore +42 -0
  83. data/rails_app/rails_7.2/.github/dependabot.yml +12 -0
  84. data/rails_app/rails_7.2/.github/workflows/ci.yml +55 -0
  85. data/rails_app/rails_7.2/.rspec +1 -0
  86. data/rails_app/rails_7.2/Dockerfile +62 -0
  87. data/rails_app/rails_7.2/Gemfile +15 -0
  88. data/rails_app/rails_7.2/Gemfile.lock +240 -0
  89. data/rails_app/rails_7.2/README.md +24 -0
  90. data/rails_app/rails_7.2/Rakefile +8 -0
  91. data/rails_app/rails_7.2/app/controllers/application_controller.rb +4 -0
  92. data/rails_app/rails_7.2/app/controllers/concerns/.keep +0 -0
  93. data/rails_app/rails_7.2/app/models/application_record.rb +5 -0
  94. data/rails_app/rails_7.2/app/models/concerns/.keep +0 -0
  95. data/rails_app/rails_7.2/bin/brakeman +9 -0
  96. data/rails_app/rails_7.2/bin/bundle +122 -0
  97. data/rails_app/rails_7.2/bin/docker-entrypoint +13 -0
  98. data/rails_app/rails_7.2/bin/rails +6 -0
  99. data/rails_app/rails_7.2/bin/rake +6 -0
  100. data/rails_app/rails_7.2/bin/rubocop +10 -0
  101. data/rails_app/rails_7.2/bin/setup +39 -0
  102. data/rails_app/rails_7.2/config/application.rb +46 -0
  103. data/rails_app/rails_7.2/config/boot.rb +5 -0
  104. data/rails_app/rails_7.2/config/credentials.yml.enc +1 -0
  105. data/rails_app/rails_7.2/config/database.yml +32 -0
  106. data/rails_app/rails_7.2/config/environment.rb +7 -0
  107. data/rails_app/rails_7.2/config/environments/development.rb +59 -0
  108. data/rails_app/rails_7.2/config/environments/production.rb +77 -0
  109. data/rails_app/rails_7.2/config/environments/test.rb +53 -0
  110. data/rails_app/rails_7.2/config/initializers/cors.rb +18 -0
  111. data/rails_app/rails_7.2/config/initializers/filter_parameter_logging.rb +10 -0
  112. data/rails_app/rails_7.2/config/initializers/inflections.rb +18 -0
  113. data/rails_app/rails_7.2/config/locales/en.yml +31 -0
  114. data/rails_app/rails_7.2/config/puma.rb +36 -0
  115. data/rails_app/rails_7.2/config/routes.rb +12 -0
  116. data/rails_app/rails_7.2/config.ru +8 -0
  117. data/rails_app/rails_7.2/db/seeds.rb +11 -0
  118. data/rails_app/rails_7.2/lib/tasks/.keep +0 -0
  119. data/rails_app/rails_7.2/public/robots.txt +3 -0
  120. data/rails_app/rails_7.2/spec/rails_helper.rb +13 -0
  121. data/rails_app/rails_7.2/spec/spec_helper.rb +13 -0
  122. data/rails_app/rails_7.2/storage/.keep +0 -0
  123. data/rails_app/rails_7.2/tmp/.keep +0 -0
  124. data/rails_app/rails_7.2/tmp/pids/.keep +0 -0
  125. data/rails_app/rails_7.2/tmp/storage/.keep +0 -0
  126. data/rails_app/rails_7.2/vendor/.keep +0 -0
  127. metadata +107 -7
@@ -0,0 +1,240 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ my_api_client (1.1.0)
5
+ activesupport (>= 6.1.0)
6
+ faraday (>= 0.17.1)
7
+ jsonpath
8
+ sawyer (>= 0.8.2)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ actioncable (7.2.1)
14
+ actionpack (= 7.2.1)
15
+ activesupport (= 7.2.1)
16
+ nio4r (~> 2.0)
17
+ websocket-driver (>= 0.6.1)
18
+ zeitwerk (~> 2.6)
19
+ actionmailbox (7.2.1)
20
+ actionpack (= 7.2.1)
21
+ activejob (= 7.2.1)
22
+ activerecord (= 7.2.1)
23
+ activestorage (= 7.2.1)
24
+ activesupport (= 7.2.1)
25
+ mail (>= 2.8.0)
26
+ actionmailer (7.2.1)
27
+ actionpack (= 7.2.1)
28
+ actionview (= 7.2.1)
29
+ activejob (= 7.2.1)
30
+ activesupport (= 7.2.1)
31
+ mail (>= 2.8.0)
32
+ rails-dom-testing (~> 2.2)
33
+ actionpack (7.2.1)
34
+ actionview (= 7.2.1)
35
+ activesupport (= 7.2.1)
36
+ nokogiri (>= 1.8.5)
37
+ racc
38
+ rack (>= 2.2.4, < 3.2)
39
+ rack-session (>= 1.0.1)
40
+ rack-test (>= 0.6.3)
41
+ rails-dom-testing (~> 2.2)
42
+ rails-html-sanitizer (~> 1.6)
43
+ useragent (~> 0.16)
44
+ actiontext (7.2.1)
45
+ actionpack (= 7.2.1)
46
+ activerecord (= 7.2.1)
47
+ activestorage (= 7.2.1)
48
+ activesupport (= 7.2.1)
49
+ globalid (>= 0.6.0)
50
+ nokogiri (>= 1.8.5)
51
+ actionview (7.2.1)
52
+ activesupport (= 7.2.1)
53
+ builder (~> 3.1)
54
+ erubi (~> 1.11)
55
+ rails-dom-testing (~> 2.2)
56
+ rails-html-sanitizer (~> 1.6)
57
+ activejob (7.2.1)
58
+ activesupport (= 7.2.1)
59
+ globalid (>= 0.3.6)
60
+ activemodel (7.2.1)
61
+ activesupport (= 7.2.1)
62
+ activerecord (7.2.1)
63
+ activemodel (= 7.2.1)
64
+ activesupport (= 7.2.1)
65
+ timeout (>= 0.4.0)
66
+ activestorage (7.2.1)
67
+ actionpack (= 7.2.1)
68
+ activejob (= 7.2.1)
69
+ activerecord (= 7.2.1)
70
+ activesupport (= 7.2.1)
71
+ marcel (~> 1.0)
72
+ activesupport (7.2.1)
73
+ base64
74
+ bigdecimal
75
+ concurrent-ruby (~> 1.0, >= 1.3.1)
76
+ connection_pool (>= 2.2.5)
77
+ drb
78
+ i18n (>= 1.6, < 2)
79
+ logger (>= 1.4.2)
80
+ minitest (>= 5.1)
81
+ securerandom (>= 0.3)
82
+ tzinfo (~> 2.0, >= 2.0.5)
83
+ addressable (2.8.7)
84
+ public_suffix (>= 2.0.2, < 7.0)
85
+ base64 (0.2.0)
86
+ bigdecimal (3.1.8)
87
+ builder (3.3.0)
88
+ concurrent-ruby (1.3.4)
89
+ connection_pool (2.4.1)
90
+ crass (1.0.6)
91
+ date (3.3.4)
92
+ debug (1.9.2)
93
+ irb (~> 1.10)
94
+ reline (>= 0.3.8)
95
+ diff-lcs (1.5.1)
96
+ drb (2.2.1)
97
+ erubi (1.13.0)
98
+ faraday (2.11.0)
99
+ faraday-net_http (>= 2.0, < 3.4)
100
+ logger
101
+ faraday-net_http (3.3.0)
102
+ net-http
103
+ globalid (1.2.1)
104
+ activesupport (>= 6.1)
105
+ i18n (1.14.5)
106
+ concurrent-ruby (~> 1.0)
107
+ io-console (0.7.2)
108
+ irb (1.14.0)
109
+ rdoc (>= 4.0.0)
110
+ reline (>= 0.4.2)
111
+ jsonpath (1.1.5)
112
+ multi_json
113
+ logger (1.6.1)
114
+ loofah (2.22.0)
115
+ crass (~> 1.0.2)
116
+ nokogiri (>= 1.12.0)
117
+ mail (2.8.1)
118
+ mini_mime (>= 0.1.1)
119
+ net-imap
120
+ net-pop
121
+ net-smtp
122
+ marcel (1.0.4)
123
+ mini_mime (1.1.5)
124
+ minitest (5.25.1)
125
+ multi_json (1.15.0)
126
+ net-http (0.4.1)
127
+ uri
128
+ net-imap (0.4.16)
129
+ date
130
+ net-protocol
131
+ net-pop (0.1.2)
132
+ net-protocol
133
+ net-protocol (0.2.2)
134
+ timeout
135
+ net-smtp (0.5.0)
136
+ net-protocol
137
+ nio4r (2.7.3)
138
+ nokogiri (1.16.7-x86_64-darwin)
139
+ racc (~> 1.4)
140
+ nokogiri (1.16.7-x86_64-linux)
141
+ racc (~> 1.4)
142
+ psych (5.1.2)
143
+ stringio
144
+ public_suffix (6.0.1)
145
+ puma (6.4.2)
146
+ nio4r (~> 2.0)
147
+ racc (1.8.1)
148
+ rack (3.1.7)
149
+ rack-session (2.0.0)
150
+ rack (>= 3.0.0)
151
+ rack-test (2.1.0)
152
+ rack (>= 1.3)
153
+ rackup (2.1.0)
154
+ rack (>= 3)
155
+ webrick (~> 1.8)
156
+ rails (7.2.1)
157
+ actioncable (= 7.2.1)
158
+ actionmailbox (= 7.2.1)
159
+ actionmailer (= 7.2.1)
160
+ actionpack (= 7.2.1)
161
+ actiontext (= 7.2.1)
162
+ actionview (= 7.2.1)
163
+ activejob (= 7.2.1)
164
+ activemodel (= 7.2.1)
165
+ activerecord (= 7.2.1)
166
+ activestorage (= 7.2.1)
167
+ activesupport (= 7.2.1)
168
+ bundler (>= 1.15.0)
169
+ railties (= 7.2.1)
170
+ rails-dom-testing (2.2.0)
171
+ activesupport (>= 5.0.0)
172
+ minitest
173
+ nokogiri (>= 1.6)
174
+ rails-html-sanitizer (1.6.0)
175
+ loofah (~> 2.21)
176
+ nokogiri (~> 1.14)
177
+ railties (7.2.1)
178
+ actionpack (= 7.2.1)
179
+ activesupport (= 7.2.1)
180
+ irb (~> 1.13)
181
+ rackup (>= 1.0.0)
182
+ rake (>= 12.2)
183
+ thor (~> 1.0, >= 1.2.2)
184
+ zeitwerk (~> 2.6)
185
+ rake (13.2.1)
186
+ rdoc (6.7.0)
187
+ psych (>= 4.0.0)
188
+ reline (0.5.10)
189
+ io-console (~> 0.5)
190
+ rspec-core (3.13.1)
191
+ rspec-support (~> 3.13.0)
192
+ rspec-expectations (3.13.2)
193
+ diff-lcs (>= 1.2.0, < 2.0)
194
+ rspec-support (~> 3.13.0)
195
+ rspec-mocks (3.13.1)
196
+ diff-lcs (>= 1.2.0, < 2.0)
197
+ rspec-support (~> 3.13.0)
198
+ rspec-rails (7.0.1)
199
+ actionpack (>= 7.0)
200
+ activesupport (>= 7.0)
201
+ railties (>= 7.0)
202
+ rspec-core (~> 3.13)
203
+ rspec-expectations (~> 3.13)
204
+ rspec-mocks (~> 3.13)
205
+ rspec-support (~> 3.13)
206
+ rspec-support (3.13.1)
207
+ sawyer (0.9.2)
208
+ addressable (>= 2.3.5)
209
+ faraday (>= 0.17.3, < 3)
210
+ securerandom (0.3.1)
211
+ sqlite3 (2.0.4-x86_64-darwin)
212
+ sqlite3 (2.0.4-x86_64-linux-gnu)
213
+ stringio (3.1.1)
214
+ thor (1.3.2)
215
+ timeout (0.4.1)
216
+ tzinfo (2.0.6)
217
+ concurrent-ruby (~> 1.0)
218
+ uri (0.13.1)
219
+ useragent (0.16.10)
220
+ webrick (1.8.1)
221
+ websocket-driver (0.7.6)
222
+ websocket-extensions (>= 0.1.0)
223
+ websocket-extensions (0.1.5)
224
+ zeitwerk (2.6.18)
225
+
226
+ PLATFORMS
227
+ x86_64-darwin-23
228
+ x86_64-linux
229
+
230
+ DEPENDENCIES
231
+ debug
232
+ my_api_client!
233
+ puma (>= 5.0)
234
+ rails (~> 7.2.1)
235
+ rspec-rails
236
+ sqlite3 (>= 1.4)
237
+ tzinfo-data
238
+
239
+ BUNDLED WITH
240
+ 2.3.27
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
4
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
5
+
6
+ require_relative 'config/application'
7
+
8
+ Rails.application.load_tasks
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationController < ActionController::API
4
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationRecord < ActiveRecord::Base
4
+ primary_abstract_class
5
+ end
File without changes
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'rubygems'
5
+ require 'bundler/setup'
6
+
7
+ ARGV.unshift('--ensure-latest')
8
+
9
+ load Gem.bin_path('brakeman', 'brakeman')
@@ -0,0 +1,122 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'bundle' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require 'rubygems'
12
+
13
+ m = Module.new do
14
+ module_function
15
+
16
+ def invoked_as_script?
17
+ File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)
18
+ end
19
+
20
+ def env_var_version
21
+ ENV.fetch('BUNDLER_VERSION', nil)
22
+ end
23
+
24
+ def cli_arg_version
25
+ return unless invoked_as_script? # don't want to hijack other binstubs
26
+ return unless 'update'.start_with?(ARGV.first || ' ') # must be running `bundle update`
27
+
28
+ bundler_version = nil
29
+ update_index = nil
30
+ ARGV.each_with_index do |a, i|
31
+ if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
32
+ bundler_version = a
33
+ end
34
+ next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/o
35
+
36
+ bundler_version = Regexp.last_match(1)
37
+ update_index = i
38
+ end
39
+ bundler_version
40
+ end
41
+
42
+ def gemfile
43
+ gemfile = ENV.fetch('BUNDLE_GEMFILE', nil)
44
+ return gemfile if gemfile && !gemfile.empty?
45
+
46
+ File.expand_path('../Gemfile', __dir__)
47
+ end
48
+
49
+ def lockfile
50
+ lockfile =
51
+ case File.basename(gemfile)
52
+ when 'gems.rb' then gemfile.sub(/\.rb$/, gemfile)
53
+ else "#{gemfile}.lock"
54
+ end
55
+ File.expand_path(lockfile)
56
+ end
57
+
58
+ def lockfile_version
59
+ return unless File.file?(lockfile)
60
+
61
+ lockfile_contents = File.read(lockfile)
62
+ unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/o
63
+ return
64
+ end
65
+
66
+ Regexp.last_match(1)
67
+ end
68
+
69
+ def bundler_requirement
70
+ @bundler_requirement ||=
71
+ env_var_version || cli_arg_version ||
72
+ bundler_requirement_for(lockfile_version)
73
+ end
74
+
75
+ def bundler_requirement_for(version)
76
+ return "#{Gem::Requirement.default}.a" unless version
77
+
78
+ bundler_gem_version = Gem::Version.new(version)
79
+
80
+ requirement = bundler_gem_version.approximate_recommendation
81
+
82
+ return requirement unless Gem.rubygems_version < Gem::Version.new('2.7.0')
83
+
84
+ requirement += '.a' if bundler_gem_version.prerelease?
85
+
86
+ requirement
87
+ end
88
+
89
+ def load_bundler!
90
+ ENV['BUNDLE_GEMFILE'] ||= gemfile
91
+
92
+ activate_bundler
93
+ end
94
+
95
+ def activate_bundler
96
+ gem_error = activation_error_handling do
97
+ gem 'bundler', bundler_requirement
98
+ end
99
+ return if gem_error.nil?
100
+
101
+ require_error = activation_error_handling do
102
+ require 'bundler/version'
103
+ end
104
+ if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
105
+ return
106
+ end
107
+
108
+ warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
109
+ exit 42
110
+ end
111
+
112
+ def activation_error_handling
113
+ yield
114
+ nil
115
+ rescue StandardError, LoadError => e
116
+ e
117
+ end
118
+ end
119
+
120
+ m.load_bundler!
121
+
122
+ load Gem.bin_path('bundler', 'bundle') if m.invoked_as_script?
@@ -0,0 +1,13 @@
1
+ #!/bin/bash -e
2
+
3
+ # Enable jemalloc for reduced memory usage and latency.
4
+ if [ -z "${LD_PRELOAD+x}" ] && [ -f /usr/lib/*/libjemalloc.so.2 ]; then
5
+ export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2)"
6
+ fi
7
+
8
+ # If running the rails server then create or migrate existing database
9
+ if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
10
+ ./bin/rails db:prepare
11
+ fi
12
+
13
+ exec "${@}"
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ APP_PATH = File.expand_path('../config/application', __dir__)
5
+ require_relative '../config/boot'
6
+ require 'rails/commands'
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative '../config/boot'
5
+ require 'rake'
6
+ Rake.application.run
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'rubygems'
5
+ require 'bundler/setup'
6
+
7
+ # explicit rubocop config increases performance slightly while avoiding config confusion.
8
+ ARGV.unshift('--config', File.expand_path('../.rubocop.yml', __dir__))
9
+
10
+ load Gem.bin_path('rubocop', 'rubocop')
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'fileutils'
5
+
6
+ APP_ROOT = File.expand_path('..', __dir__)
7
+ APP_NAME = 'rails-7-2'
8
+
9
+ def system!(*args)
10
+ system(*args, exception: true)
11
+ end
12
+
13
+ FileUtils.chdir APP_ROOT do
14
+ # This script is a way to set up or update your development environment automatically.
15
+ # This script is idempotent, so that you can run it at any time and get an expectable outcome.
16
+ # Add necessary setup steps to this file.
17
+
18
+ puts '== Installing dependencies =='
19
+ system! 'gem install bundler --conservative'
20
+ system('bundle check') || system!('bundle install')
21
+
22
+ # puts "\n== Copying sample files =="
23
+ # unless File.exist?("config/database.yml")
24
+ # FileUtils.cp "config/database.yml.sample", "config/database.yml"
25
+ # end
26
+
27
+ puts "\n== Preparing database =="
28
+ system! 'bin/rails db:prepare'
29
+
30
+ puts "\n== Removing old logs and tempfiles =="
31
+ system! 'bin/rails log:clear tmp:clear'
32
+
33
+ puts "\n== Restarting application server =="
34
+ system! 'bin/rails restart'
35
+
36
+ # puts "\n== Configuring puma-dev =="
37
+ # system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
38
+ # system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
39
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'boot'
4
+
5
+ require 'rails'
6
+ # Pick the frameworks you want:
7
+ require 'active_model/railtie'
8
+ # require "active_job/railtie"
9
+ require 'active_record/railtie'
10
+ # require "active_storage/engine"
11
+ require 'action_controller/railtie'
12
+ # require "action_mailer/railtie"
13
+ # require "action_mailbox/engine"
14
+ # require "action_text/engine"
15
+ require 'action_view/railtie'
16
+ # require "action_cable/engine"
17
+ # require "rails/test_unit/railtie"
18
+
19
+ # Require the gems listed in Gemfile, including any gems
20
+ # you've limited to :test, :development, or :production.
21
+ Bundler.require(*Rails.groups)
22
+
23
+ module Rails72
24
+ class Application < Rails::Application
25
+ # Initialize configuration defaults for originally generated Rails version.
26
+ config.load_defaults 7.2
27
+
28
+ # Please, add to the `ignore` list any other `lib` subdirectories that do
29
+ # not contain `.rb` files, or that should not be reloaded or eager loaded.
30
+ # Common ones are `templates`, `generators`, or `middleware`, for example.
31
+ config.autoload_lib(ignore: %w[assets tasks])
32
+
33
+ # Configuration for the application, engines, and railties goes here.
34
+ #
35
+ # These settings can be overridden in specific environments using the files
36
+ # in config/environments, which are processed later.
37
+ #
38
+ # config.time_zone = "Central Time (US & Canada)"
39
+ # config.eager_load_paths << Rails.root.join("extras")
40
+
41
+ # Only loads a smaller set of middleware suitable for API only apps.
42
+ # Middleware like session, flash, cookies can be added back manually.
43
+ # Skip views, helpers and assets when generating a new resource.
44
+ config.api_only = true
45
+ end
46
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
4
+
5
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1 @@
1
+ /KXo43g8r88lekaNjfdzqM8jB8HknVtLEr2MwfIJQhjrmFoS3O4cDeB46aiOJzmZy92bkW6oP7d4Em4yn3C6v7Wm+pHsE6U3CPuLVPotHR7BbQxS8UPJKFxStT0JWlKaDBAXWxG5FQA7XayV57tgCLIlr/FiasW9Df8iHT1OmqcLFm2Z2E6JNnkECiAN/DawEykmkexWOUsiYN9EzBuA9kBGUu1HUXZZy106oAAYAIL2DARtwT7hM8TL/fq1avngA8QTbNhKvQJhH+c2SNjHUvesI5LDISDOJcSL023Q89foUfWIMmBqhUygghWwbnoXCvfgDVCGszKicQovBU+3qjWgoJ4p/UKvd556YWpjieyf2BUwnXkY0+tW6ykqxakGuRemb5rR22vSwcFvoLXzPt9OHzNT--tteTrL4gdxsmm+Vk--NIfnZUFcxu2GJ1BzUiAtcg==
@@ -0,0 +1,32 @@
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem "sqlite3"
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: storage/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: storage/test.sqlite3
22
+
23
+
24
+ # SQLite3 write its data on the local filesystem, as such it requires
25
+ # persistent disks. If you are deploying to a managed service, you should
26
+ # make sure it provides disk persistence, as many don't.
27
+ #
28
+ # Similarly, if you deploy your application as a Docker container, you must
29
+ # ensure the database is located in a persisted volume.
30
+ production:
31
+ <<: *default
32
+ # database: path/to/persistent/storage/production.sqlite3
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Load the Rails application.
4
+ require_relative 'application'
5
+
6
+ # Initialize the Rails application.
7
+ Rails.application.initialize!
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'active_support/core_ext/integer/time'
4
+
5
+ Rails.application.configure do
6
+ # Settings specified here will take precedence over those in config/application.rb.
7
+
8
+ # In the development environment your application's code is reloaded any time
9
+ # it changes. This slows down response time but is perfect for development
10
+ # since you don't have to restart the web server when you make code changes.
11
+ config.enable_reloading = true
12
+
13
+ # Do not eager load code on boot.
14
+ config.eager_load = false
15
+
16
+ # Show full error reports.
17
+ config.consider_all_requests_local = true
18
+
19
+ # Enable server timing.
20
+ config.server_timing = true
21
+
22
+ # Enable/disable caching. By default caching is disabled.
23
+ # Run rails dev:cache to toggle caching.
24
+ if Rails.root.join('tmp/caching-dev.txt').exist?
25
+ config.cache_store = :memory_store
26
+ config.public_file_server.headers = { 'Cache-Control' => "public, max-age=#{2.days.to_i}" }
27
+ else
28
+ config.action_controller.perform_caching = false
29
+
30
+ config.cache_store = :null_store
31
+ end
32
+
33
+ # Print deprecation notices to the Rails logger.
34
+ config.active_support.deprecation = :log
35
+
36
+ # Raise exceptions for disallowed deprecations.
37
+ config.active_support.disallowed_deprecation = :raise
38
+
39
+ # Tell Active Support which deprecation messages to disallow.
40
+ config.active_support.disallowed_deprecation_warnings = []
41
+
42
+ # Raise an error on page load if there are pending migrations.
43
+ config.active_record.migration_error = :page_load
44
+
45
+ # Highlight code that triggered database queries in logs.
46
+ config.active_record.verbose_query_logs = true
47
+
48
+ # Raises error for missing translations.
49
+ # config.i18n.raise_on_missing_translations = true
50
+
51
+ # Annotate rendered view with file names.
52
+ config.action_view.annotate_rendered_view_with_filenames = true
53
+
54
+ # Raise error when a before_action's only/except options reference missing actions.
55
+ config.action_controller.raise_on_missing_callback_actions = true
56
+
57
+ # Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
58
+ # config.generators.apply_rubocop_autocorrect_after_generate!
59
+ end