console_renderer 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/console_renderer.rb +23 -25
  3. metadata +41 -75
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c4d9a107a5916160388a434d9319824e535f17cc
4
+ data.tar.gz: 48116e88f843e037cabd6fb410e36f2e72093fbe
5
+ SHA512:
6
+ metadata.gz: 9841f68ce2f356e3e7b4f2488b0cbb20ee19763ac5cea9701b5825121d96393b2c60cb0004ea773c2176f49a246ee2f3e1fd7332295f9b5dfb252bbd5c6b928d
7
+ data.tar.gz: 569d625955e6e15371e46fa191ab265cb2758760e0c658b43375117d1ce4699fc07f19c0665482873208551e953837a663d384b913f36db246b8714dd950b4a1
@@ -16,16 +16,16 @@ class ConsoleRenderer < Redcarpet::Render::Base
16
16
  bkp = c_line
17
17
  tokenizer.tokenize( line ) do |token|
18
18
  case token.group.to_s
19
- when "comment" then c_line = c_line + token.color(:green)
20
- when "constant" then c_line = c_line + token.color(:blue)
21
- when "expr" then c_line = c_line + token.color(:red)
22
- when "ident" then c_line = c_line + token.color(:white)
23
- when "keyword" then c_line = c_line + token.color(:yellow)
24
- when "normal" then c_line = c_line + token.color(:cyan)
25
- when "number" then c_line = c_line + token.color(:red)
26
- when "punct" then c_line = c_line + token.color(:white)
27
- when "string" then c_line = c_line + token.color(:red)
28
- when "symbol" then c_line = c_line + token.color(:green)
19
+ when "comment" then c_line = c_line + Rainbow(token).color(:green)
20
+ when "constant" then c_line = c_line + Rainbow(token).color(:blue)
21
+ when "expr" then c_line = c_line + Rainbow(token).color(:red)
22
+ when "ident" then c_line = c_line + Rainbow(token).color(:white)
23
+ when "keyword" then c_line = c_line + Rainbow(token).color(:yellow)
24
+ when "normal" then c_line = c_line + Rainbow(token).color(:cyan)
25
+ when "number" then c_line = c_line + Rainbow(token).color(:red)
26
+ when "punct" then c_line = c_line + Rainbow(token).color(:white)
27
+ when "string" then c_line = c_line + Rainbow(token).color(:red)
28
+ when "symbol" then c_line = c_line + Rainbow(token).color(:green)
29
29
  else c_line += token
30
30
  end
31
31
  end
@@ -44,7 +44,7 @@ class ConsoleRenderer < Redcarpet::Render::Base
44
44
  def block_quote(quote)
45
45
  ret = "\n"
46
46
  quote.split("\n").each do |line|
47
- ret += "|".color(:cyan) + line + "\n"
47
+ ret += Rainbow("|").color(:cyan) + line + "\n"
48
48
  end
49
49
  ret + "\n"
50
50
  end
@@ -56,14 +56,14 @@ class ConsoleRenderer < Redcarpet::Render::Base
56
56
  def header(text, header_level)
57
57
  text = "\n" + text + "\n"
58
58
  if header_level == 1
59
- text.bright.underline
59
+ Rainbow(text).bright.underline
60
60
  else
61
- text.underline
61
+ Rainbow(text).underline
62
62
  end
63
63
  end
64
64
 
65
65
  def hrule()
66
- "___________________________\n".color(:yellow)
66
+ Rainbow("___________________________\n").color(:yellow)
67
67
  end
68
68
 
69
69
  def list(contents, list_type)
@@ -74,10 +74,10 @@ class ConsoleRenderer < Redcarpet::Render::Base
74
74
  def list_item(text, list_type)
75
75
  case list_type
76
76
  when :unordered
77
- " " + "-".color(:cyan) + " " + text
77
+ " " + Rainbow("-").color(:cyan) + " " + text
78
78
  when :ordered
79
79
  @@listitemid += 1
80
- " " + (@@listitemid.to_s + ".").color(:cyan) + " " + text
80
+ " " + Rainbow(@@listitemid.to_s + ".").color(:cyan) + " " + text
81
81
  end
82
82
  end
83
83
 
@@ -98,7 +98,7 @@ class ConsoleRenderer < Redcarpet::Render::Base
98
98
  end
99
99
 
100
100
  def autolink(link, link_type)
101
- link.color(:cyan)
101
+ Rainbow(link).color(:cyan)
102
102
  end
103
103
 
104
104
  def codespan(code)
@@ -106,15 +106,15 @@ class ConsoleRenderer < Redcarpet::Render::Base
106
106
  end
107
107
 
108
108
  def double_emphasis(text)
109
- text.bright
109
+ Rainbow(text).bright
110
110
  end
111
111
 
112
112
  def emphasis(text)
113
- text.underline
113
+ Rainbow(text).underline
114
114
  end
115
115
 
116
116
  def image(link, title, alt_text)
117
- ("<" + (alt_text || "") + ">").color(:green) + ("(image at: " + (link || "") + ")").color(:cyan)
117
+ Rainbow("<" + (alt_text || "") + ">").color(:green) + Rainbow("(image at: " + (link || "") + ")").color(:cyan)
118
118
  end
119
119
 
120
120
  def linebreak()
@@ -122,7 +122,7 @@ class ConsoleRenderer < Redcarpet::Render::Base
122
122
  end
123
123
 
124
124
  def link(link, title, content)
125
- (content || "") + " " + ("<#{link}#{title ? " :" + title : ''}>").color(:cyan)
125
+ (content || "") + " " + Rainbow("<#{link}#{title ? " :" + title : ''}>").color(:cyan)
126
126
  end
127
127
 
128
128
  def raw_html(raw_html)
@@ -130,7 +130,7 @@ class ConsoleRenderer < Redcarpet::Render::Base
130
130
  end
131
131
 
132
132
  def triple_emphasis(text)
133
- text.bright.underline
133
+ Rainbow(text).bright.underline
134
134
  end
135
135
 
136
136
  def strikethrough(text)
@@ -138,8 +138,6 @@ class ConsoleRenderer < Redcarpet::Render::Base
138
138
  end
139
139
 
140
140
  def superscript(text)
141
- ("^" + text).color(:red)
141
+ Rainbow("^" + text).color(:red)
142
142
  end
143
143
  end
144
-
145
-
metadata CHANGED
@@ -1,107 +1,73 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: console_renderer
3
- version: !ruby/object:Gem::Version
4
- hash: 19
5
- prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 6
10
- version: 0.0.6
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.7
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Aditya Bhargava
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2012-03-09 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2014-08-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: redcarpet
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
26
17
  - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
32
20
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: rainbow
36
21
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
- requirements:
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rainbow
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
40
31
  - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
46
34
  type: :runtime
47
- version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: syntax
50
35
  prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
54
38
  - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 3
57
- segments:
58
- - 0
59
- version: "0"
60
- type: :runtime
61
- version_requirements: *id003
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
62
41
  description: A renderer for Redcarpet. Render Markdown to the command line!
63
42
  email: bluemangroupie@gmail.com
64
- executables:
43
+ executables:
65
44
  - console_renderer
66
45
  extensions: []
67
-
68
46
  extra_rdoc_files: []
69
-
70
- files:
71
- - lib/console_renderer.rb
47
+ files:
72
48
  - bin/console_renderer
49
+ - lib/console_renderer.rb
73
50
  homepage: https://github.com/egonSchiele/console_renderer
74
51
  licenses: []
75
-
52
+ metadata: {}
76
53
  post_install_message:
77
54
  rdoc_options: []
78
-
79
- require_paths:
55
+ require_paths:
80
56
  - lib
81
- required_ruby_version: !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ requirements:
84
59
  - - ">="
85
- - !ruby/object:Gem::Version
86
- hash: 3
87
- segments:
88
- - 0
89
- version: "0"
90
- required_rubygems_version: !ruby/object:Gem::Requirement
91
- none: false
92
- requirements:
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ requirements:
93
64
  - - ">="
94
- - !ruby/object:Gem::Version
95
- hash: 3
96
- segments:
97
- - 0
98
- version: "0"
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
99
67
  requirements: []
100
-
101
68
  rubyforge_project:
102
- rubygems_version: 1.8.25
69
+ rubygems_version: 2.2.2
103
70
  signing_key:
104
- specification_version: 3
71
+ specification_version: 4
105
72
  summary: A renderer for Redcarpet. Render Markdown to the command line.
106
73
  test_files: []
107
-