minisyntax 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ module MiniSyntax
2
2
  module Highlighter
3
3
  module CSS
4
4
  def self.highlight(code)
5
- code.gsub! %r(( *)((\$[a-z\-_]+):(.+?);|([_\*]?[a-z\-]+:)(("|[^&])+?);|@import (.+?);|(([\.\#]?[a-z0-9\-_&:]+([,\s]\s*[\.\#]?[a-z0-9\-_&:]+)*))(\s*)\{(.*?\n\1)\})|@media (.+?)\{|@(include|extend) (.+?);)im do
5
+ code.gsub! %r(( *)((\$[a-z\-_]+):(.+?);|([_\*]?[a-z\-]+:)(("|[^&])+?);|@import (.+?);|(([\.\#]?[a-z0-9\-_&:]+([,\s]\s*[\.\#]?[a-z0-9\-_&:]+)*))(\s*)\{(.*?\n\1)\})|@media (.+?)\{|@include (.+?);|@extend (.+?);)im do
6
6
  intendation = $1
7
7
  if $3
8
8
  %Q(#{intendation}<var>#{$3}</var>:#{highlight_value($4)};)
@@ -27,11 +27,14 @@ module MiniSyntax
27
27
  elsif $14
28
28
  %Q(#{intendation}@<em>media</em> #{$14.gsub('and', '<em>and</em>')}{)
29
29
  elsif $15
30
- keyword = $15
31
- call = $16
32
- rule = call.gsub(/^([\.#]?[a-z\-_]+).*$/, '<b>\\1</b>')
30
+ call = $15
31
+ mixin = call.gsub(/^([a-z\-_]+).*$/, '<b>\\1</b>')
33
32
  parameter = call.gsub(/^.*?\((.+?)\)/) { "(#{highlight_value($1)})" }
34
- %Q(#{intendation}@<em>#{keyword}</em> #{rule}#{parameter};)
33
+ %Q(#{intendation}@<em>include</em> #{mixin}#{parameter};)
34
+ elsif $16
35
+ call = $16
36
+ rule = call.gsub(/^([\.#%]?[a-z\-_]+).*$/, '<b>\\1</b>')
37
+ %Q(#{intendation}@<em>extend</em> #{rule};)
35
38
  end
36
39
  end
37
40
  code.gsub! %r((<i>)?(//.*?$|/\*.*?\*/)) do
data/lib/minisyntax.rb CHANGED
@@ -2,7 +2,7 @@ module MiniSyntax
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 1
5
+ PATCH = 2
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
data/minisyntax.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "minisyntax"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nico Hagenburger"]
12
- s.date = "2012-12-06"
12
+ s.date = "2013-01-08"
13
13
  s.description = "A simple powerful syntax highlighter with minimal HTML output"
14
14
  s.email = "nico@hagenburger.net"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minisyntax
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-06 00:00:00.000000000Z
12
+ date: 2013-01-08 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70137403490000 !ruby/object:Gem::Requirement
16
+ requirement: &70219057981500 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.3.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70137403490000
24
+ version_requirements: *70219057981500
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &70137403489520 !ruby/object:Gem::Requirement
27
+ requirement: &70219057980520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70137403489520
35
+ version_requirements: *70219057980520
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jeweler
38
- requirement: &70137403489040 !ruby/object:Gem::Requirement
38
+ requirement: &70219057978940 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.5.2
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70137403489040
46
+ version_requirements: *70219057978940
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rcov
49
- requirement: &70137403488520 !ruby/object:Gem::Requirement
49
+ requirement: &70219057977660 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70137403488520
57
+ version_requirements: *70219057977660
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: nokogiri
60
- requirement: &70137403488040 !ruby/object:Gem::Requirement
60
+ requirement: &70219057976200 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 1.4.4
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70137403488040
68
+ version_requirements: *70219057976200
69
69
  description: A simple powerful syntax highlighter with minimal HTML output
70
70
  email: nico@hagenburger.net
71
71
  executables: []
@@ -111,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  segments:
113
113
  - 0
114
- hash: -1766550032169555269
114
+ hash: 506257264124259129
115
115
  required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements: