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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 428349e826eb779854e15a41623ff91a66578b12
4
- data.tar.gz: fd5eceb3846353715b66204b26e7ee4f95061ebb
3
+ metadata.gz: d6adee78ed7b10132a947e311ed62ca3825570ab
4
+ data.tar.gz: 36c3619719c0eacd7be2805aaf9e8ecbb482eda9
5
5
  SHA512:
6
- metadata.gz: f24ad21b4e075b96c3760dba8689b5a82922029c940b3f35b5aced0a5d508fd9bdac212e1e4a83206f9b66be60798c27d72c669cd5c9d342224f0849e03f027b
7
- data.tar.gz: 05042813a9dd8c37d9d9d019800fa4a6b9716e2b98fece412712564d2437636cf84cb193332169b231e78ef121b9c5d3e18ad998de4ce820076efac6cf4f6259
6
+ metadata.gz: e8ebc98cce19ffda4fb67c84545e4e0c3f848bc1bd2ee2d8927e15e75ed18a8d9544b102e26e8adc2085b73b2341a6e600eea614cee98ab43875c02410d214ea
7
+ data.tar.gz: ad1cd1d85dd0c5356d613d3ba0c7da1b6ba4925ad6c5c16469755b7421c838a84bcb8ef65ccb908ca9a0b6f0db301f8ad121e48bd1442c7ec9aed0b6e360179f
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.1
1
+ 2.2
data/.travis.yml CHANGED
@@ -1,3 +1,7 @@
1
1
  language: ruby
2
+ bundler_args: --without dev_tooling
2
3
  rvm:
3
- - 2.2.0
4
+ - ruby-head
5
+ - 2.2.4
6
+ - 2.3.0
7
+ - 1.9.3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.7.0
2
+ -----
3
+ - added support for images
4
+ - now support ruby 1.9.3, 2.2.4 and 2.3.0
5
+
1
6
  0.3.0
2
7
  -----
3
8
 
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in mark_maker.gemspec
4
4
  gemspec
5
+
6
+ group :dev_tooling do
7
+ gem 'rubocop'
8
+ end
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ ![MarkMaker build status](https://travis-ci.org/sn1de/mark_maker.svg?branch=master Build Status)
2
+
1
3
  MarkMaker
2
4
  =========
3
5
 
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
- RuboCop::RakeTask.new(:rubocop) do |task|
17
- task.patterns = ['lib/**/*.rb']
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
-
@@ -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",
@@ -43,6 +43,10 @@ module MarkMaker
43
43
  "[#{label}](#{url})"
44
44
  end
45
45
 
46
+ def image(alt, path, title = "")
47
+ "![#{alt}](#{path} #{title})"
48
+ end
49
+
46
50
  def code_block(*content)
47
51
  content.map(&:code)
48
52
  end
@@ -1,4 +1,4 @@
1
1
  # version management
2
2
  module MarkMaker
3
- VERSION = "0.6.1"
3
+ VERSION = "0.7.0"
4
4
  end
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 "rubocop"
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
@@ -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
@@ -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.strip_heredoc
99
- This should contain no intents.
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 intents.\n\nIt should be 3 lines long.\n"
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.strip_heredoc
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.strip_heredoc
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.strip_heredoc
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.6.1
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: 2016-02-04 00:00:00.000000000 Z
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: rubocop
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: activesupport
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: simplecov
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: '0'
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: '0'
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: '0'
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.4.6
163
+ rubygems_version: 2.5.1
158
164
  signing_key:
159
165
  specification_version: 4
160
166
  summary: Markdown generator.