mumukit-content-type 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 117bd7dd214c2a5c756dbf6c99a2078f6faa896e
4
- data.tar.gz: 6aaed94c62cddba28c8a135a6fe1bb9e34c7f384
2
+ SHA256:
3
+ metadata.gz: 2da7e7173ce192c8b0a1dd3894552dc7fd7c8193fa9352d5f0a2711c43e2ce17
4
+ data.tar.gz: b4494893ecff3bb32e0889877d6f4b8fbb599e87e7d161c09c0875d1009fc8d1
5
5
  SHA512:
6
- metadata.gz: 39c8c25471f57580782ed118483ba7e8eb03ec0600fe5b308bab4a3dbb2f62e5780c16b3a7f323a3bb61034f2ad7e71993f2747a1e647668aeeef77b68f52e16
7
- data.tar.gz: 1fa95eaa20bc17d35a3afd29d74b8e0409e678e7c473648220f16ef502bb5f02f581b73e1887e2a292ee50c4fd0db9d032e0df06d0f7868cf0ec89bddcc700fb
6
+ metadata.gz: 89fa810b1b7eed726a3768a1cf2864ce125a8e2c0e3dc614766b43586d844c7344d9a42cf22658b34c5c35e8ab3b22ccc5a389a040f736b033a1631fc2ddef72
7
+ data.tar.gz: 28b7d67563ade5e986a3f2547e5ba4412564eaaa6c05c2252a74694d63efd1eb648ef8e618df31a62f3c5d02e36e9022dc62398914359057e3f86e8a3ad68282
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 Franco Leonardo Bulgarelli
3
+ Copyright (c) 2016 - 2017 Franco Leonardo Bulgarelli
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -25,4 +25,5 @@ require_relative './content_type/md_emoji'
25
25
  require_relative './content_type/markdown'
26
26
  require_relative './content_type/with_markdown'
27
27
  require_relative './content_type/plain'
28
- require_relative './content_type/html'
28
+ require_relative './content_type/html'
29
+ require_relative './content_type/gobstones'
@@ -0,0 +1,70 @@
1
+ # -*- coding: utf-8 -*- #
2
+
3
+ module Rouge
4
+ module Lexers
5
+ class Gobstones < RegexLexer
6
+ title 'Gobstones'
7
+ desc 'Gobstones language'
8
+ tag 'gobstones'
9
+ filenames '*.gbs'
10
+
11
+ def self.analyze_text(_text)
12
+ 0.3
13
+ end
14
+
15
+ reserved = %w(program interactive is return record
16
+ field variant case if then else switch to repeat while foreach
17
+ in match)
18
+
19
+ atoms = %w(False True Verde Rojo Vermelho Azul Negro Preto Norte Sur Sul Este Leste Oeste)
20
+
21
+ state :comments do
22
+ def comment_between(start, finish)
23
+ /#{start}.*?#{finish}/m
24
+ end
25
+
26
+ rule comment_between('{-', '-}'), Comment::Multiline
27
+ rule comment_between('\/\*', '\*\/'), Comment::Multiline
28
+ rule comment_between('"""', '"""'), Comment::Multiline
29
+ rule /((?<!<)-(?!>)|#|\/).*$/, Comment::Single
30
+ end
31
+
32
+ state :root do
33
+ def any(words)
34
+ /#{words.map { |word| word.concat('\\b') }.join('|')}/
35
+ end
36
+
37
+ mixin :comments
38
+ rule /\s+/, Text::Whitespace
39
+ rule any(reserved), Keyword::Reserved
40
+ rule any(atoms), Literal
41
+ rule /(type)(\s+)(\w+)/ do |m|
42
+ groups Keyword::Reserved, Text::Whitespace, Keyword::Type
43
+ end
44
+ mixin :functions
45
+ mixin :symbols
46
+ rule /\d+/, Literal::Number
47
+ rule /".+?"/, Literal::String
48
+ end
49
+
50
+ state :functions do
51
+ rule /(procedure|function)(\s+)(\w+)/ do
52
+ groups Keyword::Reserved, Text::Whitespace, Name::Function
53
+ end
54
+
55
+ rule /([a-zA-Z][a-zA-Z'_0-9]*)(\()/ do |m|
56
+ groups Name::Function, Text
57
+ end
58
+ rule /([a-z][a-zA-Z'_0-9]*)/, Name::Variable
59
+ end
60
+
61
+ state :symbols do
62
+ rule /:=|\.\.|\+\+|\.|_|->|<-/, Operator
63
+ rule /<=|<|>=|>|==|=/, Operator
64
+ rule /\|\||&&|\+|\*|-|\^/, Operator
65
+ rule /\(|\)|\{|\}/, Text
66
+ rule /,|;|:|\||\[|\]/, Text
67
+ end
68
+ end
69
+ end
70
+ end
@@ -11,6 +11,10 @@ module Mumukit::ContentType::Markdown
11
11
  def table(header, body)
12
12
  "<table class=\"table\"><thead>\n#{header}</thead><tbody>\n#{body}</tbody></table>\n"
13
13
  end
14
+
15
+ def link(link, title, content)
16
+ "<a title=\"#{title}\" href=\"#{link}\" target=\"_blank\">#{content}</a>"
17
+ end
14
18
  end
15
19
 
16
20
  @@markdown = Redcarpet::Markdown.new(HTML, autolink: true, fenced_code_blocks: true, no_intra_emphasis: true, tables: true)
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module ContentType
3
- VERSION = '1.1.0'
3
+ VERSION = '1.2.0'
4
4
  end
5
5
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency 'rake', '~> 10.0'
29
29
  spec.add_development_dependency 'rspec', '~>2.9'
30
30
 
31
- spec.add_dependency 'rouge'
31
+ spec.add_dependency 'rouge', '~> 3.1'
32
32
  spec.add_dependency 'redcarpet', '~> 3.3.2'
33
33
  spec.add_dependency 'mumukit-core', '~> 1.0'
34
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-content-type
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.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: 2017-05-22 00:00:00.000000000 Z
11
+ date: 2018-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: rouge
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '3.1'
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
- version: '0'
68
+ version: '3.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: redcarpet
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -113,6 +113,7 @@ files:
113
113
  - bin/console
114
114
  - bin/setup
115
115
  - lib/mumukit/content_type.rb
116
+ - lib/mumukit/content_type/gobstones.rb
116
117
  - lib/mumukit/content_type/html.rb
117
118
  - lib/mumukit/content_type/markdown.rb
118
119
  - lib/mumukit/content_type/md_emoji.rb
@@ -141,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
142
  version: '0'
142
143
  requirements: []
143
144
  rubyforge_project:
144
- rubygems_version: 2.4.5
145
+ rubygems_version: 2.7.4
145
146
  signing_key:
146
147
  specification_version: 4
147
148
  summary: Content Type handling for Mumuki