middleman-presentation-helpers 0.0.3 → 0.0.4

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: 50f09004b8d66cf5f765a3569e219d4487f52e93
4
- data.tar.gz: 11e6c093f9ce1781b2085c92f85a051f339a03ba
3
+ metadata.gz: 815b863742226989eaf8d22173239a2504f073df
4
+ data.tar.gz: c21675e56dca857ce18fb0fe628d0613691f5a39
5
5
  SHA512:
6
- metadata.gz: 3389255cf44e1802b99c6324691835b81a9df8f0f8c211f9b8fc3945f61436833a1972eb5cfd7f7769d193874d7b89368b63e2eeac68a5b0238c72bc53471d3d
7
- data.tar.gz: 3f4b770a845735bf7dd8664d0ed842384a32cfeecd26810dfa845f06a4739384d8cd480e157739e64eac5a525660cb17c21bcac189c5387a5f9a507ff3183415
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.2)
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
- fedux_org-stdlib (0.7.14)
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.6.48)
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-sprockets (~> 3.3.6)
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
@@ -1 +1,7 @@
1
1
  # encoding: utf-8
2
+
3
+ Given(/^an image "([^"]+)" at "([^"]+)"$/) do |source, destination|
4
+ source = source.gsub(/\.\./, '')
5
+ write_file File.join('source', destination), File.read(File.expand_path("../../fixtures/images/#{source}", __FILE__))
6
+ end
7
+
@@ -1,3 +1,3 @@
1
1
  # Test helpers
2
- require 'middleman-presentation/helpers/tests'
3
- World(Middleman::Presentation::Helpers::Tests)
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.join(Middleman::Presentation.root_path, 'fixtures'))
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 = <<-EOS.strip_heredoc.chomp
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
@@ -5,7 +5,7 @@ module Middleman
5
5
  module Presentation
6
6
  # Helpers
7
7
  module Helpers
8
- VERSION = '0.0.3'
8
+ VERSION = '0.0.4'
9
9
  end
10
10
  end
11
11
  end
@@ -0,0 +1,3 @@
1
+ <a href="<%= image_path %>" data-lightbox="<%= image_gallery_id %>">
2
+ <img src="<%= image_path %>"<% if title %> alt="<%= title %>"<% end %> class="mp-preview-image">
3
+ </a>
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.3
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