fabric-gateway 0.1.0 → 0.2.0

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: 4ebf0356b3eb18ce6a114639e36b2a2c444a3aa527b63e5678eea7fd86322f33
4
- data.tar.gz: 3578f40c92ee6828b7f82361bc2cd2480f385c956b03e936aec1ab85d004e1f1
3
+ metadata.gz: d791b2c862c686b8d4d6877dbf5fedd6563b4d5ba2092c832a018deb5d48c575
4
+ data.tar.gz: 239128c906f1ac613d562d929a6ff5b9cc72d0e9dc1adfba3b9b4a8e306228f1
5
5
  SHA512:
6
- metadata.gz: c213fa67cf1838f4aaf0d64b82e73f1c3c267dff9d61a622e877e3458072a46e455a4c90302130a35dab0f528eea6e398afa166aad1c7d6435681ef1fac36609
7
- data.tar.gz: 99b60025222f359a922a449df21310c4ebc575d4d2453825c376754c24303a8f9fbda2dc9c265c549fd6ee77bf42dff89aa433a1b91948c6a9b2005fc2a51d52
6
+ metadata.gz: ec91a9bca5003ec961e93ce670d8006a698c071f51b81a7d9ab6dcd011480597e7decc396607f6f4fbef5b29cd0b7ab2986239f558711ebd333599da8d07eddd
7
+ data.tar.gz: 6795e691fa38795aacc3e9cf0d9472cb9924105b184d283aa13ad1b7732445a334a713bc6ed79e6c283c70aa51ebbee37ace55f84e5a9d68a0c96aee5711f499
data/.editorconfig ADDED
@@ -0,0 +1,3 @@
1
+ indent_style = space
2
+ indent_size = 2
3
+ root = true
@@ -0,0 +1,37 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: RSpec Tests
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ['2.6', '2.7', '3.0']
23
+
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - name: Set up Ruby
27
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
29
+ # uses: ruby/setup-ruby@v1
30
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
31
+ with:
32
+ ruby-version: ${{ matrix.ruby-version }}
33
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
34
+ - name: Run tests
35
+ run: bundle exec rake
36
+ env:
37
+ CODECOV_TOKEN: 4b75ccca-3149-4610-99fb-3a5aeff4ff00
@@ -0,0 +1,28 @@
1
+ name: RuboCop
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - name: Set up Ruby 2.7
12
+ uses: ruby/setup-ruby@v1
13
+ with:
14
+ ruby-version: 2.7
15
+ - name: Cache gems
16
+ uses: actions/cache@v1
17
+ with:
18
+ path: vendor/bundle
19
+ key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}
20
+ restore-keys: |
21
+ ${{ runner.os }}-rubocop-
22
+ - name: Install gems
23
+ run: |
24
+ bundle config path vendor/bundle
25
+ bundle config set without 'default doc job cable storage ujs test db'
26
+ bundle install --jobs 4 --retry 3
27
+ - name: Run RuboCop
28
+ run: bundle exec rubocop --parallel
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ Gemfile.lock
data/.rubocop.yml ADDED
@@ -0,0 +1,23 @@
1
+ require:
2
+ - rubocop-rspec
3
+
4
+ Metrics/BlockLength:
5
+ Exclude:
6
+ - '*.gemspec'
7
+ - 'spec/**/*_spec.rb'
8
+ - spec/factories.rb
9
+
10
+ AllCops:
11
+ NewCops: enable
12
+ TargetRubyVersion: 2.6
13
+ Exclude:
14
+ - vendor/bundle/**/*
15
+ # exclude protoc generated code
16
+ - 'lib/gateway/*'
17
+ - 'lib/common/*'
18
+ - 'lib/gossip/*'
19
+ - 'lib/msp/*'
20
+ - 'lib/orderer/*'
21
+ - 'lib/peer/*'
22
+
23
+
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.5
@@ -0,0 +1,7 @@
1
+ {
2
+ "[ruby]": {
3
+ "editor.formatOnSave": true,
4
+ "editor.defaultFormatter": "misogi.ruby-rubocop"
5
+ },
6
+ "editor.formatOnSave": true
7
+ }
data/CODE_OF_CONDUCT.md CHANGED
@@ -2,73 +2,132 @@
2
2
 
3
3
  ## Our Pledge
4
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.
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
11
14
 
12
15
  ## Our Standards
13
16
 
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
16
19
 
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
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
22
27
 
23
- Examples of unacceptable behavior by participants include:
28
+ Examples of unacceptable behavior include:
24
29
 
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
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
28
33
  * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
31
36
  * Other conduct which could reasonably be considered inappropriate in a
32
37
  professional setting
33
38
 
34
- ## Our Responsibilities
39
+ ## Enforcement Responsibilities
35
40
 
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.
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
39
45
 
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.
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
45
50
 
46
51
  ## Scope
47
52
 
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.
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
54
58
 
55
59
  ## Enforcement
56
60
 
57
61
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at jonathan.chan@ethicalidentity.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.
62
+ reported to the community leaders responsible for enforcement at
63
+ oss@ethicalidentity.com.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
63
87
 
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.
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
67
114
 
68
115
  ## Attribution
69
116
 
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [https://contributor-covenant.org/version/1/4][version]
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
72
133
 
73
- [homepage]: https://contributor-covenant.org
74
- [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile CHANGED
@@ -1,7 +1,9 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in fabric-gateway.gemspec
4
6
  gemspec
5
7
 
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
8
+ gem 'rake', '~> 12.3.3'
9
+ gem 'rspec', '~> 3.0'
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Fabric::Gateway
2
2
 
3
+ ![Rspec Tests](https://github.com/EthicalIdentity/fabric-gateway-ruby/actions/workflows/rspec.yml/badge.svg) [![codecov](https://codecov.io/gh/EthicalIdentity/fabric-gateway-ruby/branch/master/graph/badge.svg?token=AXHQEN0R2R)](https://codecov.io/gh/EthicalIdentity/fabric-gateway-ruby) [![Maintainability](https://api.codeclimate.com/v1/badges/84bab9bb5911d3564df6/maintainability)](https://codeclimate.com/github/EthicalIdentity/fabric-gateway-ruby/maintainability) ![Gem](https://img.shields.io/gem/v/fabric-gateway) ![Downloads](https://img.shields.io/gem/dt/fabric-gateway) [![GitHub license](https://img.shields.io/github/license/EthicalIdentity/fabric-gateway-ruby)](https://github.com/EthicalIdentity/fabric-gateway-ruby/blob/master/LICENSE.txt)
4
+
5
+
6
+
3
7
  Hyperledger Fabric Gateway gRPC SDK generated directly from protos found at: https://github.com/hyperledger/fabric-protos.
4
8
 
5
9
  ## Installation
@@ -28,7 +32,7 @@ Will update to new version of grpc when fix is released.
28
32
 
29
33
  ## Usage
30
34
 
31
- This is a alpha stage library. This library is barely working.
35
+ This is an alpha stage library suitable for early adopters. Not all Hyperledger Fabric Gateway operations have been implemented. However the operations that have been implemented have pretty good unit test coverage.
32
36
 
33
37
  ```
34
38
  $ bin/console
@@ -50,26 +54,45 @@ client_opts = {
50
54
  GRPC::Core::Channel::SSL_TARGET => 'peer0.org1.example.com'
51
55
  }
52
56
  }
57
+ # optional, if you want to set deadlines to the individual calls (in seconds)
58
+ default_call_options = {
59
+ endorse_options: { deadline: GRPC::Core::TimeConsts.from_relative_time(5) },
60
+ evaluate_options: { deadline: GRPC::Core::TimeConsts.from_relative_time(5) },
61
+ submit_options: { deadline: GRPC::Core::TimeConsts.from_relative_time(5) },
62
+ commit_status_options: { deadline: GRPC::Core::TimeConsts.from_relative_time(5) },
63
+ chaincode_events_options: { deadline: GRPC::Core::TimeConsts.from_relative_time(60) }
64
+ }
65
+ creds = GRPC::Core::ChannelCredentials.new(load_certs[0])
66
+ client=Fabric::Client.new('localhost:7051', creds, default_call_options: default_call_options, **client_opts)
53
67
 
54
- user_identity = Fabric::Gateway::Identity.new(
68
+ identity = Fabric::Gateway::Identity.new(
55
69
  {
56
- username: "admin",
57
- affiliation: "org1.department1",
58
- mspid: 'Org1MSP',
70
+ msp_id: 'Org1MSP',
59
71
  private_key: Fabric::Gateway.crypto_suite.key_from_pem(load_certs[1]),
60
72
  pem_certificate: load_certs[2],
61
73
  }
62
74
  )
63
75
 
64
- creds = GRPC::Core::ChannelCredentials.new(load_certs[0])
65
- client=Gateway::Gateway::Stub.new('localhost:7051', creds, **client_opts)
66
- proposal = Fabric::Gateway::Proposal.new(user_identity, {channel_id: 'your_channel', chaincode_id: 'basic', args: [ 'GetAllAssets' ]})
76
+ gateway = identity.new_gateway(client)
77
+ network = gateway.new_network('my_channel')
78
+ contract = network.new_contract('basic')
79
+
80
+ # Evaluate
81
+ puts contract.evaluate_transaction('GetAllAssets')
82
+
83
+ # Submit - Not Yet Implemented!
84
+ puts contract.submit_transaction('CreateAsset', 'asset13', 'yellow', '5', 'Tom', '1300')
67
85
 
68
- response = client.evaluate(Gateway::EvaluateRequest.new(channel_id: "your_channel", proposed_transaction: proposal.signed_proposal))
86
+ # Endorse - Not Yet Implemented!
87
+
88
+ # Commit Status - Not Yet Implemented!
89
+
90
+ # Chaincode Events - Not Yet Implemented!
69
91
 
70
- pp response
71
92
  ```
72
93
 
94
+ Please refer to the [full reference documentation](https://rubydoc.info/github/EthicalIdentity/fabric-gateway-ruby) for complete usage information.
95
+
73
96
  ## Development
74
97
 
75
98
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -82,6 +105,17 @@ To rebuild the proto code, run the regenerate script:
82
105
  $ bin/regenerate
83
106
  ```
84
107
 
108
+ Effort has been made to follow the design patterns and naming convention where possible from the official [Hyperledger Fabric Gateway SDK](https://github.com/hyperledger/fabric-gateway) while at the same time producing an idiomatic ruby gem. Our intention is to produce a gem that would be compatible with the documentation of the official SDK while natural to use for a seasoned ruby developer.
109
+
110
+ ## Development References & Resources
111
+
112
+ These are the libraries and knowledge necessary for developing this gem:
113
+
114
+ * gRPC - [gRPC Intro](https://grpc.io/docs/what-is-grpc/introduction/) / [gRPC on ruby](https://grpc.io/docs/languages/ruby/)
115
+ * Protocol Buffers (Protobuf) - [overview](https://developers.google.com/protocol-buffers/docs/proto3) / [ruby reference](https://developers.google.com/protocol-buffers/docs/reference/ruby-generated)
116
+ * [Hyperledger Fabric Protocol Specifications](https://openblockchain.readthedocs.io/en/latest/protocol-spec/)
117
+ * [Hyperledger Fabric Gateway Overview](https://hyperledger-fabric.readthedocs.io/en/latest/gateway.html) / [Fabric Gateway RFC](https://hyperledger.github.io/fabric-rfcs/text/0000-fabric-gateway.html)
118
+
85
119
  ## Contributing
86
120
 
87
121
  Bug reports and pull requests are welcome on GitHub at https://github.com/ethicalidentity/fabric-gateway. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ethicalidentity/fabric-gateway/blob/master/CODE_OF_CONDUCT.md).
@@ -93,16 +127,29 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/ethica
93
127
  - [x] Add license
94
128
  - [x] Add ChangeLog
95
129
  - [x] Create Gem
96
- - [ ] Add usage instructions
97
- - [ ] Abstract connection and calls such that the protos aren't being interacted directly
98
- - [ ] Add testing?
130
+ - [x] Add testing & CI/CD
131
+ - [x] Add rubocop and linting
132
+ - [x] Add usage instructions
133
+ - [x] Setup auto-generation of API docs on rubydoc.info
134
+ - [x] Abstract connection and calls such that the protos aren't being interacted directly
135
+ - [x] Implement, Document & Test Evaluate
136
+ - [ ] Implement, Document & Test Endorse
137
+ - [ ] Implement, Document & Test Submit
138
+ - [ ] Implement, Document & Test CommitStatus
139
+ - [ ] Implement, Document & Test ChaincodeEvents
140
+ - [ ] Implement off-line signing - https://github.com/hyperledger/fabric-gateway/blob/1e4a926ddb98ec8ee969da3fc1500642ab389d01/node/src/contract.ts#L63
141
+ - [ ] Consider adding error handling, invalid transaction proposals will result in random GRPC::FailedPrecondition type errors
142
+ - [ ] Consider adding integration tests against blockchain; might be a ton of stuff to setup
143
+ - [ ] Support for offline transaction signing (write scenario test for this) - https://github.com/hyperledger/fabric-gateway/blob/cf78fc11a439ced7dfd2f9b55886c55c73119b25/pkg/client/offlinesign_test.go
144
+
145
+
99
146
 
100
147
 
101
148
  ## License
102
149
 
103
150
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
104
151
 
105
- Portions of the code was utilized from https://github.com/kirshin/hyperledger-fabric-sdk.
152
+ Portions of the code are from https://github.com/kirshin/hyperledger-fabric-sdk.
106
153
 
107
154
  ## Code of Conduct
108
155
 
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
- task :default => :spec
8
+ task default: :spec
data/bin/console CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "bundler/setup"
4
- require "fabric/gateway"
4
+ require 'bundler/setup'
5
+ require 'fabric'
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require "fabric/gateway"
10
11
  # require "pry"
11
12
  # Pry.start
12
13
 
13
- require "irb"
14
+ require 'irb'
14
15
  IRB.start(__FILE__)
data/bin/release ADDED
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ # Requires gem install gem-release
4
+ # usage: bin/relase -v minor|major|etc.
5
+ gem bump --file lib/fabric/version.rb -t -r $@
@@ -1,32 +1,43 @@
1
- require_relative 'lib/fabric/gateway/version'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/fabric/version'
2
4
 
3
5
  Gem::Specification.new do |spec|
4
- spec.name = "fabric-gateway"
5
- spec.version = Fabric::Gateway::VERSION
6
- spec.authors = ["Jonathan Chan"]
7
- spec.email = ["jonathan.chan@ethicalidentity.com"]
6
+ spec.name = 'fabric-gateway'
7
+ spec.version = Fabric::VERSION
8
+ spec.authors = ['Jonathan Chan']
9
+ spec.email = ['jonathan.chan@ethicalidentity.com']
8
10
 
9
- spec.summary = %q{Hyperledger Fabric Gateway gRPC SDK}
10
- spec.description = %q{Hyperledger Fabric Gateway gRPC SDK generated directly from protos found at: https://github.com/hyperledger/fabric-protos.}
11
- spec.homepage = "https://github.com/ethicalidentity/fabric-gateway-ruby"
12
- spec.license = "MIT"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
11
+ spec.summary = 'Hyperledger Fabric Gateway gRPC SDK'
12
+ spec.description = 'Hyperledger Fabric Gateway gRPC SDK generated directly from protos found at: https://github.com/hyperledger/fabric-protos.'
13
+ spec.homepage = 'https://github.com/ethicalidentity/fabric-gateway-ruby'
14
+ spec.license = 'MIT'
15
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
14
16
 
15
- spec.metadata["allowed_push_host"] = 'https://rubygems.org'
17
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
16
18
 
17
- spec.metadata["homepage_uri"] = spec.homepage
18
- spec.metadata["source_code_uri"] = "https://github.com/ethicalidentity/fabric-gateway-ruby"
19
- spec.metadata["changelog_uri"] = "https://github.com/EthicalIdentity/fabric-gateway-ruby/blob/master/CHANGELOG.md"
19
+ spec.metadata['homepage_uri'] = spec.homepage
20
+ spec.metadata['source_code_uri'] = 'https://github.com/ethicalidentity/fabric-gateway-ruby'
21
+ spec.metadata['changelog_uri'] = 'https://github.com/EthicalIdentity/fabric-gateway-ruby/blob/master/CHANGELOG.md'
20
22
 
21
23
  # Specify which files should be added to the gem when it is released.
22
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
25
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
26
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
27
  end
26
- spec.bindir = "exe"
28
+ spec.bindir = 'exe'
27
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
- spec.require_paths = ["lib"]
30
+ spec.require_paths = ['lib']
29
31
  spec.add_dependency('google-protobuf', '>= 3.19.1')
30
32
  spec.add_dependency('grpc', '~> 1.42')
31
- spec.add_development_dependency('grpc-tools','~> 1.42')
33
+ spec.add_development_dependency('codecov', '~> 0.6.0')
34
+ spec.add_development_dependency('factory_bot', '~> 6.2.0')
35
+ spec.add_development_dependency('grpc-tools', '~> 1.42')
36
+ spec.add_development_dependency('rubocop', '~> 1.23.0')
37
+ spec.add_development_dependency('rubocop-rspec', '~> 2.6.0')
38
+ spec.add_development_dependency('simplecov', '~> 0.21.2')
39
+ spec.add_development_dependency('timecop', '~> 0.9.4')
40
+ spec.metadata = {
41
+ 'rubygems_mfa_required' => 'true'
42
+ }
32
43
  end