rails_picture 0.1.0 → 0.1.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
  SHA256:
3
- metadata.gz: fd4140b9acfe949a1136ddac2aea263a8a41b9c7a8debacd3f6bcf4ddd29d1ae
4
- data.tar.gz: de1e24091ae6463f7411b54211a3825fddd0bf9128b714d47a7c4f6256d915a0
3
+ metadata.gz: 28574426228d63c2304d47b30fed29314d5215e5a1a0f383179205fd5c5185c5
4
+ data.tar.gz: ddd1854b8e4548fc6cf7f10fb54533003c5a36ba9c6af74aa0748f80715a277c
5
5
  SHA512:
6
- metadata.gz: e33635308b8eb1e57c3d68920256c60678e5526efbc13f6e91be25309d28a5004751db1e7c315465e88f3ecb5f2c00cd94ed0c123178b07ab2651108284d6bdc
7
- data.tar.gz: 1b839f929c3df94113f30f28e89ce7670505ccb0624ee37304a527fd213143b152bae091f389250381508513878eee5f5c732ff1bc676c3fe88b473f03e4834c
6
+ metadata.gz: 9cb47838919e94a48cb9dbb4c7c50a2597b8f6431585b9888308743f272fa62c827e629def29e2b168d9b8f2382d98152f7dd2964ffbf588a0e113bb15179eab
7
+ data.tar.gz: acc96233d5e7db84475eb0164554ef573160baadf9af1615ddfc7b7934aa3f73e2d6357d56e70b64c4a92f0cf5e41865ee4009b94c6a4458c2c86bd327abb4b4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_picture (0.1.0)
4
+ rails_picture (0.1.1)
5
5
  rails (~> 6.1.3)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -71,7 +71,7 @@ Add this line to your application's Gemfile:
71
71
 
72
72
  ```ruby
73
73
 
74
- gem 'rails_picture'
74
+ gem 'rails_picture'
75
75
 
76
76
  ```
77
77
 
@@ -85,7 +85,7 @@ bundle install
85
85
 
86
86
  ## Usage
87
87
 
88
- 1. Put multiple same-named images with different file formats into `app/assets/`
88
+ 1. Put multiple same-named images with different file formats into `app/assets/images/`
89
89
 
90
90
  2. Place following code into any Rails view. It takes the same options as Rails built in `image_tag` :
91
91
 
@@ -10,20 +10,20 @@ module RailsPicture
10
10
  def picture_tag(filename, **options)
11
11
  html = []
12
12
 
13
- SOURCE_FORMATS.each { |f| html << source_tag(filename, f) }
13
+ SOURCE_FORMATS.each { |f| html << build_source_tag(filename, f) }
14
14
 
15
- html << image_tag(filename, **options)
15
+ html << build_image_tag(filename, **options)
16
16
 
17
17
  tag.picture { safe_join html }
18
18
  end
19
19
 
20
20
  private
21
21
 
22
- def source_tag(filename, format)
22
+ def build_source_tag(filename, format)
23
23
  tag.source(srcset: asset_path(filename, format), type: "image/#{format}")
24
24
  end
25
25
 
26
- def image_tag(filename, **options)
26
+ def build_image_tag(filename, **options)
27
27
  tag.img(src: find_img_format(filename), alt: filename.humanize, **options)
28
28
  end
29
29
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsPicture
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_picture
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oskars Ezerins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-16 00:00:00.000000000 Z
11
+ date: 2021-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails