snipper 0.0.1 → 0.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/lib/snipper/output/pygments_output.rb +2 -1
- data/lib/snipper/snippet.rb +1 -1
- data/lib/snipper/version.rb +1 -1
- metadata +4 -4
|
@@ -44,7 +44,7 @@ class Snipper
|
|
|
44
44
|
f.puts text
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
syntax =
|
|
47
|
+
syntax = headers["lang"]
|
|
48
48
|
|
|
49
49
|
unless syntax
|
|
50
50
|
lexer = Pygments::Lexer.find_by_extname(File.extname(file))
|
|
@@ -58,6 +58,7 @@ class Snipper
|
|
|
58
58
|
|
|
59
59
|
raise "Unknown syntax #{syntax}" unless self.class.list_langs.include?(syntax)
|
|
60
60
|
|
|
61
|
+
|
|
61
62
|
html.puts "<H2>%s</H2>" % [ headers["description"] ] if headers["description"]
|
|
62
63
|
html.puts Pygments.highlight(text, :lexer => syntax, :options => {:linenos => "table", :style => theme})
|
|
63
64
|
html.puts "syntax: %s download: <a href='%s.raw'>raw</a>" % [ syntax, File.basename(file) ]
|
data/lib/snipper/snippet.rb
CHANGED
|
@@ -146,7 +146,7 @@ class Snipper
|
|
|
146
146
|
|
|
147
147
|
unless text.start_with?("##")
|
|
148
148
|
snippet.puts "## description: %s" % [ @options[:description] ] if @options[:description]
|
|
149
|
-
snippet.puts "##
|
|
149
|
+
snippet.puts "## lang: %s" % [ @options[:syntax] ] if @options[:syntax]
|
|
150
150
|
snippet.puts
|
|
151
151
|
end
|
|
152
152
|
|
data/lib/snipper/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: snipper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 27
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 2
|
|
10
|
+
version: 0.0.2
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- R.I.Pienaar
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2012-04-
|
|
18
|
+
date: 2012-04-28 00:00:00 +01:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|