tempest-rb 0.2.0 → 0.2.1
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 +4 -4
- data/lib/tempest/cli.rb +7 -1
- data/lib/tempest/commands/follow.rb +35 -0
- data/lib/tempest/commands/tui.rb +1 -0
- data/lib/tempest/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 98586ffebeb3d2fecb23743e6fd174b33852fc948f87d89a854d7d966b6876dc
|
|
4
|
+
data.tar.gz: 4860e84c81350e30f25f440f95288dc6b9848356d5d74ed3ed8c0747d79bcfa2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d8958487876f35934dd7c1e5d960fa287cba393c7aa8cac0af5a468a14dfebf5fc9fe91fc735ce6ae90ea3ee5b10e8c5338c96100d6a0dd5e87262e0ec8d682
|
|
7
|
+
data.tar.gz: f095b78d7226913e275834cce66012414d493e91bd4515188de12d20a03aa447eab1569d3cb23f8456d394548b3f40f5aa507585e4940e180ca2b8d5b7e18bd5
|
data/lib/tempest/cli.rb
CHANGED
|
@@ -4,11 +4,12 @@ require_relative "commands/base"
|
|
|
4
4
|
require_relative "commands/whoami"
|
|
5
5
|
require_relative "commands/post"
|
|
6
6
|
require_relative "commands/feed"
|
|
7
|
+
require_relative "commands/follow"
|
|
7
8
|
require_relative "xrpc_client"
|
|
8
9
|
|
|
9
10
|
module Tempest
|
|
10
11
|
module CLI
|
|
11
|
-
SUBCOMMANDS = %w[tui post feed whoami].freeze
|
|
12
|
+
SUBCOMMANDS = %w[tui post feed whoami follow].freeze
|
|
12
13
|
|
|
13
14
|
module_function
|
|
14
15
|
|
|
@@ -66,6 +67,11 @@ module Tempest
|
|
|
66
67
|
argv: argv.drop(1), session: session, client: client,
|
|
67
68
|
stdout: stdout, stderr: stderr,
|
|
68
69
|
)
|
|
70
|
+
when "follow"
|
|
71
|
+
Tempest::Commands::Follow.call(
|
|
72
|
+
argv: argv.drop(1), session: session, client: client,
|
|
73
|
+
stdout: stdout, stderr: stderr,
|
|
74
|
+
)
|
|
69
75
|
end
|
|
70
76
|
end
|
|
71
77
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require_relative "../commands"
|
|
2
|
+
require_relative "../commands/base"
|
|
3
|
+
require_relative "../handle_lookup"
|
|
4
|
+
|
|
5
|
+
module Tempest
|
|
6
|
+
module Commands
|
|
7
|
+
module Follow
|
|
8
|
+
module_function
|
|
9
|
+
|
|
10
|
+
def call(argv:, session:, client:, stdout:, stderr:)
|
|
11
|
+
handle = argv.first&.sub(/\A@/, "")
|
|
12
|
+
if handle.nil? || handle.empty?
|
|
13
|
+
stderr.puts "usage: tempest follow <handle>"
|
|
14
|
+
return 64
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
did = Tempest::HandleLookup.resolve(handle, client: client)
|
|
18
|
+
client.post(
|
|
19
|
+
"com.atproto.repo.createRecord",
|
|
20
|
+
body: {
|
|
21
|
+
"repo" => session.did,
|
|
22
|
+
"collection" => "app.bsky.graph.follow",
|
|
23
|
+
"record" => {
|
|
24
|
+
"$type" => "app.bsky.graph.follow",
|
|
25
|
+
"subject" => did,
|
|
26
|
+
"createdAt" => Time.now.utc.iso8601,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
)
|
|
30
|
+
stdout.puts "Followed @#{handle}"
|
|
31
|
+
0
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
data/lib/tempest/commands/tui.rb
CHANGED
|
@@ -296,6 +296,7 @@ module Tempest
|
|
|
296
296
|
feed me|timeline|author <handle> [opts]
|
|
297
297
|
read posts; --format=line|json|raw, --since, --until, --limit
|
|
298
298
|
whoami print the signed-in identity
|
|
299
|
+
follow <handle> follow a Bluesky account
|
|
299
300
|
|
|
300
301
|
TUI options:
|
|
301
302
|
-h, --help Show this help
|
data/lib/tempest/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tempest-rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yuya Fujiwara
|
|
@@ -97,6 +97,7 @@ files:
|
|
|
97
97
|
- lib/tempest/commands.rb
|
|
98
98
|
- lib/tempest/commands/base.rb
|
|
99
99
|
- lib/tempest/commands/feed.rb
|
|
100
|
+
- lib/tempest/commands/follow.rb
|
|
100
101
|
- lib/tempest/commands/post.rb
|
|
101
102
|
- lib/tempest/commands/tui.rb
|
|
102
103
|
- lib/tempest/commands/whoami.rb
|