markdown_helper 1.5.0 → 1.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1147c20c56afc8ddb67b90b57845d59d08488c7
4
- data.tar.gz: 0d4e6f2363d0921cdc206adc4c7c8d30a654ac1a
3
+ metadata.gz: 38e7b32f5f6e0b8b46878e5ef5586d2f94852c60
4
+ data.tar.gz: efefe056e97327bc5dafd225774e52ce81955a03
5
5
  SHA512:
6
- metadata.gz: ec0b3a986477b6c9780a31073855358880375d6ccef61d669fb5b55ed121d9327c536e46f6d7cdf075dec5129c7b4c3c4be200fd7d8afbed9c128f4a11f5f518
7
- data.tar.gz: a172ff12521ec4e2363d17d89b3149f303242fe7c506e17b376ab9499e7912a980905fc0463bb1bc84262165a3bfcc7b6e1d008ccd8e53f35c63f9414b488c8f
6
+ metadata.gz: 62891f62df9f8a0a68f1cd865335057285e9a9b1cd28d7ff0d153fdb05e679bb61accec96ec626f6dfc450843e8bc3f6f0fbc7b3b38d09d3de9e7488a2c88e9c
7
+ data.tar.gz: 588635b8668e9757edcb0d1eaa11364c640763471b3d943410a2a650344f7168d152fd2f9cd6752c494ee57c57405702153f7b57f4da1e1fcec28781144f20ee
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- markdown_helper (1.5.0)
4
+ markdown_helper (1.5.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/Rakefile CHANGED
@@ -14,13 +14,16 @@ namespace :build do
14
14
  Rake::Task['build:usages'].invoke
15
15
  require_relative 'lib/markdown_helper'
16
16
  markdown_helper = MarkdownHelper.new
17
- markdown_helper.include('readme_files/highlight_ruby_template.md', 'readme_files/highlighted_ruby.md')
17
+ template_file_path = 'readme_files/highlight_ruby_template.md'
18
+ markdown_file_path = 'readme_files/highlighted_ruby.md'
19
+ markdown_helper.include(template_file_path, markdown_file_path)
18
20
  # Do the resolve before the include, so that the included text is not also resolved.
19
- # Thie protects example code from being also resolved, thus damaging the example code.
21
+ # This protects example code from being also resolved, thus damaging the example code.
20
22
  # Temp file must be in the same directory as its source (it becomes the source).
21
23
  temp_file_path = 'readme_files/temp_resolved.md'
22
24
  markdown_helper.resolve('readme_files/README.template.md', temp_file_path)
23
- markdown_helper.include(temp_file_path, 'README.md')
25
+ readme_file_path = 'README.md'
26
+ markdown_helper.include(temp_file_path, readme_file_path)
24
27
  File.delete(temp_file_path)
25
28
  end
26
29
 
@@ -41,10 +41,9 @@ class MarkdownHelper
41
41
  # @example pragma to include text verbatim, to be rendered as markdown.
42
42
  # @[:verbatim](foo.md)
43
43
  def include(template_file_path, markdown_file_path)
44
- output = send(:generate_file, template_file_path, markdown_file_path, __method__) do |input_lines, output_lines|
44
+ send(:generate_file, template_file_path, markdown_file_path, __method__) do |input_lines, output_lines|
45
45
  send(:include_files, template_file_path, input_lines, output_lines, paths = [], realpaths = [])
46
46
  end
47
- output
48
47
  end
49
48
 
50
49
  # Resolves relative image paths to absolute urls in markdown text.
@@ -70,10 +69,9 @@ class MarkdownHelper
70
69
  # )
71
70
  def resolve(template_file_path, markdown_file_path)
72
71
  # Method :generate_file does the first things, yields the block, does the last things.
73
- output = send(:generate_file, template_file_path, markdown_file_path, __method__) do |input_lines, output_lines|
72
+ send(:generate_file, template_file_path, markdown_file_path, __method__) do |input_lines, output_lines|
74
73
  send(:resolve_images, input_lines, output_lines)
75
74
  end
76
- output
77
75
  end
78
76
  alias resolve_image_urls resolve
79
77
 
@@ -192,7 +190,6 @@ EOT
192
190
  end
193
191
  formatted_attributes_s = formatted_attributes.join(' ')
194
192
  repo_user, repo_name = repo_user_and_name
195
- absolute_file_path = nil
196
193
  if relative_file_path.start_with?('http')
197
194
  absolute_file_path = relative_file_path
198
195
  else
@@ -1,3 +1,3 @@
1
1
  class MarkdownHelper
2
- VERSION = '1.5.0'
2
+ VERSION = '1.5.1'
3
3
  end
@@ -2,12 +2,12 @@
2
2
 
3
3
  Example code and output that's embedded in a markdown file is dead text that may no longer be correct.
4
4
 
5
- Use the markdown helper to include example code and output -- but only after the project "build" has re-run the code and refreahed the output!
5
+ Use the markdown helper to include example code and output -- but only after the project "build" has re-run the code and refreshed the output!
6
6
 
7
7
  Here's how:
8
8
 
9
9
  1. Maintain each code example in a separate executable file.
10
- 1. Maintain markdown files that have include desctiptions, rather than embedded code and output.
10
+ 1. Maintain markdown files that have include descriptions, rather than embedded code and output.
11
11
  1. At project "build time" (controlled by a suitable build tool):
12
12
  1. Execute each code example, capturing its output to one or more files.
13
13
  1. Check output for errors and validity.
@@ -1,5 +1,5 @@
1
1
  ### Include Generated Text
2
2
 
3
- Use the markdown helper to include text that is genrated at project "build time."
3
+ Use the markdown helper to include text that is generated at project "build time."
4
4
 
5
- Example: Project build runs each executable with option <code>--help</code>, capturing the output into a file. That file can then be included into the markdown pages for the project.
5
+ Example: Project build runs each executable with option <code>--help</code>, capturing the output into a file. That file can then be included into the markdown pages for the project.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdown_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - burdettelamar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-07 00:00:00.000000000 Z
11
+ date: 2018-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler