the_pb 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +43 -0
- data/LICENSE.txt +21 -0
- data/README.md +68 -0
- data/Rakefile +6 -0
- data/bin/console +12 -0
- data/bin/setup +8 -0
- data/lib/pb.rb +227 -0
- data/lib/pb/version.rb +3 -0
- data/lib/the_pb.rb +1 -0
- data/pb.gemspec +33 -0
- metadata +130 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1a62a56ec70269bcfdbb806a194dd525a5572cb90d0b9af8f819dc894b54ccad
|
4
|
+
data.tar.gz: e3a5fcac9c8d7188fb7562d3394fe263c819c59b505f498280a757f2b5e18f00
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 97a247a174280ad09214ec4006c697b35dcaeeff053b48113286a5feeacad2c07a0bb71fb6841e01193289c1fface1e33ab91e4cd05bcd7ede9cae6d762348f4
|
7
|
+
data.tar.gz: 4c3b755836a7d624dfddd6ef25c99d56b8db6b890cde27e5507113e26c5530cbf2280ea4e9feb95135dbe0ff8f438c41d6aeedc9ec29d6f33bb894622f42a186
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at south37777@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
the_pb (0.0.1)
|
5
|
+
google-protobuf (~> 3.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
coderay (1.1.2)
|
11
|
+
diff-lcs (1.3)
|
12
|
+
google-protobuf (3.11.4)
|
13
|
+
method_source (0.9.2)
|
14
|
+
pry (0.12.2)
|
15
|
+
coderay (~> 1.1.0)
|
16
|
+
method_source (~> 0.9.0)
|
17
|
+
rake (10.5.0)
|
18
|
+
rspec (3.9.0)
|
19
|
+
rspec-core (~> 3.9.0)
|
20
|
+
rspec-expectations (~> 3.9.0)
|
21
|
+
rspec-mocks (~> 3.9.0)
|
22
|
+
rspec-core (3.9.1)
|
23
|
+
rspec-support (~> 3.9.1)
|
24
|
+
rspec-expectations (3.9.0)
|
25
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
26
|
+
rspec-support (~> 3.9.0)
|
27
|
+
rspec-mocks (3.9.1)
|
28
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
+
rspec-support (~> 3.9.0)
|
30
|
+
rspec-support (3.9.2)
|
31
|
+
|
32
|
+
PLATFORMS
|
33
|
+
ruby
|
34
|
+
|
35
|
+
DEPENDENCIES
|
36
|
+
bundler (~> 2.0)
|
37
|
+
pry
|
38
|
+
rake (~> 10.0)
|
39
|
+
rspec (~> 3.0)
|
40
|
+
the_pb!
|
41
|
+
|
42
|
+
BUNDLED WITH
|
43
|
+
2.0.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Nao Minami
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
# Pb
|
2
|
+
|
3
|
+
Utility for Google **P**rotocol **B**uffers.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'the_pb'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install the_pb
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
You can use `Pb` to generate protobuf objects.
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
[1] pry(main)> Pb.to_timestamp("2019-03-01T15:30:00")
|
27
|
+
=> <Google::Protobuf::Timestamp: seconds: 1551421800, nanos: 0>
|
28
|
+
|
29
|
+
[2] pry(main)> Pb.to_strval("Hello")
|
30
|
+
=> <Google::Protobuf::StringValue: value: "Hello">
|
31
|
+
```
|
32
|
+
|
33
|
+
You can also use `Pb.to_proto` to generate nested objects.
|
34
|
+
|
35
|
+
```proto
|
36
|
+
message Account {
|
37
|
+
int64 id = 1;
|
38
|
+
google.protobuf.Timestamp registered_at = 2;
|
39
|
+
Profile profile = 3;
|
40
|
+
}
|
41
|
+
|
42
|
+
message Profile {
|
43
|
+
int64 id = 1;
|
44
|
+
}
|
45
|
+
```
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
[1] pry(main)> Pb.to_proto(Account, { id: 1, registered_at: Time.new(2019, 3, 1), profile: { id: 2 })
|
49
|
+
=> <Account: id: 1, registered_at: <Google::Protobuf::Timestamp: seconds: 1551366000, nanos: 0>, profile: <Profile: id: 2>>
|
50
|
+
```
|
51
|
+
|
52
|
+
## Development
|
53
|
+
|
54
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
55
|
+
|
56
|
+
To install this gem onto your local machine, run `bundle exec rake install`. 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
57
|
+
|
58
|
+
## Contributing
|
59
|
+
|
60
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/wantedly/the_pb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
61
|
+
|
62
|
+
## License
|
63
|
+
|
64
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
65
|
+
|
66
|
+
## Code of Conduct
|
67
|
+
|
68
|
+
Everyone interacting in the Pb project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/wantedly/the_pb/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "pb"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
ENV["TZ"] = "Asia/Tokyo"
|
10
|
+
|
11
|
+
require "pry"
|
12
|
+
Pry.start
|
data/bin/setup
ADDED
data/lib/pb.rb
ADDED
@@ -0,0 +1,227 @@
|
|
1
|
+
require "date"
|
2
|
+
require "time"
|
3
|
+
require "google/protobuf"
|
4
|
+
require "google/protobuf/timestamp_pb"
|
5
|
+
require "google/protobuf/wrappers_pb"
|
6
|
+
|
7
|
+
require "pb/version"
|
8
|
+
|
9
|
+
module Pb
|
10
|
+
BUILTIN_PROTO_TYPES = [
|
11
|
+
Google::Protobuf::Timestamp,
|
12
|
+
Google::Protobuf::StringValue,
|
13
|
+
Google::Protobuf::Int32Value,
|
14
|
+
Google::Protobuf::Int64Value,
|
15
|
+
Google::Protobuf::UInt32Value,
|
16
|
+
Google::Protobuf::UInt64Value,
|
17
|
+
Google::Protobuf::FloatValue,
|
18
|
+
Google::Protobuf::DoubleValue,
|
19
|
+
Google::Protobuf::BoolValue,
|
20
|
+
Google::Protobuf::BytesValue,
|
21
|
+
].freeze
|
22
|
+
|
23
|
+
class << self
|
24
|
+
# @param [Time, DateTime, Date, String, nil] t
|
25
|
+
# @return [Google::Protobuf::Timestamp, nil]
|
26
|
+
def to_timestamp(t)
|
27
|
+
return nil if t.nil?
|
28
|
+
case t
|
29
|
+
when DateTime, Date
|
30
|
+
t = t.to_time
|
31
|
+
when String
|
32
|
+
t = Time.parse(t)
|
33
|
+
else
|
34
|
+
# Do nothing
|
35
|
+
end
|
36
|
+
Google::Protobuf::Timestamp.new(seconds: t.to_i, nanos: t.nsec)
|
37
|
+
end
|
38
|
+
|
39
|
+
# @param [String, nil]
|
40
|
+
# @return [Google::Protobuf::StringValue, nil]
|
41
|
+
def to_strval(str)
|
42
|
+
return nil if str.nil?
|
43
|
+
Google::Protobuf::StringValue.new(value: str)
|
44
|
+
end
|
45
|
+
|
46
|
+
# @param [Integer, nil] num
|
47
|
+
# @return [Google::Protobuf::Int32Value, nil]
|
48
|
+
def to_int32val(num)
|
49
|
+
return nil if num.nil?
|
50
|
+
Google::Protobuf::Int32Value.new(value: num)
|
51
|
+
end
|
52
|
+
|
53
|
+
# @param [String, Integer, nil] num
|
54
|
+
# @return [Google::Protobuf::Int64Value, nil]
|
55
|
+
def to_int64val(num)
|
56
|
+
return nil if num.nil?
|
57
|
+
case num
|
58
|
+
when String
|
59
|
+
n = num.to_i
|
60
|
+
else # Integer
|
61
|
+
n = num
|
62
|
+
end
|
63
|
+
Google::Protobuf::Int64Value.new(value: n)
|
64
|
+
end
|
65
|
+
|
66
|
+
# @param [Integer, nil] num
|
67
|
+
# @return [Google::Protobuf::UInt32Value, nil]
|
68
|
+
def to_uint32val(num)
|
69
|
+
return nil if num.nil?
|
70
|
+
Google::Protobuf::UInt32Value.new(value: num)
|
71
|
+
end
|
72
|
+
|
73
|
+
# @param [String, Integer, nil] num
|
74
|
+
# @return [Google::Protobuf::UInt64Value, nil]
|
75
|
+
def to_uint64val(num)
|
76
|
+
return nil if num.nil?
|
77
|
+
case num
|
78
|
+
when String
|
79
|
+
n = num.to_i
|
80
|
+
else # Integer
|
81
|
+
n = num
|
82
|
+
end
|
83
|
+
Google::Protobuf::UInt64Value.new(value: n)
|
84
|
+
end
|
85
|
+
|
86
|
+
# @param [Float, nil] num
|
87
|
+
# @return [Google::Protobuf::FloatValue, nil]
|
88
|
+
def to_floatval(num)
|
89
|
+
return nil if num.nil?
|
90
|
+
Google::Protobuf::FloatValue.new(value: num)
|
91
|
+
end
|
92
|
+
|
93
|
+
# @param [Float, nil] num
|
94
|
+
# @return [Google::Protobuf::DoubleValue, nil]
|
95
|
+
def to_doubleval(num)
|
96
|
+
return nil if num.nil?
|
97
|
+
Google::Protobuf::DoubleValue.new(value: num)
|
98
|
+
end
|
99
|
+
|
100
|
+
# @param [bool, nil] b
|
101
|
+
# @return [Google::Protobuf::BoolValue, nil]
|
102
|
+
def to_boolval(b)
|
103
|
+
return nil if b.nil?
|
104
|
+
Google::Protobuf::BoolValue.new(value: b)
|
105
|
+
end
|
106
|
+
|
107
|
+
# @param [String, nil] bytes
|
108
|
+
# @return [Google::Protobuf::BytesValue, nil]
|
109
|
+
def to_bytesval(bytes)
|
110
|
+
return nil if bytes.nil?
|
111
|
+
Google::Protobuf::BytesValue.new(value: bytes)
|
112
|
+
end
|
113
|
+
|
114
|
+
# @param [Class] klass Protobuf message class
|
115
|
+
# @param [Object, nil] v
|
116
|
+
# @return [Object, nil] Protobuf message object.
|
117
|
+
def to_builtin_proto(klass, v)
|
118
|
+
return nil if v.nil?
|
119
|
+
|
120
|
+
if klass == Google::Protobuf::Timestamp
|
121
|
+
to_timestamp(v)
|
122
|
+
elsif klass == Google::Protobuf::StringValue
|
123
|
+
to_strval(v)
|
124
|
+
elsif klass == Google::Protobuf::Int32Value
|
125
|
+
to_int32val(v)
|
126
|
+
elsif klass == Google::Protobuf::Int64Value
|
127
|
+
to_int64val(v)
|
128
|
+
elsif klass == Google::Protobuf::UInt32Value
|
129
|
+
to_uint32val(v)
|
130
|
+
elsif klass == Google::Protobuf::UInt64Value
|
131
|
+
to_uint64val(v)
|
132
|
+
elsif klass == Google::Protobuf::FloatValue
|
133
|
+
to_floatval(v)
|
134
|
+
elsif klass == Google::Protobuf::DoubleValue
|
135
|
+
to_doubleval(v)
|
136
|
+
elsif klass == Google::Protobuf::BoolValue
|
137
|
+
to_boolval(v)
|
138
|
+
elsif klass == Google::Protobuf::BytesValue
|
139
|
+
to_bytesval(v)
|
140
|
+
else
|
141
|
+
raise "Invalid klass: #{klass} is not included in supported classes (#{BUILTIN_PROTO_TYPES})"
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# @param [Class] klass A Protobuf message class
|
146
|
+
# @param [Hash, Array<Hash>, nil] v A Hash object or An Array of Hash objects. Hash
|
147
|
+
# objects contain parameters of a Protobuf message object
|
148
|
+
# @return [Object, Array<Object>, nil] A Protobuf message object
|
149
|
+
def to_proto(klass, v)
|
150
|
+
case v
|
151
|
+
when Array
|
152
|
+
v.map { |e| to_proto_one(klass, e) }
|
153
|
+
else
|
154
|
+
to_proto_one(klass, v)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
# @param [Symbol] type The type of protobuf field. e.g. :enum, :int64,
|
159
|
+
# :string, :int32, :bool, etc.
|
160
|
+
# @param [Object] v
|
161
|
+
# @return [Object]
|
162
|
+
def to_primitive(type, v)
|
163
|
+
case v
|
164
|
+
when Array
|
165
|
+
v.map { |e| to_primitive_one(type, e) }
|
166
|
+
else
|
167
|
+
to_primitive_one(type, v)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
private
|
172
|
+
|
173
|
+
class TypeInfo
|
174
|
+
# @param [Symbol] type The type of protobuf field. e.g. :enum, :int64,
|
175
|
+
# :string, :int32, :bool, :message, etc.
|
176
|
+
# @param [Google::Protobuf::Descriptor, nil] subtype
|
177
|
+
def initialize(type:, subtype:)
|
178
|
+
@type = type
|
179
|
+
@subtype = subtype
|
180
|
+
end
|
181
|
+
attr_reader :type, :subtype
|
182
|
+
end
|
183
|
+
|
184
|
+
# @param [Class] klass A Protobuf message class
|
185
|
+
# @param [Hash, nil] v A Hash object which contains parameters of a Protobuf
|
186
|
+
# message object
|
187
|
+
# @return [Object, nil] A Protobuf message object
|
188
|
+
def to_proto_one(klass, v)
|
189
|
+
if BUILTIN_PROTO_TYPES.include?(klass)
|
190
|
+
return to_builtin_proto(klass, v)
|
191
|
+
end
|
192
|
+
|
193
|
+
return nil if v.nil?
|
194
|
+
|
195
|
+
field_types = {} # Hash{String => TypeInfo}
|
196
|
+
klass.descriptor.entries.each do |e|
|
197
|
+
field_types[e.name.to_s] = TypeInfo.new(type: e.type, subtype: e.subtype)
|
198
|
+
end
|
199
|
+
|
200
|
+
params = {}
|
201
|
+
v.each do |k, vv|
|
202
|
+
type_info = field_types[k.to_s]
|
203
|
+
next if type_info.nil? # Ignore unknown field
|
204
|
+
|
205
|
+
if type_info.type == :message
|
206
|
+
params[k] = to_proto(type_info.subtype.msgclass, vv)
|
207
|
+
else
|
208
|
+
params[k] = to_primitive(type_info.type, vv)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
klass.new(params)
|
212
|
+
end
|
213
|
+
|
214
|
+
# @param [Symbol] type The type of protobuf field. e.g. :enum, :int64,
|
215
|
+
# :string, :int32, :bool, etc.
|
216
|
+
# @param [Object] v
|
217
|
+
# @return [Object]
|
218
|
+
def to_primitive_one(type, v)
|
219
|
+
case type
|
220
|
+
when :int64, :uint64
|
221
|
+
v.to_i # Convert string to int if necessary
|
222
|
+
else
|
223
|
+
v
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
data/lib/pb/version.rb
ADDED
data/lib/the_pb.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "pb"
|
data/pb.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "pb/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "the_pb"
|
7
|
+
spec.version = Pb::VERSION
|
8
|
+
spec.authors = ["Nao Minami"]
|
9
|
+
spec.email = ["south37777@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{Utility for Google Protocol Buffers.}
|
12
|
+
spec.description = %q{Utility for Google Protocol Buffers.}
|
13
|
+
spec.homepage = "https://github.com/wantedly/the_pb"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
spec.metadata["source_code_uri"] = "https://github.com/wantedly/the_pb"
|
18
|
+
|
19
|
+
# Specify which files should be added to the gem when it is released.
|
20
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
21
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
22
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
|
+
end
|
24
|
+
spec.bindir = "exe"
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
|
+
spec.require_paths = ["lib"]
|
27
|
+
|
28
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
29
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
30
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
31
|
+
spec.add_development_dependency "pry"
|
32
|
+
spec.add_runtime_dependency "google-protobuf", "~> 3.0"
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: the_pb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nao Minami
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-03-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: google-protobuf
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
description: Utility for Google Protocol Buffers.
|
84
|
+
email:
|
85
|
+
- south37777@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- ".travis.yml"
|
93
|
+
- CODE_OF_CONDUCT.md
|
94
|
+
- Gemfile
|
95
|
+
- Gemfile.lock
|
96
|
+
- LICENSE.txt
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
99
|
+
- bin/console
|
100
|
+
- bin/setup
|
101
|
+
- lib/pb.rb
|
102
|
+
- lib/pb/version.rb
|
103
|
+
- lib/the_pb.rb
|
104
|
+
- pb.gemspec
|
105
|
+
homepage: https://github.com/wantedly/the_pb
|
106
|
+
licenses:
|
107
|
+
- MIT
|
108
|
+
metadata:
|
109
|
+
homepage_uri: https://github.com/wantedly/the_pb
|
110
|
+
source_code_uri: https://github.com/wantedly/the_pb
|
111
|
+
post_install_message:
|
112
|
+
rdoc_options: []
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
requirements: []
|
126
|
+
rubygems_version: 3.0.6
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: Utility for Google Protocol Buffers.
|
130
|
+
test_files: []
|