flickr_sync 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/flickr_sync/cli.rb +8 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fdf01f58886c741d0d674670401666e0930ff9e
4
- data.tar.gz: 225ff5361e96660ab4f1648867ca52d910605ebd
3
+ metadata.gz: 261656c86a10baf79c11bc9acc5082d318fc9521
4
+ data.tar.gz: 69a73711d2734d901c1dde6452f378e41eed3dc4
5
5
  SHA512:
6
- metadata.gz: 3d38e4df203f74c19d417dd06ba34db09251a36907faeabadb8c5f22a2f77aa08d758c5ebfc48fafafa08ba74f6acb9539e3db4c60ad6ba380270be8ff09083d
7
- data.tar.gz: 124e56e8ec0d3f1ce205fc1085fef457d194a978c771d06a2934585929e73f2bec85078c57b4f5619132958b5f458bda20c55608437b9dfe562a7b8b0c3a3b63
6
+ metadata.gz: fe547d5886662e21ec9ce4ae6be680a136cd4744edf7eefef1b561f8cf2b2840780ea3bfdd4b08f45a2713da0a01c757126e37f46f98b3da9f21feac5d98d426
7
+ data.tar.gz: b8d54dbdef7a7a664d60b79cae314ead69f1d9a6d337cc7648f4b54c6349cdf16fa76a678f4c6cec8ce887d62a7757968f32331a5d4596138582857daec737af
@@ -5,10 +5,14 @@ require 'splat'
5
5
 
6
6
  module FlickrSync
7
7
  class Cli < Clamp::Command
8
+ IMAGES_ONLY = %w{.jpg .gif .m4v}
9
+ IMAGES_AND_VIDEO = IMAGES_ONLY + %w{.mp4 .mov}
10
+
8
11
  attr_reader :preferences
9
12
  attr_reader :prompt
10
13
 
11
14
  # option "--optimistic", :flag, "assume there are no duplicates"
15
+ option "--video", :flag, "include videos"
12
16
  parameter "DIRECTORY_PATH", "the folder containing images"
13
17
 
14
18
  def api_key
@@ -60,8 +64,10 @@ module FlickrSync
60
64
  written_path = File.join directory_path, 'written.txt'
61
65
  duplicates_path = File.join directory_path, 'duplicates.txt'
62
66
 
63
- allfiles = `find "#{directory_path}"`.split("\n").select {|p| ['.jpg', '.gif', '.m4v'].include? File.extname(p).downcase}
64
- puts "Found #{allfiles.count} image files"
67
+ file_extensions = video? ? IMAGES_AND_VIDEO : IMAGES_ONLY
68
+
69
+ allfiles = `find "#{directory_path}"`.split("\n").select {|p| file_extensions.include? File.extname(p).downcase}
70
+ puts "Found #{allfiles.count} #{video? ? 'image/video' : 'image'} files"
65
71
  writtenfiles = load_list written_path
66
72
  puts "Found #{writtenfiles.count} previously sent files"
67
73
  newfiles = allfiles - writtenfiles
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickr_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Ryall