heredoc_unindent 1.0.1 → 1.0.2
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.
- data.tar.gz.sig +0 -0
- data/History.rdoc +7 -0
- data/README.rdoc +16 -20
- data/Rakefile +5 -1
- metadata +7 -7
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -8,35 +8,31 @@ Removes common margin from indented strings such as the ones produced by
|
|
8
8
|
heredocs, i.e., strips out leading whitespace chars at the beggining of
|
9
9
|
each line (but only as much as the line with the smallest margin).
|
10
10
|
|
11
|
-
It is acknowledged that many strings defined
|
12
|
-
code to be read exclusively by parsers (e.g., Kernel#eval
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
It is acknowledged that many strings defined by heredocs contain nothing but
|
12
|
+
code to be read exclusively by parsers (e.g., Kernel#eval), which are often
|
13
|
+
insensitive to extra indentation. Nevertheless, in the cases the string is
|
14
|
+
printed or displayed, the unintended indentation is rarely innocuous -- and
|
15
|
+
thus the reason for this gem.
|
16
16
|
|
17
17
|
== SYNOPSIS:
|
18
18
|
|
19
19
|
if true
|
20
|
-
|
21
|
-
|
20
|
+
s1 = <<-EOS
|
21
|
+
How sad it is
|
22
|
+
to be unable
|
23
|
+
to unindent heredocs
|
24
|
+
EOS
|
25
|
+
s2 = <<-EOS.unindent
|
26
|
+
How wonderful it is
|
22
27
|
to be able
|
23
|
-
to
|
28
|
+
to do it!
|
24
29
|
EOS
|
25
30
|
end
|
26
31
|
|
27
|
-
|
28
|
-
|
29
|
-
"How wonderful it is
|
30
|
-
to be able
|
31
|
-
to unindent heredocs"
|
32
|
-
|
33
|
-
instead of
|
34
|
-
|
35
|
-
"How wonderful it is
|
36
|
-
to be able
|
37
|
-
to unindent heredocs"
|
32
|
+
s1[0, 13] #=> " How sad"
|
33
|
+
s2[0, 13] #=> "How wonderful"
|
38
34
|
|
39
|
-
|
35
|
+
" foo\n bar\n baz".unindent #=> "foo\n bar\nbaz"
|
40
36
|
|
41
37
|
== REQUIREMENTS:
|
42
38
|
|
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@ require 'hoe'
|
|
6
6
|
Hoe.spec 'heredoc_unindent' do
|
7
7
|
developer('Adriano Mitre', 'adriano.mitre@gmail.com')
|
8
8
|
|
9
|
-
self.version = '1.0.
|
9
|
+
self.version = '1.0.2'
|
10
10
|
|
11
11
|
self.readme_file = 'README.rdoc'
|
12
12
|
self.history_file = 'History.rdoc'
|
@@ -20,3 +20,7 @@ end
|
|
20
20
|
task :tests => [:test] do
|
21
21
|
# aliasing :test with :tests for RVM ('rvm tests')
|
22
22
|
end
|
23
|
+
|
24
|
+
task :clean_all => [:clean] do
|
25
|
+
rm_rf '.yardoc/'
|
26
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 2
|
9
|
+
version: 1.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Adriano Mitre
|
@@ -58,11 +58,11 @@ description: |-
|
|
58
58
|
heredocs, i.e., strips out leading whitespace chars at the beggining of
|
59
59
|
each line (but only as much as the line with the smallest margin).
|
60
60
|
|
61
|
-
It is acknowledged that many strings defined
|
62
|
-
code to be read exclusively by parsers (e.g., Kernel#eval
|
63
|
-
|
64
|
-
|
65
|
-
|
61
|
+
It is acknowledged that many strings defined by heredocs contain nothing but
|
62
|
+
code to be read exclusively by parsers (e.g., Kernel#eval), which are often
|
63
|
+
insensitive to extra indentation. Nevertheless, in the cases the string is
|
64
|
+
printed or displayed, the unintended indentation is rarely innocuous -- and
|
65
|
+
thus the reason for this gem.
|
66
66
|
email:
|
67
67
|
- adriano.mitre@gmail.com
|
68
68
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|