codemerger 0.3.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.ruby-version +1 -0
- data/Gemfile +12 -3
- data/Gemfile.lock +132 -18
- data/LICENSE +22 -0
- data/README.markdown +2 -2
- data/Rakefile +42 -7
- data/VERSION +1 -0
- data/codemerger.gemspec +51 -33
- data/lib/codemerger/document_with_css.html.erb +48 -0
- data/lib/codemerger/merger.rb +59 -79
- data/lib/codemerger/rake_tasks.rb +9 -9
- data/lib/codemerger/version.rb +1 -1
- data/lib/codemerger.rb +2 -2
- data/test/merger_spec.rb +28 -36
- data/test/sample.rb +1 -1
- data/test/test2.markdown +5 -3
- data/test/test_helper.rb +7 -0
- data/test/version_spec.rb +4 -4
- metadata +135 -57
- data/.Gemfile.swp +0 -0
- data/.codemerger.gemspec.swp +0 -0
- data/.gitignore +0 -8
- data/.rvmrc +0 -41
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 138e0018aa36bcdef11297caa65360ba39db60afe8afc5d23f13e7d6897cbd05
|
4
|
+
data.tar.gz: 1e986254f52e0005d9effd651d281cd5e55b04b70b0358bbb40ecba81a6b1612
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bd032ec6da7b1c713240d098fe1f43c58ed8f1bfe050e6489c28605c6a7b4f69b736c49cebd61b6ac9cd8413deef4db75eacb6a646dec79f497c82564245f4bb
|
7
|
+
data.tar.gz: c6c06615c9e412e058d72271c30c53599d1c2718940aec7c233d44a447c8881caeca2a697e792f188edbfecae4de258e5a534c49d4a4e8a382313ac781d66fd5
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-3.3.7
|
data/Gemfile
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
|
-
gem
|
3
|
-
|
4
|
-
|
2
|
+
gem "kramdown"
|
3
|
+
gem "rake"
|
4
|
+
gem "rouge"
|
5
|
+
|
6
|
+
group :development, :test do
|
7
|
+
gem "simplecov", require: false
|
8
|
+
# gem "rspec"
|
9
|
+
gem "bundler"
|
10
|
+
gem "jeweler"
|
11
|
+
gem "minitest"
|
12
|
+
gem "rubocop"
|
13
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,27 +1,141 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
codemerger (0.3.2)
|
5
|
-
albino (= 1.3.3)
|
6
|
-
redcarpet (= 2.0.0b3)
|
7
|
-
|
8
1
|
GEM
|
9
2
|
remote: http://rubygems.org/
|
10
3
|
specs:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
4
|
+
addressable (2.4.0)
|
5
|
+
ast (2.4.2)
|
6
|
+
base64 (0.2.0)
|
7
|
+
bigdecimal (3.1.9)
|
8
|
+
builder (3.3.0)
|
9
|
+
date (3.4.1)
|
10
|
+
descendants_tracker (0.0.4)
|
11
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
12
|
+
docile (1.4.1)
|
13
|
+
faraday (0.9.2)
|
14
|
+
multipart-post (>= 1.2, < 3)
|
15
|
+
git (1.11.0)
|
16
|
+
rchardet (~> 1.8)
|
17
|
+
github_api (0.16.0)
|
18
|
+
addressable (~> 2.4.0)
|
19
|
+
descendants_tracker (~> 0.0.4)
|
20
|
+
faraday (~> 0.8, < 0.10)
|
21
|
+
hashie (>= 3.4)
|
22
|
+
mime-types (>= 1.16, < 3.0)
|
23
|
+
oauth2 (~> 1.0)
|
24
|
+
hashie (5.0.0)
|
25
|
+
highline (3.1.2)
|
26
|
+
reline
|
27
|
+
io-console (0.8.0)
|
28
|
+
jeweler (2.3.9)
|
29
|
+
builder
|
30
|
+
bundler
|
31
|
+
git (>= 1.2.5)
|
32
|
+
github_api (~> 0.16.0)
|
33
|
+
highline (>= 1.6.15)
|
34
|
+
nokogiri (>= 1.5.10)
|
35
|
+
psych
|
36
|
+
rake
|
37
|
+
rdoc
|
38
|
+
semver2
|
39
|
+
json (2.10.1)
|
40
|
+
jwt (2.10.1)
|
41
|
+
base64
|
42
|
+
kramdown (2.5.1)
|
43
|
+
rexml (>= 3.3.9)
|
44
|
+
language_server-protocol (3.17.0.4)
|
45
|
+
lint_roller (1.1.0)
|
46
|
+
mime-types (2.99.3)
|
47
|
+
minitest (5.25.4)
|
48
|
+
multi_json (1.15.0)
|
49
|
+
multi_xml (0.7.1)
|
50
|
+
bigdecimal (~> 3.1)
|
51
|
+
multipart-post (2.4.1)
|
52
|
+
nokogiri (1.18.3-aarch64-linux-gnu)
|
53
|
+
racc (~> 1.4)
|
54
|
+
nokogiri (1.18.3-aarch64-linux-musl)
|
55
|
+
racc (~> 1.4)
|
56
|
+
nokogiri (1.18.3-arm-linux-gnu)
|
57
|
+
racc (~> 1.4)
|
58
|
+
nokogiri (1.18.3-arm-linux-musl)
|
59
|
+
racc (~> 1.4)
|
60
|
+
nokogiri (1.18.3-arm64-darwin)
|
61
|
+
racc (~> 1.4)
|
62
|
+
nokogiri (1.18.3-x86_64-darwin)
|
63
|
+
racc (~> 1.4)
|
64
|
+
nokogiri (1.18.3-x86_64-linux-gnu)
|
65
|
+
racc (~> 1.4)
|
66
|
+
nokogiri (1.18.3-x86_64-linux-musl)
|
67
|
+
racc (~> 1.4)
|
68
|
+
oauth2 (1.4.8)
|
69
|
+
faraday (>= 0.8, < 3.0)
|
70
|
+
jwt (>= 1.0, < 3.0)
|
71
|
+
multi_json (~> 1.3)
|
72
|
+
multi_xml (~> 0.5)
|
73
|
+
rack (>= 1.2, < 3)
|
74
|
+
parallel (1.26.3)
|
75
|
+
parser (3.3.7.1)
|
76
|
+
ast (~> 2.4.1)
|
77
|
+
racc
|
78
|
+
psych (5.2.3)
|
79
|
+
date
|
80
|
+
stringio
|
81
|
+
racc (1.8.1)
|
82
|
+
rack (2.2.11)
|
83
|
+
rainbow (3.1.1)
|
84
|
+
rake (13.2.1)
|
85
|
+
rchardet (1.9.0)
|
86
|
+
rdoc (6.12.0)
|
87
|
+
psych (>= 4.0.0)
|
88
|
+
regexp_parser (2.10.0)
|
89
|
+
reline (0.6.0)
|
90
|
+
io-console (~> 0.5)
|
91
|
+
rexml (3.4.1)
|
92
|
+
rouge (4.5.1)
|
93
|
+
rubocop (1.72.2)
|
94
|
+
json (~> 2.3)
|
95
|
+
language_server-protocol (~> 3.17.0.2)
|
96
|
+
lint_roller (~> 1.1.0)
|
97
|
+
parallel (~> 1.10)
|
98
|
+
parser (>= 3.3.0.2)
|
99
|
+
rainbow (>= 2.2.2, < 4.0)
|
100
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
101
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
102
|
+
ruby-progressbar (~> 1.7)
|
103
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
104
|
+
rubocop-ast (1.38.0)
|
105
|
+
parser (>= 3.3.1.0)
|
106
|
+
ruby-progressbar (1.13.0)
|
107
|
+
semver2 (3.4.2)
|
108
|
+
simplecov (0.22.0)
|
109
|
+
docile (~> 1.1)
|
110
|
+
simplecov-html (~> 0.11)
|
111
|
+
simplecov_json_formatter (~> 0.1)
|
112
|
+
simplecov-html (0.13.1)
|
113
|
+
simplecov_json_formatter (0.1.4)
|
114
|
+
stringio (3.1.5)
|
115
|
+
thread_safe (0.3.6)
|
116
|
+
unicode-display_width (3.1.4)
|
117
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
118
|
+
unicode-emoji (4.0.4)
|
19
119
|
|
20
120
|
PLATFORMS
|
21
|
-
|
22
|
-
|
121
|
+
aarch64-linux-gnu
|
122
|
+
aarch64-linux-musl
|
123
|
+
arm-linux-gnu
|
124
|
+
arm-linux-musl
|
125
|
+
arm64-darwin
|
126
|
+
x86_64-darwin
|
127
|
+
x86_64-linux-gnu
|
128
|
+
x86_64-linux-musl
|
23
129
|
|
24
130
|
DEPENDENCIES
|
25
|
-
|
131
|
+
bundler
|
132
|
+
jeweler
|
133
|
+
kramdown
|
134
|
+
minitest
|
26
135
|
rake
|
136
|
+
rouge
|
137
|
+
rubocop
|
27
138
|
simplecov
|
139
|
+
|
140
|
+
BUNDLED WITH
|
141
|
+
2.5.22
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2018 Rodrigo Urubatan <rodrigo@urubatan.com.br>
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
CHANGED
@@ -4,7 +4,7 @@ To use this GEM I usually create a new directory for the post or post group proj
|
|
4
4
|
|
5
5
|
source "http://rubygems.org"
|
6
6
|
group :rake do
|
7
|
-
gem "codemerger", "0.
|
7
|
+
gem "codemerger", "0.5.0", :require => "codemerger/rake_tasks"
|
8
8
|
end
|
9
9
|
|
10
10
|
After that I create a Rakefile like this:
|
@@ -50,4 +50,4 @@ For the next steps I'm planning to write more automated tests, refactor the lang
|
|
50
50
|
|
51
51
|
All these changes are simple, but besides the automated tests, I do not need any of the other right now, if you think they will be usefull for you, send me a message, file an enhancement request or fork, implement and send me a pull request.
|
52
52
|
|
53
|
-
Any testing or comments will be of great value, today, I think only I'm using this GEM.
|
53
|
+
Any testing or comments will be of great value, today, I think only I'm using this GEM.
|
data/Rakefile
CHANGED
@@ -1,9 +1,44 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
|
5
|
-
|
6
|
-
Bundler::
|
1
|
+
require "rubygems"
|
2
|
+
require "bundler"
|
3
|
+
require "rake/testtask"
|
4
|
+
begin
|
5
|
+
Bundler.setup(:default, :development)
|
6
|
+
rescue Bundler::BundlerError => e
|
7
|
+
warn e.message
|
8
|
+
warn "Run `bundle install` to install missing gems"
|
9
|
+
exit e.status_code
|
10
|
+
end
|
11
|
+
|
12
|
+
require "jeweler"
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "codemerger"
|
16
|
+
gem.homepage = "https://github.com/urubatan/codemerger"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = %(Used to create blog posts and tecnical articles that need code samples, the code samples will be taken from the actual source code file instead of a copy paste approach)
|
19
|
+
gem.description = %{This gem is used to help writing technical posts for wordpress.
|
20
|
+
The output is copied and pasted to a post into my wordpress blog, and the code gets colored using the plugin wp-syntax, and the output can be turned into PDF with the plugin wp-mpdf.
|
21
|
+
|
22
|
+
Today this gem supports source files in the following languages:
|
23
|
+
|
24
|
+
* Ruby (including Rakefile and Gemfile)
|
25
|
+
* Java
|
26
|
+
* YAML
|
27
|
+
* HTML
|
28
|
+
* XML
|
29
|
+
* Scala
|
30
|
+
* CSS
|
31
|
+
* Javascript
|
32
|
+
* Bash
|
33
|
+
* Batch
|
34
|
+
|
35
|
+
All other files are configured as "text".}
|
36
|
+
gem.email = "rodrigo@urubatan.com.br"
|
37
|
+
gem.authors = [ "Rodrigo Urubatan" ]
|
38
|
+
# dependencies defined in Gemfile
|
39
|
+
end
|
40
|
+
Jeweler::RubygemsDotOrgTasks.new
|
41
|
+
|
7
42
|
Rake::TestTask.new do |t|
|
8
43
|
t.pattern = "test/*_spec.rb"
|
9
|
-
end
|
44
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.5.0
|
data/codemerger.gemspec
CHANGED
@@ -1,40 +1,58 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
1
4
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
require "codemerger/version"
|
5
|
+
# stub: codemerger 0.5.0 ruby lib
|
4
6
|
|
5
7
|
Gem::Specification.new do |s|
|
6
|
-
s.name
|
7
|
-
s.version
|
8
|
-
s.platform = Gem::Platform::RUBY
|
9
|
-
s.authors = ["Rodrigo Urubatan"]
|
10
|
-
s.email = ["rodrigo@urubatan.com.br"]
|
11
|
-
s.homepage = "https://github.com/urubatan/codemerger"
|
12
|
-
s.summary = %q{Used to create blog posts and tecnical articles that need code samples, the code samples will be taken from the actual source code file instead of a copy paste approach}
|
13
|
-
s.description = %q{This gem is used to help writing technical posts for wordpress.
|
14
|
-
The output is copied and pasted to a post into my wordpress blog, and the code gets colored using the plugin wp-syntax, and the output can be turned into PDF with the plugin wp-mpdf.
|
8
|
+
s.name = "codemerger".freeze
|
9
|
+
s.version = "0.5.0".freeze
|
15
10
|
|
16
|
-
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["Rodrigo Urubatan".freeze]
|
14
|
+
s.date = "2025-02-26"
|
15
|
+
s.description = "This gem is used to help writing technical posts for wordpress.\n The output is copied and pasted to a post into my wordpress blog, and the code gets colored using the plugin wp-syntax, and the output can be turned into PDF with the plugin wp-mpdf.\n\nToday this gem supports source files in the following languages:\n\n* Ruby (including Rakefile and Gemfile)\n* Java\n* YAML\n* HTML\n* XML\n* Scala\n* CSS\n* Javascript\n* Bash\n* Batch\n\nAll other files are configured as \"text\".".freeze
|
16
|
+
s.email = "rodrigo@urubatan.com.br".freeze
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE",
|
19
|
+
"README.markdown"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".ruby-version",
|
23
|
+
"Gemfile",
|
24
|
+
"Gemfile.lock",
|
25
|
+
"LICENSE",
|
26
|
+
"README.markdown",
|
27
|
+
"Rakefile",
|
28
|
+
"VERSION",
|
29
|
+
"codemerger.gemspec",
|
30
|
+
"lib/codemerger.rb",
|
31
|
+
"lib/codemerger/document_with_css.html.erb",
|
32
|
+
"lib/codemerger/merger.rb",
|
33
|
+
"lib/codemerger/rake_tasks.rb",
|
34
|
+
"lib/codemerger/version.rb",
|
35
|
+
"test/merger_spec.rb",
|
36
|
+
"test/sample.rb",
|
37
|
+
"test/test.html",
|
38
|
+
"test/test2.markdown",
|
39
|
+
"test/test_helper.rb",
|
40
|
+
"test/version_spec.rb"
|
41
|
+
]
|
42
|
+
s.homepage = "https://github.com/urubatan/codemerger".freeze
|
43
|
+
s.licenses = ["MIT".freeze]
|
44
|
+
s.rubygems_version = "3.5.22".freeze
|
45
|
+
s.summary = "Used to create blog posts and tecnical articles that need code samples, the code samples will be taken from the actual source code file instead of a copy paste approach".freeze
|
17
46
|
|
18
|
-
|
19
|
-
* Java
|
20
|
-
* YAML
|
21
|
-
* HTML
|
22
|
-
* XML
|
23
|
-
* Scala
|
24
|
-
* CSS
|
25
|
-
* Javascript
|
26
|
-
* Bash
|
27
|
-
* Batch
|
47
|
+
s.specification_version = 4
|
28
48
|
|
29
|
-
|
30
|
-
|
31
|
-
s.
|
32
|
-
s.
|
33
|
-
s.
|
34
|
-
s.add_development_dependency
|
35
|
-
|
36
|
-
s.
|
37
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
38
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
39
|
-
s.require_paths = ["lib"]
|
49
|
+
s.add_runtime_dependency(%q<kramdown>.freeze, [">= 0".freeze])
|
50
|
+
s.add_runtime_dependency(%q<rake>.freeze, [">= 0".freeze])
|
51
|
+
s.add_runtime_dependency(%q<rouge>.freeze, [">= 0".freeze])
|
52
|
+
s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
|
53
|
+
s.add_development_dependency(%q<bundler>.freeze, [">= 0".freeze])
|
54
|
+
s.add_development_dependency(%q<jeweler>.freeze, [">= 0".freeze])
|
55
|
+
s.add_development_dependency(%q<minitest>.freeze, [">= 0".freeze])
|
56
|
+
s.add_development_dependency(%q<rubocop>.freeze, [">= 0".freeze])
|
40
57
|
end
|
58
|
+
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<% if @converter.root.options[:encoding] %>
|
5
|
+
<meta http-equiv="Content-type" content="text/html;charset=<%= @converter.root.options[:encoding] %>">
|
6
|
+
<% end %>
|
7
|
+
<%
|
8
|
+
extend ::Kramdown::Utils::Html
|
9
|
+
title = ''
|
10
|
+
h = @converter.root.children.find {|c| c.type == :header}
|
11
|
+
if h
|
12
|
+
collector = lambda {|c| c.children.collect {|cc| cc.type == :text ? escape_html(cc.value, :text) : collector.call(cc)}.join('')}
|
13
|
+
title = collector.call(h)
|
14
|
+
end
|
15
|
+
%>
|
16
|
+
<title><%= title %></title>
|
17
|
+
<meta name="generator" content="kramdown <%= ::Kramdown::VERSION %>" />
|
18
|
+
<style>
|
19
|
+
p:has(.code-title) {
|
20
|
+
margin-bottom: 0;
|
21
|
+
.code-title {
|
22
|
+
font-weight: bold;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
.highlighter-rouge {
|
27
|
+
border: 1px solid black;
|
28
|
+
display: block;
|
29
|
+
width: fit-content;
|
30
|
+
margin: 1em 0;
|
31
|
+
|
32
|
+
pre.highlight {
|
33
|
+
margin: 0;
|
34
|
+
}
|
35
|
+
|
36
|
+
}
|
37
|
+
|
38
|
+
p:has(.code-title)+.highlighter-rouge {
|
39
|
+
margin-top: 0;
|
40
|
+
}
|
41
|
+
|
42
|
+
<%= Rouge::Themes::Github.render(scope: '.highlight') %>
|
43
|
+
</style>
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
<%= @body %>
|
47
|
+
</body>
|
48
|
+
</html>
|
data/lib/codemerger/merger.rb
CHANGED
@@ -1,126 +1,106 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require 'albino'
|
1
|
+
require "fileutils"
|
2
|
+
require "kramdown"
|
4
3
|
|
5
4
|
module Codemerger
|
6
|
-
class HTMLwithAlbino < Redcarpet::Render::HTML
|
7
|
-
include Redcarpet::Render::SmartyPants
|
8
|
-
def code(code, language)
|
9
|
-
if language
|
10
|
-
Albino.new(code, language).colorize({O:"linenos=table,encoding=utf-8"})
|
11
|
-
else
|
12
|
-
%Q{<pre><code>#{code}</code></pre>}
|
13
|
-
end
|
14
|
-
end
|
15
|
-
def block_html(raw_html)
|
16
|
-
@markdown ||= Redcarpet::Markdown.new(HTMLwithAlbino.new,
|
17
|
-
:autolink => true, :space_after_headers => true, :superscript => true,
|
18
|
-
:fenced_code_blocks => true, :tables => true, :no_intra_emphasis => true)
|
19
|
-
m,tag,attrs,content = *(raw_html.match(/<([a-z]+)(.*?)>(.*)<\/\1>/m))
|
20
|
-
result = @markdown.render(content)
|
21
|
-
%Q{<#{tag}#{attrs}>
|
22
|
-
#{result}
|
23
|
-
</#{tag}>
|
24
|
-
}
|
25
|
-
end
|
26
|
-
def block_code(code, language)
|
27
|
-
if language
|
28
|
-
Albino.new(code, language).colorize({O:"linenos=table,encoding=utf-8"})
|
29
|
-
else
|
30
|
-
%Q{<pre><code>#{code}</code></pre>}
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
5
|
class Merger
|
35
|
-
attr_reader :markdown
|
36
6
|
def initialize(dir_name)
|
37
7
|
@dir_name = dir_name
|
38
8
|
end
|
9
|
+
|
39
10
|
def clean_dirs
|
40
|
-
FileUtils.rm_rf
|
41
|
-
FileUtils.mkdir_p
|
42
|
-
FileUtils.mkdir_p "output/#{@dir_name}" if @dir_name !=
|
11
|
+
FileUtils.rm_rf "output"
|
12
|
+
FileUtils.mkdir_p "output"
|
13
|
+
FileUtils.mkdir_p "output/#{@dir_name}" if @dir_name != "."
|
43
14
|
end
|
15
|
+
|
44
16
|
def get_language_str(ext)
|
45
17
|
case ext
|
46
|
-
when ".yml"
|
47
|
-
when ".xml"
|
48
|
-
when ".html"
|
49
|
-
when ".rb"
|
50
|
-
when ".java"
|
51
|
-
when ".scala"
|
52
|
-
when ".erb"
|
53
|
-
when ".xsl"
|
54
|
-
when ".css"
|
55
|
-
when ".scss"
|
56
|
-
when ".coffee"
|
57
|
-
when ".js"
|
58
|
-
when ".sh"
|
59
|
-
when ".bat"
|
60
|
-
when ".xhtml"
|
61
|
-
when nil
|
18
|
+
when ".yml" then "yaml"
|
19
|
+
when ".xml" then "xml"
|
20
|
+
when ".html" then "xml"
|
21
|
+
when ".rb" then "ruby"
|
22
|
+
when ".java" then "java"
|
23
|
+
when ".scala" then "scala"
|
24
|
+
when ".erb" then "erb"
|
25
|
+
when ".xsl" then "xslt"
|
26
|
+
when ".css" then "css"
|
27
|
+
when ".scss" then "scss"
|
28
|
+
when ".coffee" then "coffeescript"
|
29
|
+
when ".js" then "javascript"
|
30
|
+
when ".sh" then "bash"
|
31
|
+
when ".bat" then "batch"
|
32
|
+
when ".xhtml" then "xml"
|
33
|
+
when nil then "ruby"
|
62
34
|
else; "text"
|
63
35
|
end
|
64
36
|
end
|
37
|
+
|
65
38
|
def sanitize(fname)
|
66
39
|
fname.gsub(/.*?:/, "")
|
67
40
|
end
|
41
|
+
|
68
42
|
def read_contents(fname)
|
69
43
|
if fname =~ /.+:/
|
70
44
|
`git cat-file blob #{fname}`
|
71
45
|
else
|
72
|
-
IO.readlines(fname).join(
|
46
|
+
IO.readlines(fname).join("")
|
73
47
|
end
|
74
48
|
end
|
49
|
+
|
75
50
|
def build_html_merged_file_content(f_name)
|
76
51
|
ext = f_name[/(\.[a-zA-Z]+)/]
|
77
52
|
lang_str = get_language_str(ext)
|
78
|
-
%
|
53
|
+
%(
|
79
54
|
<b>#{sanitize(f_name)}</b>
|
80
55
|
<pre line="1" lang="#{lang_str}">
|
81
56
|
#{read_contents(f_name)}
|
82
57
|
</pre>
|
83
|
-
|
58
|
+
)
|
84
59
|
end
|
60
|
+
|
85
61
|
def build_md_merged_file_content(f_name)
|
86
62
|
ext = f_name[/(\.[a-zA-Z]+)/]
|
87
63
|
lang_str = get_language_str(ext)
|
88
|
-
%
|
64
|
+
%(_#{sanitize(f_name)}_{:.code-title}
|
89
65
|
|
90
|
-
|
66
|
+
~~~ #{lang_str}
|
91
67
|
#{read_contents(f_name)}
|
92
|
-
|
93
|
-
|
68
|
+
~~~
|
69
|
+
)
|
94
70
|
end
|
71
|
+
|
95
72
|
def process_files
|
96
|
-
in_files = Dir.glob("#{@dir_name}
|
73
|
+
in_files = Dir.glob("#{@dir_name}/**/*.{markdown,md,html}")
|
97
74
|
in_files.sort.each do |file|
|
98
|
-
in_lines = IO.readlines(file).join(
|
75
|
+
in_lines = IO.readlines(file).join("")
|
99
76
|
is_markdown = (file =~ /markdown$/) || (file =~ /md$/)
|
100
77
|
out_fname = file[/^.*\./]
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
78
|
+
out_f_name = "output/#{out_fname}html"
|
79
|
+
out_d = File.dirname(out_f_name)
|
80
|
+
FileUtils.mkdir_p out_d
|
81
|
+
File.open(out_f_name, "w:utf-8") do |out_f|
|
82
|
+
if is_markdown
|
83
|
+
in_lines.gsub!(%r{(\{\{[/a-zA-Z0-9:_]+(?>\.[a-z:_A-Z0-9]{2,}){0,3}\}\})}) do |f_name_match|
|
84
|
+
puts "Merging #{f_name_match}"
|
85
|
+
f_name = f_name_match[2..-3]
|
86
|
+
build_md_merged_file_content(f_name)
|
87
|
+
end
|
88
|
+
out_f << process_markdown(in_lines)
|
89
|
+
else
|
90
|
+
out_f << in_lines.gsub(%r{(\{\{[/a-zA-Z0-9_]+(?>\.[a-zA-Z0-9]{2,}){0,3}\}\})}) do |f_name_match|
|
91
|
+
puts "Merging #{f_name_match}"
|
92
|
+
f_name = f_name_match[2..-3]
|
93
|
+
build_html_merged_file_content(f_name)
|
94
|
+
end
|
114
95
|
end
|
115
96
|
end
|
116
97
|
end
|
117
98
|
end
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
result
|
99
|
+
|
100
|
+
def process_markdown(text)
|
101
|
+
template = "string://#{File.read(File.join(File.dirname(File.expand_path(__FILE__)),'document_with_css.html.erb'))}"
|
102
|
+
doc = Kramdown::Document.new(text, syntax_highlighter: :rouge, header_links: true, auto_ids: true, template: template)
|
103
|
+
doc.to_html
|
124
104
|
end
|
125
105
|
end
|
126
106
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require
|
2
|
-
namespace "codemerger" do
|
3
|
-
desc "Merge all the markdown files and the source files to create the output/post.html file"
|
4
|
-
task :merge do
|
5
|
-
@merger = Codemerger::Merger.new
|
6
|
-
@merger.clean_dirs
|
7
|
-
@merger.process_files
|
8
|
-
end
|
9
|
-
end
|
1
|
+
require "codemerger"
|
2
|
+
namespace "codemerger" do
|
3
|
+
desc "Merge all the markdown files and the source files to create the output/post.html file"
|
4
|
+
task :merge do
|
5
|
+
@merger = Codemerger::Merger.new "."
|
6
|
+
@merger.clean_dirs
|
7
|
+
@merger.process_files
|
8
|
+
end
|
9
|
+
end
|
data/lib/codemerger/version.rb
CHANGED
data/lib/codemerger.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "codemerger/version"
|
2
|
+
require "codemerger/merger"
|
data/test/merger_spec.rb
CHANGED
@@ -1,53 +1,45 @@
|
|
1
|
-
|
2
|
-
require
|
3
|
-
|
1
|
+
require_relative 'test_helper'
|
2
|
+
require "codemerger"
|
4
3
|
describe Codemerger::Merger do
|
5
4
|
def setup
|
6
|
-
@merger = Codemerger::Merger.new
|
5
|
+
@merger = Codemerger::Merger.new "test"
|
7
6
|
end
|
8
7
|
it "should return the correct language string" do
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
8
|
+
_(@merger.get_language_str(".yml")).must_equal "yaml"
|
9
|
+
_(@merger.get_language_str(".xml")).must_equal "xml"
|
10
|
+
_(@merger.get_language_str(".html")).must_equal "xml"
|
11
|
+
_(@merger.get_language_str(".rb")).must_equal "ruby"
|
12
|
+
_(@merger.get_language_str(".java")).must_equal "java"
|
13
|
+
_(@merger.get_language_str(".scala")).must_equal "scala"
|
14
|
+
_(@merger.get_language_str(".erb")).must_equal "erb"
|
15
|
+
_(@merger.get_language_str(".xsl")).must_equal "xslt"
|
16
|
+
_(@merger.get_language_str(".css")).must_equal "css"
|
17
|
+
_(@merger.get_language_str(".js")).must_equal "javascript"
|
18
|
+
_(@merger.get_language_str(".sh")).must_equal "bash"
|
19
|
+
_(@merger.get_language_str(".bat")).must_equal "batch"
|
20
|
+
_(@merger.get_language_str(".xhtml")).must_equal "xml"
|
21
|
+
_(@merger.get_language_str(nil)).must_equal "ruby"
|
22
|
+
_(@merger.get_language_str("niaaa")).must_equal "text"
|
23
|
+
_(@merger.get_language_str(".coffee")).must_equal "coffeescript"
|
24
|
+
_(@merger.get_language_str(".scss")).must_equal "scss"
|
26
25
|
end
|
27
26
|
it "should delete and re-create the output directory" do
|
28
|
-
FileUtils.mkdir_p
|
29
|
-
out_f = File.new("output/temp.txt",
|
27
|
+
FileUtils.mkdir_p "output"
|
28
|
+
out_f = File.new("output/temp.txt", "w")
|
30
29
|
out_f << "content"
|
31
30
|
out_f.close
|
32
31
|
@merger.clean_dirs
|
33
|
-
File.
|
32
|
+
_(File.exist?("output/temp.txt")).must_equal false
|
34
33
|
end
|
35
34
|
it "should return the correctly formated output for an embedded file" do
|
36
|
-
expected =
|
37
|
-
|
38
|
-
|
39
|
-
def sample
|
40
|
-
println "sample"
|
41
|
-
end
|
42
|
-
</pre>
|
43
|
-
}
|
44
|
-
actual = @merger.build_html_merged_file_content('test/sample.rb')
|
45
|
-
expected.must_equal actual
|
35
|
+
expected = "\n <b>test/sample.rb</b>\n <pre line=\"1\" lang=\"ruby\">\n def sample\n println \"sample\"\nend\n\n </pre>\n "
|
36
|
+
actual = @merger.build_html_merged_file_content("test/sample.rb")
|
37
|
+
_(expected).must_equal actual
|
46
38
|
end
|
47
39
|
it "should process HTML and Markdown files" do
|
48
40
|
@merger.process_files
|
49
|
-
File.
|
50
|
-
File.
|
41
|
+
_(File.exist?("output/test/test.html")).must_equal true
|
42
|
+
_(File.exist?("output/test/test2.html")).must_equal true
|
51
43
|
puts File.new("output/test/test2.html").read
|
52
44
|
end
|
53
45
|
end
|
data/test/sample.rb
CHANGED
data/test/test2.markdown
CHANGED
data/test/test_helper.rb
ADDED
data/test/version_spec.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
|
2
|
-
require
|
1
|
+
require_relative 'test_helper'
|
2
|
+
require "codemerger/version"
|
3
3
|
|
4
4
|
describe Codemerger do
|
5
5
|
it "should return the correct version number" do
|
6
|
-
"0.
|
6
|
+
_("0.5.0").must_equal Codemerger::VERSION
|
7
7
|
end
|
8
|
-
end
|
8
|
+
end
|
metadata
CHANGED
@@ -1,72 +1,162 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codemerger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Rodrigo Urubatan
|
9
|
-
autorequire:
|
8
|
+
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
default_executable:
|
11
|
+
date: 2025-02-26 00:00:00.000000000 Z
|
14
12
|
dependencies:
|
15
13
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
17
|
-
requirement:
|
18
|
-
none: false
|
14
|
+
name: kramdown
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
19
16
|
requirements:
|
20
|
-
- -
|
17
|
+
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
19
|
+
version: '0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
26
27
|
- !ruby/object:Gem::Dependency
|
27
|
-
name:
|
28
|
-
requirement:
|
29
|
-
none: false
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rouge
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
37
55
|
- !ruby/object:Gem::Dependency
|
38
56
|
name: simplecov
|
39
|
-
requirement:
|
40
|
-
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
79
|
requirements:
|
42
|
-
- -
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: jeweler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: minitest
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
43
102
|
- !ruby/object:Gem::Version
|
44
103
|
version: '0'
|
45
104
|
type: :development
|
46
105
|
prerelease: false
|
47
|
-
version_requirements:
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: |-
|
126
|
+
This gem is used to help writing technical posts for wordpress.
|
127
|
+
The output is copied and pasted to a post into my wordpress blog, and the code gets colored using the plugin wp-syntax, and the output can be turned into PDF with the plugin wp-mpdf.
|
128
|
+
|
129
|
+
Today this gem supports source files in the following languages:
|
130
|
+
|
131
|
+
* Ruby (including Rakefile and Gemfile)
|
132
|
+
* Java
|
133
|
+
* YAML
|
134
|
+
* HTML
|
135
|
+
* XML
|
136
|
+
* Scala
|
137
|
+
* CSS
|
138
|
+
* Javascript
|
139
|
+
* Bash
|
140
|
+
* Batch
|
141
|
+
|
142
|
+
All other files are configured as "text".
|
143
|
+
email: rodrigo@urubatan.com.br
|
56
144
|
executables: []
|
57
145
|
extensions: []
|
58
|
-
extra_rdoc_files:
|
146
|
+
extra_rdoc_files:
|
147
|
+
- LICENSE
|
148
|
+
- README.markdown
|
59
149
|
files:
|
60
|
-
- .
|
61
|
-
- .codemerger.gemspec.swp
|
62
|
-
- .gitignore
|
63
|
-
- .rvmrc
|
150
|
+
- ".ruby-version"
|
64
151
|
- Gemfile
|
65
152
|
- Gemfile.lock
|
153
|
+
- LICENSE
|
66
154
|
- README.markdown
|
67
155
|
- Rakefile
|
156
|
+
- VERSION
|
68
157
|
- codemerger.gemspec
|
69
158
|
- lib/codemerger.rb
|
159
|
+
- lib/codemerger/document_with_css.html.erb
|
70
160
|
- lib/codemerger/merger.rb
|
71
161
|
- lib/codemerger/rake_tasks.rb
|
72
162
|
- lib/codemerger/version.rb
|
@@ -74,43 +164,31 @@ files:
|
|
74
164
|
- test/sample.rb
|
75
165
|
- test/test.html
|
76
166
|
- test/test2.markdown
|
167
|
+
- test/test_helper.rb
|
77
168
|
- test/version_spec.rb
|
78
|
-
has_rdoc: true
|
79
169
|
homepage: https://github.com/urubatan/codemerger
|
80
|
-
licenses:
|
81
|
-
|
170
|
+
licenses:
|
171
|
+
- MIT
|
172
|
+
metadata: {}
|
173
|
+
post_install_message:
|
82
174
|
rdoc_options: []
|
83
175
|
require_paths:
|
84
176
|
- lib
|
85
177
|
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
-
none: false
|
87
178
|
requirements:
|
88
|
-
- -
|
179
|
+
- - ">="
|
89
180
|
- !ruby/object:Gem::Version
|
90
181
|
version: '0'
|
91
|
-
segments:
|
92
|
-
- 0
|
93
|
-
hash: -2316311512102027505
|
94
182
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
-
none: false
|
96
183
|
requirements:
|
97
|
-
- -
|
184
|
+
- - ">="
|
98
185
|
- !ruby/object:Gem::Version
|
99
186
|
version: '0'
|
100
|
-
segments:
|
101
|
-
- 0
|
102
|
-
hash: -2316311512102027505
|
103
187
|
requirements: []
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
specification_version: 3
|
188
|
+
rubygems_version: 3.5.22
|
189
|
+
signing_key:
|
190
|
+
specification_version: 4
|
108
191
|
summary: Used to create blog posts and tecnical articles that need code samples, the
|
109
192
|
code samples will be taken from the actual source code file instead of a copy paste
|
110
193
|
approach
|
111
|
-
test_files:
|
112
|
-
- test/merger_spec.rb
|
113
|
-
- test/sample.rb
|
114
|
-
- test/test.html
|
115
|
-
- test/test2.markdown
|
116
|
-
- test/version_spec.rb
|
194
|
+
test_files: []
|
data/.Gemfile.swp
DELETED
Binary file
|
data/.codemerger.gemspec.swp
DELETED
Binary file
|
data/.gitignore
DELETED
data/.rvmrc
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
-
# development environment upon cd'ing into the directory
|
5
|
-
|
6
|
-
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
|
7
|
-
environment_id="ruby-1.9.2-p180"
|
8
|
-
|
9
|
-
#
|
10
|
-
# First we attempt to load the desired environment directly from the environment
|
11
|
-
# file. This is very fast and efficient compared to running through the entire
|
12
|
-
# CLI and selector. If you want feedback on which environment was used then
|
13
|
-
# insert the word 'use' after --create as this triggers verbose mode.
|
14
|
-
#
|
15
|
-
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
|
16
|
-
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
17
|
-
then
|
18
|
-
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
19
|
-
|
20
|
-
if [[ -s ".rvm/hooks/after_use" ]]
|
21
|
-
then
|
22
|
-
. ".rvm/hooks/after_use"
|
23
|
-
fi
|
24
|
-
else
|
25
|
-
# If the environment file has not yet been created, use the RVM CLI to select.
|
26
|
-
if ! rvm --create use "$environment_id"
|
27
|
-
then
|
28
|
-
echo "Failed to create RVM environment ''."
|
29
|
-
fi
|
30
|
-
fi
|
31
|
-
|
32
|
-
#
|
33
|
-
# If you use an RVM gemset file to install a list of gems (*.gems), you can have
|
34
|
-
# it be automatically loaded. Uncomment the following and adjust the filename if
|
35
|
-
# necessary.
|
36
|
-
#
|
37
|
-
# filename=".gems"
|
38
|
-
# if [[ -s "$filename" ]] ; then
|
39
|
-
# rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
|
40
|
-
# fi
|
41
|
-
|