Skip to content

Commit 0dcfb17

Browse files
committed
refactor(*): use standard indenting for heredocs
1 parent eece747 commit 0dcfb17

File tree

5 files changed

+64
-64
lines changed

5 files changed

+64
-64
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,12 @@ Alternatively, if you want a completely custom design, you can pass a string dir
297297

298298
```crystal
299299
def help_template : String
300-
<<-TXT
301-
My custom command help text!
300+
<<-TEXT
301+
My custom command help text!
302302
303-
Use:
304-
greet <name> [-c | --caps] [-h | --help]
305-
TXT
303+
Use:
304+
greet <name> [-c | --caps] [-h | --help]
305+
TEXT
306306
end
307307
```
308308

@@ -330,12 +330,12 @@ class StatCommand < Cling::MainCommand
330330
if File.exists? path
331331
info = File.info path
332332
stdout.puts <<-INFO
333-
name: #{path.basename}
334-
size: #{info.size}
335-
directory: #{info.directory?}
336-
symlink: #{info.symlink?}
337-
permissions: #{info.permissions}
338-
INFO
333+
name: #{path.basename}
334+
size: #{info.size}
335+
directory: #{info.directory?}
336+
symlink: #{info.symlink?}
337+
permissions: #{info.permissions}
338+
INFO
339339
else
340340
stderr.puts "No file found at that path"
341341
end

examples/stat/stat.cr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ class StatCommand < Cling::MainCommand
1717
if File.exists? path
1818
info = File.info path
1919
stdout.puts <<-INFO
20-
name: #{path.basename}
21-
size: #{info.size}
22-
directory: #{info.directory?}
23-
symlink: #{info.symlink?}
24-
permissions: #{info.permissions}
25-
INFO
20+
name: #{path.basename}
21+
size: #{info.size}
22+
directory: #{info.directory?}
23+
symlink: #{info.symlink?}
24+
permissions: #{info.permissions}
25+
INFO
2626
else
2727
stderr.puts "No file found at that path"
2828
end

spec/formatter_spec.cr

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,44 +32,44 @@ formatter = Cling::Formatter.new
3232
describe Cling::Formatter do
3333
it "generates a help template" do
3434
formatter.generate(command).chomp.should eq <<-HELP
35-
Greets a person
35+
Greets a person
3636
37-
Usage:
38-
\tgreet <arguments> [options]
37+
Usage:
38+
\tgreet <arguments> [options]
3939
40-
Commands:
41-
\twelcome sends a friendly welcome message
40+
Commands:
41+
\twelcome sends a friendly welcome message
4242
43-
Arguments:
44-
\tname the name of the person (required)
43+
Arguments:
44+
\tname the name of the person (required)
4545
46-
Options:
47-
\t-h, --help sends help information
48-
\t-v, --version sends the app version
49-
\t-c, --caps greet with caps
50-
HELP
46+
Options:
47+
\t-h, --help sends help information
48+
\t-v, --version sends the app version
49+
\t-c, --caps greet with caps
50+
HELP
5151
end
5252

5353
it "generates with a custom delimiter" do
5454
formatter.options.option_delim = '+'
5555

5656
formatter.generate(command).chomp.should eq <<-HELP
57-
Greets a person
57+
Greets a person
5858
59-
Usage:
60-
\tgreet <arguments> [options]
59+
Usage:
60+
\tgreet <arguments> [options]
6161
62-
Commands:
63-
\twelcome sends a friendly welcome message
62+
Commands:
63+
\twelcome sends a friendly welcome message
6464
65-
Arguments:
66-
\tname the name of the person (required)
65+
Arguments:
66+
\tname the name of the person (required)
6767
68-
Options:
69-
\t+h, ++help sends help information
70-
\t+v, ++version sends the app version
71-
\t+c, ++caps greet with caps
72-
HELP
68+
Options:
69+
\t+h, ++help sends help information
70+
\t+v, ++version sends the app version
71+
\t+c, ++caps greet with caps
72+
HELP
7373
end
7474

7575
it "generates a description section" do
@@ -96,11 +96,11 @@ describe Cling::Formatter do
9696
String.build do |io|
9797
formatter.format_options(command, io)
9898
end.chomp.should eq <<-HELP
99-
Options:
100-
\t-h, --help sends help information
101-
\t-v, --version sends the app version
102-
\t-c, --caps greet with caps
99+
Options:
100+
\t-h, --help sends help information
101+
\t-v, --version sends the app version
102+
\t-c, --caps greet with caps
103103
104-
HELP
104+
HELP
105105
end
106106
end

spec/helper_spec.cr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ describe Cling::MainCommand do
5151
command.execute "" rescue nil
5252

5353
io.to_s.chomp.should eq <<-HELP
54-
Runs some Crystal commands
54+
Runs some Crystal commands
5555
56-
Usage:
57-
\tmain [options]
56+
Usage:
57+
\tmain [options]
5858
59-
Commands:
60-
\tcontext
61-
\tformat
59+
Commands:
60+
\tcontext
61+
\tformat
6262
63-
Options:
64-
\t-h, --help sends help information
65-
\t-v, --version sends the app version
66-
HELP
63+
Options:
64+
\t-h, --help sends help information
65+
\t-v, --version sends the app version
66+
HELP
6767
end
6868

6969
it "runs the context command" do

spec/main_spec.cr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ describe Cling do
4141
command.execute "" rescue nil
4242

4343
io.to_s.should eq <<-HELP
44-
Greets a person
44+
Greets a person
4545
46-
Usage:
47-
\tgreet <arguments> [options]
46+
Usage:
47+
\tgreet <arguments> [options]
4848
49-
Arguments:
50-
\tname the name of the person (required)
49+
Arguments:
50+
\tname the name of the person (required)
5151
52-
Options:
53-
\t-c, --caps greet with caps
52+
Options:
53+
\t-c, --caps greet with caps
5454
55-
HELP
55+
HELP
5656
end
5757

5858
it "tests the main command" do

0 commit comments

Comments
 (0)