photo-helper 0.5.5 → 0.5.6

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: 4f793d621388e948911926c3f3a4d8a0198d6b2da1d1e13dad185eb7ca8b3bf8
4
- data.tar.gz: c459e096a41bc7213571782befc9f2fe397209516b7e74e7e9bdbdd58e6f0f61
3
+ metadata.gz: 267cd7787b42ba92cc8a5cbb0b2fc3b6df7c89e9f9e329448d15ca2b0497f312
4
+ data.tar.gz: 50a2f2411eb195e74445652ce13e6bd3e5aaefc7b2e9a9fba8134cb0530d786d
5
5
  SHA512:
6
- metadata.gz: 762600a20e6d62978c90a5ae69f75bf736790753e12c8545b6ff1a822d6a23f3cef5f52f0b7808c2a65761cc8c352465f6bbd08918f1192d7738936d3f71e228
7
- data.tar.gz: 201b2a1fb043de1c27ef0cfeac1eb6a05b6c6f7ac72f7d7560af745c9f142defdc1140309ac01ea4c44e137abfeb72ffa718dd23b0968367d837afcafc5b373c
6
+ metadata.gz: 3b9af79a851d3be2e57a1c20189fd0e145a415f09046a95820b8c97cf6d9dc82d64dd6b6cba3effc9edd6bde73a05bab5fc1705e0f2dfaa74de0d93519a48b50
7
+ data.tar.gz: 626ca8ea86130530e073ec17f3144376e104b618edbff9c057f26203d15423899b7e8fa6d2721b0ea0f453f5f94df5c33e6a5f990562fa3ffaea5b06b961b904
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- photo-helper (0.5.5)
4
+ photo-helper (0.5.6)
5
5
  ejson
6
6
  mimemagic
7
7
  mini_magick
@@ -8,7 +8,7 @@ class SmugmugAlbumHelper
8
8
  attr_accessor :smugmug_api
9
9
 
10
10
  PATH_REGEX = %r{^.+Pictures\/.+\/(\d{4})\/(\d{2})_.+\/[^_]+_([^\/]+)}
11
- KEYWORD_WHITELITS = %w(instagram exported)
11
+ # KEYWORD_WHITELITS = %w(instagram exported)
12
12
 
13
13
  def self.supported_folder?(search_path)
14
14
  PATH_REGEX.match?(search_path)
@@ -37,7 +37,9 @@ class SmugmugAlbumHelper
37
37
  def initialize(search_path, album = nil)
38
38
  @search_extensions = IMAGE_EXTENSIONS.concat(["XMP"])
39
39
 
40
+
40
41
  @search_path = Pathname.new(search_path)
42
+
41
43
  @smugmug = SmugmugAPI.new
42
44
 
43
45
  @album_name = album || album_name
@@ -52,6 +54,7 @@ class SmugmugAlbumHelper
52
54
 
53
55
  def parse_path
54
56
  if matches = "#{@search_path}/".to_s.match(PATH_REGEX)
57
+ @album_root = Pathname.new(matches[0])
55
58
  @year = matches[1]
56
59
  @month = Date::MONTHNAMES[matches[2].to_i].capitalize
57
60
  @location = matches[3].split("_").map(&:capitalize).join(' ')
@@ -180,10 +183,6 @@ class SmugmugAlbumHelper
180
183
  trash_album_name = File.join("trash/#{album_name}")
181
184
  trash_album = @smugmug.get_or_create_album(trash_album_name)
182
185
  @smugmug.move_images(to_delete.map{ |u| u[:uri] }, trash_album[:id])
183
- # to_delete.each do |uploaded|
184
- # puts uploaded[:filename]
185
- # @smugmug.http(:delete, uploaded[:uri])
186
- # end
187
186
  end
188
187
  end
189
188
 
@@ -284,9 +283,9 @@ class SmugmugAlbumHelper
284
283
  end
285
284
 
286
285
  def image_dir_keywords(image)
287
- rel = Pathname.new(image).relative_path_from(@search_path).to_s.downcase.split("/")
288
- # ignore first and last parts
289
- rel &= KEYWORD_WHITELITS
286
+ rel = Pathname.new(image).relative_path_from(@album_root).to_s.downcase.split("/")
287
+ # drop filename
288
+ rel.pop
290
289
  return nil if rel.empty?
291
290
  rel
292
291
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module PhotoHelper
3
- VERSION = '0.5.5'
3
+ VERSION = '0.5.6'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: photo-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Caldwell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-28 00:00:00.000000000 Z
11
+ date: 2018-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler