duniter_rb_cli 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +84 -0
- data/LICENSE.txt +543 -0
- data/README.md +43 -0
- data/Rakefile +14 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/duniter_rb_cli.gemspec +62 -0
- data/exe/duniter_rb_cli +18 -0
- data/ext/duniter_rb_cli/duniter_rb_cli.c +9 -0
- data/ext/duniter_rb_cli/duniter_rb_cli.h +6 -0
- data/ext/duniter_rb_cli/extconf.rb +3 -0
- data/lib/duniter_rb_cli.rb +6 -0
- data/lib/duniter_rb_cli/cli.rb +48 -0
- data/lib/duniter_rb_cli/command.rb +131 -0
- data/lib/duniter_rb_cli/commands/.gitkeep +1 -0
- data/lib/duniter_rb_cli/commands/config.rb +24 -0
- data/lib/duniter_rb_cli/commands/config/network.rb +34 -0
- data/lib/duniter_rb_cli/commands/wot_count.rb +34 -0
- data/lib/duniter_rb_cli/commands/wot_list.rb +36 -0
- data/lib/duniter_rb_cli/templates/.gitkeep +1 -0
- data/lib/duniter_rb_cli/templates/config/network/.gitkeep +1 -0
- data/lib/duniter_rb_cli/templates/wot_count/.gitkeep +1 -0
- data/lib/duniter_rb_cli/templates/wot_list/.gitkeep +1 -0
- data/lib/duniter_rb_cli/version.rb +3 -0
- metadata +229 -0
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../command'
|
4
|
+
require_relative './config/network'
|
5
|
+
require "httparty"
|
6
|
+
|
7
|
+
module DuniterRbCli
|
8
|
+
module Commands
|
9
|
+
class WotList < DuniterRbCli::Command
|
10
|
+
def initialize(options)
|
11
|
+
@options = options
|
12
|
+
@config = config
|
13
|
+
@config.filename = 'network'
|
14
|
+
@config.extname = '.yml'
|
15
|
+
@config.append_path Dir.pwd
|
16
|
+
@config.append_path Dir.home
|
17
|
+
if @config.exist?
|
18
|
+
@actual_config = @config.read
|
19
|
+
else
|
20
|
+
puts 'Missing some config'
|
21
|
+
DuniterRbCli::Commands::Config::Network.new(options).execute
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def execute(input: $stdin, output: $stdout)
|
26
|
+
endpoint = @config.fetch(:base_url) + "wot/members"
|
27
|
+
response = HTTParty.get endpoint
|
28
|
+
wot_list = response['results']
|
29
|
+
wot_list.each_with_index do |wot_member, index|
|
30
|
+
puts "#{wot_member['uid']}: #{wot_member['pubkey']}"
|
31
|
+
end
|
32
|
+
output.puts "OK"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
#
|
@@ -0,0 +1 @@
|
|
1
|
+
#
|
@@ -0,0 +1 @@
|
|
1
|
+
#
|
@@ -0,0 +1 @@
|
|
1
|
+
#
|
metadata
ADDED
@@ -0,0 +1,229 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: duniter_rb_cli
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Vincent REHM
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-01-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.20.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.20.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: tty-command
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.8.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.8.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: tty-config
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.3.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.3.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: tty-prompt
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.18.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.18.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: tty-tree
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.2.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.2.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: httparty
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.13.7
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.13.7
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: bundler
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.16'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.16'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '10.0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '10.0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rake-compiler
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '3.0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '3.0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry-byebug
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '3.6'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '3.6'
|
167
|
+
description: Manipulate easily BMA endpoints in Duniter's nodes.
|
168
|
+
email:
|
169
|
+
- vincentrehm@protonmail.com
|
170
|
+
executables:
|
171
|
+
- duniter_rb_cli
|
172
|
+
extensions:
|
173
|
+
- ext/duniter_rb_cli/extconf.rb
|
174
|
+
extra_rdoc_files: []
|
175
|
+
files:
|
176
|
+
- ".gitignore"
|
177
|
+
- ".rspec"
|
178
|
+
- ".travis.yml"
|
179
|
+
- CODE_OF_CONDUCT.md
|
180
|
+
- Gemfile
|
181
|
+
- Gemfile.lock
|
182
|
+
- LICENSE.txt
|
183
|
+
- README.md
|
184
|
+
- Rakefile
|
185
|
+
- bin/console
|
186
|
+
- bin/setup
|
187
|
+
- duniter_rb_cli.gemspec
|
188
|
+
- exe/duniter_rb_cli
|
189
|
+
- ext/duniter_rb_cli/duniter_rb_cli.c
|
190
|
+
- ext/duniter_rb_cli/duniter_rb_cli.h
|
191
|
+
- ext/duniter_rb_cli/extconf.rb
|
192
|
+
- lib/duniter_rb_cli.rb
|
193
|
+
- lib/duniter_rb_cli/cli.rb
|
194
|
+
- lib/duniter_rb_cli/command.rb
|
195
|
+
- lib/duniter_rb_cli/commands/.gitkeep
|
196
|
+
- lib/duniter_rb_cli/commands/config.rb
|
197
|
+
- lib/duniter_rb_cli/commands/config/network.rb
|
198
|
+
- lib/duniter_rb_cli/commands/wot_count.rb
|
199
|
+
- lib/duniter_rb_cli/commands/wot_list.rb
|
200
|
+
- lib/duniter_rb_cli/templates/.gitkeep
|
201
|
+
- lib/duniter_rb_cli/templates/config/network/.gitkeep
|
202
|
+
- lib/duniter_rb_cli/templates/wot_count/.gitkeep
|
203
|
+
- lib/duniter_rb_cli/templates/wot_list/.gitkeep
|
204
|
+
- lib/duniter_rb_cli/version.rb
|
205
|
+
homepage: https://github.com/vrehm/duniter-rb-cli
|
206
|
+
licenses:
|
207
|
+
- GPL-3.0
|
208
|
+
metadata:
|
209
|
+
allowed_push_host: https://rubygems.org
|
210
|
+
post_install_message:
|
211
|
+
rdoc_options: []
|
212
|
+
require_paths:
|
213
|
+
- lib
|
214
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
215
|
+
requirements:
|
216
|
+
- - ">="
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: '0'
|
219
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
|
+
requirements:
|
221
|
+
- - ">="
|
222
|
+
- !ruby/object:Gem::Version
|
223
|
+
version: '0'
|
224
|
+
requirements: []
|
225
|
+
rubygems_version: 3.0.2
|
226
|
+
signing_key:
|
227
|
+
specification_version: 4
|
228
|
+
summary: Lightweight CLI in Ruby manipulating Duniter's BMA API.
|
229
|
+
test_files: []
|