m1key_gallery_generator 0.3.10 → 0.3.12

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: 9a05edfc5a9ca0d7c63469789151df09ad2e0b25361906e2ce65029e356cdf15
4
- data.tar.gz: d61e9e6d030bcc057875952485eaddd87e939a2d3a2081d56137d4789f65ecbb
3
+ metadata.gz: '08442ae82a99eb2c9253cd9d0ff798a48cf004627394b1d752473e56f672ce76'
4
+ data.tar.gz: 953a20a23228155023d61c7a3f0d72d094635c797eadde1b312e65c7c9cdda47
5
5
  SHA512:
6
- metadata.gz: f9315fd151a474dfcb8e210c848b9f07bb5246ec546fb60ea0e3e1531f6104351b8c2b7a68f89689d86295d016af364797ed29105fccfccf5b5fd39dc821d9d7
7
- data.tar.gz: 0f74dd1dfb2e798d657d81e40464db66081d39bdc77decf36dab6c08c43bd680316711155757af1350f92dd39010f6927a2d34f8a0357b47661416925b969aea
6
+ metadata.gz: c1e8f7322aa6036c60856aee438ec1766c3cf29f01608a370c330aa4602558c9d863062537e89e06f8c02216cacb988a4eba43d4d2f48607b766e990c8206faa
7
+ data.tar.gz: 890eef5203fe474eb0048e3ba9810c46051da6ef3b5f787e58a44871f7d57434f6ddd381c22fefdb2dd985a5acbecad33b557e1bfbe37d9041f5203d50a61721
data/README.md CHANGED
@@ -74,11 +74,11 @@ Build the gem.
74
74
 
75
75
  Install the gem.
76
76
 
77
- > gem install m1key_gallery_generator-0.3.10.gem
77
+ > gem install m1key_gallery_generator-0.3.12.gem
78
78
 
79
79
  In your gallery directory, have a file called generate.bat that looks like this:
80
80
 
81
- > ruby c:\Ruby34-x64\lib\ruby\gems\3.4.0\gems\m1key_gallery_generator-0.3.10\bin\console . wait_on_error
81
+ > ruby c:\Ruby34-x64\lib\ruby\gems\3.4.0\gems\m1key_gallery_generator-0.3.12\bin\console . wait_on_error
82
82
 
83
83
  ## Development
84
84
 
@@ -95,7 +95,7 @@ To build gem:
95
95
  > gem build m1key_gallery_generator.gemspec
96
96
 
97
97
  To install gem:
98
- > gem install m1key_gallery_generator-0.3.10.gem
98
+ > gem install m1key_gallery_generator-0.3.12.gem
99
99
 
100
100
  To test gem:
101
101
  > irb
data/bin/console CHANGED
@@ -3,6 +3,7 @@
3
3
  require 'm1key_gallery_generator'
4
4
  require 'erb'
5
5
  require 'htmlentities'
6
+ require 'date'
6
7
 
7
8
  Encoding.default_external = Encoding::UTF_8
8
9
 
@@ -29,10 +30,14 @@ begin
29
30
  viewable_photos = photos_config_into_viewable_photos(working_directory, gallery_config)
30
31
 
31
32
  puts 'Creating viewable gallery...'
32
-
33
+ update_date = gallery_config.update_date
34
+ if update_date.to_s == ''
35
+ update_date = Date.today.strftime('%Y-%m-%d')
36
+ end
33
37
  gallery = ViewableGallery.new(gallery_config.title, gallery_config.description, gallery_config.slug,
34
38
  gallery_config.sources, gallery_config.upload_date, gallery_config.map_url, gallery_config.map_title,
35
- gallery_config.year, viewable_photos, gallery_config.small_print, gallery_config.blurb, gallery_config.genre).
39
+ gallery_config.year, viewable_photos, gallery_config.small_print, gallery_config.blurb, gallery_config.genre,
40
+ update_date).
36
41
  update_using(
37
42
  add_tabs_before_every_description_line(3),
38
43
  add_links_to_descriptions,
@@ -5,7 +5,7 @@ require_relative 'console_utils'
5
5
  module GalleryGenerator
6
6
  class GalleryConfig
7
7
 
8
- attr_reader :title, :map_url, :map_title, :slug, :upload_date, :description, :sources, :year, :photos, :small_print, :blurb, :genre
8
+ attr_reader :title, :map_url, :map_title, :slug, :upload_date, :description, :sources, :year, :photos, :small_print, :blurb, :genre, :update_date
9
9
 
10
10
  def initialize(yaml_config_file_name)
11
11
  puts "Attempting to parse #{yaml_config_file_name} to read gallery configuration..."
@@ -23,6 +23,8 @@ module GalleryGenerator
23
23
  puts "Gallery slug is [#{@slug}]."
24
24
  @upload_date = gallery_configuration['upload_date']
25
25
  puts "Gallery upload date is [#{@upload_date}]."
26
+ @update_date = gallery_configuration['update_date']
27
+ puts "Gallery updated date is [#{@update_date}]."
26
28
  @description = gallery_configuration['description']
27
29
  puts "Gallery description is [#{compact(@description)}]."
28
30
  @small_print = gallery_configuration['small_print']
@@ -40,7 +40,7 @@
40
40
  "name": "<%= title %> by Michal Huniewicz",
41
41
  "url": "https://www.m1key.me/<%= genre %>/<%= slug %>",
42
42
  "datePublished": "<%= upload_date %>",
43
- "dateModified": "<%= upload_date %>",
43
+ "dateModified": "<%= update_date %>",
44
44
  "author": {
45
45
  "@type": "Person",
46
46
  "name": "Michal Huniewicz",
@@ -112,7 +112,7 @@
112
112
  <%= description -%>
113
113
  <% if small_print.to_s != '' %>
114
114
  <p><%= small_print -%></p><% end %>
115
- <p class="smallprint">Uploaded on: <%= upload_date %>.</p>
115
+ <p class="smallprint">Uploaded on: <%= upload_date %>. Updated on: <%= update_date %>.</p>
116
116
  </section>
117
117
 
118
118
  <figure class="map">
@@ -137,14 +137,16 @@
137
137
  </figcaption>
138
138
  </figure>
139
139
  </article>
140
- <% end %>
140
+ <% end -%>
141
+ <% if sources %>
141
142
  <details class="sources" id="sources">
142
143
  <summary>Sources</summary>
143
144
  <ul class="smallprint"><% sources.each_with_index do |source, index| %>
144
145
  <li><%= index + 1 %>: <a href="<%= source %>" rel="noopener noreferrer" class="nav-link"><% if source.length > 100 %><%= source[0..50] %>[...]<%= source[-30..-1] %><% else %><%= source %><% end -%></a></li><% end %>
145
146
  </ul>
146
147
  </details>
147
-
148
+ <% end -%>
149
+
148
150
  <nav class="navigation" aria-label="Gallery navigation bottom">
149
151
  <ul>
150
152
  <li><a href="../" class="nav-link">&lt; Back to <%= genre.capitalize %></a></li>
@@ -1,3 +1,3 @@
1
1
  module M1keyGalleryGenerator
2
- VERSION = '0.3.10'
2
+ VERSION = '0.3.12'
3
3
  end
@@ -2,13 +2,14 @@ require_relative 'string_utils'
2
2
 
3
3
  module GalleryGenerator
4
4
  class ViewableGallery
5
- attr_reader :title, :description, :slug, :sources, :upload_date, :map_url, :map_title, :year, :photos, :small_print, :blurb, :genre
6
- def initialize(title, description, slug, sources, upload_date, map_url, map_title, year, viewable_photos, small_print, blurb, genre)
5
+ attr_reader :title, :description, :slug, :sources, :upload_date, :map_url, :map_title, :year, :photos, :small_print, :blurb, :genre, :update_date
6
+ def initialize(title, description, slug, sources, upload_date, map_url, map_title, year, viewable_photos, small_print, blurb, genre, update_date)
7
7
  @title = String.new(title)
8
8
  @description = description
9
9
  @slug = slug
10
10
  @sources = sources
11
11
  @upload_date = upload_date
12
+ @update_date = update_date
12
13
  @map_url = map_url
13
14
  @map_title = map_title
14
15
  @year = year
@@ -31,7 +32,7 @@ module GalleryGenerator
31
32
 
32
33
  ViewableGallery.new(updated_gallery.title, updated_gallery.description, updated_gallery.slug,
33
34
  updated_gallery.sources, updated_gallery.upload_date, updated_gallery.map_url,
34
- updated_gallery.map_title, updated_gallery.year, to_viewable_photos(updated_gallery.photos), updated_gallery.small_print, updated_gallery.blurb, updated_gallery.genre)
35
+ updated_gallery.map_title, updated_gallery.year, to_viewable_photos(updated_gallery.photos), updated_gallery.small_print, updated_gallery.blurb, updated_gallery.genre, updated_gallery.update_date)
35
36
  end
36
37
 
37
38
  def to_viewable_photos(mutable_viewable_photos)
@@ -43,7 +44,7 @@ module GalleryGenerator
43
44
  end
44
45
 
45
46
  class MutableViewableGallery
46
- attr_accessor :title, :description, :slug, :sources, :upload_date, :map_url, :map_title, :year, :photos, :small_print, :blurb, :genre
47
+ attr_accessor :title, :description, :slug, :sources, :upload_date, :map_url, :map_title, :year, :photos, :small_print, :blurb, :genre, :update_date
47
48
  def initialize(viewable_gallery)
48
49
  @title = viewable_gallery.title
49
50
  @description = viewable_gallery.description
@@ -57,6 +58,7 @@ module GalleryGenerator
57
58
  @small_print = viewable_gallery.small_print
58
59
  @blurb = viewable_gallery.blurb
59
60
  @genre = viewable_gallery.genre
61
+ @update_date = viewable_gallery.update_date
60
62
  end
61
63
 
62
64
  def to_mutable_viewable_photos(viewable_photos)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: m1key_gallery_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Huniewicz