rails_respond_to_pb 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0aa245e7ea71430e7649f6287293c9c2e1daafec5ff1689c5c78ba78f9bb9baf
4
- data.tar.gz: 24f3a9834c934dc896b772780275a82a9f49094951cc8da185547fc98be05f16
3
+ metadata.gz: 72802f972933ce66eb55b4da8451ba00b2d12f0f52215a98c75af0d8016bdcfe
4
+ data.tar.gz: dc9c577f01084400fb2ab4db0150d5c06c384a840dbfe09ea8035686d3514f8c
5
5
  SHA512:
6
- metadata.gz: 625454f9b1c30231ce95c46460f6723b283d05a1f1664dfff20906ed49888b927db1fca70f992d31d7974a17883b99e43fc32ecfee057b857425731f79af7a85
7
- data.tar.gz: 4c8f924f845479b6eaf938f50de51fe2ecc375af260ad36886fc92c6b82a1c10a5b84a037d1b8bcdfd5197c40d38744a353cb065b9cb24a724e9202c4080e036
6
+ metadata.gz: 413ee918b3c2412990c7c15e37d25aa072c7857dd56ecdabe167f7ab0e2e2a864990e3af5ccad6d81a60a054d657fdb18f77042e9153991f9d083f16b121b20b
7
+ data.tar.gz: 75fef258b0b4386cf5e8220dabe2407b8ce51cfdae8275ead38754f0efc3b4341951ef80a1fd21ccd35be7c64f99e315998c19d2b9adc4b4b21c38cb986c25c8
@@ -0,0 +1,20 @@
1
+ name: Rubocop
2
+
3
+ on:
4
+ - push
5
+ - pull_request
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ - name: Set up Ruby
13
+ uses: ruby/setup-ruby@v1
14
+ with:
15
+ ruby-version: 3.0.0
16
+ - name: Rubocop
17
+ run: |
18
+ gem install bundler -v 2.2.3
19
+ bundle install
20
+ bundle exec rake rubocop
@@ -1,6 +1,8 @@
1
- name: Ruby
1
+ name: Specs
2
2
 
3
- on: [push,pull_request]
3
+ on:
4
+ - push
5
+ - pull_request
4
6
 
5
7
  jobs:
6
8
  build:
@@ -11,8 +13,8 @@ jobs:
11
13
  uses: ruby/setup-ruby@v1
12
14
  with:
13
15
  ruby-version: 3.0.0
14
- - name: Run the default task
16
+ - name: Spec
15
17
  run: |
16
18
  gem install bundler -v 2.2.3
17
19
  bundle install
18
- bundle exec rake
20
+ bundle exec rake spec
data/README.md CHANGED
@@ -96,8 +96,8 @@ The **required** setup here is:
96
96
 
97
97
  ```ruby
98
98
  respond_to do |format|
99
- format.pb do
100
- render plain: YourProtoResponse.to_proto
99
+ format.pb do
100
+ render plain: YourProtoResponse.to_proto
101
101
  ```
102
102
 
103
103
  Of note, if you're trying to wire up **entirely new** methods, you do **NOT** need this gem at all, and you can simply add this to your routes file:
data/Rakefile CHANGED
@@ -9,4 +9,4 @@ require 'rubocop/rake_task'
9
9
 
10
10
  RuboCop::RakeTask.new
11
11
 
12
- task default: %i[spec rubocop]
12
+ task default: :spec
data/docker-compose.yml CHANGED
@@ -1,6 +1,5 @@
1
1
  services:
2
2
  bundle: &bundle
3
- env_file: .env
4
3
  stdin_open: true
5
4
  tty: true
6
5
  build: .
@@ -15,7 +15,7 @@ module RailsRespondToPb
15
15
  end
16
16
 
17
17
  initializer 'respond_to_pb.require_pb' do
18
- Dir["#{Rails.root}/lib/**/*_twirp.rb"].each { |file| require file }
18
+ Dir["#{Rails.root}/lib/**/*_twirp.rb"].sort.each { |file| require file }
19
19
  end
20
20
  end
21
21
  end
@@ -9,6 +9,7 @@ class RespondToPb
9
9
 
10
10
  def call(env)
11
11
  _, @resource, @action = env['PATH_INFO'].split('/')
12
+ @resource = @resource.split('.').map(&:camelize).join('::')
12
13
 
13
14
  if env['CONTENT_TYPE'] == Twirp::Encoding::PROTO
14
15
  env['HTTP_ACCEPT'] = Twirp::Encoding::PROTO
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsRespondToPb
4
- VERSION = '0.2.0'
4
+ VERSION = '0.2.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_respond_to_pb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett C. Dudo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-22 00:00:00.000000000 Z
11
+ date: 2022-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc-tools
@@ -59,8 +59,9 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - ".github/workflows/main.yml"
63
62
  - ".github/workflows/release.yml"
63
+ - ".github/workflows/rubocop.yml"
64
+ - ".github/workflows/spec.yml"
64
65
  - ".gitignore"
65
66
  - ".rspec"
66
67
  - ".rubocop.yml"
@@ -103,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
104
  - !ruby/object:Gem::Version
104
105
  version: '0'
105
106
  requirements: []
106
- rubygems_version: 3.2.3
107
+ rubygems_version: 3.3.7
107
108
  signing_key:
108
109
  specification_version: 4
109
110
  summary: Middleware for a Rails App providing functionality for gRPC and Twirp