twirp_rails 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/Gemfile.lock +1 -1
- data/lib/twirp_rails/generators/twirp/twirp_generator.rb +7 -3
- data/lib/twirp_rails/twirp.rb +4 -0
- data/lib/twirp_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 779e660390a93d455f017154d2accf76eefd7e41dffd90c2ad5fbba774167156
|
4
|
+
data.tar.gz: abef8778a5a29580fbf1dab96830d01bde5f132bbbba381b83496d2533ec50f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e3b89a22aa4f6a7d6c6217ddc7f0b7e04e1dd0311f837ea69d8600b9fe6bcb4c22843c2974f1a9deaebca7e377e491710612d7a4aca0622932ba847208834f6
|
7
|
+
data.tar.gz: ea609977601a7920db1d8257ce8b94a51de09e30018e02f0aee90c0b4c0637cd6ae116c2dbb25b64f3748756128ff2a2550f4ba118b80ea12191cbfac1abfd3c
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
##
|
7
|
+
## 0.1.1 - 2020-01-27
|
8
|
+
|
9
|
+
### Added
|
10
|
+
- import directive support
|
11
|
+
- generator always renews all generated _twirp and _pb files from all protos to support import directive
|
12
|
+
- lib/twirp added to $LOAD_PATH
|
13
|
+
|
14
|
+
## 0.1.0 - 2020-01-24
|
8
15
|
|
9
16
|
### Added
|
10
17
|
- mount_twirp route helper
|
data/Gemfile.lock
CHANGED
@@ -25,11 +25,14 @@ class TwirpGenerator < Rails::Generators::NamedBase
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
describe 'Generate twirp files'
|
28
29
|
def generate_twirp_files
|
29
|
-
cmd = protoc_cmd
|
30
|
-
|
31
30
|
in_root do
|
31
|
+
cmd = protoc_cmd
|
32
|
+
|
32
33
|
`#{cmd}`
|
34
|
+
|
35
|
+
raise "protoc failure: #{cmd}" unless $?.success?
|
33
36
|
end
|
34
37
|
end
|
35
38
|
|
@@ -73,7 +76,8 @@ class TwirpGenerator < Rails::Generators::NamedBase
|
|
73
76
|
FileUtils.mkdir_p 'lib/twirp'
|
74
77
|
flags = "--proto_path=app/protos --ruby_out=lib/twirp --twirp_ruby_out=lib/twirp --plugin=#{PLUGIN_PATH}"
|
75
78
|
|
76
|
-
|
79
|
+
proto_files = Dir.glob 'app/protos/*.proto'
|
80
|
+
"#{PROTOC_PATH} #{flags} #{proto_files.join(' ')}"
|
77
81
|
end
|
78
82
|
|
79
83
|
def proto_content
|
data/lib/twirp_rails/twirp.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
module TwirpRails
|
2
2
|
module Twirp
|
3
3
|
def self.auto_require_twirp_files
|
4
|
+
# protoc generates require without path in a _pb files
|
5
|
+
twirp_path = Rails.root.join('lib/twirp').to_s
|
6
|
+
$LOAD_PATH.unshift(twirp_path) if !$LOAD_PATH.include?(twirp_path)
|
7
|
+
|
4
8
|
Dir.glob(Rails.root.join('lib/twirp/*_twirp.rb')).sort.each do |file|
|
5
9
|
require file
|
6
10
|
end
|
data/lib/twirp_rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twirp_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandr Zimin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: twirp
|