markdown_ruby_documentation 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +3 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +134 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/github-markdown.css +656 -0
- data/lib/markdown_ruby_documentation.rb +29 -0
- data/lib/markdown_ruby_documentation/constants_presenter.rb +38 -0
- data/lib/markdown_ruby_documentation/default_erb_methods.rb +11 -0
- data/lib/markdown_ruby_documentation/generate.rb +107 -0
- data/lib/markdown_ruby_documentation/git_hub_link.rb +74 -0
- data/lib/markdown_ruby_documentation/git_hub_project.rb +29 -0
- data/lib/markdown_ruby_documentation/instance_to_class_methods.rb +44 -0
- data/lib/markdown_ruby_documentation/markdown_presenter.rb +36 -0
- data/lib/markdown_ruby_documentation/method.rb +101 -0
- data/lib/markdown_ruby_documentation/method/class_method.rb +13 -0
- data/lib/markdown_ruby_documentation/method/instance_method.rb +11 -0
- data/lib/markdown_ruby_documentation/method/null_method.rb +28 -0
- data/lib/markdown_ruby_documentation/method_linker.rb +41 -0
- data/lib/markdown_ruby_documentation/print_method_source.rb +19 -0
- data/lib/markdown_ruby_documentation/reject_blank_methods.rb +9 -0
- data/lib/markdown_ruby_documentation/summary.rb +32 -0
- data/lib/markdown_ruby_documentation/template_parser.rb +348 -0
- data/lib/markdown_ruby_documentation/version.rb +3 -0
- data/lib/markdown_ruby_documentation/write_markdown_to_disk.rb +29 -0
- data/markdown_ruby_documenation.gemspec +30 -0
- metadata +162 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
module MarkdownRubyDocumentation
|
2
|
+
class WriteMarkdownToDisk
|
3
|
+
|
4
|
+
attr_reader :dir, :skip_if_blank
|
5
|
+
|
6
|
+
def initialize(dir:, skip_if_blank: false)
|
7
|
+
@dir = dir
|
8
|
+
@skip_if_blank = skip_if_blank
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(name:, text:)
|
12
|
+
return if skip_save?(text, name)
|
13
|
+
name = name.gsub(dir, "").underscore
|
14
|
+
path = File.join(dir, name)
|
15
|
+
FileUtils.mkdir_p(path.split("/").tap { |p| p.pop }.join("/"))
|
16
|
+
File.open("#{path}.md", "w").write(text)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def skip_save?(text, name)
|
22
|
+
if skip_if_blank
|
23
|
+
if Array(text.split("\n")[2..-1]).all? { |line| line.blank? }
|
24
|
+
return true
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'markdown_ruby_documentation/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "markdown_ruby_documentation"
|
8
|
+
spec.version = MarkdownRubyDocumentation::VERSION
|
9
|
+
spec.authors = ["Dustin Zeisler"]
|
10
|
+
spec.email = ["dustin@zeisler.net"]
|
11
|
+
|
12
|
+
spec.summary = %q{Gem provides the ability to use markdown and ruby ERB with some helper methods inside of comments}
|
13
|
+
spec.description = %q{Gem provides the ability to use markdown and ruby ERB with some helper methods inside of comments. The comment area then can be generated into a markdown file.}
|
14
|
+
spec.homepage = "https://github.com/zeisler/markdown_ruby_documentation"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.required_ruby_version = ">= 2.1"
|
18
|
+
|
19
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_runtime_dependency "method_source", "~> 0.8.2"
|
25
|
+
spec.add_runtime_dependency "activesupport", ">= 4.1"
|
26
|
+
spec.add_runtime_dependency "ruby-progressbar", "~> 1.7"
|
27
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
28
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.4"
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,162 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: markdown_ruby_documentation
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dustin Zeisler
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: method_source
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.8.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.8.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: ruby-progressbar
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.7'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.10'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.10'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '10.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.4'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.4'
|
97
|
+
description: Gem provides the ability to use markdown and ruby ERB with some helper
|
98
|
+
methods inside of comments. The comment area then can be generated into a markdown
|
99
|
+
file.
|
100
|
+
email:
|
101
|
+
- dustin@zeisler.net
|
102
|
+
executables: []
|
103
|
+
extensions: []
|
104
|
+
extra_rdoc_files: []
|
105
|
+
files:
|
106
|
+
- ".gitignore"
|
107
|
+
- ".rspec"
|
108
|
+
- ".travis.yml"
|
109
|
+
- CODE_OF_CONDUCT.md
|
110
|
+
- Gemfile
|
111
|
+
- LICENSE.txt
|
112
|
+
- README.md
|
113
|
+
- Rakefile
|
114
|
+
- bin/console
|
115
|
+
- bin/setup
|
116
|
+
- lib/github-markdown.css
|
117
|
+
- lib/markdown_ruby_documentation.rb
|
118
|
+
- lib/markdown_ruby_documentation/constants_presenter.rb
|
119
|
+
- lib/markdown_ruby_documentation/default_erb_methods.rb
|
120
|
+
- lib/markdown_ruby_documentation/generate.rb
|
121
|
+
- lib/markdown_ruby_documentation/git_hub_link.rb
|
122
|
+
- lib/markdown_ruby_documentation/git_hub_project.rb
|
123
|
+
- lib/markdown_ruby_documentation/instance_to_class_methods.rb
|
124
|
+
- lib/markdown_ruby_documentation/markdown_presenter.rb
|
125
|
+
- lib/markdown_ruby_documentation/method.rb
|
126
|
+
- lib/markdown_ruby_documentation/method/class_method.rb
|
127
|
+
- lib/markdown_ruby_documentation/method/instance_method.rb
|
128
|
+
- lib/markdown_ruby_documentation/method/null_method.rb
|
129
|
+
- lib/markdown_ruby_documentation/method_linker.rb
|
130
|
+
- lib/markdown_ruby_documentation/print_method_source.rb
|
131
|
+
- lib/markdown_ruby_documentation/reject_blank_methods.rb
|
132
|
+
- lib/markdown_ruby_documentation/summary.rb
|
133
|
+
- lib/markdown_ruby_documentation/template_parser.rb
|
134
|
+
- lib/markdown_ruby_documentation/version.rb
|
135
|
+
- lib/markdown_ruby_documentation/write_markdown_to_disk.rb
|
136
|
+
- markdown_ruby_documenation.gemspec
|
137
|
+
homepage: https://github.com/zeisler/markdown_ruby_documentation
|
138
|
+
licenses:
|
139
|
+
- MIT
|
140
|
+
metadata: {}
|
141
|
+
post_install_message:
|
142
|
+
rdoc_options: []
|
143
|
+
require_paths:
|
144
|
+
- lib
|
145
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '2.1'
|
150
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
requirements: []
|
156
|
+
rubyforge_project:
|
157
|
+
rubygems_version: 2.5.1
|
158
|
+
signing_key:
|
159
|
+
specification_version: 4
|
160
|
+
summary: Gem provides the ability to use markdown and ruby ERB with some helper methods
|
161
|
+
inside of comments
|
162
|
+
test_files: []
|