middleman-presentation-helpers 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -2
- data/Gemfile.lock +12 -6
- data/doc/licenses/dependencies.db +0 -0
- data/features/step_definitions.rb +6 -0
- data/features/support/ci.rb +2 -2
- data/features/support/fixtures.rb +2 -2
- data/fixtures/images/image01.png +0 -0
- data/fixtures/images/image02.png +0 -0
- data/lib/middleman-presentation/helpers/images.rb +2 -17
- data/lib/middleman-presentation/helpers/version.rb +1 -1
- data/templates/image_gallery.erb +3 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 815b863742226989eaf8d22173239a2504f073df
|
4
|
+
data.tar.gz: c21675e56dca857ce18fb0fe628d0613691f5a39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27c207d9176e67c9362df89fcdf47bc0da331502370fca55a0091b223f54e2142bd9c322adc682b30accbe3a0e763afdaa86383c48a4b402bfc0ca19b1100c6f
|
7
|
+
data.tar.gz: 147c34b334597e0de676a17751e927a25e68e0b063b9be98e93ca3a9bf9e2aed41c8db7045d119e98e7963f10e5b1f924cab355a4cfb39619c868e415943eb2b
|
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem 'middleman-presentation'
|
5
|
+
gem 'middleman-presentation', '>= 0.15.8'
|
6
6
|
|
7
7
|
group :development, :test do
|
8
8
|
gem 'rspec', require: false
|
@@ -41,9 +41,10 @@ group :development, :test do
|
|
41
41
|
gem 'command_exec', require: false
|
42
42
|
gem 'rake', require: false
|
43
43
|
gem 'launchy', require: false
|
44
|
+
gem 'hirb'
|
44
45
|
|
45
46
|
gem 'therubyracer'
|
46
47
|
gem 'therubyrhino'
|
47
48
|
|
48
|
-
gem 'fedux_org-stdlib'
|
49
|
+
gem 'fedux_org-stdlib', '>= 0.7.20'
|
49
50
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
middleman-presentation-helpers (0.0.
|
4
|
+
middleman-presentation-helpers (0.0.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
CFPropertyList (2.2.8)
|
9
10
|
abstract_type (0.0.7)
|
10
11
|
activesupport (4.1.5)
|
11
12
|
i18n (~> 0.6, >= 0.6.9)
|
@@ -84,7 +85,8 @@ GEM
|
|
84
85
|
erubis (2.7.0)
|
85
86
|
execjs (2.2.1)
|
86
87
|
facter (2.2.0)
|
87
|
-
|
88
|
+
CFPropertyList (~> 2.2.6)
|
89
|
+
fedux_org-stdlib (0.7.20)
|
88
90
|
activesupport
|
89
91
|
ffi (1.9.3)
|
90
92
|
filegen (0.4.3)
|
@@ -102,6 +104,7 @@ GEM
|
|
102
104
|
haml (4.0.5)
|
103
105
|
tilt
|
104
106
|
hike (1.2.3)
|
107
|
+
hirb (0.7.2)
|
105
108
|
hooks (0.4.0)
|
106
109
|
uber (~> 0.0.4)
|
107
110
|
httparty (0.13.1)
|
@@ -163,13 +166,15 @@ GEM
|
|
163
166
|
bundler
|
164
167
|
erubis
|
165
168
|
facter
|
166
|
-
fedux_org-stdlib (>= 0.
|
169
|
+
fedux_org-stdlib (>= 0.7.17)
|
170
|
+
hirb
|
167
171
|
i18n
|
168
172
|
kramdown
|
169
173
|
launchy (~> 2.4.2)
|
170
174
|
liquid
|
171
175
|
middleman (~> 3.3.4)
|
172
|
-
middleman-
|
176
|
+
middleman-presentation-helpers (>= 0.0.3)
|
177
|
+
middleman-sprockets (~> 3.3.8)
|
173
178
|
nokogiri
|
174
179
|
rake
|
175
180
|
tzinfo (>= 0.3.0)
|
@@ -342,15 +347,16 @@ DEPENDENCIES
|
|
342
347
|
coveralls
|
343
348
|
cucumber
|
344
349
|
erubis
|
345
|
-
fedux_org-stdlib
|
350
|
+
fedux_org-stdlib (>= 0.7.20)
|
346
351
|
filegen
|
347
352
|
foreman
|
348
353
|
fuubar
|
349
354
|
github-markup
|
355
|
+
hirb
|
350
356
|
inch
|
351
357
|
launchy
|
352
358
|
license_finder
|
353
|
-
middleman-presentation
|
359
|
+
middleman-presentation (>= 0.15.8)
|
354
360
|
middleman-presentation-helpers!
|
355
361
|
mutant
|
356
362
|
mutant-rspec
|
Binary file
|
data/features/support/ci.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
# Test helpers
|
2
|
-
require 'middleman-presentation/
|
3
|
-
World(Middleman::Presentation::
|
2
|
+
require 'middleman-presentation/test_helpers'
|
3
|
+
World(Middleman::Presentation::TestHelpers)
|
@@ -5,9 +5,9 @@ module Middleman
|
|
5
5
|
# Helper for fixtures
|
6
6
|
module Fixtures
|
7
7
|
def fixtures_manager
|
8
|
-
@fixtures_manager ||= FixturesManager.new
|
8
|
+
@fixtures_manager ||= FeduxOrg::FixturesManagement::FixturesManager.new
|
9
9
|
|
10
|
-
@fixtures_manager.load_fixtures(File.
|
10
|
+
@fixtures_manager.load_fixtures(File.expand_path('../../../fixtures', __FILE__))
|
11
11
|
|
12
12
|
@fixtures_manager
|
13
13
|
end
|
Binary file
|
Binary file
|
@@ -7,14 +7,11 @@ module Middleman
|
|
7
7
|
module Images
|
8
8
|
# Create image gallery
|
9
9
|
def image_gallery(images, image_gallery_id:)
|
10
|
-
template =
|
11
|
-
<a href="<%= image_path %>" data-lightbox="<%= image_gallery_id %>">
|
12
|
-
<img src="<%= image_path %>"<% if title %> alt="<%= title %>"<% end %> class="mp-preview-image">
|
13
|
-
</a>
|
14
|
-
EOS
|
10
|
+
template = File.read(File.expand_path('../../../../templates/image_gallery.erb', __FILE__)).chomp
|
15
11
|
|
16
12
|
images.each_with_object([]) do |(image, title), memo|
|
17
13
|
engine = Erubis::Eruby.new(template)
|
14
|
+
|
18
15
|
memo << engine.result(image_path: image, image_gallery_id: image_gallery_id, title: title)
|
19
16
|
end.join("\n")
|
20
17
|
end
|
@@ -23,18 +20,6 @@ module Middleman
|
|
23
20
|
def image(image)
|
24
21
|
image_gallery Array(image), image_gallery_id: SecureRandom.hex
|
25
22
|
end
|
26
|
-
|
27
|
-
# Find asset for substring
|
28
|
-
def find_asset(substring)
|
29
|
-
# sprockets.each_logical_path.find { |f| f.to_s.include? substring }
|
30
|
-
result = sprockets.each_file.find { |f| f.to_s.include? substring }
|
31
|
-
|
32
|
-
if result.blank?
|
33
|
-
Middleman::Presentation.t('errors.asset_not_found', asset: substring)
|
34
|
-
else
|
35
|
-
result.relative_path_from(Pathname.new(source_dir)).to_s
|
36
|
-
end
|
37
|
-
end
|
38
23
|
end
|
39
24
|
end
|
40
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-presentation-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Meyer
|
@@ -33,6 +33,7 @@ files:
|
|
33
33
|
- config/rubocop/exclude.yml
|
34
34
|
- config/rubocop/include.yml
|
35
35
|
- cucumber.yml
|
36
|
+
- doc/licenses/dependencies.db
|
36
37
|
- features/image_gallery.feature
|
37
38
|
- features/step_definitions.rb
|
38
39
|
- features/support/aruba.rb
|
@@ -40,10 +41,13 @@ files:
|
|
40
41
|
- features/support/env.rb
|
41
42
|
- features/support/fixtures.rb
|
42
43
|
- features/support/reporting.rb
|
44
|
+
- fixtures/images/image01.png
|
45
|
+
- fixtures/images/image02.png
|
43
46
|
- lib/middleman-presentation/helpers.rb
|
44
47
|
- lib/middleman-presentation/helpers/images.rb
|
45
48
|
- lib/middleman-presentation/helpers/version.rb
|
46
49
|
- middleman-presentation-helpers.gemspec
|
50
|
+
- templates/image_gallery.erb
|
47
51
|
homepage: https://github.com/maxmeyer/middleman-presentation-helpers
|
48
52
|
licenses:
|
49
53
|
- MIT
|