snipper 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,7 +44,7 @@ class Snipper
44
44
  f.puts text
45
45
  end
46
46
 
47
- syntax = @snippet.options[: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) ]
@@ -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 "## syntax: %s" % [ @options[:syntax] ] if @options[:syntax]
149
+ snippet.puts "## lang: %s" % [ @options[:syntax] ] if @options[:syntax]
150
150
  snippet.puts
151
151
  end
152
152
 
@@ -1,3 +1,3 @@
1
1
  class Snipper
2
- VERSION="0.0.1"
2
+ VERSION="0.0.2"
3
3
  end
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: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
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-26 00:00:00 +01:00
18
+ date: 2012-04-28 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency