polytexnic 0.6.0 → 0.6.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/.pull_requests/1384446851 +0 -0
- data/lib/polytexnic/literal.rb +1 -1
- data/lib/polytexnic/version.rb +1 -1
- data/spec/markdown_to_polytex_spec.rb +12 -0
- data/spec/to_html/codelistings_spec.rb +21 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b446df53404a9a04b877d6cca7d2e597c8aeb248
|
4
|
+
data.tar.gz: 306bbb15becc07f985e2d670aa783e9715e07164
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9edb1dfa39ccd01042ee5990813dc2ee45e81c0eae11233a967e7285dfc81a05e089a69cfabe2708bc6061b3bd4769606ef52f1c87d2404e5b3f51efee94c5d
|
7
|
+
data.tar.gz: f829982d042ec3c585364dae133701ae3634957f1195a5d40678d6fe884920febc65a3d05c12425fd03a6e1f5ccfc879df612acd757a9bee49b54835876f7798
|
File without changes
|
data/lib/polytexnic/literal.rb
CHANGED
@@ -9,7 +9,7 @@ module Polytexnic
|
|
9
9
|
# Matches the line for code inclusion.
|
10
10
|
# %= <</path/to/code.ext
|
11
11
|
CODE_INCLUSION_REGEX = /^\s*%=\s+<<\s*\( # opening
|
12
|
-
\s*([\w
|
12
|
+
\s*([\w\/-]+\.?(\w*)) # path
|
13
13
|
(?:,\s*lang:\s*(\w+))? # optional lang
|
14
14
|
\s*\) # closing paren
|
15
15
|
/x
|
data/lib/polytexnic/version.rb
CHANGED
@@ -157,6 +157,18 @@ def foo; "bar"; end
|
|
157
157
|
it { should resemble '\label{code:lorem}' }
|
158
158
|
it { should resemble '\end{codelisting}' }
|
159
159
|
end
|
160
|
+
|
161
|
+
context "code inclusion inside codelisting" do
|
162
|
+
let(:source) do <<-'EOS'
|
163
|
+
\begin{codelisting}
|
164
|
+
\codecaption{Lorem ipsum.}
|
165
|
+
\label{code:lorem}
|
166
|
+
<<(/path/to/code)
|
167
|
+
\end{codelisting}
|
168
|
+
EOS
|
169
|
+
end
|
170
|
+
it { should resemble '%= <<(/path/to/code)' }
|
171
|
+
end
|
160
172
|
end
|
161
173
|
|
162
174
|
describe "source code" do
|
@@ -67,4 +67,25 @@ $ subl .gemrc
|
|
67
67
|
expect { processed_text }.not_to raise_error
|
68
68
|
end
|
69
69
|
end
|
70
|
+
|
71
|
+
describe "containing code inclusion with a hyphen" do
|
72
|
+
before do
|
73
|
+
File.write(File.join('spec', 'fixtures', 'name-with-hyphens.txt'), '')
|
74
|
+
end
|
75
|
+
after do
|
76
|
+
FileUtils.rm(File.join('spec', 'fixtures', 'name-with-hyphens.txt'))
|
77
|
+
end
|
78
|
+
let(:polytex) do <<-'EOS'
|
79
|
+
\begin{codelisting}
|
80
|
+
\codecaption{Foo}
|
81
|
+
\label{code:foo}
|
82
|
+
%= <<(spec/fixtures/name-with-hyphens.txt, lang: text)
|
83
|
+
\end{codelisting}
|
84
|
+
EOS
|
85
|
+
end
|
86
|
+
|
87
|
+
it "should not raise an error" do
|
88
|
+
expect { processed_text }.not_to raise_error
|
89
|
+
end
|
90
|
+
end
|
70
91
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polytexnic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Hartl
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -164,6 +164,7 @@ files:
|
|
164
164
|
- .pull_requests/1383263695
|
165
165
|
- .pull_requests/1383274008
|
166
166
|
- .pull_requests/1383327328
|
167
|
+
- .pull_requests/1384446851
|
167
168
|
- .rspec
|
168
169
|
- .ruby-gemset
|
169
170
|
- .ruby-version
|