Skip to content

Commit a762c17

Browse files
committed
first commit
0 parents  commit a762c17

9 files changed

+182
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.gem

.rubocop.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
AllCops:
2+
TargetRubyVersion: 3.2.0
3+
NewCops: enable
4+
5+
Style/Documentation:
6+
Enabled: false

Gemfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
ruby '3.2.0'
4+
5+
source 'https://rubygems.org'
6+
7+
gem 'grpc', '~> 1.50'
8+
9+
group :test, :development do
10+
gem 'grpc-tools', '~> 1.50'
11+
gem 'pry-byebug', '~> 3.10', '>= 3.10.1'
12+
gem 'rubocop', '~> 1.43'
13+
end

Gemfile.lock

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
ast (2.4.2)
5+
byebug (11.1.3)
6+
coderay (1.1.3)
7+
google-protobuf (3.21.12)
8+
googleapis-common-protos-types (1.5.0)
9+
google-protobuf (~> 3.14)
10+
grpc (1.50.0)
11+
google-protobuf (~> 3.21)
12+
googleapis-common-protos-types (~> 1.0)
13+
grpc-tools (1.50.0)
14+
json (2.6.3)
15+
method_source (1.0.0)
16+
parallel (1.22.1)
17+
parser (3.2.0.0)
18+
ast (~> 2.4.1)
19+
pry (0.14.2)
20+
coderay (~> 1.1)
21+
method_source (~> 1.0)
22+
pry-byebug (3.10.1)
23+
byebug (~> 11.0)
24+
pry (>= 0.13, < 0.15)
25+
rainbow (3.1.1)
26+
regexp_parser (2.6.2)
27+
rexml (3.2.5)
28+
rubocop (1.43.0)
29+
json (~> 2.3)
30+
parallel (~> 1.10)
31+
parser (>= 3.2.0.0)
32+
rainbow (>= 2.2.2, < 4.0)
33+
regexp_parser (>= 1.8, < 3.0)
34+
rexml (>= 3.2.5, < 4.0)
35+
rubocop-ast (>= 1.24.1, < 2.0)
36+
ruby-progressbar (~> 1.7)
37+
unicode-display_width (>= 2.4.0, < 3.0)
38+
rubocop-ast (1.24.1)
39+
parser (>= 3.1.1.0)
40+
ruby-progressbar (1.11.0)
41+
unicode-display_width (2.4.2)
42+
43+
PLATFORMS
44+
x86_64-linux
45+
46+
DEPENDENCIES
47+
grpc (~> 1.50)
48+
grpc-tools (~> 1.50)
49+
pry-byebug (~> 3.10, >= 3.10.1)
50+
rubocop (~> 1.43)
51+
52+
RUBY VERSION
53+
ruby 3.2.0p0
54+
55+
BUNDLED WITH
56+
2.4.4

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 icebaker
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 all
13+
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 THE
21+
SOFTWARE.

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Nitrox Streams
2+
3+
## Development
4+
5+
```ruby
6+
# demo.rb
7+
require 'lnd-client'
8+
9+
puts LNDClient.version
10+
```
11+
12+
```sh
13+
bundle exec ruby demo.rb
14+
```
15+
16+
## Upgrading gRPC
17+
18+
```
19+
bundle
20+
21+
mkdir grpc-upgrade
22+
cd grpc-upgrade
23+
24+
git clone https://github.com/googleapis/googleapis.git
25+
curl -o lightning.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/lightning.proto
26+
27+
grpc_tools_ruby_protoc --proto_path googleapis:. --ruby_out=. --grpc_out=. lightning.proto
28+
```

lnd-client.gemspec

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# frozen_string_literal: true
2+
3+
require_relative 'static/spec'
4+
5+
Gem::Specification.new do |spec|
6+
spec.name = Static::Spec[:name]
7+
spec.version = Static::Spec[:version]
8+
spec.authors = [Static::Spec[:author]]
9+
10+
spec.summary = Static::Spec[:summary]
11+
spec.description = Static::Spec[:description]
12+
13+
spec.homepage = Static::Spec[:github]
14+
15+
spec.license = Static::Spec[:license]
16+
17+
spec.required_ruby_version = Gem::Requirement.new('>= 3.2.0')
18+
19+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
20+
21+
spec.metadata['homepage_uri'] = spec.homepage
22+
spec.metadata['source_code_uri'] = Static::Spec[:github]
23+
24+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
25+
`git ls-files -z`.split("\x0").reject do |f|
26+
f.match(%r{\A(?:test|spec|features)/})
27+
end
28+
end
29+
30+
spec.require_paths = ['ports/dsl']
31+
32+
spec.add_dependency 'grpc', '~> 1.50'
33+
34+
spec.metadata['rubygems_mfa_required'] = 'true'
35+
end

ports/dsl.rb

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
require_relative '../static/spec'
4+
5+
module LNDClient
6+
def version
7+
Static::Spec[:version]
8+
end
9+
end

static/spec.rb

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
module Static
4+
SPEC = {
5+
name: 'lnd-client',
6+
version: '0.0.1',
7+
author: 'icebaker',
8+
summary: 'Lightning Network Daemon client for Ruby.',
9+
description: 'Lightning Network Daemon client for Ruby.',
10+
github: 'https://github.com/icebaker/lnd-client',
11+
license: 'MIT'
12+
}.freeze
13+
end

0 commit comments

Comments
 (0)