rails_twirp 0.13.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.standard.yml +0 -1
- data/CHANGELOG.md +4 -0
- data/lib/rails_twirp/version.rb +1 -1
- data/rails_twirp.gemspec +2 -2
- metadata +8 -78
- data/.github/workflows/test.yml +0 -21
- data/bin/test +0 -5
- data/lib/rails_twirp/testing/integration_test.rb +0 -106
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/assets/config/manifest.js +0 -2
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/stylesheets/application.css +0 -15
- data/test/dummy/app/channels/application_cable/channel.rb +0 -4
- data/test/dummy/app/channels/application_cable/connection.rb +0 -4
- data/test/dummy/app/controllers/application_controller.rb +0 -2
- data/test/dummy/app/controllers/application_twirp_controller.rb +0 -7
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/controllers/dummy_controller.rb +0 -5
- data/test/dummy/app/controllers/pings_controller.rb +0 -40
- data/test/dummy/app/controllers/testmod/nested/other_controller.rb +0 -10
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/helpers/random_helper.rb +0 -5
- data/test/dummy/app/javascript/packs/application.js +0 -15
- data/test/dummy/app/jobs/application_job.rb +0 -7
- data/test/dummy/app/mailers/application_mailer.rb +0 -4
- data/test/dummy/app/models/application_record.rb +0 -3
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/dummy/rpc_name_check.pb.pbbuilder +0 -3
- data/test/dummy/app/views/layouts/application.html.erb +0 -15
- data/test/dummy/app/views/layouts/mailer.html.erb +0 -13
- data/test/dummy/app/views/layouts/mailer.text.erb +0 -1
- data/test/dummy/app/views/pings/ping_template.pb.pbbuilder +0 -1
- data/test/dummy/bin/generate +0 -3
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/bin/setup +0 -33
- data/test/dummy/config/application.rb +0 -23
- data/test/dummy/config/boot.rb +0 -5
- data/test/dummy/config/cable.yml +0 -10
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -76
- data/test/dummy/config/environments/production.rb +0 -120
- data/test/dummy/config/environments/test.rb +0 -59
- data/test/dummy/config/initializers/application_controller_renderer.rb +0 -8
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -8
- data/test/dummy/config/initializers/content_security_policy.rb +0 -28
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -5
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -6
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/mime_types.rb +0 -4
- data/test/dummy/config/initializers/permissions_policy.rb +0 -11
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -33
- data/test/dummy/config/puma.rb +0 -43
- data/test/dummy/config/routes.rb +0 -3
- data/test/dummy/config/storage.yml +0 -34
- data/test/dummy/config/twirp/routes.rb +0 -22
- data/test/dummy/config.ru +0 -6
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/proto/api.proto +0 -30
- data/test/dummy/proto/api_pb.rb +0 -29
- data/test/dummy/proto/api_twirp.rb +0 -25
- data/test/dummy/public/404.html +0 -67
- data/test/dummy/public/422.html +0 -67
- data/test/dummy/public/500.html +0 -66
- data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy_test.rb +0 -10
- data/test/other_controller_test.rb +0 -9
- data/test/ping_controller_test.rb +0 -114
- data/test/rails_twirp_test.rb +0 -7
- data/test/test_helper.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d04982e98774e2a130671b2729dad6141905df3544c7cfa3900137a7cd553356
|
4
|
+
data.tar.gz: 650187fd3c34f30ca91885c6c1fa9b1547035a816d088e0b8c583f9ea6a0608e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4021ee3e130f4647423177456c9ccfb5bcce728874b547f56c2ae52a78fc92a953f6e98e7dee7eb87c78adca37f4f42cd21c7761f3842f20859923a3a8b8096f
|
7
|
+
data.tar.gz: bcb8240668e0c0d59f63ad7148595fcf15142533bed252e6f55212f51a73df0f31a623ca97f675c1494712631ffb025b20f71956dbfaa71ba61d9d48e12f2512
|
data/.standard.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
### 0.13.1
|
2
|
+
* Don't include `test/` folder in a final gem distribution
|
3
|
+
* Format dummy app code with standardrb
|
4
|
+
|
1
5
|
### 0.13.0
|
2
6
|
* Adding #controller_name methods to Metal/Base controller (used for instrumentation)
|
3
7
|
* Include `ActionController::Caching` with Base controller/helpers
|
data/lib/rails_twirp/version.rb
CHANGED
data/rails_twirp.gemspec
CHANGED
@@ -9,9 +9,9 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.summary = "Integrate Twirp into Rails"
|
10
10
|
spec.license = "MIT"
|
11
11
|
|
12
|
-
spec.files = `git ls-files`.split("\n")
|
12
|
+
spec.files = `git ls-files | grep -v -E "test/*"`.split("\n")
|
13
13
|
|
14
14
|
spec.add_dependency "rails", ">= 6.1.3"
|
15
|
-
spec.add_dependency "twirp", ">= 1.
|
15
|
+
spec.add_dependency "twirp", ">= 1.9", "< 1.11"
|
16
16
|
spec.required_ruby_version = ">= 3"
|
17
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_twirp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bouke van der Bijl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,20 +30,20 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
34
|
-
- - "
|
33
|
+
version: '1.9'
|
34
|
+
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 1.
|
36
|
+
version: '1.11'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.
|
44
|
-
- - "
|
43
|
+
version: '1.9'
|
44
|
+
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 1.
|
46
|
+
version: '1.11'
|
47
47
|
description:
|
48
48
|
email:
|
49
49
|
- bouke@cheddar.me
|
@@ -52,7 +52,6 @@ extensions: []
|
|
52
52
|
extra_rdoc_files: []
|
53
53
|
files:
|
54
54
|
- ".github/dependabot.yml"
|
55
|
-
- ".github/workflows/test.yml"
|
56
55
|
- ".gitignore"
|
57
56
|
- ".ruby-version"
|
58
57
|
- ".standard.yml"
|
@@ -61,7 +60,6 @@ files:
|
|
61
60
|
- MIT-LICENSE
|
62
61
|
- README.md
|
63
62
|
- Rakefile
|
64
|
-
- bin/test
|
65
63
|
- lib/commands/twirp/routes_command.rb
|
66
64
|
- lib/rails_twirp.rb
|
67
65
|
- lib/rails_twirp/application.rb
|
@@ -77,77 +75,9 @@ files:
|
|
77
75
|
- lib/rails_twirp/render_pb.rb
|
78
76
|
- lib/rails_twirp/rescue.rb
|
79
77
|
- lib/rails_twirp/route_set.rb
|
80
|
-
- lib/rails_twirp/testing/integration_test.rb
|
81
78
|
- lib/rails_twirp/url_for.rb
|
82
79
|
- lib/rails_twirp/version.rb
|
83
80
|
- rails_twirp.gemspec
|
84
|
-
- test/dummy/Rakefile
|
85
|
-
- test/dummy/app/assets/config/manifest.js
|
86
|
-
- test/dummy/app/assets/images/.keep
|
87
|
-
- test/dummy/app/assets/stylesheets/application.css
|
88
|
-
- test/dummy/app/channels/application_cable/channel.rb
|
89
|
-
- test/dummy/app/channels/application_cable/connection.rb
|
90
|
-
- test/dummy/app/controllers/application_controller.rb
|
91
|
-
- test/dummy/app/controllers/application_twirp_controller.rb
|
92
|
-
- test/dummy/app/controllers/concerns/.keep
|
93
|
-
- test/dummy/app/controllers/dummy_controller.rb
|
94
|
-
- test/dummy/app/controllers/pings_controller.rb
|
95
|
-
- test/dummy/app/controllers/testmod/nested/other_controller.rb
|
96
|
-
- test/dummy/app/helpers/application_helper.rb
|
97
|
-
- test/dummy/app/helpers/random_helper.rb
|
98
|
-
- test/dummy/app/javascript/packs/application.js
|
99
|
-
- test/dummy/app/jobs/application_job.rb
|
100
|
-
- test/dummy/app/mailers/application_mailer.rb
|
101
|
-
- test/dummy/app/models/application_record.rb
|
102
|
-
- test/dummy/app/models/concerns/.keep
|
103
|
-
- test/dummy/app/views/dummy/rpc_name_check.pb.pbbuilder
|
104
|
-
- test/dummy/app/views/layouts/application.html.erb
|
105
|
-
- test/dummy/app/views/layouts/mailer.html.erb
|
106
|
-
- test/dummy/app/views/layouts/mailer.text.erb
|
107
|
-
- test/dummy/app/views/pings/ping_template.pb.pbbuilder
|
108
|
-
- test/dummy/bin/generate
|
109
|
-
- test/dummy/bin/rails
|
110
|
-
- test/dummy/bin/rake
|
111
|
-
- test/dummy/bin/setup
|
112
|
-
- test/dummy/config.ru
|
113
|
-
- test/dummy/config/application.rb
|
114
|
-
- test/dummy/config/boot.rb
|
115
|
-
- test/dummy/config/cable.yml
|
116
|
-
- test/dummy/config/database.yml
|
117
|
-
- test/dummy/config/environment.rb
|
118
|
-
- test/dummy/config/environments/development.rb
|
119
|
-
- test/dummy/config/environments/production.rb
|
120
|
-
- test/dummy/config/environments/test.rb
|
121
|
-
- test/dummy/config/initializers/application_controller_renderer.rb
|
122
|
-
- test/dummy/config/initializers/backtrace_silencers.rb
|
123
|
-
- test/dummy/config/initializers/content_security_policy.rb
|
124
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
125
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
126
|
-
- test/dummy/config/initializers/inflections.rb
|
127
|
-
- test/dummy/config/initializers/mime_types.rb
|
128
|
-
- test/dummy/config/initializers/permissions_policy.rb
|
129
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
130
|
-
- test/dummy/config/locales/en.yml
|
131
|
-
- test/dummy/config/puma.rb
|
132
|
-
- test/dummy/config/routes.rb
|
133
|
-
- test/dummy/config/storage.yml
|
134
|
-
- test/dummy/config/twirp/routes.rb
|
135
|
-
- test/dummy/lib/assets/.keep
|
136
|
-
- test/dummy/log/.keep
|
137
|
-
- test/dummy/proto/api.proto
|
138
|
-
- test/dummy/proto/api_pb.rb
|
139
|
-
- test/dummy/proto/api_twirp.rb
|
140
|
-
- test/dummy/public/404.html
|
141
|
-
- test/dummy/public/422.html
|
142
|
-
- test/dummy/public/500.html
|
143
|
-
- test/dummy/public/apple-touch-icon-precomposed.png
|
144
|
-
- test/dummy/public/apple-touch-icon.png
|
145
|
-
- test/dummy/public/favicon.ico
|
146
|
-
- test/dummy_test.rb
|
147
|
-
- test/other_controller_test.rb
|
148
|
-
- test/ping_controller_test.rb
|
149
|
-
- test/rails_twirp_test.rb
|
150
|
-
- test/test_helper.rb
|
151
81
|
homepage: https://github.com/cheddar-me/rails-twirp
|
152
82
|
licenses:
|
153
83
|
- MIT
|
data/.github/workflows/test.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
name: Ruby Test
|
2
|
-
on: push
|
3
|
-
|
4
|
-
jobs:
|
5
|
-
test:
|
6
|
-
runs-on: ubuntu-latest
|
7
|
-
steps:
|
8
|
-
- name: Checkout code
|
9
|
-
uses: actions/checkout@v3
|
10
|
-
|
11
|
-
- name: Setup Ruby
|
12
|
-
uses: ruby/setup-ruby@v1
|
13
|
-
with:
|
14
|
-
ruby-version: 3.0.0
|
15
|
-
bundler-cache: true
|
16
|
-
|
17
|
-
- name: Run tests
|
18
|
-
run: bin/test
|
19
|
-
|
20
|
-
- name: Run standardrb
|
21
|
-
run: bundle exec standardrb
|
data/bin/test
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
require "twirp/encoding"
|
2
|
-
|
3
|
-
module RailsTwirp
|
4
|
-
class IntegrationTest < ActiveSupport::TestCase
|
5
|
-
DEFAULT_HOST = "www.example.com"
|
6
|
-
Response = Struct.new(:status, :body, :headers)
|
7
|
-
|
8
|
-
attr_reader :response, :request, :controller
|
9
|
-
attr_writer :mount_path
|
10
|
-
alias_method :mount_path!, :mount_path=
|
11
|
-
|
12
|
-
def initialize(name)
|
13
|
-
super
|
14
|
-
reset!
|
15
|
-
@before_rpc = []
|
16
|
-
end
|
17
|
-
|
18
|
-
def host
|
19
|
-
@host || DEFAULT_HOST
|
20
|
-
end
|
21
|
-
attr_writer :host
|
22
|
-
alias_method :host!, :host=
|
23
|
-
|
24
|
-
def https?
|
25
|
-
@https
|
26
|
-
end
|
27
|
-
|
28
|
-
def https!(value = true)
|
29
|
-
@https = value
|
30
|
-
end
|
31
|
-
|
32
|
-
def reset!
|
33
|
-
@request = nil
|
34
|
-
@response = nil
|
35
|
-
@host = nil
|
36
|
-
@host = nil
|
37
|
-
@https = false
|
38
|
-
@mount_path = "/twirp"
|
39
|
-
end
|
40
|
-
|
41
|
-
def before_rpc(&block)
|
42
|
-
@before_rpc << block
|
43
|
-
end
|
44
|
-
|
45
|
-
def rpc(service, rpc, request, headers: nil)
|
46
|
-
@request = request
|
47
|
-
|
48
|
-
env = build_rack_env(service, rpc, request, headers)
|
49
|
-
@before_rpc.each do |hook|
|
50
|
-
hook.call(env)
|
51
|
-
end
|
52
|
-
|
53
|
-
status, headers, body = app.call(env)
|
54
|
-
@response = decode_rack_response(service, rpc, status, headers, body)
|
55
|
-
set_controller_from_rack_env(env)
|
56
|
-
|
57
|
-
@response
|
58
|
-
end
|
59
|
-
|
60
|
-
def app
|
61
|
-
RailsTwirp.test_app
|
62
|
-
end
|
63
|
-
|
64
|
-
private
|
65
|
-
|
66
|
-
def build_rack_env(service, rpc, request, headers)
|
67
|
-
env = {
|
68
|
-
"CONTENT_TYPE" => request_content_type,
|
69
|
-
"HTTPS" => https? ? "on" : "off",
|
70
|
-
"HTTP_HOST" => host,
|
71
|
-
"PATH_INFO" => "#{@mount_path}/#{service.service_full_name}/#{rpc}",
|
72
|
-
"REQUEST_METHOD" => "POST",
|
73
|
-
"SERVER_NAME" => host,
|
74
|
-
"SERVER_PORT" => https? ? "443" : "80",
|
75
|
-
"rack.url_scheme" => https? ? "https" : "http"
|
76
|
-
}
|
77
|
-
if headers.present?
|
78
|
-
http_request = ActionDispatch::Request.new(env)
|
79
|
-
http_request.headers.merge! headers
|
80
|
-
end
|
81
|
-
|
82
|
-
input_class = service.rpcs[rpc][:input_class]
|
83
|
-
env["rack.input"] = StringIO.new(Twirp::Encoding.encode(request, input_class, request_content_type))
|
84
|
-
env
|
85
|
-
end
|
86
|
-
|
87
|
-
def request_content_type
|
88
|
-
Twirp::Encoding::PROTO
|
89
|
-
end
|
90
|
-
|
91
|
-
def decode_rack_response(service, rpc, status, headers, body)
|
92
|
-
body = body.join # body is an Enumerable
|
93
|
-
|
94
|
-
if status === 200
|
95
|
-
output_class = service.rpcs[rpc][:output_class]
|
96
|
-
Twirp::Encoding.decode(body, output_class, headers["Content-Type"])
|
97
|
-
else
|
98
|
-
Twirp::Client.error_from_response(Response.new(status, body, headers))
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
def set_controller_from_rack_env(env)
|
103
|
-
@controller = ActionDispatch::Request.new(env).controller_instance
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
data/test/dummy/Rakefile
DELETED
File without changes
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
-
* It is generally better to create a new file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|
File without changes
|
@@ -1,40 +0,0 @@
|
|
1
|
-
class PingsController < ApplicationTwirpController
|
2
|
-
before_action :respond_error, only: :before_error
|
3
|
-
|
4
|
-
def ping
|
5
|
-
response = RPC::DummyAPI::PingResponse.new(double_name: request.name * 2)
|
6
|
-
self.response_body = response
|
7
|
-
end
|
8
|
-
|
9
|
-
def ping_render
|
10
|
-
url = rails_twirp_engine_url
|
11
|
-
response = RPC::DummyAPI::PingResponse.new(double_name: "#{url} #{helpers.does_this_work(request.name)}")
|
12
|
-
render pb: response
|
13
|
-
end
|
14
|
-
|
15
|
-
def ping_template
|
16
|
-
@double_name = request.name * 2
|
17
|
-
end
|
18
|
-
|
19
|
-
def error_response
|
20
|
-
error :unauthenticated, "You are not authenticated!!"
|
21
|
-
end
|
22
|
-
|
23
|
-
def raise_error
|
24
|
-
# This error is rescued in ApplicationTwirpController
|
25
|
-
raise ActiveRecord::RecordNotFound, "Not found"
|
26
|
-
end
|
27
|
-
|
28
|
-
def uncaught_raise
|
29
|
-
raise StandardError, "Uncaught"
|
30
|
-
end
|
31
|
-
|
32
|
-
def before_error
|
33
|
-
# This error won't be reached because of the before_action
|
34
|
-
raise NotImplementedError
|
35
|
-
end
|
36
|
-
|
37
|
-
def respond_error
|
38
|
-
error :malformed, "yOuR ReQuEsT Is mAlFoRmEd"
|
39
|
-
end
|
40
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require rails-ujs
|
14
|
-
//= require activestorage
|
15
|
-
//= require_tree .
|
@@ -1,7 +0,0 @@
|
|
1
|
-
class ApplicationJob < ActiveJob::Base
|
2
|
-
# Automatically retry jobs that encountered a deadlock
|
3
|
-
# retry_on ActiveRecord::Deadlocked
|
4
|
-
|
5
|
-
# Most jobs are safe to ignore if the underlying records are no longer available
|
6
|
-
# discard_on ActiveJob::DeserializationError
|
7
|
-
end
|
File without changes
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Dummy</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<%= csrf_meta_tags %>
|
7
|
-
<%= csp_meta_tag %>
|
8
|
-
|
9
|
-
<%= stylesheet_link_tag 'application', media: 'all' %>
|
10
|
-
</head>
|
11
|
-
|
12
|
-
<body>
|
13
|
-
<%= yield %>
|
14
|
-
</body>
|
15
|
-
</html>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= yield %>
|
@@ -1 +0,0 @@
|
|
1
|
-
pb.double_name @double_name
|
data/test/dummy/bin/generate
DELETED
data/test/dummy/bin/rails
DELETED
data/test/dummy/bin/rake
DELETED
data/test/dummy/bin/setup
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require "fileutils"
|
3
|
-
|
4
|
-
# path to your application root.
|
5
|
-
APP_ROOT = File.expand_path("..", __dir__)
|
6
|
-
|
7
|
-
def system!(*args)
|
8
|
-
system(*args) || abort("\n== Command #{args} failed ==")
|
9
|
-
end
|
10
|
-
|
11
|
-
FileUtils.chdir APP_ROOT do
|
12
|
-
# This script is a way to set up or update your development environment automatically.
|
13
|
-
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
|
14
|
-
# Add necessary setup steps to this file.
|
15
|
-
|
16
|
-
puts "== Installing dependencies =="
|
17
|
-
system! "gem install bundler --conservative"
|
18
|
-
system("bundle check") || system!("bundle install")
|
19
|
-
|
20
|
-
# puts "\n== Copying sample files =="
|
21
|
-
# unless File.exist?('config/database.yml')
|
22
|
-
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
|
23
|
-
# end
|
24
|
-
|
25
|
-
puts "\n== Preparing database =="
|
26
|
-
system! "bin/rails db:prepare"
|
27
|
-
|
28
|
-
puts "\n== Removing old logs and tempfiles =="
|
29
|
-
system! "bin/rails log:clear tmp:clear"
|
30
|
-
|
31
|
-
puts "\n== Restarting application server =="
|
32
|
-
system! "bin/rails restart"
|
33
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require_relative "boot"
|
2
|
-
|
3
|
-
require "rails/all"
|
4
|
-
|
5
|
-
require "rails_twirp/engine"
|
6
|
-
|
7
|
-
# Require the gems listed in Gemfile, including any gems
|
8
|
-
# you've limited to :test, :development, or :production.
|
9
|
-
Bundler.require(*Rails.groups)
|
10
|
-
|
11
|
-
module Dummy
|
12
|
-
class Application < Rails::Application
|
13
|
-
config.load_defaults Rails::VERSION::STRING.to_f
|
14
|
-
|
15
|
-
# Configuration for the application, engines, and railties goes here.
|
16
|
-
#
|
17
|
-
# These settings can be overridden in specific environments using the files
|
18
|
-
# in config/environments, which are processed later.
|
19
|
-
#
|
20
|
-
# config.time_zone = "Central Time (US & Canada)"
|
21
|
-
# config.eager_load_paths << Rails.root.join("extras")
|
22
|
-
end
|
23
|
-
end
|
data/test/dummy/config/boot.rb
DELETED
data/test/dummy/config/cable.yml
DELETED
@@ -1,25 +0,0 @@
|
|
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
|