the_pb 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb6041f0983f5e3855d14f58ff1940cf2e7e4d6a10c1f750428be00a36f98838
4
- data.tar.gz: 590b5e5f3b7e1bd066ef7ce3590d0560017831db53ea3573662d5c446e8a45b9
3
+ metadata.gz: ca726029e35c3146001358e2e6e19a3bb19ee008b4a986d78139984b2c430859
4
+ data.tar.gz: e434a895e83547538731ec4ed693d673e23f1aa54c90bf79de76ee212b812246
5
5
  SHA512:
6
- metadata.gz: ac3d4f93ca96285c79804b3d5df669acc90e42590dfea9ef15074281258373c7c0d4efcbf5e75651648e4188c0b74993f975582d8b9813461eb39bcd684ee46d
7
- data.tar.gz: 79519c5f2a45484f6b5f257f2e17d694327bd6a5991d9b6e65625e5e1798283e57d8623c6f7a6891f1a48d1ff0aaa06cc021c95d091fa3d54955630ba4f77f95
6
+ metadata.gz: 38fb426655699206ba62977ab44c4e2eed17b72cb9fe921b810125f0ae565a3ff7bd04c3b745b1da9ca0546ce436d10c21bd2f2504da1decd9f6ec8a9a8011c3
7
+ data.tar.gz: 85c421a1ef7c21710cc451503ec53368a3fc3233d665216b895a6d51fa7eefc94a7ad4f1338fcf116a223fbeff7680a6f6a84d0b883a9cc157e334c1d112f456
@@ -0,0 +1,31 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - master
8
+
9
+ pull_request:
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ name: Ruby ${{ matrix.ruby }}
15
+ strategy:
16
+ matrix:
17
+ ruby:
18
+ - '4.0'
19
+ - '3.4'
20
+
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ with:
24
+ persist-credentials: false
25
+ - name: Set up Ruby
26
+ uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: ${{ matrix.ruby }}
29
+ bundler-cache: true
30
+ - name: Run the default task
31
+ run: bundle exec rspec
@@ -0,0 +1,31 @@
1
+ name: Publish Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+ environment: publish
12
+ permissions:
13
+ id-token: write
14
+ contents: read
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ with:
19
+ persist-credentials: false
20
+
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: '4.0'
25
+ bundler-cache: true
26
+
27
+ - name: Build gem
28
+ run: gem build pb.gemspec
29
+
30
+ - name: Publish to RubyGems
31
+ uses: rubygems/release-gem@v1
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in pb.gemspec
4
4
  gemspec
5
+
6
+ gem "bundler", "~> 2.7"
7
+ gem "rake", "~> 13.3"
8
+ gem "rspec", "~> 3.13"
data/Gemfile.lock CHANGED
@@ -1,43 +1,56 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- the_pb (0.0.2)
5
- google-protobuf (~> 3.0)
4
+ the_pb (0.0.3)
5
+ google-protobuf (>= 3.0, < 5.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
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 (13.0.1)
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)
10
+ bigdecimal (4.0.1)
11
+ diff-lcs (1.6.2)
12
+ google-protobuf (4.34.0)
13
+ bigdecimal
14
+ rake (~> 13.3)
15
+ google-protobuf (4.34.0-aarch64-linux-gnu)
16
+ bigdecimal
17
+ rake (~> 13.3)
18
+ google-protobuf (4.34.0-arm64-darwin)
19
+ bigdecimal
20
+ rake (~> 13.3)
21
+ google-protobuf (4.34.0-x86_64-darwin)
22
+ bigdecimal
23
+ rake (~> 13.3)
24
+ google-protobuf (4.34.0-x86_64-linux-gnu)
25
+ bigdecimal
26
+ rake (~> 13.3)
27
+ rake (13.3.1)
28
+ rspec (3.13.2)
29
+ rspec-core (~> 3.13.0)
30
+ rspec-expectations (~> 3.13.0)
31
+ rspec-mocks (~> 3.13.0)
32
+ rspec-core (3.13.6)
33
+ rspec-support (~> 3.13.0)
34
+ rspec-expectations (3.13.5)
25
35
  diff-lcs (>= 1.2.0, < 2.0)
26
- rspec-support (~> 3.9.0)
27
- rspec-mocks (3.9.1)
36
+ rspec-support (~> 3.13.0)
37
+ rspec-mocks (3.13.7)
28
38
  diff-lcs (>= 1.2.0, < 2.0)
29
- rspec-support (~> 3.9.0)
30
- rspec-support (3.9.2)
39
+ rspec-support (~> 3.13.0)
40
+ rspec-support (3.13.7)
31
41
 
32
42
  PLATFORMS
43
+ aarch64-linux
44
+ arm64-darwin
33
45
  ruby
46
+ x86_64-darwin
47
+ x86_64-linux
34
48
 
35
49
  DEPENDENCIES
36
- bundler (~> 2.0)
37
- pry
38
- rake (~> 13.0)
39
- rspec (~> 3.0)
50
+ bundler (~> 2.7)
51
+ rake (~> 13.3)
52
+ rspec (~> 3.13)
40
53
  the_pb!
41
54
 
42
55
  BUNDLED WITH
43
- 2.1.4
56
+ 2.7.2
data/Rakefile CHANGED
@@ -3,4 +3,11 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
+ desc "Compile protobuf files"
7
+ task :protoc do
8
+ sh "protoc --ruby_out=spec/proto -Ispec/proto spec/proto/*.proto"
9
+ end
10
+
11
+ task :spec => :protoc unless ENV["CI"]
12
+
6
13
  task :default => :spec
data/lib/pb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pb
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/pb.rb CHANGED
@@ -21,7 +21,7 @@ module Pb
21
21
  ].freeze
22
22
 
23
23
  class << self
24
- # @param [Time, DateTime, Date, String, nil] t
24
+ # @param [Time, DateTime, Date, String, Google::Protobuf::Timestamp, nil] t
25
25
  # @return [Google::Protobuf::Timestamp, nil]
26
26
  def to_timestamp(t)
27
27
  return nil if t.nil?
@@ -37,7 +37,7 @@ module Pb
37
37
  Google::Protobuf::Timestamp.new(seconds: t.to_i, nanos: t.nsec)
38
38
  end
39
39
 
40
- # @param [String, nil]
40
+ # @param [String, Google::Protobuf::StringValue, nil]
41
41
  # @return [Google::Protobuf::StringValue, nil]
42
42
  def to_strval(str)
43
43
  return nil if str.nil?
@@ -45,7 +45,7 @@ module Pb
45
45
  Google::Protobuf::StringValue.new(value: str)
46
46
  end
47
47
 
48
- # @param [Integer, nil] num
48
+ # @param [Integer, Google::Protobuf::Int32Value, nil] num
49
49
  # @return [Google::Protobuf::Int32Value, nil]
50
50
  def to_int32val(num)
51
51
  return nil if num.nil?
@@ -53,7 +53,7 @@ module Pb
53
53
  Google::Protobuf::Int32Value.new(value: num)
54
54
  end
55
55
 
56
- # @param [String, Integer, nil] num
56
+ # @param [String, Integer, Google::Protobuf::Int64Value, nil] num
57
57
  # @return [Google::Protobuf::Int64Value, nil]
58
58
  def to_int64val(num)
59
59
  return nil if num.nil?
@@ -67,7 +67,7 @@ module Pb
67
67
  Google::Protobuf::Int64Value.new(value: n)
68
68
  end
69
69
 
70
- # @param [Integer, nil] num
70
+ # @param [Integer, Google::Protobuf::UInt32Value, nil] num
71
71
  # @return [Google::Protobuf::UInt32Value, nil]
72
72
  def to_uint32val(num)
73
73
  return nil if num.nil?
@@ -75,7 +75,7 @@ module Pb
75
75
  Google::Protobuf::UInt32Value.new(value: num)
76
76
  end
77
77
 
78
- # @param [String, Integer, nil] num
78
+ # @param [String, Integer, Google::Protobuf::UInt64Value, nil] num
79
79
  # @return [Google::Protobuf::UInt64Value, nil]
80
80
  def to_uint64val(num)
81
81
  return nil if num.nil?
@@ -89,7 +89,7 @@ module Pb
89
89
  Google::Protobuf::UInt64Value.new(value: n)
90
90
  end
91
91
 
92
- # @param [Float, nil] num
92
+ # @param [Float, Google::Protobuf::FloatValue, nil] num
93
93
  # @return [Google::Protobuf::FloatValue, nil]
94
94
  def to_floatval(num)
95
95
  return nil if num.nil?
@@ -97,7 +97,7 @@ module Pb
97
97
  Google::Protobuf::FloatValue.new(value: num)
98
98
  end
99
99
 
100
- # @param [Float, nil] num
100
+ # @param [Float, Google::Protobuf::DoubleValue, nil] num
101
101
  # @return [Google::Protobuf::DoubleValue, nil]
102
102
  def to_doubleval(num)
103
103
  return nil if num.nil?
@@ -105,7 +105,7 @@ module Pb
105
105
  Google::Protobuf::DoubleValue.new(value: num)
106
106
  end
107
107
 
108
- # @param [bool, nil] b
108
+ # @param [bool, Google::Protobuf::BoolValue, nil] b
109
109
  # @return [Google::Protobuf::BoolValue, nil]
110
110
  def to_boolval(b)
111
111
  return nil if b.nil?
@@ -113,7 +113,7 @@ module Pb
113
113
  Google::Protobuf::BoolValue.new(value: b)
114
114
  end
115
115
 
116
- # @param [String, nil] bytes
116
+ # @param [String, Google::Protobuf::BytesValue, nil] bytes
117
117
  # @return [Google::Protobuf::BytesValue, nil]
118
118
  def to_bytesval(bytes)
119
119
  return nil if bytes.nil?
data/pb.gemspec CHANGED
@@ -25,9 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ["lib"]
27
27
 
28
- spec.add_development_dependency "bundler", "~> 2.0"
29
- spec.add_development_dependency "rake", "~> 13.0"
30
- spec.add_development_dependency "rspec", "~> 3.0"
31
- spec.add_development_dependency "pry"
32
- spec.add_runtime_dependency "google-protobuf", "~> 3.0"
28
+ spec.add_runtime_dependency "google-protobuf", ">= 3.0", "< 5.0"
33
29
  end
metadata CHANGED
@@ -1,85 +1,34 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the_pb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nao Minami
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2020-03-24 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !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: '13.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '13.0'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
13
+ name: google-protobuf
43
14
  requirement: !ruby/object:Gem::Requirement
44
15
  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
- - - "~>"
16
+ - - ">="
53
17
  - !ruby/object:Gem::Version
54
18
  version: '3.0'
55
- - !ruby/object:Gem::Dependency
56
- name: pry
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
19
+ - - "<"
60
20
  - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
21
+ version: '5.0'
22
+ type: :runtime
63
23
  prerelease: false
64
24
  version_requirements: !ruby/object:Gem::Requirement
65
25
  requirements:
66
26
  - - ">="
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
27
  - !ruby/object:Gem::Version
75
28
  version: '3.0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
29
+ - - "<"
81
30
  - !ruby/object:Gem::Version
82
- version: '3.0'
31
+ version: '5.0'
83
32
  description: Utility for Google Protocol Buffers.
84
33
  email:
85
34
  - south37777@gmail.com
@@ -87,9 +36,10 @@ executables: []
87
36
  extensions: []
88
37
  extra_rdoc_files: []
89
38
  files:
39
+ - ".github/workflows/main.yml"
40
+ - ".github/workflows/publish.yml"
90
41
  - ".gitignore"
91
42
  - ".rspec"
92
- - ".travis.yml"
93
43
  - CODE_OF_CONDUCT.md
94
44
  - Gemfile
95
45
  - Gemfile.lock
@@ -108,7 +58,6 @@ licenses:
108
58
  metadata:
109
59
  homepage_uri: https://github.com/wantedly/the_pb
110
60
  source_code_uri: https://github.com/wantedly/the_pb
111
- post_install_message:
112
61
  rdoc_options: []
113
62
  require_paths:
114
63
  - lib
@@ -123,8 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
72
  - !ruby/object:Gem::Version
124
73
  version: '0'
125
74
  requirements: []
126
- rubygems_version: 3.0.3
127
- signing_key:
75
+ rubygems_version: 4.0.3
128
76
  specification_version: 4
129
77
  summary: Utility for Google Protocol Buffers.
130
78
  test_files: []
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6.3
7
- before_install:
8
- - gem install bundler -v 2.0.2
9
- script:
10
- - bundle exec rspec