rembrandt 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 586a9a58bb833d6fedb3bba1861445ff3c2b8b41
|
4
|
+
data.tar.gz: 106a4f5990356d6ed2ff8aec46f489b8557640a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74f1d4257baafabe27a16f1440c03c655692caaf18c0dd31d3d54a140c11dd6864dd047f704d353ed004e8019d621ebe7a11342ed0a1e5695c2d1d19b243d316
|
7
|
+
data.tar.gz: 992527bc9dbb36a77f8bf8e22b0add05707a9d9e95cc1dfe6ec584b91f87e153b16050989ef8211c8a08164fe506adb3f9966f2316d86750e68c192adea45441
|
@@ -2,10 +2,12 @@ module Rembrandt
|
|
2
2
|
module Engines
|
3
3
|
class Pygmentize
|
4
4
|
def highlight(input, language)
|
5
|
-
tmp_file = File.open("
|
5
|
+
tmp_file = File.open(".colorize_temp", "w")
|
6
6
|
tmp_file.write(input)
|
7
7
|
tmp_file.close
|
8
|
-
`pygmentize -f html -l #{language}
|
8
|
+
output = `pygmentize -f html -l #{language} .colorize_temp`
|
9
|
+
`rm .colorize_temp`
|
10
|
+
output
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
data/lib/rembrandt/version.rb
CHANGED
data/lib/rembrandt.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
|
1
|
+
require_relative "rembrandt/version"
|
2
|
+
require_relative "rembrandt/highlighter"
|
3
|
+
require_relative "rembrandt/engines/pygmentize"
|
4
|
+
require_relative "rembrandt/engines/web_service"
|
5
|
+
require_relative "rembrandt/formatters/table"
|
2
6
|
|
3
7
|
module Rembrandt
|
4
8
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rembrandt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Casimir
|
@@ -114,7 +114,6 @@ files:
|
|
114
114
|
- lib/rembrandt/highlighter.rb
|
115
115
|
- lib/rembrandt/version.rb
|
116
116
|
- rembrandt.gemspec
|
117
|
-
- support/vcr_cassettes/web_engine_highlights_ruby_sample_1.yml
|
118
117
|
- test/rembrandt/engines/pygmentize_test.rb
|
119
118
|
- test/rembrandt/engines/web_service_test.rb
|
120
119
|
- test/rembrandt/formatters/table_test.rb
|
@@ -1,46 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: http://pygmentize.herokuapp.com/
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: lang=ruby&code=class+Sample%0A++def+a_method%0A++++puts+%22Some+String%22%0A++end%0Aend
|
9
|
-
headers:
|
10
|
-
Accept-Encoding:
|
11
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
-
Accept:
|
13
|
-
- '*/*'
|
14
|
-
User-Agent:
|
15
|
-
- Ruby
|
16
|
-
Host:
|
17
|
-
- pygmentize.herokuapp.com
|
18
|
-
Content-Type:
|
19
|
-
- application/x-www-form-urlencoded
|
20
|
-
response:
|
21
|
-
status:
|
22
|
-
code: 200
|
23
|
-
message: OK
|
24
|
-
headers:
|
25
|
-
Content-Type:
|
26
|
-
- text/html; charset=utf-8
|
27
|
-
Date:
|
28
|
-
- Sun, 22 Dec 2013 06:55:17 GMT
|
29
|
-
Server:
|
30
|
-
- Werkzeug/0.8.1 Python/2.7.1
|
31
|
-
Content-Length:
|
32
|
-
- '300'
|
33
|
-
Connection:
|
34
|
-
- keep-alive
|
35
|
-
body:
|
36
|
-
encoding: UTF-8
|
37
|
-
string: |
|
38
|
-
<div class="highlight"><pre><span class="k">class</span> <span class="nc">Sample</span>
|
39
|
-
<span class="k">def</span> <span class="nf">a_method</span>
|
40
|
-
<span class="nb">puts</span> <span class="s2">"Some String"</span>
|
41
|
-
<span class="k">end</span>
|
42
|
-
<span class="k">end</span>
|
43
|
-
</pre></div>
|
44
|
-
http_version:
|
45
|
-
recorded_at: Sun, 22 Dec 2013 06:55:17 GMT
|
46
|
-
recorded_with: VCR 2.8.0
|