jekyll_album_generator 0.0.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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/album_generator.rb +58 -0
  3. metadata +58 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 073f1b1aa1d8dc4421d791b91644968d4609253b
4
+ data.tar.gz: 45751645cf397ef455b7659379fcd3bef68b71ae
5
+ SHA512:
6
+ metadata.gz: da8d9f032747b6d623b0922a024af13ce44acbf3336f33766c57c0e6faadf2e6f97685ad751bd5288031afb318a9093c11cf19f6ab610ff2916d07a64bcd9f42
7
+ data.tar.gz: 20fc774245399880d02bd535c800baec9fddf29cf55a8b6f17b0ca7fa8d210600595ff0dbf03c5645f8900c2956043144aa3659c2a7a1ac72637b96bf0eede8d
@@ -0,0 +1,58 @@
1
+ # Copyright 2015 Johan Ask.
2
+ # E-mail: jhnesk@gmail.com
3
+ #
4
+ # This file is part of Jekyll Album Generator.
5
+ #
6
+ # Jekyll Album Generator is free software: you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License as published
8
+ # by the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # Jekyll Album Generator is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13
+ # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ # General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU General Public License along
17
+ # with Jekyll Album Generator. If not, see <http://www.gnu.org/licenses/>.
18
+ #
19
+ require "exifr"
20
+
21
+ module Jekyll
22
+
23
+ class AlbumGenerator < Generator
24
+
25
+ def generate(site)
26
+ file = File.open("_data/albums.yml", "w")
27
+ print_albums(file)
28
+ file.close
29
+ end
30
+
31
+ def print_albums(output)
32
+ Dir.glob('albums/*').each do |album|
33
+ print_album(output, album)
34
+ end
35
+ end
36
+
37
+ def print_album(output, dir)
38
+ output.puts '- album: ' + File.basename(dir)
39
+ output.puts ' photos:'
40
+ Dir.glob(dir + '/*.jpg').each do |image|
41
+ print_image(output, image)
42
+ end
43
+ end
44
+
45
+ def print_image(output, image)
46
+ exif = EXIFR::JPEG.new(image)
47
+ output.puts ' - image : ' + File.basename(image)
48
+ output.puts ' time : ' + exif.date_time.to_s
49
+ output.puts ' width : ' + exif.width.to_s
50
+ output.puts ' height : ' + exif.height.to_s
51
+ if(exif.gps)
52
+ output.puts ' gps:'
53
+ output.puts ' longitude: ' + exif.gps.longitude.to_s
54
+ output.puts ' latitude : ' + exif.gps.latitude.to_s
55
+ end
56
+ end
57
+ end
58
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll_album_generator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Johan Ask
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: exifr
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
27
+ description: Jekyll plugin for generating photo album data
28
+ email: jhnesk@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - lib/album_generator.rb
34
+ homepage: https://github.com/jhnesk/jekyll-album-generator
35
+ licenses:
36
+ - GPL-3.0
37
+ metadata: {}
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubyforge_project:
54
+ rubygems_version: 2.4.5.1
55
+ signing_key:
56
+ specification_version: 4
57
+ summary: Jekyll Album Generator
58
+ test_files: []