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,241 @@
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.1.4)
14
+ actionpack (= 7.1.4)
15
+ activesupport (= 7.1.4)
16
+ nio4r (~> 2.0)
17
+ websocket-driver (>= 0.6.1)
18
+ zeitwerk (~> 2.6)
19
+ actionmailbox (7.1.4)
20
+ actionpack (= 7.1.4)
21
+ activejob (= 7.1.4)
22
+ activerecord (= 7.1.4)
23
+ activestorage (= 7.1.4)
24
+ activesupport (= 7.1.4)
25
+ mail (>= 2.7.1)
26
+ net-imap
27
+ net-pop
28
+ net-smtp
29
+ actionmailer (7.1.4)
30
+ actionpack (= 7.1.4)
31
+ actionview (= 7.1.4)
32
+ activejob (= 7.1.4)
33
+ activesupport (= 7.1.4)
34
+ mail (~> 2.5, >= 2.5.4)
35
+ net-imap
36
+ net-pop
37
+ net-smtp
38
+ rails-dom-testing (~> 2.2)
39
+ actionpack (7.1.4)
40
+ actionview (= 7.1.4)
41
+ activesupport (= 7.1.4)
42
+ nokogiri (>= 1.8.5)
43
+ racc
44
+ rack (>= 2.2.4)
45
+ rack-session (>= 1.0.1)
46
+ rack-test (>= 0.6.3)
47
+ rails-dom-testing (~> 2.2)
48
+ rails-html-sanitizer (~> 1.6)
49
+ actiontext (7.1.4)
50
+ actionpack (= 7.1.4)
51
+ activerecord (= 7.1.4)
52
+ activestorage (= 7.1.4)
53
+ activesupport (= 7.1.4)
54
+ globalid (>= 0.6.0)
55
+ nokogiri (>= 1.8.5)
56
+ actionview (7.1.4)
57
+ activesupport (= 7.1.4)
58
+ builder (~> 3.1)
59
+ erubi (~> 1.11)
60
+ rails-dom-testing (~> 2.2)
61
+ rails-html-sanitizer (~> 1.6)
62
+ activejob (7.1.4)
63
+ activesupport (= 7.1.4)
64
+ globalid (>= 0.3.6)
65
+ activemodel (7.1.4)
66
+ activesupport (= 7.1.4)
67
+ activerecord (7.1.4)
68
+ activemodel (= 7.1.4)
69
+ activesupport (= 7.1.4)
70
+ timeout (>= 0.4.0)
71
+ activestorage (7.1.4)
72
+ actionpack (= 7.1.4)
73
+ activejob (= 7.1.4)
74
+ activerecord (= 7.1.4)
75
+ activesupport (= 7.1.4)
76
+ marcel (~> 1.0)
77
+ activesupport (7.1.4)
78
+ base64
79
+ bigdecimal
80
+ concurrent-ruby (~> 1.0, >= 1.0.2)
81
+ connection_pool (>= 2.2.5)
82
+ drb
83
+ i18n (>= 1.6, < 2)
84
+ minitest (>= 5.1)
85
+ mutex_m
86
+ tzinfo (~> 2.0)
87
+ addressable (2.8.7)
88
+ public_suffix (>= 2.0.2, < 7.0)
89
+ base64 (0.2.0)
90
+ bigdecimal (3.1.8)
91
+ builder (3.3.0)
92
+ concurrent-ruby (1.3.4)
93
+ connection_pool (2.4.1)
94
+ crass (1.0.6)
95
+ date (3.3.4)
96
+ debug (1.9.2)
97
+ irb (~> 1.10)
98
+ reline (>= 0.3.8)
99
+ diff-lcs (1.5.1)
100
+ drb (2.2.1)
101
+ error_highlight (0.6.0)
102
+ erubi (1.13.0)
103
+ faraday (2.11.0)
104
+ faraday-net_http (>= 2.0, < 3.4)
105
+ logger
106
+ faraday-net_http (3.3.0)
107
+ net-http
108
+ globalid (1.2.1)
109
+ activesupport (>= 6.1)
110
+ i18n (1.14.5)
111
+ concurrent-ruby (~> 1.0)
112
+ io-console (0.7.2)
113
+ irb (1.14.0)
114
+ rdoc (>= 4.0.0)
115
+ reline (>= 0.4.2)
116
+ jsonpath (1.1.5)
117
+ multi_json
118
+ logger (1.6.1)
119
+ loofah (2.22.0)
120
+ crass (~> 1.0.2)
121
+ nokogiri (>= 1.12.0)
122
+ mail (2.8.1)
123
+ mini_mime (>= 0.1.1)
124
+ net-imap
125
+ net-pop
126
+ net-smtp
127
+ marcel (1.0.4)
128
+ mini_mime (1.1.5)
129
+ minitest (5.25.1)
130
+ multi_json (1.15.0)
131
+ mutex_m (0.2.0)
132
+ net-http (0.4.1)
133
+ uri
134
+ net-imap (0.4.16)
135
+ date
136
+ net-protocol
137
+ net-pop (0.1.2)
138
+ net-protocol
139
+ net-protocol (0.2.2)
140
+ timeout
141
+ net-smtp (0.5.0)
142
+ net-protocol
143
+ nio4r (2.7.3)
144
+ nokogiri (1.16.7-x86_64-darwin)
145
+ racc (~> 1.4)
146
+ nokogiri (1.16.7-x86_64-linux)
147
+ racc (~> 1.4)
148
+ psych (5.1.2)
149
+ stringio
150
+ public_suffix (6.0.1)
151
+ racc (1.8.1)
152
+ rack (3.1.7)
153
+ rack-session (2.0.0)
154
+ rack (>= 3.0.0)
155
+ rack-test (2.1.0)
156
+ rack (>= 1.3)
157
+ rackup (2.1.0)
158
+ rack (>= 3)
159
+ webrick (~> 1.8)
160
+ rails (7.1.4)
161
+ actioncable (= 7.1.4)
162
+ actionmailbox (= 7.1.4)
163
+ actionmailer (= 7.1.4)
164
+ actionpack (= 7.1.4)
165
+ actiontext (= 7.1.4)
166
+ actionview (= 7.1.4)
167
+ activejob (= 7.1.4)
168
+ activemodel (= 7.1.4)
169
+ activerecord (= 7.1.4)
170
+ activestorage (= 7.1.4)
171
+ activesupport (= 7.1.4)
172
+ bundler (>= 1.15.0)
173
+ railties (= 7.1.4)
174
+ rails-dom-testing (2.2.0)
175
+ activesupport (>= 5.0.0)
176
+ minitest
177
+ nokogiri (>= 1.6)
178
+ rails-html-sanitizer (1.6.0)
179
+ loofah (~> 2.21)
180
+ nokogiri (~> 1.14)
181
+ railties (7.1.4)
182
+ actionpack (= 7.1.4)
183
+ activesupport (= 7.1.4)
184
+ irb
185
+ rackup (>= 1.0.0)
186
+ rake (>= 12.2)
187
+ thor (~> 1.0, >= 1.2.2)
188
+ zeitwerk (~> 2.6)
189
+ rake (13.2.1)
190
+ rdoc (6.7.0)
191
+ psych (>= 4.0.0)
192
+ reline (0.5.10)
193
+ io-console (~> 0.5)
194
+ rspec-core (3.13.1)
195
+ rspec-support (~> 3.13.0)
196
+ rspec-expectations (3.13.2)
197
+ diff-lcs (>= 1.2.0, < 2.0)
198
+ rspec-support (~> 3.13.0)
199
+ rspec-mocks (3.13.1)
200
+ diff-lcs (>= 1.2.0, < 2.0)
201
+ rspec-support (~> 3.13.0)
202
+ rspec-rails (7.0.1)
203
+ actionpack (>= 7.0)
204
+ activesupport (>= 7.0)
205
+ railties (>= 7.0)
206
+ rspec-core (~> 3.13)
207
+ rspec-expectations (~> 3.13)
208
+ rspec-mocks (~> 3.13)
209
+ rspec-support (~> 3.13)
210
+ rspec-support (3.13.1)
211
+ sawyer (0.9.2)
212
+ addressable (>= 2.3.5)
213
+ faraday (>= 0.17.3, < 3)
214
+ sqlite3 (2.0.4-x86_64-darwin)
215
+ sqlite3 (2.0.4-x86_64-linux-gnu)
216
+ stringio (3.1.1)
217
+ thor (1.3.2)
218
+ timeout (0.4.1)
219
+ tzinfo (2.0.6)
220
+ concurrent-ruby (~> 1.0)
221
+ uri (0.13.1)
222
+ webrick (1.8.1)
223
+ websocket-driver (0.7.6)
224
+ websocket-extensions (>= 0.1.0)
225
+ websocket-extensions (0.1.5)
226
+ zeitwerk (2.6.18)
227
+
228
+ PLATFORMS
229
+ x86_64-darwin-23
230
+ x86_64-linux
231
+
232
+ DEPENDENCIES
233
+ debug
234
+ error_highlight (>= 0.4.0)
235
+ my_api_client!
236
+ rails (~> 7.1.4)
237
+ rspec-rails
238
+ sqlite3 (>= 1.4)
239
+
240
+ BUNDLED WITH
241
+ 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,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,8 @@
1
+ #!/bin/bash -e
2
+
3
+ # If running the rails server then create or migrate existing database
4
+ if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
5
+ ./bin/rails db:prepare
6
+ fi
7
+
8
+ 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,35 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'fileutils'
5
+
6
+ # path to your application root.
7
+ APP_ROOT = File.expand_path('..', __dir__)
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
+ 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 Rails71
24
+ class Application < Rails::Application
25
+ # Initialize configuration defaults for originally generated Rails version.
26
+ config.load_defaults 7.1
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
+ tFnndSiXz8i0445d+z1JMwWVHJWVqBWvBxso+pMBFWMTIbZ3kXKdLyx259VUxRWvIIVpGBJPRRLlJv5fLf8a8dgFyjzLnXvaLlrchLCKoa6ivVQGH8/eQV8rxF218m5DiZLHK3TqN+nXSU3dOCDWY20fDtG7EBUgBliPCF3WftJv7HxGBGwilorbL3coS5A9cU0G2DFmK/PNkc+E2JTVOMjLjvqHslNf7pH64SwGE9mptHiVTe/tt+tTHTmEWrfm5Itk2nNKTC4Zm3wrbf1rAMbQWmKjC82COMqzTAgBaVY3tRR+IV+HMrZkCIEEnr6Xl2B8BOHtcMykTHHvTn+sHu/T/D3iBJChHujfd8K6S6hRnNXyoQh0Y+2N+aNNpg93JeNtYvcfe2CLm5E8k736ZuYKPFsy--3mZap9HcRKd3aQdC--lfdXoF8GfxlYXr+a84PV6w==
@@ -0,0 +1,25 @@
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
+ production:
24
+ <<: *default
25
+ database: 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,58 @@
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 = {
27
+ 'Cache-Control' => "public, max-age=#{2.days.to_i}",
28
+ }
29
+ else
30
+ config.action_controller.perform_caching = false
31
+
32
+ config.cache_store = :null_store
33
+ end
34
+
35
+ # Print deprecation notices to the Rails logger.
36
+ config.active_support.deprecation = :log
37
+
38
+ # Raise exceptions for disallowed deprecations.
39
+ config.active_support.disallowed_deprecation = :raise
40
+
41
+ # Tell Active Support which deprecation messages to disallow.
42
+ config.active_support.disallowed_deprecation_warnings = []
43
+
44
+ # Raise an error on page load if there are pending migrations.
45
+ config.active_record.migration_error = :page_load
46
+
47
+ # Highlight code that triggered database queries in logs.
48
+ config.active_record.verbose_query_logs = true
49
+
50
+ # Raises error for missing translations.
51
+ # config.i18n.raise_on_missing_translations = true
52
+
53
+ # Annotate rendered view with file names.
54
+ # config.action_view.annotate_rendered_view_with_filenames = true
55
+
56
+ # Raise error when a before_action's only/except options reference missing actions
57
+ config.action_controller.raise_on_missing_callback_actions = true
58
+ end