rails_twirp 0.13.0 → 0.13.1

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 (76) hide show
  1. checksums.yaml +4 -4
  2. data/.standard.yml +0 -1
  3. data/CHANGELOG.md +4 -0
  4. data/lib/rails_twirp/version.rb +1 -1
  5. data/rails_twirp.gemspec +2 -2
  6. metadata +8 -78
  7. data/.github/workflows/test.yml +0 -21
  8. data/bin/test +0 -5
  9. data/lib/rails_twirp/testing/integration_test.rb +0 -106
  10. data/test/dummy/Rakefile +0 -6
  11. data/test/dummy/app/assets/config/manifest.js +0 -2
  12. data/test/dummy/app/assets/images/.keep +0 -0
  13. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  14. data/test/dummy/app/channels/application_cable/channel.rb +0 -4
  15. data/test/dummy/app/channels/application_cable/connection.rb +0 -4
  16. data/test/dummy/app/controllers/application_controller.rb +0 -2
  17. data/test/dummy/app/controllers/application_twirp_controller.rb +0 -7
  18. data/test/dummy/app/controllers/concerns/.keep +0 -0
  19. data/test/dummy/app/controllers/dummy_controller.rb +0 -5
  20. data/test/dummy/app/controllers/pings_controller.rb +0 -40
  21. data/test/dummy/app/controllers/testmod/nested/other_controller.rb +0 -10
  22. data/test/dummy/app/helpers/application_helper.rb +0 -2
  23. data/test/dummy/app/helpers/random_helper.rb +0 -5
  24. data/test/dummy/app/javascript/packs/application.js +0 -15
  25. data/test/dummy/app/jobs/application_job.rb +0 -7
  26. data/test/dummy/app/mailers/application_mailer.rb +0 -4
  27. data/test/dummy/app/models/application_record.rb +0 -3
  28. data/test/dummy/app/models/concerns/.keep +0 -0
  29. data/test/dummy/app/views/dummy/rpc_name_check.pb.pbbuilder +0 -3
  30. data/test/dummy/app/views/layouts/application.html.erb +0 -15
  31. data/test/dummy/app/views/layouts/mailer.html.erb +0 -13
  32. data/test/dummy/app/views/layouts/mailer.text.erb +0 -1
  33. data/test/dummy/app/views/pings/ping_template.pb.pbbuilder +0 -1
  34. data/test/dummy/bin/generate +0 -3
  35. data/test/dummy/bin/rails +0 -4
  36. data/test/dummy/bin/rake +0 -4
  37. data/test/dummy/bin/setup +0 -33
  38. data/test/dummy/config/application.rb +0 -23
  39. data/test/dummy/config/boot.rb +0 -5
  40. data/test/dummy/config/cable.yml +0 -10
  41. data/test/dummy/config/database.yml +0 -25
  42. data/test/dummy/config/environment.rb +0 -5
  43. data/test/dummy/config/environments/development.rb +0 -76
  44. data/test/dummy/config/environments/production.rb +0 -120
  45. data/test/dummy/config/environments/test.rb +0 -59
  46. data/test/dummy/config/initializers/application_controller_renderer.rb +0 -8
  47. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -8
  48. data/test/dummy/config/initializers/content_security_policy.rb +0 -28
  49. data/test/dummy/config/initializers/cookies_serializer.rb +0 -5
  50. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -6
  51. data/test/dummy/config/initializers/inflections.rb +0 -16
  52. data/test/dummy/config/initializers/mime_types.rb +0 -4
  53. data/test/dummy/config/initializers/permissions_policy.rb +0 -11
  54. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  55. data/test/dummy/config/locales/en.yml +0 -33
  56. data/test/dummy/config/puma.rb +0 -43
  57. data/test/dummy/config/routes.rb +0 -3
  58. data/test/dummy/config/storage.yml +0 -34
  59. data/test/dummy/config/twirp/routes.rb +0 -22
  60. data/test/dummy/config.ru +0 -6
  61. data/test/dummy/lib/assets/.keep +0 -0
  62. data/test/dummy/log/.keep +0 -0
  63. data/test/dummy/proto/api.proto +0 -30
  64. data/test/dummy/proto/api_pb.rb +0 -29
  65. data/test/dummy/proto/api_twirp.rb +0 -25
  66. data/test/dummy/public/404.html +0 -67
  67. data/test/dummy/public/422.html +0 -67
  68. data/test/dummy/public/500.html +0 -66
  69. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  70. data/test/dummy/public/apple-touch-icon.png +0 -0
  71. data/test/dummy/public/favicon.ico +0 -0
  72. data/test/dummy_test.rb +0 -10
  73. data/test/other_controller_test.rb +0 -9
  74. data/test/ping_controller_test.rb +0 -114
  75. data/test/rails_twirp_test.rb +0 -7
  76. data/test/test_helper.rb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6af836779332d2bcf1810379884b7ef9e219f63e81b2972b501a45ae1880f1cb
4
- data.tar.gz: b0a967815e9326fa7889fdf1f3ec77b08f835921b8a919cee5cc95150407aa20
3
+ metadata.gz: d04982e98774e2a130671b2729dad6141905df3544c7cfa3900137a7cd553356
4
+ data.tar.gz: 650187fd3c34f30ca91885c6c1fa9b1547035a816d088e0b8c583f9ea6a0608e
5
5
  SHA512:
6
- metadata.gz: 139e2f8517c0e1b2664b0d264d4722ebdc74fde78bfdb9724ea03d31d80ab99eec66a304a25bfaec23e17ed032b5396406742993ebabc2fc464c3eea338dd5bd
7
- data.tar.gz: 4df604dc7f1772238a2ea95b3e573aa352b354a58a92f9caa157add1889ba59dd95d8bbab9283dbf9632b807514c28fc21eca913b03f0bb254d57eadfbef200b
6
+ metadata.gz: 4021ee3e130f4647423177456c9ccfb5bcce728874b547f56c2ae52a78fc92a953f6e98e7dee7eb87c78adca37f4f42cd21c7761f3842f20859923a3a8b8096f
7
+ data.tar.gz: bcb8240668e0c0d59f63ad7148595fcf15142533bed252e6f55212f51a73df0f31a623ca97f675c1494712631ffb025b20f71956dbfaa71ba61d9d48e12f2512
data/.standard.yml CHANGED
@@ -1,4 +1,3 @@
1
1
  ignore:
2
- - 'test/dummy/proto/*'
3
2
  - '**/*':
4
3
  - Lint/RescueException
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
@@ -1,3 +1,3 @@
1
1
  module RailsTwirp
2
- VERSION = "0.13.0"
2
+ VERSION = "0.13.1"
3
3
  end
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.7.2", "~> 1.9.0"
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.0
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-24 00:00:00.000000000 Z
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.7.2
34
- - - "~>"
33
+ version: '1.9'
34
+ - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: 1.9.0
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.7.2
44
- - - "~>"
43
+ version: '1.9'
44
+ - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: 1.9.0
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
@@ -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,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
- $: << File.expand_path("../test", __dir__)
3
-
4
- require "bundler/setup"
5
- require "rails/plugin/test"
@@ -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
@@ -1,6 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require_relative "config/application"
5
-
6
- Rails.application.load_tasks
@@ -1,2 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../stylesheets .css
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
- */
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Channel < ActionCable::Channel::Base
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module ApplicationCable
2
- class Connection < ActionCable::Connection::Base
3
- end
4
- end
@@ -1,2 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- end
@@ -1,7 +0,0 @@
1
- class ApplicationTwirpController < RailsTwirp::Base
2
- rescue_from ActiveRecord::RecordNotFound, with: :handle_not_found
3
-
4
- def handle_not_found
5
- error :not_found, "Not found"
6
- end
7
- end
File without changes
@@ -1,5 +0,0 @@
1
- class DummyController < RailsTwirp::Base
2
- def rpc_name_check
3
- @rpc_name = rpc_name
4
- end
5
- end
@@ -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,10 +0,0 @@
1
- module Testmod
2
- module Nested
3
- class OtherController < ApplicationTwirpController
4
- def ping
5
- response = RPC::DummyAPI::PingResponse.new(double_name: request.name * 2)
6
- self.response_body = response
7
- end
8
- end
9
- end
10
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,5 +0,0 @@
1
- module RandomHelper
2
- def does_this_work(n)
3
- n * 2
4
- end
5
- 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
@@ -1,4 +0,0 @@
1
- class ApplicationMailer < ActionMailer::Base
2
- default from: "from@example.com"
3
- layout "mailer"
4
- end
@@ -1,3 +0,0 @@
1
- class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- end
File without changes
@@ -1,3 +0,0 @@
1
- pb.cache! "rpc-#{@rpc_name}", expire_in: 1.minute do
2
- pb.rpc_name @rpc_name
3
- end
@@ -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,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <style>
6
- /* Email styles need to be inline */
7
- </style>
8
- </head>
9
-
10
- <body>
11
- <%= yield %>
12
- </body>
13
- </html>
@@ -1 +0,0 @@
1
- <%= yield %>
@@ -1 +0,0 @@
1
- pb.double_name @double_name
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- protoc --twirp_ruby_out=proto/ --ruby_out=proto/ -I proto/ proto/api.proto
data/test/dummy/bin/rails DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path("../config/application", __dir__)
3
- require_relative "../config/boot"
4
- require "rails/commands"
data/test/dummy/bin/rake DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative "../config/boot"
3
- require "rake"
4
- Rake.application.run
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
@@ -1,5 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
3
-
4
- require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
5
- $LOAD_PATH.unshift File.expand_path("../../../lib", __dir__)
@@ -1,10 +0,0 @@
1
- development:
2
- adapter: async
3
-
4
- test:
5
- adapter: test
6
-
7
- production:
8
- adapter: redis
9
- url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10
- channel_prefix: dummy_production
@@ -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
@@ -1,5 +0,0 @@
1
- # Load the Rails application.
2
- require_relative "application"
3
-
4
- # Initialize the Rails application.
5
- Rails.application.initialize!