mumukit-content-type 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- Y2Y2OGZkMzkzYjA5MmFiYThjY2ZiNTBjYmU5NjFjMDg4MjQ3MzdmYQ==
5
- data.tar.gz: !binary |-
6
- NDc3OTg3YzFhNzk3ZDE5Mzk5NWM2NmIzMjI4YTgzM2VkZWVmN2I3MA==
2
+ SHA1:
3
+ metadata.gz: 3cef0ed456f41d1780064cd4182925cfc0f8eddc
4
+ data.tar.gz: ca77919a31e699f24cde5b4432c88aed271c2ecd
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZTljZDJiNGFiODZmZDQ2MGQzY2VjY2I1MTAxY2FhM2ZhOWE2MmZmMDEzNTlk
10
- MWE1N2YxMTM5ZmZmNWVkM2NiYWM0M2E0ZmU1OTk3ZTVkYmU3ZWQ1Y2QxOGU0
11
- YjkzOTc4OTIzZDUwYjRmMWI5MmRkMTVlM2FiNmZiZmU3OTU5OTI=
12
- data.tar.gz: !binary |-
13
- Nzk5ZTBjNDdjNWRmZTI2M2JlOWY4NmNmNGJiNGNiNzdmNzY5MGU1NDVkMTZl
14
- NGI1M2Y0ZmZjZjFhMGI0ODlkZjkyNzZhN2FmNGQ1ZTFjMmIyOTBmMjU3MDYx
15
- OWI3MjUwOTJhYzljMGI0OTg2M2E1NjQxNTdkZDVmMDc4M2Y4NzU=
6
+ metadata.gz: 0ceed53682cc7fdf37b2b52c3b1def93d431d852091da013442c171fe2e1e2a40d4dc53965430dc1e6e94eb5c00f031af0041cfba4582e2d47955946dbc235ef
7
+ data.tar.gz: 5d920b9159d27d157d767a4bc385c83c161a24bb3fa63f958cae5378daf1768da3861775f1c5b0f8112ad7cf9b6737d0e4906768dbaad41e18a392d65966919c
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .idea/*
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /Gemfile.lock
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.3.1
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
3
+ - 2.3.1
4
4
  deploy:
5
5
  provider: rubygems
6
6
  api_key:
@@ -6,6 +6,16 @@ require 'rouge/plugins/redcarpet'
6
6
  module Mumukit::ContentType::Markdown
7
7
  extend Mumukit::ContentType::BaseContentType
8
8
 
9
+ class HTML < MdEmoji::Render
10
+ include Rouge::Plugins::Redcarpet
11
+
12
+ def table(header, body)
13
+ "<table class=\"table\"><thead>\n#{header}</thead><tbody>\n#{body}</tbody></table>\n"
14
+ end
15
+ end
16
+
17
+ @@markdown = Redcarpet::Markdown.new(HTML, autolink: true, fenced_code_blocks: true, no_intra_emphasis: true, tables: true)
18
+
9
19
  def self.title(title)
10
20
  "**#{title}**"
11
21
  end
@@ -14,18 +24,24 @@ module Mumukit::ContentType::Markdown
14
24
  "\n```\n#{code}\n```\n\n"
15
25
  end
16
26
 
17
- class HTML < MdEmoji::Render
18
- include Rouge::Plugins::Redcarpet
27
+ def self.highlighted_code(language, code)
28
+ "```#{language}\n#{code}```"
29
+ end
19
30
 
20
- def table(header, body)
21
- "<table class=\"table\"><thead>\n#{header}</thead><tbody>\n#{body}</tbody></table>\n"
22
- end
31
+ def self.inline_code(code)
32
+ "`#{code}`"
23
33
  end
24
34
 
25
- @@markdown = Redcarpet::Markdown.new(HTML, autolink: true, fenced_code_blocks: true, no_intra_emphasis: true, tables: true)
35
+ def self.replace_mu_logo(content)
36
+ mumuki_logo = '<i class="text-primary da da-mumuki"></i>'
37
+ @@markdown
38
+ .render(content)
39
+ .gsub('<span class="err">ム</span>', mumuki_logo)
40
+ .gsub('ム', mumuki_logo)
41
+ end
26
42
 
27
43
  def self.to_html(content)
28
- @@markdown.render(content).html_safe if content
44
+ replace_mu_logo(content).html_safe if content
29
45
  end
30
46
 
31
47
  def self.name
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module ContentType
3
- VERSION = '0.2.1'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
@@ -9,7 +9,7 @@ module Mumukit
9
9
  end
10
10
 
11
11
  def self.parse(s)
12
- Kernel.const_get "Mumukit::ContentType::#{s.to_s.titlecase}"
12
+ "Mumukit::ContentType::#{s.to_s.titlecase}".constantize
13
13
  rescue
14
14
  raise "unknown content_type #{s}"
15
15
  end
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-content-type
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-08 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2.9'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.9'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rouge
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: redcarpet
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 3.3.2
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 3.3.2
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: md_emoji
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: mumukit-core
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0.1'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.1'
111
111
  description:
@@ -115,9 +115,10 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - .gitignore
119
- - .rspec
120
- - .travis.yml
118
+ - ".gitignore"
119
+ - ".rspec"
120
+ - ".ruby-version"
121
+ - ".travis.yml"
121
122
  - CODE_OF_CONDUCT.md
122
123
  - Gemfile
123
124
  - LICENSE.txt
@@ -136,19 +137,19 @@ homepage: http://mumuki.io
136
137
  licenses:
137
138
  - MIT
138
139
  metadata:
139
- allowed_push_host: ! 'TODO: Set to ''http://mygemserver.com'''
140
+ allowed_push_host: 'TODO: Set to ''http://mygemserver.com'''
140
141
  post_install_message:
141
142
  rdoc_options: []
142
143
  require_paths:
143
144
  - lib
144
145
  required_ruby_version: !ruby/object:Gem::Requirement
145
146
  requirements:
146
- - - ! '>='
147
+ - - ">="
147
148
  - !ruby/object:Gem::Version
148
149
  version: '0'
149
150
  required_rubygems_version: !ruby/object:Gem::Requirement
150
151
  requirements:
151
- - - ! '>='
152
+ - - ">="
152
153
  - !ruby/object:Gem::Version
153
154
  version: '0'
154
155
  requirements: []