my_api_client 0.16.0 → 0.20.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 (143) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +95 -135
  3. data/.gem_comet.yml +13 -2
  4. data/.rubocop.yml +5 -1
  5. data/.rubocop_todo.yml +39 -1
  6. data/CHANGELOG.md +142 -0
  7. data/Gemfile +0 -3
  8. data/Gemfile.lock +70 -64
  9. data/README.jp.md +126 -5
  10. data/bin/console +4 -0
  11. data/example/api_clients/application_api_client.rb +2 -2
  12. data/example/api_clients/my_rest_api_client.rb +9 -3
  13. data/gemfiles/{rails_4.2.gemfile → rails_6.1.gemfile} +1 -1
  14. data/lib/generators/rails/USAGE +1 -1
  15. data/lib/generators/rails/api_client_generator.rb +6 -0
  16. data/lib/generators/rails/templates/api_client.rb.erb +1 -1
  17. data/lib/generators/rspec/USAGE +1 -1
  18. data/lib/generators/rspec/api_client_generator.rb +6 -0
  19. data/lib/generators/rspec/templates/api_client_spec.rb.erb +23 -16
  20. data/lib/my_api_client/base.rb +2 -9
  21. data/lib/my_api_client/error_handling/generator.rb +0 -2
  22. data/lib/my_api_client/errors.rb +1 -0
  23. data/lib/my_api_client/integrations/bugsnag.rb +1 -1
  24. data/lib/my_api_client/params/params.rb +1 -3
  25. data/lib/my_api_client/request.rb +3 -3
  26. data/lib/my_api_client/request/basic.rb +1 -3
  27. data/lib/my_api_client/request/executor.rb +1 -1
  28. data/lib/my_api_client/rspec/matchers/request_to.rb +1 -1
  29. data/lib/my_api_client/rspec/stub.rb +30 -9
  30. data/lib/my_api_client/version.rb +1 -1
  31. data/my_api/.ruby-version +1 -1
  32. data/my_api/Gemfile +3 -0
  33. data/my_api/Gemfile.lock +116 -108
  34. data/my_api/app/controllers/pagination_controller.rb +2 -2
  35. data/my_api/spec/controllers/rest_controller_spec.rb +23 -5
  36. data/my_api_client.gemspec +3 -3
  37. data/rails_app/rails_5.2/.rspec +3 -0
  38. data/rails_app/rails_5.2/Gemfile +17 -0
  39. data/rails_app/rails_5.2/Gemfile.lock +174 -0
  40. data/rails_app/rails_5.2/README.md +24 -0
  41. data/rails_app/rails_5.2/Rakefile +8 -0
  42. data/rails_app/rails_5.2/app/controllers/application_controller.rb +4 -0
  43. data/rails_app/rails_5.2/app/jobs/application_job.rb +4 -0
  44. data/rails_app/rails_5.2/bin/bundle +5 -0
  45. data/rails_app/rails_5.2/bin/rails +6 -0
  46. data/rails_app/rails_5.2/bin/rake +6 -0
  47. data/rails_app/rails_5.2/bin/setup +27 -0
  48. data/rails_app/rails_5.2/bin/update +27 -0
  49. data/rails_app/rails_5.2/config.ru +7 -0
  50. data/rails_app/rails_5.2/config/application.rb +37 -0
  51. data/rails_app/rails_5.2/config/boot.rb +6 -0
  52. data/rails_app/rails_5.2/config/credentials.yml.enc +1 -0
  53. data/rails_app/rails_5.2/config/environment.rb +7 -0
  54. data/rails_app/rails_5.2/config/environments/development.rb +41 -0
  55. data/rails_app/rails_5.2/config/environments/production.rb +70 -0
  56. data/rails_app/rails_5.2/config/environments/test.rb +38 -0
  57. data/rails_app/rails_5.2/config/initializers/application_controller_renderer.rb +9 -0
  58. data/rails_app/rails_5.2/config/initializers/backtrace_silencers.rb +8 -0
  59. data/rails_app/rails_5.2/config/initializers/cors.rb +17 -0
  60. data/rails_app/rails_5.2/config/initializers/filter_parameter_logging.rb +6 -0
  61. data/rails_app/rails_5.2/config/initializers/inflections.rb +17 -0
  62. data/rails_app/rails_5.2/config/initializers/mime_types.rb +5 -0
  63. data/rails_app/rails_5.2/config/initializers/wrap_parameters.rb +11 -0
  64. data/rails_app/rails_5.2/config/locales/en.yml +33 -0
  65. data/rails_app/rails_5.2/config/routes.rb +5 -0
  66. data/rails_app/rails_5.2/config/spring.rb +8 -0
  67. data/rails_app/rails_5.2/public/robots.txt +1 -0
  68. data/rails_app/rails_5.2/spec/rails_helper.rb +14 -0
  69. data/rails_app/rails_5.2/spec/spec_helper.rb +13 -0
  70. data/rails_app/rails_6.0/.rspec +3 -0
  71. data/rails_app/rails_6.0/Gemfile +17 -0
  72. data/rails_app/rails_6.0/Gemfile.lock +190 -0
  73. data/rails_app/rails_6.0/README.md +24 -0
  74. data/rails_app/rails_6.0/Rakefile +8 -0
  75. data/rails_app/rails_6.0/app/controllers/application_controller.rb +4 -0
  76. data/rails_app/rails_6.0/app/jobs/application_job.rb +9 -0
  77. data/rails_app/rails_6.0/bin/rails +6 -0
  78. data/rails_app/rails_6.0/bin/rake +6 -0
  79. data/rails_app/rails_6.0/bin/setup +27 -0
  80. data/rails_app/rails_6.0/config.ru +7 -0
  81. data/rails_app/rails_6.0/config/application.rb +39 -0
  82. data/rails_app/rails_6.0/config/boot.rb +6 -0
  83. data/rails_app/rails_6.0/config/credentials.yml.enc +1 -0
  84. data/rails_app/rails_6.0/config/environment.rb +7 -0
  85. data/rails_app/rails_6.0/config/environments/development.rb +39 -0
  86. data/rails_app/rails_6.0/config/environments/production.rb +90 -0
  87. data/rails_app/rails_6.0/config/environments/test.rb +41 -0
  88. data/rails_app/rails_6.0/config/initializers/application_controller_renderer.rb +9 -0
  89. data/rails_app/rails_6.0/config/initializers/backtrace_silencers.rb +8 -0
  90. data/rails_app/rails_6.0/config/initializers/cors.rb +17 -0
  91. data/rails_app/rails_6.0/config/initializers/filter_parameter_logging.rb +6 -0
  92. data/rails_app/rails_6.0/config/initializers/inflections.rb +17 -0
  93. data/rails_app/rails_6.0/config/initializers/mime_types.rb +5 -0
  94. data/rails_app/rails_6.0/config/initializers/wrap_parameters.rb +11 -0
  95. data/rails_app/rails_6.0/config/locales/en.yml +33 -0
  96. data/rails_app/rails_6.0/config/routes.rb +5 -0
  97. data/rails_app/rails_6.0/config/spring.rb +8 -0
  98. data/rails_app/rails_6.0/public/robots.txt +1 -0
  99. data/rails_app/rails_6.0/spec/rails_helper.rb +14 -0
  100. data/rails_app/rails_6.0/spec/spec_helper.rb +13 -0
  101. data/rails_app/rails_6.1/.gitattributes +8 -0
  102. data/rails_app/rails_6.1/.gitignore +28 -0
  103. data/rails_app/rails_6.1/.rspec +3 -0
  104. data/rails_app/rails_6.1/Gemfile +17 -0
  105. data/rails_app/rails_6.1/Gemfile.lock +197 -0
  106. data/rails_app/rails_6.1/README.md +24 -0
  107. data/rails_app/rails_6.1/Rakefile +6 -0
  108. data/rails_app/rails_6.1/app/controllers/application_controller.rb +4 -0
  109. data/rails_app/rails_6.1/app/controllers/concerns/.keep +0 -0
  110. data/rails_app/rails_6.1/app/javascript/.keep +0 -0
  111. data/rails_app/rails_6.1/app/models/application_record.rb +5 -0
  112. data/rails_app/rails_6.1/app/models/concerns/.keep +0 -0
  113. data/rails_app/rails_6.1/bin/bundle +114 -0
  114. data/rails_app/rails_6.1/bin/rails +4 -0
  115. data/rails_app/rails_6.1/bin/rake +4 -0
  116. data/rails_app/rails_6.1/bin/setup +33 -0
  117. data/rails_app/rails_6.1/config.ru +6 -0
  118. data/rails_app/rails_6.1/config/application.rb +42 -0
  119. data/rails_app/rails_6.1/config/boot.rb +5 -0
  120. data/rails_app/rails_6.1/config/credentials.yml.enc +1 -0
  121. data/rails_app/rails_6.1/config/database.yml +25 -0
  122. data/rails_app/rails_6.1/config/environment.rb +7 -0
  123. data/rails_app/rails_6.1/config/environments/development.rb +59 -0
  124. data/rails_app/rails_6.1/config/environments/production.rb +97 -0
  125. data/rails_app/rails_6.1/config/environments/test.rb +51 -0
  126. data/rails_app/rails_6.1/config/initializers/application_controller_renderer.rb +9 -0
  127. data/rails_app/rails_6.1/config/initializers/backtrace_silencers.rb +10 -0
  128. data/rails_app/rails_6.1/config/initializers/cors.rb +17 -0
  129. data/rails_app/rails_6.1/config/initializers/filter_parameter_logging.rb +8 -0
  130. data/rails_app/rails_6.1/config/initializers/inflections.rb +17 -0
  131. data/rails_app/rails_6.1/config/initializers/mime_types.rb +5 -0
  132. data/rails_app/rails_6.1/config/initializers/wrap_parameters.rb +16 -0
  133. data/rails_app/rails_6.1/config/locales/en.yml +33 -0
  134. data/rails_app/rails_6.1/config/routes.rb +5 -0
  135. data/rails_app/rails_6.1/db/seeds.rb +8 -0
  136. data/rails_app/rails_6.1/lib/tasks/.keep +0 -0
  137. data/rails_app/rails_6.1/public/robots.txt +1 -0
  138. data/rails_app/rails_6.1/spec/rails_helper.rb +14 -0
  139. data/rails_app/rails_6.1/spec/spec_helper.rb +13 -0
  140. data/rails_app/rails_6.1/tmp/.keep +0 -0
  141. data/rails_app/rails_6.1/tmp/pids/.keep +0 -0
  142. data/rails_app/rails_6.1/vendor/.keep +0 -0
  143. metadata +115 -9
@@ -4,7 +4,7 @@
4
4
  class PaginationController < ApplicationController
5
5
  # GET pagination
6
6
  def index
7
- case params[:page]
7
+ case params[:page]&.to_s
8
8
  when '1', nil
9
9
  render status: :ok, json: first_page
10
10
  when '2'
@@ -50,7 +50,7 @@ class PaginationController < ApplicationController
50
50
  # but it should be `https://xxxxx.execute-api.ap-northeast-1.amazonaws.com/dev/pagination`.
51
51
  # So this is workaround.
52
52
  def page_link(page)
53
- query_strings = '?' + { page: page }.to_query
53
+ query_strings = "?#{{ page: page }.to_query}"
54
54
  uri = File.join(ENV['JETS_HOST'], ENV['JETS_STAGE'], pagination_path)
55
55
  uri.sub!('http://', 'https://')
56
56
  URI.join(uri, query_strings)
@@ -60,14 +60,32 @@ describe RestController, type: :controller do
60
60
  end
61
61
 
62
62
  describe '#update' do
63
- let(:post) do
63
+ let(:the_post) do
64
64
  { id: 1, title: 'Modified title' }.to_json
65
65
  end
66
66
 
67
- it 'returns a updated post' do
68
- patch '/rest/:id', id: 1, title: 'Modified title'
69
- expect(response.status).to eq 200
70
- expect(response.body).to eq post
67
+ context 'with POST method' do
68
+ it 'returns a updated post' do
69
+ post '/rest/:id', id: 1, title: 'Modified title'
70
+ expect(response.status).to eq 200
71
+ expect(response.body).to eq the_post
72
+ end
73
+ end
74
+
75
+ context 'with PUT method' do
76
+ it 'returns a updated post' do
77
+ put '/rest/:id', id: 1, title: 'Modified title'
78
+ expect(response.status).to eq 200
79
+ expect(response.body).to eq the_post
80
+ end
81
+ end
82
+
83
+ context 'with PATCH method' do
84
+ it 'returns a updated post' do
85
+ patch '/rest/:id', id: 1, title: 'Modified title'
86
+ expect(response.status).to eq 200
87
+ expect(response.body).to eq the_post
88
+ end
71
89
  end
72
90
  end
73
91
 
@@ -22,9 +22,9 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.required_ruby_version = '>= 2.4.0'
25
+ spec.required_ruby_version = '>= 2.5.0'
26
26
 
27
- spec.add_dependency 'activesupport', '>= 4.2.0'
27
+ spec.add_dependency 'activesupport', '>= 5.2.0'
28
28
  spec.add_dependency 'faraday', '>= 0.17.1'
29
29
  spec.add_dependency 'jsonpath'
30
30
  spec.add_dependency 'sawyer', '>= 0.8.2'
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency 'rubocop'
38
38
  spec.add_development_dependency 'rubocop-performance'
39
39
  spec.add_development_dependency 'rubocop-rspec'
40
- spec.add_development_dependency 'simplecov', '0.17.1'
40
+ spec.add_development_dependency 'simplecov', '0.21.2'
41
41
  spec.add_development_dependency 'webmock'
42
42
  spec.add_development_dependency 'yard'
43
43
  end
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5
+
6
+ gem 'bootsnap', '>= 1.1.0', require: false
7
+ gem 'my_api_client', path: '../..'
8
+ gem 'rails', '~> 5.2.4'
9
+
10
+ group :development, :test do
11
+ gem 'byebug', platforms: %i[mri mingw x64_mingw]
12
+ gem 'rspec-rails'
13
+ end
14
+
15
+ group :development do
16
+ gem 'spring'
17
+ end
@@ -0,0 +1,174 @@
1
+ PATH
2
+ remote: ../..
3
+ specs:
4
+ my_api_client (0.17.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 (5.2.4.4)
14
+ actionpack (= 5.2.4.4)
15
+ nio4r (~> 2.0)
16
+ websocket-driver (>= 0.6.1)
17
+ actionmailer (5.2.4.4)
18
+ actionpack (= 5.2.4.4)
19
+ actionview (= 5.2.4.4)
20
+ activejob (= 5.2.4.4)
21
+ mail (~> 2.5, >= 2.5.4)
22
+ rails-dom-testing (~> 2.0)
23
+ actionpack (5.2.4.4)
24
+ actionview (= 5.2.4.4)
25
+ activesupport (= 5.2.4.4)
26
+ rack (~> 2.0, >= 2.0.8)
27
+ rack-test (>= 0.6.3)
28
+ rails-dom-testing (~> 2.0)
29
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
30
+ actionview (5.2.4.4)
31
+ activesupport (= 5.2.4.4)
32
+ builder (~> 3.1)
33
+ erubi (~> 1.4)
34
+ rails-dom-testing (~> 2.0)
35
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
36
+ activejob (5.2.4.4)
37
+ activesupport (= 5.2.4.4)
38
+ globalid (>= 0.3.6)
39
+ activemodel (5.2.4.4)
40
+ activesupport (= 5.2.4.4)
41
+ activerecord (5.2.4.4)
42
+ activemodel (= 5.2.4.4)
43
+ activesupport (= 5.2.4.4)
44
+ arel (>= 9.0)
45
+ activestorage (5.2.4.4)
46
+ actionpack (= 5.2.4.4)
47
+ activerecord (= 5.2.4.4)
48
+ marcel (~> 0.3.1)
49
+ activesupport (5.2.4.4)
50
+ concurrent-ruby (~> 1.0, >= 1.0.2)
51
+ i18n (>= 0.7, < 2)
52
+ minitest (~> 5.1)
53
+ tzinfo (~> 1.1)
54
+ addressable (2.7.0)
55
+ public_suffix (>= 2.0.2, < 5.0)
56
+ arel (9.0.0)
57
+ bootsnap (1.4.8)
58
+ msgpack (~> 1.0)
59
+ builder (3.2.4)
60
+ byebug (11.1.3)
61
+ concurrent-ruby (1.1.7)
62
+ crass (1.0.6)
63
+ diff-lcs (1.4.4)
64
+ erubi (1.9.0)
65
+ faraday (1.3.0)
66
+ faraday-net_http (~> 1.0)
67
+ multipart-post (>= 1.2, < 3)
68
+ ruby2_keywords
69
+ faraday-net_http (1.0.0)
70
+ globalid (0.4.2)
71
+ activesupport (>= 4.2.0)
72
+ i18n (1.8.5)
73
+ concurrent-ruby (~> 1.0)
74
+ jsonpath (1.1.0)
75
+ multi_json
76
+ loofah (2.7.0)
77
+ crass (~> 1.0.2)
78
+ nokogiri (>= 1.5.9)
79
+ mail (2.7.1)
80
+ mini_mime (>= 0.1.1)
81
+ marcel (0.3.3)
82
+ mimemagic (~> 0.3.2)
83
+ method_source (1.0.0)
84
+ mimemagic (0.3.5)
85
+ mini_mime (1.0.2)
86
+ mini_portile2 (2.5.0)
87
+ minitest (5.14.2)
88
+ msgpack (1.3.3)
89
+ multi_json (1.15.0)
90
+ multipart-post (2.1.1)
91
+ nio4r (2.5.4)
92
+ nokogiri (1.11.0)
93
+ mini_portile2 (~> 2.5.0)
94
+ racc (~> 1.4)
95
+ public_suffix (4.0.6)
96
+ racc (1.5.2)
97
+ rack (2.2.3)
98
+ rack-test (1.1.0)
99
+ rack (>= 1.0, < 3)
100
+ rails (5.2.4.4)
101
+ actioncable (= 5.2.4.4)
102
+ actionmailer (= 5.2.4.4)
103
+ actionpack (= 5.2.4.4)
104
+ actionview (= 5.2.4.4)
105
+ activejob (= 5.2.4.4)
106
+ activemodel (= 5.2.4.4)
107
+ activerecord (= 5.2.4.4)
108
+ activestorage (= 5.2.4.4)
109
+ activesupport (= 5.2.4.4)
110
+ bundler (>= 1.3.0)
111
+ railties (= 5.2.4.4)
112
+ sprockets-rails (>= 2.0.0)
113
+ rails-dom-testing (2.0.3)
114
+ activesupport (>= 4.2.0)
115
+ nokogiri (>= 1.6)
116
+ rails-html-sanitizer (1.3.0)
117
+ loofah (~> 2.3)
118
+ railties (5.2.4.4)
119
+ actionpack (= 5.2.4.4)
120
+ activesupport (= 5.2.4.4)
121
+ method_source
122
+ rake (>= 0.8.7)
123
+ thor (>= 0.19.0, < 2.0)
124
+ rake (13.0.1)
125
+ rspec-core (3.9.2)
126
+ rspec-support (~> 3.9.3)
127
+ rspec-expectations (3.9.2)
128
+ diff-lcs (>= 1.2.0, < 2.0)
129
+ rspec-support (~> 3.9.0)
130
+ rspec-mocks (3.9.1)
131
+ diff-lcs (>= 1.2.0, < 2.0)
132
+ rspec-support (~> 3.9.0)
133
+ rspec-rails (4.0.1)
134
+ actionpack (>= 4.2)
135
+ activesupport (>= 4.2)
136
+ railties (>= 4.2)
137
+ rspec-core (~> 3.9)
138
+ rspec-expectations (~> 3.9)
139
+ rspec-mocks (~> 3.9)
140
+ rspec-support (~> 3.9)
141
+ rspec-support (3.9.3)
142
+ ruby2_keywords (0.0.2)
143
+ sawyer (0.8.2)
144
+ addressable (>= 2.3.5)
145
+ faraday (> 0.8, < 2.0)
146
+ spring (2.1.1)
147
+ sprockets (3.7.2)
148
+ concurrent-ruby (~> 1.0)
149
+ rack (> 1, < 3)
150
+ sprockets-rails (3.2.2)
151
+ actionpack (>= 4.0)
152
+ activesupport (>= 4.0)
153
+ sprockets (>= 3.0.0)
154
+ thor (1.0.1)
155
+ thread_safe (0.3.6)
156
+ tzinfo (1.2.7)
157
+ thread_safe (~> 0.1)
158
+ websocket-driver (0.7.3)
159
+ websocket-extensions (>= 0.1.0)
160
+ websocket-extensions (0.1.5)
161
+
162
+ PLATFORMS
163
+ ruby
164
+
165
+ DEPENDENCIES
166
+ bootsnap (>= 1.1.0)
167
+ byebug
168
+ my_api_client!
169
+ rails (~> 5.2.4)
170
+ rspec-rails
171
+ spring
172
+
173
+ BUNDLED WITH
174
+ 2.1.4
@@ -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,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationJob < ActiveJob::Base
4
+ end
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
5
+ load Gem.bin_path('bundler', 'bundle')
@@ -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,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'fileutils'
5
+ include FileUtils
6
+
7
+ # path to your application root.
8
+ APP_ROOT = File.expand_path('..', __dir__)
9
+
10
+ def system!(*args)
11
+ system(*args) || abort("\n== Command #{args} failed ==")
12
+ end
13
+
14
+ chdir APP_ROOT do
15
+ # This script is a starting point to setup your application.
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== Removing old logs and tempfiles =="
23
+ system! 'bin/rails log:clear tmp:clear'
24
+
25
+ puts "\n== Restarting application server =="
26
+ system! 'bin/rails restart'
27
+ end
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'fileutils'
5
+ include FileUtils
6
+
7
+ # path to your application root.
8
+ APP_ROOT = File.expand_path('..', __dir__)
9
+
10
+ def system!(*args)
11
+ system(*args) || abort("\n== Command #{args} failed ==")
12
+ end
13
+
14
+ chdir APP_ROOT do
15
+ # This script is a way to update your development environment automatically.
16
+ # Add necessary update 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== Removing old logs and tempfiles =="
23
+ system! 'bin/rails log:clear tmp:clear'
24
+
25
+ puts "\n== Restarting application server =="
26
+ system! 'bin/rails restart'
27
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is used by Rack-based servers to start the application.
4
+
5
+ require_relative 'config/environment'
6
+
7
+ run Rails.application
@@ -0,0 +1,37 @@
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_view/railtie'
14
+ # require "action_cable/engine"
15
+ # require "sprockets/railtie"
16
+ # require "rails/test_unit/railtie"
17
+
18
+ # Require the gems listed in Gemfile, including any gems
19
+ # you've limited to :test, :development, or :production.
20
+ Bundler.require(*Rails.groups)
21
+
22
+ module Rails52
23
+ class Application < Rails::Application
24
+ # Initialize configuration defaults for originally generated Rails version.
25
+ config.load_defaults 5.2
26
+
27
+ # Settings in config/environments/* take precedence over those specified here.
28
+ # Application configuration can go into files in config/initializers
29
+ # -- all .rb files in that directory are automatically loaded after loading
30
+ # the framework and any gems in your application.
31
+
32
+ # Only loads a smaller set of middleware suitable for API only apps.
33
+ # Middleware like session, flash, cookies can be added back manually.
34
+ # Skip views, helpers and assets when generating a new resource.
35
+ config.api_only = true
36
+ end
37
+ end