middlemac-extras 1.0.6 → 1.0.7
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 +4 -4
- data/.gitignore +8 -1
- data/.yardopts +7 -0
- data/CHANGELOG.md +26 -9
- data/Rakefile +209 -7
- data/documentation_project/Gemfile +3 -3
- data/documentation_project/config.rb +2 -2
- 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 +146 -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 +135 -43
- data/lib/middlemac-extras/version.rb +1 -1
- data/middlemac-extras.gemspec +11 -3
- 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 +92 -13
data/yard/readme.md
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
This gem provides conveniences to **Middleman** projects such as CSS-based image
|
2
|
+
size limits; easy-to-use Markdown link references (including title!);
|
3
|
+
easy-to-use Markdown image references; and an enhanced `image_tag` helper
|
4
|
+
that includes @2x images automatically.
|
5
|
+
|
6
|
+
It is standalone and can be used in any **Middleman** project.
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% scopes(method_listing(false)) do |list, scope| %>
|
2
|
+
<div id="<%= scope %>_method_details" class="method_details_list">
|
3
|
+
<% groups = list.group_by { |g| g.group.nil? ? 'ZZZ' : g.group }.sort.to_h %>
|
4
|
+
<% groups.each_value do |group| %>
|
5
|
+
<h2><%= group[0].group || "#{scope.to_s.capitalize} Method Details" %></h2>
|
6
|
+
<% group.each_with_index do |meth, i| %>
|
7
|
+
<%= yieldall :object => meth, :owner => object, :index => i %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% scopes(attr_listing) do |list, scope| %>
|
2
|
+
<div id="<%= scope %>_attr_details" class="attr_details">
|
3
|
+
<% list.each_with_index do |meth, i| %>
|
4
|
+
<% rw = meth.attr_info %>
|
5
|
+
<span id="<%= anchor_for(rw[meth.reader? ? :write : :read]) %>"></span>
|
6
|
+
<%= yieldall :object => meth, :owner => object, :index => i %>
|
7
|
+
<% end %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% scopes(method_listing(false)) do |list, scope| %>
|
2
|
+
<div class="method_details_list">
|
3
|
+
<% groups = list.group_by { |g| g.group.nil? ? 'ZZZ' : g.group }.sort.to_h %>
|
4
|
+
<% groups.each_value do |group| %>
|
5
|
+
<% group.each_with_index do |meth, i| %>
|
6
|
+
<%= yieldall :object => meth, :owner => object, :index => i %>
|
7
|
+
<% end %>
|
8
|
+
<% end %>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yieldall %>
|
@@ -0,0 +1,109 @@
|
|
1
|
+
##########################################################################
|
2
|
+
# Our template groups the methods by @group instead of lumping all of
|
3
|
+
# them together as instance methods. This is because most of them simply
|
4
|
+
# *aren't* instance methods but rather helpers or resource methods.
|
5
|
+
# This template will be used by default because .yardopts loads this
|
6
|
+
# file; however `rake partials` will override this template via the
|
7
|
+
# command line in order to use the `template-partials` instead.
|
8
|
+
##########################################################################
|
9
|
+
YARD::Templates::Engine.register_template_path File.join(File.dirname(__FILE__), 'template-grouped')
|
10
|
+
|
11
|
+
##########################################################################
|
12
|
+
# Force Yard to parse the helpers block in a Middleman extension.
|
13
|
+
#
|
14
|
+
# * Assign a generic "Helpers" group to each item if they don't have
|
15
|
+
# their own @group assignment. Note that @!group doesn't work in this
|
16
|
+
# section.
|
17
|
+
# * Add a @note to each item to distinguish them in a mixed up instance
|
18
|
+
# method detail section.
|
19
|
+
##########################################################################
|
20
|
+
class HelpersHandler < YARD::Handlers::Ruby::Base
|
21
|
+
handles method_call(:helpers)
|
22
|
+
namespace_only
|
23
|
+
|
24
|
+
def process
|
25
|
+
|
26
|
+
statement.last.last.each do |node|
|
27
|
+
|
28
|
+
extra = ''
|
29
|
+
|
30
|
+
# Find out if there's a @group assigned.
|
31
|
+
extra << '@group Helpers' unless node.docstring.match(/^@group (.*?)$/i)
|
32
|
+
|
33
|
+
# Clean up the doc string because we like - and = borders.
|
34
|
+
# Force the note and group on each of these "fake" methods.
|
35
|
+
if node.docstring
|
36
|
+
docstring = node.docstring
|
37
|
+
docstring = docstring.gsub(/^[\-=]+\n/, '')
|
38
|
+
docstring = docstring.gsub(/[\-=]+$/, '')
|
39
|
+
docstring << extra
|
40
|
+
node.docstring = docstring
|
41
|
+
else
|
42
|
+
node.docstring = extra
|
43
|
+
end
|
44
|
+
|
45
|
+
parse_block(node, :owner => self.owner)
|
46
|
+
end # do
|
47
|
+
|
48
|
+
end # def
|
49
|
+
|
50
|
+
end # class
|
51
|
+
|
52
|
+
|
53
|
+
##########################################################################
|
54
|
+
# Force Yard to parse the resources.each block in a Middleman extension.
|
55
|
+
#
|
56
|
+
# * Assign a generic "Resource Extensions" group to each item if they
|
57
|
+
# don't have their own @group assignment. Note that @!group
|
58
|
+
# doesn't work in this section.
|
59
|
+
# * Force each item to have a `@visibility public` because we will
|
60
|
+
# probably have `@visibility private` in the wrapping method.
|
61
|
+
# * Add a @note to each item to distinguish them in a mixed up instance
|
62
|
+
# method detail section.
|
63
|
+
##########################################################################
|
64
|
+
class ResourcesHandler < YARD::Handlers::Ruby::Base
|
65
|
+
handles :def
|
66
|
+
namespace_only
|
67
|
+
|
68
|
+
def process
|
69
|
+
extra = <<HEREDOC
|
70
|
+
@visibility public
|
71
|
+
HEREDOC
|
72
|
+
|
73
|
+
return unless statement.method_name(true).to_sym == :manipulate_resource_list
|
74
|
+
|
75
|
+
# Block consists of everything in the actual `do` block
|
76
|
+
block = statement.last.first.last.last
|
77
|
+
block.each do | node |
|
78
|
+
if node.type == :defs
|
79
|
+
# Clean up the doc string because we like - and = borders.
|
80
|
+
# Force the note and public on each of these "fake" methods.
|
81
|
+
if node.docstring
|
82
|
+
docstring = node.docstring
|
83
|
+
docstring = docstring.gsub(/^[\-=]+\n/, '')
|
84
|
+
docstring = docstring.gsub(/[\-=]+$/, '')
|
85
|
+
docstring << extra
|
86
|
+
else
|
87
|
+
docstring = extra
|
88
|
+
end
|
89
|
+
|
90
|
+
# Find out if there's a @group assigned.
|
91
|
+
if ( group = docstring.match(/^@group (.*?)$/i) )
|
92
|
+
group = group[1]
|
93
|
+
else
|
94
|
+
group = 'Resource Extensions'
|
95
|
+
end
|
96
|
+
|
97
|
+
def_name = node[2][0]
|
98
|
+
object = YARD::CodeObjects::MethodObject.new(namespace, "resource.#{def_name}")
|
99
|
+
register(object)
|
100
|
+
object.dynamic = true
|
101
|
+
object.source = node.source.clone
|
102
|
+
object[:docstring] = docstring
|
103
|
+
object[:group] = group
|
104
|
+
end
|
105
|
+
end # do
|
106
|
+
|
107
|
+
end # def
|
108
|
+
|
109
|
+
end # class
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middlemac-extras
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Derry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '4.1'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 4.1.
|
22
|
+
version: 4.1.7
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '4.1'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 4.1.
|
32
|
+
version: 4.1.7
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: middleman-cli
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '4.1'
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 4.1.
|
42
|
+
version: 4.1.7
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,27 +49,83 @@ dependencies:
|
|
49
49
|
version: '4.1'
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 4.1.
|
52
|
+
version: 4.1.7
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: fastimage
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: '
|
59
|
+
version: '2.0'
|
60
|
+
type: :runtime
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - "~>"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '2.0'
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: middleman
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '4.1'
|
60
74
|
- - ">="
|
61
75
|
- !ruby/object:Gem::Version
|
62
|
-
version: 1.
|
63
|
-
type: :
|
76
|
+
version: 4.1.7
|
77
|
+
type: :development
|
64
78
|
prerelease: false
|
65
79
|
version_requirements: !ruby/object:Gem::Requirement
|
66
80
|
requirements:
|
67
81
|
- - "~>"
|
68
82
|
- !ruby/object:Gem::Version
|
69
|
-
version: '1
|
83
|
+
version: '4.1'
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 4.1.7
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: bundler
|
89
|
+
requirement: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '1.6'
|
94
|
+
type: :development
|
95
|
+
prerelease: false
|
96
|
+
version_requirements: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '1.6'
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: rake
|
103
|
+
requirement: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '10.3'
|
108
|
+
type: :development
|
109
|
+
prerelease: false
|
110
|
+
version_requirements: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '10.3'
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: git
|
117
|
+
requirement: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
type: :development
|
123
|
+
prerelease: false
|
124
|
+
version_requirements: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
70
126
|
- - ">="
|
71
127
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
128
|
+
version: '0'
|
73
129
|
description: Implements several useful developer conveniences for Middleman projects.
|
74
130
|
email:
|
75
131
|
- balthisar@gmail.com
|
@@ -79,6 +135,7 @@ extensions: []
|
|
79
135
|
extra_rdoc_files: []
|
80
136
|
files:
|
81
137
|
- ".gitignore"
|
138
|
+
- ".yardopts"
|
82
139
|
- CHANGELOG.md
|
83
140
|
- Gemfile
|
84
141
|
- LICENSE.md
|
@@ -89,6 +146,7 @@ files:
|
|
89
146
|
- documentation_project/Gemfile
|
90
147
|
- documentation_project/README.md
|
91
148
|
- documentation_project/config.rb
|
149
|
+
- documentation_project/source/api_reference.html.md.erb
|
92
150
|
- documentation_project/source/archives/about.html.md.erb
|
93
151
|
- documentation_project/source/archives/index.html.md.erb
|
94
152
|
- documentation_project/source/archives/past_far/about.html.md.erb
|
@@ -126,15 +184,34 @@ files:
|
|
126
184
|
- documentation_project/source/license.html.md.erb
|
127
185
|
- documentation_project/source/md_images.html.md.erb
|
128
186
|
- documentation_project/source/md_links.html.md.erb
|
187
|
+
- documentation_project/source/partials/_yard_config.erb
|
188
|
+
- documentation_project/source/partials/_yard_helpers.erb
|
189
|
+
- documentation_project/source/partials/_yard_helpers_extended.erb
|
129
190
|
- documentation_project/source/stylesheets/_github.scss
|
130
191
|
- documentation_project/source/stylesheets/_middlemac_minimal.scss
|
131
192
|
- documentation_project/source/stylesheets/_normalize.scss
|
132
193
|
- documentation_project/source/stylesheets/css_image_sizes.css.erb
|
133
194
|
- documentation_project/source/stylesheets/style.css.scss
|
195
|
+
- features/helpers.feature
|
196
|
+
- features/support/env.rb
|
197
|
+
- fixtures/middlemac_extras_app/config.rb
|
198
|
+
- fixtures/middlemac_extras_app/source/images/middlemac-extras-small.png
|
199
|
+
- fixtures/middlemac_extras_app/source/images/middlemac-extras-small@2x.png
|
200
|
+
- fixtures/middlemac_extras_app/source/images/middlemac-extras-smaller.png
|
201
|
+
- fixtures/middlemac_extras_app/source/index.html.md.erb
|
134
202
|
- lib/middlemac-extras.rb
|
135
203
|
- lib/middlemac-extras/extension.rb
|
136
204
|
- lib/middlemac-extras/version.rb
|
137
205
|
- middlemac-extras.gemspec
|
206
|
+
- yard/readme.md
|
207
|
+
- yard/template-grouped/default/module/html/method_details_list.erb
|
208
|
+
- yard/template-partials/default/method_details/setup.rb
|
209
|
+
- yard/template-partials/default/module/html/attribute_details.erb
|
210
|
+
- yard/template-partials/default/module/html/method_details_list.erb
|
211
|
+
- yard/template-partials/default/module/setup.rb
|
212
|
+
- yard/template-partials/default/onefile/html/layout.erb
|
213
|
+
- yard/template-partials/default/onefile/html/setup.rb
|
214
|
+
- yard/yard_extensions.rb
|
138
215
|
homepage: https://github.com/middlemac/middlemac-extras
|
139
216
|
licenses:
|
140
217
|
- MIT
|
@@ -155,9 +232,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
232
|
version: '0'
|
156
233
|
requirements: []
|
157
234
|
rubyforge_project:
|
158
|
-
rubygems_version: 2.
|
235
|
+
rubygems_version: 2.5.1
|
159
236
|
signing_key:
|
160
237
|
specification_version: 4
|
161
238
|
summary: Implements several useful developer conveniences for Middleman projects.
|
162
|
-
test_files:
|
239
|
+
test_files:
|
240
|
+
- features/helpers.feature
|
241
|
+
- features/support/env.rb
|
163
242
|
has_rdoc:
|