preadly-bulbasaur 0.7.0 → 0.7.1

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: 0dc0a73c1850ae685cf72ca24ef60eb89f72b28e
4
- data.tar.gz: 82073826c2a3eae44106a25afdc82c16cf6ec853
3
+ metadata.gz: 75b989582785e56fa7033a634ef68f664118cc2b
4
+ data.tar.gz: a622c9d1db2fc88f0b053859bcd8e6ea3ec4ee69
5
5
  SHA512:
6
- metadata.gz: eb0a1cf64c3eb6f738b37e9ee54814c544fe69447053145ae6a8320ade4221dd7ac3b535cff41ae881c9eb662f3b200ad7b157a6750d975251eb2d529b679196
7
- data.tar.gz: a75600ad921fad3dd30e56c5fa0e47ce2efba244a5c49b8d12523c1696fa42da23d9f6328ad96eff88e43dfe746a1a762f66b202d8e1c0a83d59c01e76da3da0
6
+ metadata.gz: 87a4cc64a0ea8f231b59f4446ca1319bece8f51ca41900d427c1fd4e585f3dba855919a2ca21da0314d903798a3bc124134c357ab1436adf4bdb7c6f4174626c
7
+ data.tar.gz: cb01394e15a2b9cd0e376d2b438ab4237398bc104b7fd1c93e0bf312d4cf485f7cba236a9dff04005ce398a1a0bcb25a9ee550af593379b7ff684da939505de2
@@ -17,7 +17,7 @@ module Bulbasaur
17
17
 
18
18
  def check_for_attrs(element)
19
19
  @target_attrs.each do |attr|
20
- if element.xpath "@#{attr}"
20
+ if element.at "@#{attr}"
21
21
  adjust element, "@#{attr}"
22
22
  break
23
23
  end
@@ -3,7 +3,7 @@ module Bulbasaur
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 7
6
- PATCH = 0
6
+ PATCH = 1
7
7
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
8
8
  end
9
9
 
@@ -4,7 +4,7 @@ RSpec.describe Bulbasaur::NormalizeImageSources do
4
4
  subject { described_class.new(html, target_attrs).call }
5
5
 
6
6
  describe '#call' do
7
- let(:html) { '<img src="http://somewhere.to/get/a-pixel.gif" data-lazy-src="http://somewhere.to/get/the-real-image.jpg" alt="Image" width="800" height="1200">' }
7
+ let(:html) { '<img src="http://somewhere.to/get/a-pixel.gif" data-lazy-src="http://somewhere.to/get/the-real-image.jpg" alt="Image" width="800" height="1200"><img src="http://somewhere.to/get/another-pixel.gif" data-image="http://somewhere.to/get/the-other-real-image.jpg"><img src="http://somewhere.to/get/a-third-pixel.gif" data-src="http://somewhere.to/get/the-third-real-image.jpg">' }
8
8
 
9
9
  context 'when there are no target attributes' do
10
10
  let(:target_attrs) { [] }
@@ -15,10 +15,10 @@ RSpec.describe Bulbasaur::NormalizeImageSources do
15
15
  end
16
16
 
17
17
  context 'when there are target attributes' do
18
- let(:target_attrs) { %w(data-lazy-src) }
18
+ let(:target_attrs) { %w(data-lazy-src data-image) }
19
19
 
20
- it 'returns the HTML code with the image tags adjusted' do
21
- expect(subject).to eq '<img src="http://somewhere.to/get/the-real-image.jpg" alt="Image" width="800" height="1200">'
20
+ it 'returns the HTML code with the specified image tags adjusted' do
21
+ expect(subject).to eq '<img src="http://somewhere.to/get/the-real-image.jpg" alt="Image" width="800" height="1200"><img src="http://somewhere.to/get/the-other-real-image.jpg"><img src="http://somewhere.to/get/a-third-pixel.gif" data-src="http://somewhere.to/get/the-third-real-image.jpg">'
22
22
  end
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preadly-bulbasaur
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magno Costa