Skip to content

Commit 09336b2

Browse files
committed
Cleanup [skip ci]
1 parent 8aff98c commit 09336b2

File tree

6 files changed

+17
-21
lines changed

6 files changed

+17
-21
lines changed

lib/readwise/cli.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ def show_help
6161
HELP
6262
end
6363
end
64-
end
64+
end

lib/readwise/cli/base_command.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_api_client
5656
puts "Error: READWISE_API_KEY environment variable is not set"
5757
exit 1
5858
end
59-
59+
6060
Readwise::Client.new(token: token)
6161
end
6262

@@ -105,4 +105,4 @@ def run(args)
105105
end
106106
end
107107
end
108-
end
108+
end

lib/readwise/cli/command_registry.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ def self.all_commands
2121
end
2222

2323
# Register available commands
24-
require_relative 'document/create_command'
24+
require_relative 'document/create_command'

lib/readwise/cli/document/create_command.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def run(args)
9292
client = get_api_client
9393
document_create = Readwise::DocumentCreate.new(**document_params)
9494
document = client.create_document(document: document_create)
95-
95+
9696
puts "Document created successfully!"
9797
puts "ID: #{document.id}"
9898
puts "Title: #{document.title}"
@@ -124,4 +124,4 @@ def build_document_params(html_content, html_file)
124124
end
125125

126126
# Register this command
127-
Readwise::CLI::CommandRegistry.register('document', 'create', Readwise::CLI::Document::CreateCommand)
127+
Readwise::CLI::CommandRegistry.register('document', 'create', Readwise::CLI::Document::CreateCommand)

spec/cli_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,29 @@ def run_cli_without_token(*args)
2929
describe 'help and error handling' do
3030
it 'shows help when --help is passed' do
3131
stdout, stderr, status = run_cli('--help')
32-
32+
3333
expect(status.success?).to be true
3434
expect(stdout).to include('Usage: readwise')
3535
expect(stdout).to include('Available commands:')
3636
end
3737

3838
it 'shows help when no arguments are provided' do
3939
stdout, stderr, status = run_cli()
40-
40+
4141
expect(status.success?).to be false
4242
expect(stdout).to include('Usage: readwise <resource> <action>')
4343
end
4444

4545
it 'shows error for unknown command' do
4646
stdout, stderr, status = run_cli('unknown', 'command')
47-
47+
4848
expect(status.success?).to be false
4949
expect(stdout).to include("Error: Unknown command 'unknown command'")
5050
end
5151

5252
it 'shows error when resource or action is missing' do
5353
stdout, stderr, status = run_cli('document')
54-
54+
5555
expect(status.success?).to be false
5656
expect(stdout).to include('Error: Resource and action are required')
5757
end
@@ -60,43 +60,43 @@ def run_cli_without_token(*args)
6060
describe 'document create command' do
6161
it 'shows help for document create command' do
6262
stdout, stderr, status = run_cli('document', 'create', '--help')
63-
63+
6464
expect(status.success?).to be true
6565
expect(stdout).to include('Usage: readwise document create')
6666
expect(stdout).to include('Sends HTML content to Readwise Reader API')
6767
end
6868

6969
it 'shows error when no HTML file is provided' do
7070
stdout, stderr, status = run_cli('document', 'create')
71-
71+
7272
expect(status.success?).to be false
7373
expect(stdout).to include('Error: HTML file path is required (use --file or -f)')
7474
end
7575

7676
it 'shows error when file does not exist' do
7777
stdout, stderr, status = run_cli('document', 'create', '--file', 'nonexistent.html')
78-
78+
7979
expect(status.success?).to be false
8080
expect(stdout).to include("Error: File 'nonexistent.html' not found")
8181
end
8282

8383
it 'shows error when READWISE_API_KEY is not set' do
8484
stdout, stderr, status = run_cli_without_token('document', 'create', '--file', temp_file.path)
85-
85+
8686
expect(status.success?).to be false
8787
expect(stdout).to include('Error: READWISE_API_KEY environment variable is not set')
8888
end
8989

9090
it 'shows error for invalid location' do
9191
stdout, stderr, status = run_cli('document', 'create', '--location=invalid', '--file', temp_file.path)
92-
92+
9393
expect(status.success?).to be false
9494
expect(stdout).to include('Error: Invalid location. Must be one of: new, later, archive, feed')
9595
end
9696

9797
it 'shows error for invalid category' do
9898
stdout, stderr, status = run_cli('document', 'create', '--category=invalid', '--file', temp_file.path)
99-
99+
100100
expect(status.success?).to be false
101101
expect(stdout).to include('Error: Invalid category. Must be one of: article, email, rss, highlight, note, pdf, epub, tweet, video')
102102
end
@@ -117,4 +117,4 @@ def run_cli_without_token(*args)
117117
unreadable_file.unlink
118118
end
119119
end
120-
end
120+
end

spec/readwise_spec.rb

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)