mark_maker 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +5 -1
- data/CHANGELOG.md +5 -0
- data/Gemfile +4 -0
- data/README.md +2 -0
- data/Rakefile +5 -4
- data/bin/generate_readme.rb +3 -1
- data/lib/mark_maker/generator.rb +4 -0
- data/lib/mark_maker/version.rb +1 -1
- data/mark_maker.gemspec +3 -2
- data/test/minitest_helper.rb +0 -1
- data/test/test_mark_maker.rb +20 -12
- metadata +15 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6adee78ed7b10132a947e311ed62ca3825570ab
|
4
|
+
data.tar.gz: 36c3619719c0eacd7be2805aaf9e8ecbb482eda9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8ebc98cce19ffda4fb67c84545e4e0c3f848bc1bd2ee2d8927e15e75ed18a8d9544b102e26e8adc2085b73b2341a6e600eea614cee98ab43875c02410d214ea
|
7
|
+
data.tar.gz: ad1cd1d85dd0c5356d613d3ba0c7da1b6ba4925ad6c5c16469755b7421c838a84bcb8ef65ccb908ca9a0b6f0db301f8ad121e48bd1442c7ec9aed0b6e360179f
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2
|
1
|
+
2.2
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
2
|
require 'rake/testtask'
|
3
|
-
require 'rubocop/rake_task'
|
3
|
+
require 'rubocop/rake_task' unless ENV['CI'] == 'true'
|
4
4
|
|
5
5
|
Rake::TestTask.new(:test) do |t|
|
6
6
|
t.libs << "test"
|
@@ -13,12 +13,13 @@ task :console do
|
|
13
13
|
exec "irb -r mark_maker -I ./lib"
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
if ENV['CI'] != 'true'
|
17
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
18
|
+
task.patterns = ['lib/**/*.rb']
|
19
|
+
end
|
18
20
|
end
|
19
21
|
|
20
22
|
desc "generate the readme file for the project programatically using MarkMaker"
|
21
23
|
task :readme do
|
22
24
|
exec "ruby -Ilib bin/generate_readme.rb > README.md"
|
23
25
|
end
|
24
|
-
|
data/bin/generate_readme.rb
CHANGED
@@ -25,6 +25,8 @@ ensure
|
|
25
25
|
end
|
26
26
|
|
27
27
|
gen = MarkMaker::Generator.new
|
28
|
+
puts gen.image("MarkMaker build status", "https://travis-ci.org/sn1de/mark_maker.svg?branch=master", "Build Status")
|
29
|
+
puts ""
|
28
30
|
puts "MarkMaker".header1
|
29
31
|
puts ""
|
30
32
|
puts "Programatically generate markdown documents."
|
@@ -112,7 +114,7 @@ puts ""
|
|
112
114
|
puts "Standard markdown code blocks and #{'code span'.code_span} are supported, as well as github"
|
113
115
|
puts "flavored markdown fenced code blocks."
|
114
116
|
puts ""
|
115
|
-
sample_block = <<-EOT.lines
|
117
|
+
sample_block = <<-EOT.lines.to_a
|
116
118
|
some_code = [ "# add it up",
|
117
119
|
"total = [1, 2, 3, 4].inject do |sum, i|",
|
118
120
|
" sum += i",
|
data/lib/mark_maker/generator.rb
CHANGED
data/lib/mark_maker/version.rb
CHANGED
data/mark_maker.gemspec
CHANGED
@@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = %q{Programatically generate markdown documents.}
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = '>= 1.9.3'
|
15
16
|
|
16
17
|
spec.files = `git ls-files -z`.split("\x0")
|
17
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
@@ -22,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
22
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
24
|
spec.add_development_dependency "minitest"
|
24
25
|
spec.add_development_dependency "pry"
|
25
|
-
spec.add_development_dependency "
|
26
|
-
spec.add_development_dependency "activesupport"
|
26
|
+
spec.add_development_dependency "unindent"
|
27
27
|
spec.add_development_dependency "simplecov"
|
28
|
+
spec.add_development_dependency "minitest-reporters", '~> 1.1', '>= 1.1.8'
|
28
29
|
end
|
data/test/minitest_helper.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
2
|
require 'mark_maker'
|
3
3
|
require 'mark_maker_string'
|
4
|
-
require 'active_support/core_ext/string'
|
5
4
|
require 'minitest/autorun'
|
6
5
|
require 'minitest/reporters'
|
7
6
|
Minitest::Reporters.use! Minitest::Reporters::DefaultReporter.new
|
data/test/test_mark_maker.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'unindent'
|
1
2
|
require 'simplecov'
|
2
3
|
SimpleCov.start
|
3
4
|
|
@@ -36,6 +37,15 @@ class TestMarkMaker < Minitest::Test
|
|
36
37
|
assert_match(/^\[#{label}\]\(#{url}\)$/, markup)
|
37
38
|
end
|
38
39
|
|
40
|
+
def test_image_generation
|
41
|
+
path = "https://travis-ci.org/sn1de/mark_maker.svg?branch=master"
|
42
|
+
alt = "Mark Maker build status from Travis continuous integration"
|
43
|
+
title = "Build Status"
|
44
|
+
gen = MarkMaker::Generator.new
|
45
|
+
markup = gen.image(alt, path, title)
|
46
|
+
assert_match(/^!\[#{Regexp.quote(alt)}\]\(#{Regexp.quote(path)}\s#{Regexp.quote(title)}\)/, markup)
|
47
|
+
end
|
48
|
+
|
39
49
|
def test_code_block_generation
|
40
50
|
content = ["a = 1", "b = 2", "c = 3"]
|
41
51
|
gen = MarkMaker::Generator.new
|
@@ -95,22 +105,26 @@ class TestMarkMaker < Minitest::Test
|
|
95
105
|
# usage of a heredoc as a test method
|
96
106
|
|
97
107
|
def test_heredoc_method
|
98
|
-
desired_output = <<-EOS.
|
99
|
-
This should contain no
|
108
|
+
desired_output = <<-EOS.unindent
|
109
|
+
This should contain no indents.
|
100
110
|
|
101
111
|
It should be 3 lines long.
|
102
112
|
EOS
|
103
|
-
test_output = "This should contain no
|
113
|
+
test_output = "This should contain no indents.\n\nIt should be 3 lines long.\n"
|
104
114
|
assert_equal(desired_output, test_output, "Output must exactly match.")
|
105
115
|
end
|
106
116
|
|
117
|
+
def test_join
|
118
|
+
assert_equal("abc", ["a", "b", "c"].join)
|
119
|
+
end
|
120
|
+
|
107
121
|
def test_column_width
|
108
122
|
gen = MarkMaker::Generator.new
|
109
123
|
assert_equal(5, gen.column_width("One", "Two", "12345", "Four"))
|
110
124
|
end
|
111
125
|
|
112
126
|
def test_pretty_table_generation
|
113
|
-
pretty_table = <<-EOS.
|
127
|
+
pretty_table = <<-EOS.unindent
|
114
128
|
|Col One|Col Two|Col Three|
|
115
129
|
|:------|:-----:|--------:|
|
116
130
|
|First | A | $3.99|
|
@@ -150,12 +164,6 @@ class TestMarkMaker < Minitest::Test
|
|
150
164
|
assert_equal(test_justified, gen_justified)
|
151
165
|
end
|
152
166
|
|
153
|
-
def test_column_width
|
154
|
-
gen = MarkMaker::Generator.new
|
155
|
-
width = gen.column_width("a", "bbb", "ccccc", "dd")
|
156
|
-
assert_equal(5, width)
|
157
|
-
end
|
158
|
-
|
159
167
|
def test_centered_margins
|
160
168
|
gen = MarkMaker::Generator.new
|
161
169
|
left, right = gen.centered_margins(5, "cc")
|
@@ -240,7 +248,7 @@ class TestMarkMaker < Minitest::Test
|
|
240
248
|
# end
|
241
249
|
|
242
250
|
# def test_right_justify_table_column
|
243
|
-
# right_justified = <<-EOS.
|
251
|
+
# right_justified = <<-EOS.unindent
|
244
252
|
# | Justified|
|
245
253
|
# |----------:|
|
246
254
|
# | a|
|
@@ -254,7 +262,7 @@ class TestMarkMaker < Minitest::Test
|
|
254
262
|
|
255
263
|
|
256
264
|
# def test_pretty_table_justified_generation
|
257
|
-
# pretty_table = <<-EOS.
|
265
|
+
# pretty_table = <<-EOS.unindent
|
258
266
|
# |Col One|Col Two|Col Three |Data Sized |
|
259
267
|
# |-------|-------|----------|-------------|
|
260
268
|
# |First | A | $3.99|xxxxxxxxxxxxx|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mark_maker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Schneider
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: unindent
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,19 +95,25 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: minitest-reporters
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.1'
|
101
104
|
- - ">="
|
102
105
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
106
|
+
version: 1.1.8
|
104
107
|
type: :development
|
105
108
|
prerelease: false
|
106
109
|
version_requirements: !ruby/object:Gem::Requirement
|
107
110
|
requirements:
|
111
|
+
- - "~>"
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '1.1'
|
108
114
|
- - ">="
|
109
115
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
116
|
+
version: 1.1.8
|
111
117
|
description: Programatically generate markdown documents.
|
112
118
|
email:
|
113
119
|
- brad.schneider@me.com
|
@@ -146,7 +152,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
152
|
requirements:
|
147
153
|
- - ">="
|
148
154
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
155
|
+
version: 1.9.3
|
150
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
157
|
requirements:
|
152
158
|
- - ">="
|
@@ -154,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
160
|
version: '0'
|
155
161
|
requirements: []
|
156
162
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
163
|
+
rubygems_version: 2.5.1
|
158
164
|
signing_key:
|
159
165
|
specification_version: 4
|
160
166
|
summary: Markdown generator.
|