protoc-gen-twirp_ruby 1.1.0 → 1.1.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: 30f68aaf9f4bab30eb440d98f94cb4840712d18ce8dd44b846b1ba2b8c95878f
4
- data.tar.gz: c6ca8284ee938254b60383cf3c38bb801940f758e460c0fd63cdf61468d0f9e1
3
+ metadata.gz: 61fb4daca3b43bb74a7dd7d55604ee44120f94fd414a8e800aec9c75796b1bcd
4
+ data.tar.gz: ff8f5d616e451c35df3f3d5439386c8d2f61b1f80df12c396f8b3ff6a77be88d
5
5
  SHA512:
6
- metadata.gz: 55d98147c37865e774a5e5b68206b53fad68c25b7ac61a9a69a92bf09d0adb569a7e8175aae8dd281be1b94099b699a7830f18c7c256e78db00799b5cddb092b
7
- data.tar.gz: b32badee47a22d048aef598801a4412e8cd85b5cc69d6f1665f88cb58fd0d3d7a0adca19145713a258529e480bef58cc5f98d14792f1b9c4e42d36c3c6d280b5
6
+ metadata.gz: 54051cb2108ebf06765b8dd80477b10486bae2db1b79db945ea7e3b10238560d6c0bf84c768799e70c9b22c62bd3976017426d2f8a0d6097088af98b2885bc28
7
+ data.tar.gz: 1766042ae8e9d6012bd99f9829c630ccf99b67173920bca4ee763b7888e676557f1e196516b88516d127f0015121db2bfeac1da12943c1bbbf4cc9a471a67b3a
data/CHANGELOG.md CHANGED
@@ -1,6 +1,8 @@
1
1
  ## [Unreleased]
2
2
 
3
- - Nothing (yet)
3
+ ## [1.1.1] - 2024-05-22
4
+
5
+ - Remove unnecessary `racc` runtime dependency - [#33](https://github.com/collectiveidea/protoc-gen-twirp_ruby/pull/33)
4
6
 
5
7
  ## [1.1.0] - 2024-05-21
6
8
 
data/README.md CHANGED
@@ -2,13 +2,20 @@
2
2
  [![Build](https://github.com/collectiveidea/protoc-gen-twirp_ruby/actions/workflows/main.yml/badge.svg)](https://github.com/collectiveidea/protoc-gen-twirp_ruby/actions/workflows/main.yml)
3
3
  [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/standardrb/standard)
4
4
 
5
- # protoc-gen-twirp_ruby
5
+ # protoc-gen-twirp_ruby - A `protoc` plugin for Twirp-Ruby.
6
6
 
7
- This gem provides a `protoc` plugin that generates [Twirp-Ruby](https://github.com/arthurnn/twirp-ruby) services and clients.
7
+ This gem is a `protoc` plugin that generates [Twirp-Ruby](https://github.com/arthurnn/twirp-ruby) services and clients.
8
8
 
9
- **NOTE:** Twirp-Ruby [already has a protoc plugin available](https://github.com/arthurnn/twirp-ruby/tree/main/protoc-gen-twirp_ruby)
10
- released as a `go` module. This project creates an alternative plugin written in Ruby and distributed as a gem that
11
- produces comparable output while being both more familiar and accessible to Ruby developers.
9
+ ## Why use this?
10
+
11
+ Twirp-Ruby [already does this](https://github.com/arthurnn/twirp-ruby/tree/main/protoc-gen-twirp_ruby)
12
+ via a `go` module. So why use this version?
13
+
14
+ * Easier install (just add the gem).
15
+ * You already know and love Ruby.
16
+ * We're committed to keeping it up to date.
17
+
18
+ The Go version works fine (we used it for years) but it was missing features that we wanted. Building in Ruby allows us to iterate quicker and makes it easier for others to contribute.
12
19
 
13
20
  ## Installation
14
21
 
@@ -25,41 +32,17 @@ the `--ruby_out` option). It does not generate Twirp services and clients; that
25
32
 
26
33
  ### Install the `protoc-gen-twirp_ruby` plugin
27
34
 
28
- Install the gem by adding it to your Gemfile:
35
+ Run `gem install protoc-gen-twirp_ruby` or add it to your Gemfile:
29
36
 
30
37
  ```ruby
31
- group :development, :test do
32
- "protoc-gen-twirp_ruby"
33
- end
34
- ````
35
-
36
- Alternatively, install the gem on your system:
37
-
38
- ```bash
39
- gem install protoc-gen-twirp_ruby
38
+ gem "protoc-gen-twirp_ruby", group: :development
40
39
  ```
41
40
 
42
- ## Migration from the `protoc-gen-twirp_ruby` go module
43
-
44
- If you have previously installed the `go` version of the plugin via the [Twirp-Ruby Code Generation wiki page](https://github.com/arthurnn/twirp-ruby/wiki/Code-Generation)
45
- instructions, then you'll want to uninstall it before invoking the `protoc` command.
46
-
47
- ```bash
48
- rm `go env GOPATH`/bin/protoc-gen-twirp_ruby
49
- ```
50
-
51
- ### Notable plugin differences
52
-
53
- This gem generates nearly identical Twirp-Ruby output as the go version plugin. Some notable differences
54
- that might affect migration include:
55
-
56
- * Generated output code is in [standardrb style](https://github.com/standardrb/standard).
57
- * Generated service and client class names are improved for well-named protobuf services. See [#6](https://github.com/collectiveidea/protoc-gen-twirp_ruby/pull/6).
58
- * Supports various protoc command line [configuration options](https://github.com/collectiveidea/protoc-gen-twirp_ruby?tab=readme-ov-file#options).
41
+ If you previously used the Go version, see our [Migration Instructions](#migrating-from-the-go-module).
59
42
 
60
43
  ## Usage
61
44
 
62
- Once `protoc` and the `protoc-gen-twirp_ruby` gem is installed, pass `--twirp_ruby_out` to generate Twirp-Ruby code:
45
+ Pass `--twirp_ruby_out` to `protoc` to generate Twirp-Ruby code:
63
46
 
64
47
  ```bash
65
48
  protoc --proto_path=. --ruby_out=. --twirp_ruby_out=. ./path/to/service.proto
@@ -67,8 +50,7 @@ protoc --proto_path=. --ruby_out=. --twirp_ruby_out=. ./path/to/service.proto
67
50
 
68
51
  ### Options
69
52
 
70
- The plugin supports the following options to configure code generation. Pass options by
71
- specifying `--twirp_ruby_opt=<option>` on the `protoc` command line.
53
+ You can configure the code generation. Pass options by specifying `--twirp_ruby_opt=<option>` on the `protoc` command line.
72
54
 
73
55
  * `skip-empty`: Avoid generating a `_twirp.rb` for a `.proto` with no service definitions. By default, a `_twirp.rb`
74
56
  file is generated for every proto file listed on the command line, even if the file is empty scaffolding.
@@ -78,6 +60,32 @@ specifying `--twirp_ruby_opt=<option>` on the `protoc` command line.
78
60
  * `generate=both` - generate both services and clients. This is the default option to preserve
79
61
  backwards compatibility.
80
62
 
63
+ Example (with two options):
64
+
65
+ ```bash
66
+ protoc --proto_path=. --ruby_out=. --twirp_ruby_out=. --twirp_ruby_opt=generate=client --twirp_ruby_opt=skip-empty ./path/to/service.proto
67
+ ```
68
+
69
+ ## Migrating from the Go module
70
+
71
+ If you previously installed the `protoc-gen-twirp_ruby` Go module via the [Twirp-Ruby's Code Generation wiki page](https://github.com/arthurnn/twirp-ruby/wiki/Code-Generation)
72
+ instructions, then you'll want to uninstall it before invoking the `protoc` command.
73
+
74
+ ```bash
75
+ rm `go env GOPATH`/bin/protoc-gen-twirp_ruby
76
+ ```
77
+
78
+ ### Differences from the Go module
79
+
80
+ This gem generates nearly identical Twirp-Ruby output as the Go version. Some notable differences
81
+ that might affect migration include:
82
+
83
+ * Generated output code is in [standardrb style](https://github.com/standardrb/standard).
84
+ * Generated service and client class names are improved for well-named protobuf services. See [#6](https://github.com/collectiveidea/protoc-gen-twirp_ruby/pull/6).
85
+ * Supports `ruby_package` in `.proto` files
86
+ * Supports various protoc command line [configuration options](https://github.com/collectiveidea/protoc-gen-twirp_ruby?tab=readme-ov-file#options).
87
+
88
+
81
89
  ## Development
82
90
 
83
91
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -97,7 +105,20 @@ protoc --ruby_out=. --twirp_ruby_out=. ./example/hello_world.proto
97
105
 
98
106
  ## Releasing
99
107
 
100
- To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
108
+ To release a new version:
109
+
110
+ * Submit a PR with the following changes (see [#30](https://github.com/collectiveidea/protoc-gen-twirp_ruby/pull/30)):
111
+ * Update the version number in `version.rb`
112
+ * Update the CHANGELOG.md
113
+ * Create a section for the new version and move the unreleased version there
114
+ * Re-generate the example:
115
+ * `protoc --plugin=protoc-gen-twirp_ruby=./exe/protoc-gen-twirp_ruby --ruby_out=. --twirp_ruby_out=. ./example/hello_world.proto`
116
+ * Once merged, run the release task from main. Note that we prepend `gem_push=no` to avoid
117
+ pushing to RubyGems directly; our GitHub publish action will do this for us.
118
+ * `gem_push=no bundle exec rake release`
119
+ * Create a GitHub release:
120
+ * `gh release create v<version>`
121
+ * Edit the release notes to link to the notes in the CHANGELOG.md for the version
101
122
 
102
123
  ## Contributing
103
124
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Twirp
4
4
  module ProtocPlugin
5
- VERSION = "1.1.0"
5
+ VERSION = "1.1.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protoc-gen-twirp_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darron Schall
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2024-05-21 00:00:00.000000000 Z
13
+ date: 2024-05-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: google-protobuf
@@ -26,20 +26,6 @@ dependencies:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  version: '0'
29
- - !ruby/object:Gem::Dependency
30
- name: racc
31
- requirement: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: '0'
36
- type: :runtime
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: '0'
43
29
  - !ruby/object:Gem::Dependency
44
30
  name: rake
45
31
  requirement: !ruby/object:Gem::Requirement
@@ -96,7 +82,8 @@ dependencies:
96
82
  - - ">="
97
83
  - !ruby/object:Gem::Version
98
84
  version: '0'
99
- description: A Ruby protoc plugin generator for Twirp-Ruby.
85
+ description: A protoc plugin that generates Twirp-Ruby services and clients. A pure
86
+ Ruby alternative to the Go version that ships with Twirp-Ruby.
100
87
  email: info@collectiveidea.com
101
88
  executables:
102
89
  - protoc-gen-twirp_ruby
@@ -147,5 +134,5 @@ requirements: []
147
134
  rubygems_version: 3.5.9
148
135
  signing_key:
149
136
  specification_version: 4
150
- summary: A Ruby protoc plugin generator for Twirp-Ruby.
137
+ summary: A protoc plugin for generating Twirp-Ruby clients and/or services
151
138
  test_files: []