my_api_client 0.20.0 → 0.23.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.
- checksums.yaml +4 -4
- data/.circleci/config.yml +34 -18
- data/.github/dependabot.yml +32 -0
- data/.rubocop.yml +10 -10
- data/.rubocop_todo.yml +2 -2
- data/CHANGELOG.md +215 -249
- data/Gemfile.lock +54 -57
- data/README.jp.md +36 -34
- data/README.md +391 -8
- data/example/api_clients/application_api_client.rb +1 -1
- data/gemfiles/rails_5.0.gemfile +1 -0
- data/gemfiles/rails_5.1.gemfile +1 -0
- data/gemfiles/rails_5.2.gemfile +1 -0
- data/gemfiles/rails_6.0.gemfile +1 -0
- data/gemfiles/rails_7.0.gemfile +15 -0
- data/lib/generators/rails/templates/api_client.rb.erb +3 -5
- data/lib/generators/rspec/templates/api_client_spec.rb.erb +0 -8
- data/lib/my_api_client/errors/network_error.rb +3 -3
- data/lib/my_api_client/errors.rb +2 -2
- data/lib/my_api_client/integrations/bugsnag.rb +2 -2
- data/lib/my_api_client/rspec/matchers/be_handled_as_an_error.rb +3 -3
- data/lib/my_api_client/rspec/stub.rb +11 -7
- data/lib/my_api_client/version.rb +1 -1
- data/my_api/Gemfile +1 -1
- data/my_api/Gemfile.lock +100 -99
- data/my_api/app/controllers/pagination_controller.rb +1 -1
- data/my_api/public/index.html +2 -2
- data/my_api/spec/spec_helper.rb +1 -1
- data/my_api_client.gemspec +4 -1
- data/rails_app/rails_5.2/Gemfile.lock +70 -64
- data/rails_app/rails_6.0/Gemfile +1 -0
- data/rails_app/rails_6.0/Gemfile.lock +92 -94
- data/rails_app/rails_6.1/Gemfile +2 -2
- data/rails_app/rails_6.1/Gemfile.lock +91 -95
- data/rails_app/rails_6.1/Rakefile +3 -1
- data/rails_app/rails_6.1/bin/bundle +28 -20
- data/rails_app/rails_6.1/bin/rails +4 -2
- data/rails_app/rails_6.1/bin/rake +4 -2
- data/rails_app/rails_6.1/bin/setup +3 -1
- data/rails_app/rails_6.1/config.ru +3 -1
- data/rails_app/rails_7.0/Gemfile +13 -0
- data/rails_app/rails_7.0/Gemfile.lock +210 -0
- data/rails_app/rails_7.0/README.md +24 -0
- data/rails_app/rails_7.0/Rakefile +8 -0
- data/rails_app/rails_7.0/app/controllers/application_controller.rb +4 -0
- data/rails_app/rails_7.0/app/models/application_record.rb +5 -0
- data/rails_app/rails_7.0/bin/bundle +122 -0
- data/rails_app/rails_7.0/bin/rails +6 -0
- data/rails_app/rails_7.0/bin/rake +6 -0
- data/rails_app/rails_7.0/bin/setup +35 -0
- data/rails_app/rails_7.0/config/application.rb +41 -0
- data/rails_app/rails_7.0/config/boot.rb +5 -0
- data/rails_app/rails_7.0/config/credentials.yml.enc +1 -0
- data/rails_app/rails_7.0/config/database.yml +25 -0
- data/rails_app/rails_7.0/config/environment.rb +7 -0
- data/rails_app/rails_7.0/config/environments/development.rb +58 -0
- data/rails_app/rails_7.0/config/environments/production.rb +70 -0
- data/rails_app/rails_7.0/config/environments/test.rb +52 -0
- data/rails_app/rails_7.0/config/initializers/cors.rb +17 -0
- data/rails_app/rails_7.0/config/initializers/filter_parameter_logging.rb +8 -0
- data/rails_app/rails_7.0/config/initializers/inflections.rb +17 -0
- data/rails_app/rails_7.0/config/locales/en.yml +33 -0
- data/rails_app/rails_7.0/config/routes.rb +8 -0
- data/rails_app/rails_7.0/config.ru +8 -0
- data/rails_app/rails_7.0/db/seeds.rb +8 -0
- data/rails_app/rails_7.0/public/robots.txt +1 -0
- data/rails_app/rails_7.0/spec/rails_helper.rb +14 -0
- data/rails_app/rails_7.0/spec/spec_helper.rb +13 -0
- metadata +36 -6
- data/.dependabot/config.yml +0 -34
@@ -8,46 +8,48 @@
|
|
8
8
|
# this file is here to facilitate running it.
|
9
9
|
#
|
10
10
|
|
11
|
-
require
|
11
|
+
require 'rubygems'
|
12
12
|
|
13
13
|
m = Module.new do
|
14
14
|
module_function
|
15
15
|
|
16
16
|
def invoked_as_script?
|
17
|
-
File.expand_path($
|
17
|
+
File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)
|
18
18
|
end
|
19
19
|
|
20
20
|
def env_var_version
|
21
|
-
ENV[
|
21
|
+
ENV['BUNDLER_VERSION']
|
22
22
|
end
|
23
23
|
|
24
24
|
def cli_arg_version
|
25
25
|
return unless invoked_as_script? # don't want to hijack other binstubs
|
26
|
-
return unless
|
26
|
+
return unless 'update'.start_with?(ARGV.first || ' ') # must be running `bundle update`
|
27
|
+
|
27
28
|
bundler_version = nil
|
28
29
|
update_index = nil
|
29
30
|
ARGV.each_with_index do |a, i|
|
30
31
|
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
|
31
32
|
bundler_version = a
|
32
33
|
end
|
33
|
-
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
|
34
|
-
|
34
|
+
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/o
|
35
|
+
|
36
|
+
bundler_version = Regexp.last_match(1)
|
35
37
|
update_index = i
|
36
38
|
end
|
37
39
|
bundler_version
|
38
40
|
end
|
39
41
|
|
40
42
|
def gemfile
|
41
|
-
gemfile = ENV[
|
43
|
+
gemfile = ENV['BUNDLE_GEMFILE']
|
42
44
|
return gemfile if gemfile && !gemfile.empty?
|
43
45
|
|
44
|
-
File.expand_path(
|
46
|
+
File.expand_path('../Gemfile', __dir__)
|
45
47
|
end
|
46
48
|
|
47
49
|
def lockfile
|
48
50
|
lockfile =
|
49
51
|
case File.basename(gemfile)
|
50
|
-
when
|
52
|
+
when 'gems.rb' then gemfile.sub(/\.rb$/, gemfile)
|
51
53
|
else "#{gemfile}.lock"
|
52
54
|
end
|
53
55
|
File.expand_path(lockfile)
|
@@ -55,15 +57,19 @@ m = Module.new do
|
|
55
57
|
|
56
58
|
def lockfile_version
|
57
59
|
return unless File.file?(lockfile)
|
60
|
+
|
58
61
|
lockfile_contents = File.read(lockfile)
|
59
|
-
|
62
|
+
unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/o
|
63
|
+
return
|
64
|
+
end
|
65
|
+
|
60
66
|
Regexp.last_match(1)
|
61
67
|
end
|
62
68
|
|
63
69
|
def bundler_version
|
64
70
|
@bundler_version ||=
|
65
71
|
env_var_version || cli_arg_version ||
|
66
|
-
|
72
|
+
lockfile_version
|
67
73
|
end
|
68
74
|
|
69
75
|
def bundler_requirement
|
@@ -73,28 +79,32 @@ m = Module.new do
|
|
73
79
|
|
74
80
|
requirement = bundler_gem_version.approximate_recommendation
|
75
81
|
|
76
|
-
return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new(
|
82
|
+
return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new('2.7.0')
|
77
83
|
|
78
|
-
requirement +=
|
84
|
+
requirement += '.a' if bundler_gem_version.prerelease?
|
79
85
|
|
80
86
|
requirement
|
81
87
|
end
|
82
88
|
|
83
89
|
def load_bundler!
|
84
|
-
ENV[
|
90
|
+
ENV['BUNDLE_GEMFILE'] ||= gemfile
|
85
91
|
|
86
92
|
activate_bundler
|
87
93
|
end
|
88
94
|
|
89
95
|
def activate_bundler
|
90
96
|
gem_error = activation_error_handling do
|
91
|
-
gem
|
97
|
+
gem 'bundler', bundler_requirement
|
92
98
|
end
|
93
99
|
return if gem_error.nil?
|
100
|
+
|
94
101
|
require_error = activation_error_handling do
|
95
|
-
require
|
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
|
96
106
|
end
|
97
|
-
|
107
|
+
|
98
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}'`"
|
99
109
|
exit 42
|
100
110
|
end
|
@@ -109,6 +119,4 @@ end
|
|
109
119
|
|
110
120
|
m.load_bundler!
|
111
121
|
|
112
|
-
if m.invoked_as_script?
|
113
|
-
load Gem.bin_path("bundler", "bundle")
|
114
|
-
end
|
122
|
+
load Gem.bin_path('bundler', 'bundle') if m.invoked_as_script?
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
5
|
+
|
6
|
+
gem 'my_api_client', path: '../..'
|
7
|
+
gem 'rails', '~> 7.0.0'
|
8
|
+
gem 'sqlite3', '~> 1.4'
|
9
|
+
|
10
|
+
group :development, :test do
|
11
|
+
gem 'debug', platforms: %i[mri mingw x64_mingw]
|
12
|
+
gem 'rspec-rails'
|
13
|
+
end
|
@@ -0,0 +1,210 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../..
|
3
|
+
specs:
|
4
|
+
my_api_client (0.22.0)
|
5
|
+
activesupport (>= 5.2.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.0.2.4)
|
14
|
+
actionpack (= 7.0.2.4)
|
15
|
+
activesupport (= 7.0.2.4)
|
16
|
+
nio4r (~> 2.0)
|
17
|
+
websocket-driver (>= 0.6.1)
|
18
|
+
actionmailbox (7.0.2.4)
|
19
|
+
actionpack (= 7.0.2.4)
|
20
|
+
activejob (= 7.0.2.4)
|
21
|
+
activerecord (= 7.0.2.4)
|
22
|
+
activestorage (= 7.0.2.4)
|
23
|
+
activesupport (= 7.0.2.4)
|
24
|
+
mail (>= 2.7.1)
|
25
|
+
net-imap
|
26
|
+
net-pop
|
27
|
+
net-smtp
|
28
|
+
actionmailer (7.0.2.4)
|
29
|
+
actionpack (= 7.0.2.4)
|
30
|
+
actionview (= 7.0.2.4)
|
31
|
+
activejob (= 7.0.2.4)
|
32
|
+
activesupport (= 7.0.2.4)
|
33
|
+
mail (~> 2.5, >= 2.5.4)
|
34
|
+
net-imap
|
35
|
+
net-pop
|
36
|
+
net-smtp
|
37
|
+
rails-dom-testing (~> 2.0)
|
38
|
+
actionpack (7.0.2.4)
|
39
|
+
actionview (= 7.0.2.4)
|
40
|
+
activesupport (= 7.0.2.4)
|
41
|
+
rack (~> 2.0, >= 2.2.0)
|
42
|
+
rack-test (>= 0.6.3)
|
43
|
+
rails-dom-testing (~> 2.0)
|
44
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
45
|
+
actiontext (7.0.2.4)
|
46
|
+
actionpack (= 7.0.2.4)
|
47
|
+
activerecord (= 7.0.2.4)
|
48
|
+
activestorage (= 7.0.2.4)
|
49
|
+
activesupport (= 7.0.2.4)
|
50
|
+
globalid (>= 0.6.0)
|
51
|
+
nokogiri (>= 1.8.5)
|
52
|
+
actionview (7.0.2.4)
|
53
|
+
activesupport (= 7.0.2.4)
|
54
|
+
builder (~> 3.1)
|
55
|
+
erubi (~> 1.4)
|
56
|
+
rails-dom-testing (~> 2.0)
|
57
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
58
|
+
activejob (7.0.2.4)
|
59
|
+
activesupport (= 7.0.2.4)
|
60
|
+
globalid (>= 0.3.6)
|
61
|
+
activemodel (7.0.2.4)
|
62
|
+
activesupport (= 7.0.2.4)
|
63
|
+
activerecord (7.0.2.4)
|
64
|
+
activemodel (= 7.0.2.4)
|
65
|
+
activesupport (= 7.0.2.4)
|
66
|
+
activestorage (7.0.2.4)
|
67
|
+
actionpack (= 7.0.2.4)
|
68
|
+
activejob (= 7.0.2.4)
|
69
|
+
activerecord (= 7.0.2.4)
|
70
|
+
activesupport (= 7.0.2.4)
|
71
|
+
marcel (~> 1.0)
|
72
|
+
mini_mime (>= 1.1.0)
|
73
|
+
activesupport (7.0.2.4)
|
74
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
75
|
+
i18n (>= 1.6, < 2)
|
76
|
+
minitest (>= 5.1)
|
77
|
+
tzinfo (~> 2.0)
|
78
|
+
addressable (2.8.0)
|
79
|
+
public_suffix (>= 2.0.2, < 5.0)
|
80
|
+
builder (3.2.4)
|
81
|
+
concurrent-ruby (1.1.10)
|
82
|
+
crass (1.0.6)
|
83
|
+
debug (1.4.0)
|
84
|
+
irb (>= 1.3.6)
|
85
|
+
reline (>= 0.2.7)
|
86
|
+
diff-lcs (1.5.0)
|
87
|
+
digest (3.1.0)
|
88
|
+
erubi (1.10.0)
|
89
|
+
faraday (2.3.0)
|
90
|
+
faraday-net_http (~> 2.0)
|
91
|
+
ruby2_keywords (>= 0.0.4)
|
92
|
+
faraday-net_http (2.0.2)
|
93
|
+
globalid (1.0.0)
|
94
|
+
activesupport (>= 5.0)
|
95
|
+
i18n (1.10.0)
|
96
|
+
concurrent-ruby (~> 1.0)
|
97
|
+
io-console (0.5.9)
|
98
|
+
irb (1.4.1)
|
99
|
+
reline (>= 0.3.0)
|
100
|
+
jsonpath (1.1.2)
|
101
|
+
multi_json
|
102
|
+
loofah (2.17.0)
|
103
|
+
crass (~> 1.0.2)
|
104
|
+
nokogiri (>= 1.5.9)
|
105
|
+
mail (2.7.1)
|
106
|
+
mini_mime (>= 0.1.1)
|
107
|
+
marcel (1.0.2)
|
108
|
+
method_source (1.0.0)
|
109
|
+
mini_mime (1.1.2)
|
110
|
+
minitest (5.15.0)
|
111
|
+
multi_json (1.15.0)
|
112
|
+
net-imap (0.2.3)
|
113
|
+
digest
|
114
|
+
net-protocol
|
115
|
+
strscan
|
116
|
+
net-pop (0.1.1)
|
117
|
+
digest
|
118
|
+
net-protocol
|
119
|
+
timeout
|
120
|
+
net-protocol (0.1.3)
|
121
|
+
timeout
|
122
|
+
net-smtp (0.3.1)
|
123
|
+
digest
|
124
|
+
net-protocol
|
125
|
+
timeout
|
126
|
+
nio4r (2.5.8)
|
127
|
+
nokogiri (1.13.6-x86_64-darwin)
|
128
|
+
racc (~> 1.4)
|
129
|
+
nokogiri (1.13.6-x86_64-linux)
|
130
|
+
racc (~> 1.4)
|
131
|
+
public_suffix (4.0.7)
|
132
|
+
racc (1.6.0)
|
133
|
+
rack (2.2.3.1)
|
134
|
+
rack-test (1.1.0)
|
135
|
+
rack (>= 1.0, < 3)
|
136
|
+
rails (7.0.2.4)
|
137
|
+
actioncable (= 7.0.2.4)
|
138
|
+
actionmailbox (= 7.0.2.4)
|
139
|
+
actionmailer (= 7.0.2.4)
|
140
|
+
actionpack (= 7.0.2.4)
|
141
|
+
actiontext (= 7.0.2.4)
|
142
|
+
actionview (= 7.0.2.4)
|
143
|
+
activejob (= 7.0.2.4)
|
144
|
+
activemodel (= 7.0.2.4)
|
145
|
+
activerecord (= 7.0.2.4)
|
146
|
+
activestorage (= 7.0.2.4)
|
147
|
+
activesupport (= 7.0.2.4)
|
148
|
+
bundler (>= 1.15.0)
|
149
|
+
railties (= 7.0.2.4)
|
150
|
+
rails-dom-testing (2.0.3)
|
151
|
+
activesupport (>= 4.2.0)
|
152
|
+
nokogiri (>= 1.6)
|
153
|
+
rails-html-sanitizer (1.4.2)
|
154
|
+
loofah (~> 2.3)
|
155
|
+
railties (7.0.2.4)
|
156
|
+
actionpack (= 7.0.2.4)
|
157
|
+
activesupport (= 7.0.2.4)
|
158
|
+
method_source
|
159
|
+
rake (>= 12.2)
|
160
|
+
thor (~> 1.0)
|
161
|
+
zeitwerk (~> 2.5)
|
162
|
+
rake (13.0.6)
|
163
|
+
reline (0.3.0)
|
164
|
+
io-console (~> 0.5)
|
165
|
+
rspec-core (3.11.0)
|
166
|
+
rspec-support (~> 3.11.0)
|
167
|
+
rspec-expectations (3.11.0)
|
168
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
169
|
+
rspec-support (~> 3.11.0)
|
170
|
+
rspec-mocks (3.11.1)
|
171
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
172
|
+
rspec-support (~> 3.11.0)
|
173
|
+
rspec-rails (5.1.2)
|
174
|
+
actionpack (>= 5.2)
|
175
|
+
activesupport (>= 5.2)
|
176
|
+
railties (>= 5.2)
|
177
|
+
rspec-core (~> 3.10)
|
178
|
+
rspec-expectations (~> 3.10)
|
179
|
+
rspec-mocks (~> 3.10)
|
180
|
+
rspec-support (~> 3.10)
|
181
|
+
rspec-support (3.11.0)
|
182
|
+
ruby2_keywords (0.0.5)
|
183
|
+
sawyer (0.9.1)
|
184
|
+
addressable (>= 2.3.5)
|
185
|
+
faraday (>= 0.17.3, < 3)
|
186
|
+
sqlite3 (1.4.2)
|
187
|
+
strscan (3.0.1)
|
188
|
+
thor (1.2.1)
|
189
|
+
timeout (0.2.0)
|
190
|
+
tzinfo (2.0.4)
|
191
|
+
concurrent-ruby (~> 1.0)
|
192
|
+
websocket-driver (0.7.5)
|
193
|
+
websocket-extensions (>= 0.1.0)
|
194
|
+
websocket-extensions (0.1.5)
|
195
|
+
zeitwerk (2.5.4)
|
196
|
+
|
197
|
+
PLATFORMS
|
198
|
+
x86_64-darwin-19
|
199
|
+
x86_64-darwin-20
|
200
|
+
x86_64-linux
|
201
|
+
|
202
|
+
DEPENDENCIES
|
203
|
+
debug
|
204
|
+
my_api_client!
|
205
|
+
rails (~> 7.0.0)
|
206
|
+
rspec-rails
|
207
|
+
sqlite3 (~> 1.4)
|
208
|
+
|
209
|
+
BUNDLED WITH
|
210
|
+
2.3.11
|
@@ -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,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['BUNDLER_VERSION']
|
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['BUNDLE_GEMFILE']
|
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_version
|
70
|
+
@bundler_version ||=
|
71
|
+
env_var_version || cli_arg_version ||
|
72
|
+
lockfile_version
|
73
|
+
end
|
74
|
+
|
75
|
+
def bundler_requirement
|
76
|
+
return "#{Gem::Requirement.default}.a" unless bundler_version
|
77
|
+
|
78
|
+
bundler_gem_version = Gem::Version.new(bundler_version)
|
79
|
+
|
80
|
+
requirement = bundler_gem_version.approximate_recommendation
|
81
|
+
|
82
|
+
return requirement unless Gem::Version.new(Gem::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,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) || abort("\n== Command #{args} failed ==")
|
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,41 @@
|
|
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 Rails70
|
24
|
+
class Application < Rails::Application
|
25
|
+
# Initialize configuration defaults for originally generated Rails version.
|
26
|
+
config.load_defaults 7.0
|
27
|
+
|
28
|
+
# Configuration for the application, engines, and railties goes here.
|
29
|
+
#
|
30
|
+
# These settings can be overridden in specific environments using the files
|
31
|
+
# in config/environments, which are processed later.
|
32
|
+
#
|
33
|
+
# config.time_zone = "Central Time (US & Canada)"
|
34
|
+
# config.eager_load_paths << Rails.root.join("extras")
|
35
|
+
|
36
|
+
# Only loads a smaller set of middleware suitable for API only apps.
|
37
|
+
# Middleware like session, flash, cookies can be added back manually.
|
38
|
+
# Skip views, helpers and assets when generating a new resource.
|
39
|
+
config.api_only = true
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
675SZ1fwXvA0HBSGp++Gt/Oke+NosIn7Uq+sLF646+77SridEzRMIqWTxglNJsDTsrj6HC9ZHtBWl9XT4MSzQ5Wx289QcFawf46Hz/yWzOw5G0BgqLcf74Qv29QamsgwaPclL9zOLg0lKR/8bLoQsnE3rNo5TrwG3gK5AK3lJdrhXCsET98fSa2Iegun7oBFTtK7d0eIPocNqz1252ifK12ttWCn4e/WbLRIzA3Zb6AptsNnQPJTnDEuzq1mfloa+13Pe76d/O4/U0siAypFYEoO+JAA/THivbex0Tnd3c0tH/OBkvNdi3N2G+8QsHCEhSnlTR7/0OZzAJLSsctFiPmnU4xarKizpwdUs1NglBk04Y+hlryW89CpsHzfBTih+4YtFnl9OuRpv2H2D6Mn90KcBtUXTbxEUG01--zKbe0/GzDQpJXrjh--9VLflHmJZhLOQisaeS5pAw==
|
@@ -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: db/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: db/test.sqlite3
|
22
|
+
|
23
|
+
production:
|
24
|
+
<<: *default
|
25
|
+
database: db/production.sqlite3
|