rouge-lexers-docker 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6fdfdd6717d7f1a4509bbee04b19e2faed147ccd
4
+ data.tar.gz: fc5eecb16cdc96beffc39a67af63f40470b26f3a
5
+ SHA512:
6
+ metadata.gz: 04f151748d28f160a471608d7850c935ab9399b81dc0636db7792e04f0673823d4d46ae089747626b8bcf943a2187e9a9e15e3355a70a4b2fd84a4b64a76842d
7
+ data.tar.gz: b97f0aaa853bd2e5fd2ca02215bc4a41e42bca5335e8c912d52242592d234629af973766092fed4612820603313e0ef1ef65dfdc73cb884455cd9d13e144d013
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ README.md
3
+ ChangeLog.md
4
+
5
+ COPYING.txt
@@ -0,0 +1,5 @@
1
+ /.bundle
2
+ /Gemfile.lock
3
+ /html/
4
+ /pkg/
5
+ /vendor/cache/*.gem
@@ -0,0 +1,16 @@
1
+ --- !ruby/object:RDoc::Options
2
+ encoding: UTF-8
3
+ static_path: []
4
+ rdoc_include:
5
+ - .
6
+ charset: UTF-8
7
+ exclude:
8
+ hyperlink_all: false
9
+ line_numbers: false
10
+ main_page: README.md
11
+ markup: markdown
12
+ show_hash: false
13
+ tab_width: 8
14
+ title: rouge-lexers-docker Documentation
15
+ visibility: :protected
16
+ webcvs:
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour --format documentation
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
@@ -0,0 +1,4 @@
1
+ ### 0.1.0 / 2015-12-20
2
+
3
+ * Initial release:
4
+
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,53 @@
1
+ Rouge::Lexers::Docker
2
+ ===================
3
+
4
+ * [Homepage](https://rubygems.org/gems/rouge-lexers-docker)
5
+ * [Documentation](http://rubydoc.info/gems/rouge-lexers-docker/frames)
6
+ * [Email](mailto:KitaitiMakoto at gmail.com)
7
+
8
+ Description
9
+ -----------
10
+
11
+ Rouge lexer for Dockerfiles.
12
+
13
+ Features
14
+ --------
15
+
16
+ Parses and markups Dockerfiles.
17
+
18
+ Examples
19
+ --------
20
+
21
+ require 'rouge'
22
+ require 'rouge/lexers/docker'
23
+
24
+ dockerfile = ARGV.shift
25
+ abort 'USAGE: ruby rougify-dockerfile.rb DOCKERFILE' unless dockerfile
26
+
27
+ content = File.read(dockerfile)
28
+ lexer = Rouge::Lexers::Docker.new
29
+ lexed = lexer.lex(content)
30
+
31
+ formatter = Rouge::Formatters::Terminal256.new
32
+ # or formatter = Rouge::Formatters::HTML.new(wrap: false)
33
+ highlighted = formatter.format(lexed)
34
+ print highlighted
35
+
36
+ Requirements
37
+ ------------
38
+
39
+ [Rouge][] gem.
40
+
41
+ [Rouge]: https://github.com/jneen/rouge
42
+
43
+ Install
44
+ -------
45
+
46
+ $ gem install rouge-lexers-docker
47
+
48
+ Copyright
49
+ ---------
50
+
51
+ Copyright (c) 2015 KITAITI Makoto
52
+
53
+ See COPYING.txt for details.
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+
5
+ begin
6
+ require 'bundler/setup'
7
+ rescue LoadError => e
8
+ abort e.message
9
+ end
10
+
11
+ require 'rake'
12
+
13
+
14
+ require 'rubygems/tasks'
15
+ Gem::Tasks.new
16
+
17
+ require 'rdoc/task'
18
+ RDoc::Task.new
19
+ task :doc => :rdoc
20
+
21
+ require 'rspec/core/rake_task'
22
+ RSpec::Core::RakeTask.new
23
+
24
+ task :test => :spec
25
+ task :default => :spec
@@ -0,0 +1,42 @@
1
+ # -*- coding: utf-8 -*- #
2
+ require 'rouge'
3
+
4
+ module Rouge
5
+ module Lexers
6
+ class Docker < RegexLexer
7
+ title "Docker"
8
+ desc "Dockerfile syntax"
9
+ tag 'docker'
10
+ aliases 'docker', 'dockerfile'
11
+ filenames 'Dockerfile', '*.docker'
12
+ mimetypes 'text/x-dockerfile-config'
13
+
14
+ KEYWORDS = %w(
15
+ FROM MAINTAINER CMD EXPOSE ENV ADD ENTRYPOINT VOLUME WORKDIR
16
+ ).join('|')
17
+
18
+ state :root do
19
+ rule /^(ONBUILD)(\s+)(#{KEYWORDS})(.*)/io do |m|
20
+ groups Keyword, Text::Whitespace, Keyword, Str
21
+ end
22
+
23
+ rule /^(#{KEYWORDS})\b(.*)/io do |m|
24
+ groups Keyword, Str
25
+ end
26
+
27
+ rule /#.*?$/, Comment
28
+
29
+ rule /^(ONBUILD\s+)?RUN(\s+)/i, Keyword, :run
30
+
31
+ rule /$\s*/m, Text
32
+ end
33
+
34
+ state :run do
35
+ rule /(.*\\\n)*.+/ do
36
+ delegate Shell
37
+ pop!
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,37 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "rouge-lexers-docker"
8
+ gem.version = "0.1.0"
9
+ gem.summary = %q{Rouge lexer for Dockerfiles}
10
+ gem.description = %q{Parses and markups Dockerfiles.}
11
+ gem.license = "LGPL"
12
+ gem.authors = ["KITAITI Makoto"]
13
+ gem.email = "KitaitiMakoto@gmail.com"
14
+ gem.homepage = "https://rubygems.org/gems/rouge-lexers-docker"
15
+
16
+ gem.files = `git ls-files`.split($/)
17
+
18
+ `git submodule --quiet foreach --recursive pwd`.split($/).each do |submodule|
19
+ submodule.sub!("#{Dir.pwd}/",'')
20
+
21
+ Dir.chdir(submodule) do
22
+ `git ls-files`.split($/).map do |subpath|
23
+ gem.files << File.join(submodule,subpath)
24
+ end
25
+ end
26
+ end
27
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
28
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
29
+ gem.require_paths = ['lib']
30
+
31
+ gem.add_development_dependency 'rouge'
32
+ gem.add_development_dependency 'bundler', '~> 1.10'
33
+ gem.add_development_dependency 'rake', '~> 10.0'
34
+ gem.add_development_dependency 'rdoc', '~> 4.0'
35
+ gem.add_development_dependency 'rspec', '~> 3.0'
36
+ gem.add_development_dependency 'rubygems-tasks', '~> 0.2'
37
+ end
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+ require 'rouge/lexers/docker'
3
+
4
+ describe Rouge::Lexers::Docker do
5
+ it "should have a VERSION constant" do
6
+ expect(subject.const_get('VERSION')).to_not be_empty
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ require 'rspec'
2
+ require 'rouge/lexers/docker/version'
3
+
4
+ include Rouge::Lexers::Docker
metadata ADDED
@@ -0,0 +1,142 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rouge-lexers-docker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - KITAITI Makoto
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rouge
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
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: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rdoc
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '4.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '4.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubygems-tasks
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.2'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.2'
97
+ description: Parses and markups Dockerfiles.
98
+ email: KitaitiMakoto@gmail.com
99
+ executables: []
100
+ extensions: []
101
+ extra_rdoc_files: []
102
+ files:
103
+ - ".document"
104
+ - ".gitignore"
105
+ - ".rdoc_options"
106
+ - ".rspec"
107
+ - COPYING.txt
108
+ - ChangeLog.md
109
+ - Gemfile
110
+ - README.md
111
+ - Rakefile
112
+ - lib/rouge/lexers/docker.rb
113
+ - rouge-lexers-docker.gemspec
114
+ - spec/docker_spec.rb
115
+ - spec/spec_helper.rb
116
+ homepage: https://rubygems.org/gems/rouge-lexers-docker
117
+ licenses:
118
+ - LGPL
119
+ metadata: {}
120
+ post_install_message:
121
+ rdoc_options: []
122
+ require_paths:
123
+ - lib
124
+ required_ruby_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ required_rubygems_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ requirements: []
135
+ rubyforge_project:
136
+ rubygems_version: 2.4.6
137
+ signing_key:
138
+ specification_version: 4
139
+ summary: Rouge lexer for Dockerfiles
140
+ test_files:
141
+ - spec/docker_spec.rb
142
+ - spec/spec_helper.rb