middlemac-extras 1.0.6 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitattributes +4 -0
- data/.gitignore +8 -1
- data/.yardopts +7 -0
- data/CHANGELOG.md +55 -9
- data/Rakefile +206 -7
- data/documentation_project/Gemfile +3 -3
- data/documentation_project/config.rb +2 -6
- data/documentation_project/source/api_reference.html.md.erb +38 -0
- data/documentation_project/source/cli.html.md.erb +4 -3
- data/documentation_project/source/config_rb.html.md.erb +1 -2
- data/documentation_project/source/css_image_sizes.html.md.erb +2 -3
- data/documentation_project/source/image_tag.html.md.erb +1 -2
- data/documentation_project/source/index.html.md.erb +8 -7
- data/documentation_project/source/license.html.md.erb +1 -2
- data/documentation_project/source/md_images.html.md.erb +1 -2
- data/documentation_project/source/md_links.html.md.erb +1 -2
- data/documentation_project/source/partials/_yard_config.erb +200 -0
- data/documentation_project/source/partials/_yard_helpers.erb +192 -0
- data/documentation_project/source/partials/_yard_helpers_extended.erb +135 -0
- data/documentation_project/source/stylesheets/_middlemac_minimal.scss +281 -0
- data/features/helpers.feature +39 -0
- data/features/support/env.rb +20 -0
- data/fixtures/middlemac_extras_app/config.rb +7 -0
- data/fixtures/middlemac_extras_app/source/images/middlemac-extras-small.png +0 -0
- data/fixtures/middlemac_extras_app/source/images/middlemac-extras-small@2x.png +0 -0
- data/fixtures/middlemac_extras_app/source/images/middlemac-extras-smaller.png +0 -0
- data/fixtures/middlemac_extras_app/source/index.html.md.erb +31 -0
- data/lib/middlemac-extras/extension.rb +187 -61
- data/lib/middlemac-extras/version.rb +1 -1
- data/middlemac-extras.gemspec +44 -17
- data/yard/readme.md +6 -0
- data/yard/template-grouped/default/module/html/method_details_list.erb +11 -0
- data/yard/template-partials/default/method_details/setup.rb +4 -0
- data/yard/template-partials/default/module/html/attribute_details.erb +9 -0
- data/yard/template-partials/default/module/html/method_details_list.erb +10 -0
- data/yard/template-partials/default/module/setup.rb +6 -0
- data/yard/template-partials/default/onefile/html/layout.erb +1 -0
- data/yard/template-partials/default/onefile/html/setup.rb +4 -0
- data/yard/yard_extensions.rb +109 -0
- metadata +118 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 62c558839c6210edb90fc9af6769a000b2a5192de0a047e796ee67796d759ae1
|
4
|
+
data.tar.gz: 862e1a8f7d748db8d981d55c492a1ffb309f4b4944047d88e5a55e3706cc1811
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3333535b3f47c533f8faac58372a6a142d0d1a0dfc3c6a7fa81cc85be1702bf224628283966b02ea7eca25c04b1fc7f81d89ad6fe2619d0df718a1f6e69719c
|
7
|
+
data.tar.gz: c0132e7a7791a8010673d0f28211d9f41dfa951d3f5db6127ede91792ae27b0381d18a31cf650d5a12b0ada230f03e73db17002e5cbe21857e70edc8a28f50b2
|
data/.gitattributes
ADDED
data/.gitignore
CHANGED
data/.yardopts
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,19 +1,65 @@
|
|
1
1
|
middlemac-extras change log
|
2
2
|
===========================
|
3
3
|
|
4
|
+
- Version 1.0.11 / 2021-April-12
|
5
|
+
|
6
|
+
- Updated Ruby version requirements to make it clear that Ruby 3.0+ is not yet
|
7
|
+
supported.
|
8
|
+
Updated test task so that default task doesn't use the noisy version with deprecation
|
9
|
+
warnings, and to remove the advertisement at the end of output.
|
10
|
+
Removed support for automatic_image_tags, which was removed due to middleman
|
11
|
+
issue #2319.
|
12
|
+
- Added .gitattributes for proper language reporting in GitHub.
|
13
|
+
No version bump.
|
14
|
+
No new gem.
|
15
|
+
|
16
|
+
- Version 1.0.10 / 2018-April-28
|
17
|
+
|
18
|
+
- Update to 1.0.10 for use with newer middlemac.
|
19
|
+
|
20
|
+
- Version 1.0.9 / 2018-April-28
|
21
|
+
|
22
|
+
- Updated to 1.0.9. md_links no longer outputs empty quotes if no description.
|
23
|
+
|
24
|
+
- Version 1.0.8 / 2016-May-15
|
25
|
+
|
26
|
+
- Bump to 1.0.8 improvements:
|
27
|
+
- Better version management in Rakefile.
|
28
|
+
- Fixes failing Cucumber testing by forcing capybara development dependency.
|
29
|
+
|
30
|
+
- Version 1.0.7 / 2016-May-11
|
31
|
+
|
32
|
+
- Version 1.0.7 supports RAKE, Yard, etc.
|
33
|
+
- YARD support added.
|
34
|
+
- Cucumber tests added.
|
35
|
+
- Documentation project updates.
|
36
|
+
- Source code commented extensively for YARD.
|
37
|
+
|
4
38
|
- Version 1.0.6 / 2016-April-08
|
5
39
|
|
6
|
-
-
|
7
|
-
|
8
|
-
|
9
|
-
|
40
|
+
- Works cooperative if middleman-targets is installed to support images without extensions for target-specific images, too. Added CLI help section.
|
41
|
+
|
42
|
+
- Version 1.0.5 / 2016-April-07
|
43
|
+
|
44
|
+
- 1.0.5 Fixes id-ten-t issue.
|
45
|
+
|
46
|
+
- Version 1.0.4 / 2016-April-07
|
47
|
+
|
48
|
+
- Final gem fix.
|
49
|
+
|
50
|
+
- Version 1.0.3 / 2016-April-07
|
51
|
+
|
52
|
+
- Gem fixes.
|
53
|
+
|
54
|
+
- Version 1.0.2 / 2016-April-07
|
55
|
+
|
56
|
+
- Fix bad gem push.
|
10
57
|
|
11
|
-
- Version 1.0.
|
58
|
+
- Version 1.0.1 / 2016-April-07
|
12
59
|
|
13
|
-
-
|
14
|
-
always used, as Middleman using `:relative_assets` doesn't use the full
|
15
|
-
path.
|
60
|
+
- css_images_sizes fixed for relative_assets
|
16
61
|
|
17
62
|
- Version 1.0.0 / 2016-April-05
|
18
63
|
|
19
|
-
-
|
64
|
+
- middlemac-extras
|
65
|
+
Initial release.
|
data/Rakefile
CHANGED
@@ -1,10 +1,209 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'cucumber/rake/task'
|
3
|
+
require 'yard'
|
4
|
+
require 'git'
|
5
|
+
require File.expand_path('../lib/middlemac-extras/version.rb', __FILE__)
|
3
6
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
7
|
+
|
8
|
+
###############################################################################
|
9
|
+
# :default
|
10
|
+
# Define the default task.
|
11
|
+
###############################################################################
|
12
|
+
task :default => :test
|
13
|
+
|
14
|
+
|
15
|
+
###############################################################################
|
16
|
+
# :test
|
17
|
+
# Perform Cucumber testing.
|
18
|
+
###############################################################################
|
19
|
+
Cucumber::Rake::Task.new(:test, 'Features that must pass') do |task|
|
20
|
+
task.cucumber_opts = '--publish-quiet --require features --color --tags "not @wip" --strict --format pretty 2>/dev/null'
|
8
21
|
end
|
9
22
|
|
10
|
-
|
23
|
+
Cucumber::Rake::Task.new(:testnoisy, 'Features that must pass') do |task|
|
24
|
+
task.cucumber_opts = '--publish-quiet --require features --color --tags "not @wip" --strict --format pretty'
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
###############################################################################
|
29
|
+
# :yard
|
30
|
+
# Generate documentation using YARD. Note that there is a `.yardopts` file
|
31
|
+
# present that will load the `yard/yard_extensions.rb` file in order to
|
32
|
+
# control how output is generated. Output will be to the default `doc`
|
33
|
+
# directory using the template-grouped template, as a single page.
|
34
|
+
###############################################################################
|
35
|
+
YARD::Rake::YardocTask.new(:yard) do |task|
|
36
|
+
task.stats_options = ['--list-undoc']
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
###############################################################################
|
41
|
+
# :partials
|
42
|
+
# Generate documentation partials using YARD. These are used by the
|
43
|
+
# documentation project in order to include the API documentation.
|
44
|
+
###############################################################################
|
45
|
+
desc 'Make separate documents for documentation_project'
|
46
|
+
task :partials do
|
47
|
+
|
48
|
+
# Define the @!group to output file relationships.
|
49
|
+
sections = [
|
50
|
+
{ :file => '_yard_helpers.erb', :group => 'Helpers', },
|
51
|
+
{ :file => '_yard_helpers_extended.erb', :group => 'Extended Helpers' },
|
52
|
+
{ :file => '_yard_config.erb', :group => 'Extension Configuration' },
|
53
|
+
]
|
54
|
+
|
55
|
+
# Define the output directory.
|
56
|
+
dest = File.join('documentation_project', 'source', 'partials')
|
57
|
+
|
58
|
+
# Run YARD multiple times, filtering the group that interests us.
|
59
|
+
sections.each do |s|
|
60
|
+
params = [
|
61
|
+
"--query 'o.group == \"#{s[:group]}\" || has_tag?(:author)'",
|
62
|
+
"-o #{dest}",
|
63
|
+
"-t default",
|
64
|
+
"-p #{File.join(File.dirname(__FILE__), 'yard', 'template-partials')}"
|
65
|
+
]
|
66
|
+
command = "yardoc #{params.join(' ')}"
|
67
|
+
puts command
|
68
|
+
system(command)
|
69
|
+
File.rename( File.join(dest, 'index.html'), File.join(dest, s[:file]) )
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
|
75
|
+
###############################################################################
|
76
|
+
# :version
|
77
|
+
# Displays the current version.
|
78
|
+
###############################################################################
|
79
|
+
desc 'Displays the current version'
|
80
|
+
task :version do
|
81
|
+
puts "Current version: #{Middleman::MiddlemacExtras::VERSION}"
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
###############################################################################
|
86
|
+
# :version_finalize
|
87
|
+
# Remove any wip suffix from the version, as we are ready to release.
|
88
|
+
###############################################################################
|
89
|
+
desc 'Remove any wip suffix from the version'
|
90
|
+
task :version_finalize do
|
91
|
+
version_old = Middleman::MiddlemacExtras::VERSION
|
92
|
+
version_new = version_old.sub('.wip', '')
|
93
|
+
update_versions( version_new )
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
###############################################################################
|
98
|
+
# :version_next_wip
|
99
|
+
# Increment the patch level and add a wip suffix. We are ready for work.
|
100
|
+
###############################################################################
|
101
|
+
desc 'Increment the patch level and add a wip suffix'
|
102
|
+
task :version_next_wip do
|
103
|
+
version_old = Middleman::MiddlemacExtras::VERSION
|
104
|
+
version_new = version_old.sub('.wip', '').split('.')
|
105
|
+
version_new.last.succ!
|
106
|
+
version_new = version_new.join('.') + '.wip'
|
107
|
+
update_versions( version_new )
|
108
|
+
end
|
109
|
+
|
110
|
+
|
111
|
+
###############################################################################
|
112
|
+
# :version_set
|
113
|
+
# Sets an arbitrary version.
|
114
|
+
###############################################################################
|
115
|
+
desc 'Sets all of the files to the version specified. Use rake version_set[value].'
|
116
|
+
task :version_set, :new_version do |t, args|
|
117
|
+
update_versions( args[:new_version] )
|
118
|
+
end
|
119
|
+
|
120
|
+
|
121
|
+
###############################################################################
|
122
|
+
# :log
|
123
|
+
# Generate the CHANGELOG.md file.
|
124
|
+
###############################################################################
|
125
|
+
desc 'Generate the CHANGELOG.md file'
|
126
|
+
task :log do
|
127
|
+
report = ''
|
128
|
+
report << "middlemac-extras change log\n"
|
129
|
+
report << "===========================\n"
|
130
|
+
|
131
|
+
Git.open( File.expand_path('..', __FILE__) ).log.each_with_index do |l, i|
|
132
|
+
|
133
|
+
version = nil
|
134
|
+
if i == 0 && !l.name.start_with?('tags/')
|
135
|
+
version = "Version #{Middleman::MiddlemacExtras::VERSION}"
|
136
|
+
elsif l.name.end_with?('^0')
|
137
|
+
version = "Version #{l.name.match(/tags\/v(.*)\^0/)[1]}"
|
138
|
+
end
|
139
|
+
|
140
|
+
if version
|
141
|
+
report << "\n- #{version} / #{l.date.strftime('%Y-%B-%d')}\n"
|
142
|
+
report << "\n"
|
143
|
+
end
|
144
|
+
|
145
|
+
l.message.each_line.with_index do |line, lineno|
|
146
|
+
if lineno == 0
|
147
|
+
report << " - #{line}"
|
148
|
+
else
|
149
|
+
report << " #{line}" unless line.strip == ''
|
150
|
+
end
|
151
|
+
end
|
152
|
+
report << "\n"
|
153
|
+
end # Git.open
|
154
|
+
|
155
|
+
file = File.expand_path('../CHANGELOG.md', __FILE__)
|
156
|
+
File.write(file, report)
|
157
|
+
puts "The changelog has been written."
|
158
|
+
end
|
159
|
+
|
160
|
+
|
161
|
+
###############################################################################
|
162
|
+
# :pre_release
|
163
|
+
# Prepares the project for release.
|
164
|
+
###############################################################################
|
165
|
+
desc "Prepares the project for release"
|
166
|
+
task :pre_release do
|
167
|
+
|
168
|
+
if `git status -s`.length > 0
|
169
|
+
puts "Cannot continue because you have uncommitted changes."
|
170
|
+
exit 1
|
171
|
+
end
|
172
|
+
|
173
|
+
Rake::Task[:version_finalize].execute
|
174
|
+
Rake::Task[:partials].execute
|
175
|
+
Rake::Task[:log].execute
|
176
|
+
sh "git add -A"
|
177
|
+
sh "git commit --amend --no-edit"
|
178
|
+
end
|
179
|
+
|
180
|
+
private
|
181
|
+
|
182
|
+
|
183
|
+
###############################################################################
|
184
|
+
# update_versions
|
185
|
+
# Update the version in various files that depend on the correct version.
|
186
|
+
###############################################################################
|
187
|
+
def update_versions( version_new )
|
188
|
+
[ {
|
189
|
+
:file => File.expand_path('../lib/middlemac-extras/version.rb', __FILE__),
|
190
|
+
:regex => /(?<=VERSION = ')(.*)(?=')/
|
191
|
+
},
|
192
|
+
{
|
193
|
+
:file => File.expand_path('../documentation_project/Gemfile', __FILE__),
|
194
|
+
:regex => /(?<=gem 'middlemac-extras', '~> ).*(?=')/
|
195
|
+
},
|
196
|
+
{
|
197
|
+
:file => File.expand_path('../documentation_project/config.rb', __FILE__),
|
198
|
+
:regex => /(?<=def product_version\n ').*?(?='\n end)/m
|
199
|
+
},
|
200
|
+
].each do | item |
|
201
|
+
|
202
|
+
content = File.read( item[:file] )
|
203
|
+
content.gsub!( item[:regex], version_new )
|
204
|
+
File.write( item[:file], content )
|
205
|
+
puts "#{File.basename( item[:file] )} changed to '#{version_new}'."
|
206
|
+
end
|
207
|
+
|
208
|
+
Middleman::MiddlemacExtras::VERSION.replace version_new
|
209
|
+
end
|
@@ -9,9 +9,9 @@ gem 'wdm', '~> 0.1.0', platforms: [:mswin, :mingw]
|
|
9
9
|
gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby]
|
10
10
|
|
11
11
|
# Middleman Gems
|
12
|
-
gem 'middlemac-extras', '~> 1.0.
|
13
|
-
gem 'middleman', '~> 4.
|
12
|
+
gem 'middlemac-extras', '~> 1.0.11'
|
13
|
+
gem 'middleman', '~> 4.3.7'
|
14
14
|
gem 'middleman-syntax'
|
15
15
|
|
16
16
|
# Other required gems
|
17
|
-
gem 'fastimage', '~>
|
17
|
+
gem 'fastimage', '~> 2.0'
|
@@ -13,7 +13,7 @@
|
|
13
13
|
# so it's best to make sure they're activated first.
|
14
14
|
#==========================================================================
|
15
15
|
# activate :MiddlemanPageGroups
|
16
|
-
|
16
|
+
|
17
17
|
|
18
18
|
#==========================================================================
|
19
19
|
# Extension Setup
|
@@ -58,11 +58,7 @@ helpers do
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def product_version
|
61
|
-
'1.0.
|
62
|
-
end
|
63
|
-
|
64
|
-
def product_uri
|
65
|
-
'https://github.com/middlemac'
|
61
|
+
'1.0.11'
|
66
62
|
end
|
67
63
|
|
68
64
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
title: API Reference
|
3
|
+
blurb: Look at the API documentation for the helpers and configuration
|
4
|
+
settings directly.
|
5
|
+
layout: template-logo-medium
|
6
|
+
---
|
7
|
+
|
8
|
+
<%= md_links %>
|
9
|
+
<% content_for :seeAlso do %>
|
10
|
+
<ul>
|
11
|
+
<li><a href="/">Welcome to <code>middlemac-extras</code></a></li>
|
12
|
+
<li><a href="css_image_sizes.html">The <code>css_image_sizes</code> helper</a></li>
|
13
|
+
<li><a href="md_images.html">The <code>md_images</code> helper</a></li>
|
14
|
+
<li><a href="md_links.html">The <code>md_links</code> helper</a></li>
|
15
|
+
<li><a href="config_rb.html">Setting up <code>config.rb</code></a></li>
|
16
|
+
<li><a href="cli.html">Command line interface</a></li>
|
17
|
+
<li><a href="license.html">The MIT License</a></li>
|
18
|
+
</ul>
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
# <%= current_page.data.title %>
|
22
|
+
<%= current_page.data.blurb %>
|
23
|
+
|
24
|
+
## Configuration settings
|
25
|
+
|
26
|
+
<%= partial 'partials/yard_config' %>
|
27
|
+
|
28
|
+
* * *
|
29
|
+
|
30
|
+
## Extended Helpers
|
31
|
+
|
32
|
+
<%= partial 'partials/yard_helpers_extended' %>
|
33
|
+
|
34
|
+
* * *
|
35
|
+
|
36
|
+
## Helpers
|
37
|
+
|
38
|
+
<%= partial 'partials/yard_helpers' %>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
---
|
2
2
|
title: Command Line Interface
|
3
|
+
blurb: This gem offers a simple command line interface for building its own
|
4
|
+
documentation.
|
3
5
|
layout: template-logo-medium
|
4
6
|
---
|
5
7
|
|
6
8
|
# <%= current_page.data.title %>
|
7
|
-
|
8
|
-
`middlemac-extras` has a small command line interface that might be useful
|
9
|
-
for generating sample documentation.
|
9
|
+
<%= current_page.data.blurb %>
|
10
10
|
|
11
11
|
The CLI takes the format:
|
12
12
|
|
@@ -44,6 +44,7 @@ bundle exec middleman server
|
|
44
44
|
<li><a href="image_tag.html">The <code>image_tag</code> helper</a></li>
|
45
45
|
<li><a href="md_images.html">The <code>md_images</code> helper</a></li>
|
46
46
|
<li><a href="md_links.html">The <code>md_links</code> helper</a></li>
|
47
|
+
<li><a href="api_reference.html">API Reference</a></li>
|
47
48
|
<li><a href="license.html">The MIT License</a></li>
|
48
49
|
</ul>
|
49
50
|
<% end %>
|
@@ -2,8 +2,6 @@
|
|
2
2
|
title: Setting up config.rb
|
3
3
|
blurb: Review the key configuration values for making this extension work.
|
4
4
|
layout: template-logo-medium
|
5
|
-
order: 40
|
6
|
-
navigate: false
|
7
5
|
---
|
8
6
|
|
9
7
|
<%= md_links %>
|
@@ -14,6 +12,7 @@ navigate: false
|
|
14
12
|
<li><a href="image_tag.html">The <code>image_tag</code> helper</a></li>
|
15
13
|
<li><a href="md_images.html">The <code>md_images</code> helper</a></li>
|
16
14
|
<li><a href="md_links.html">The <code>md_links</code> helper</a></li>
|
15
|
+
<li><a href="api_reference.html">API Reference</a></li>
|
17
16
|
<li><a href="cli.html">Command line interface</a></li>
|
18
17
|
<li><a href="license.html">The MIT License</a></li>
|
19
18
|
</ul>
|