iphoto_backup 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44c4fce9fadb69fc79509c4e8985821fd195f200
4
- data.tar.gz: 138043130b9820d45a1f5c8825b4c6e0ca43b20a
3
+ metadata.gz: 9dc6333b0ff52d5877e21a81cc783da8c1425a1a
4
+ data.tar.gz: d40cfb52061a847c085d444e7bd5aec1a6db2323
5
5
  SHA512:
6
- metadata.gz: 3e29cf915394e78d8ebaa78b9608512a5a398b690d621f93ddac8d486a45cf779649f31525a783e8f04ca6ad5d12337cd7b999103d8e888eb3c5b077d44c1041
7
- data.tar.gz: 1a83b334c6cf959d7a0dd4b5fbba0f3a1c6bc06a2e509ac28ac7ad8a9147f61b1ddf5d155f17d9da74f81d765b15b5b7dcf9ff3b1f5f00308cefcebc09a20b56
6
+ metadata.gz: a2a91715481008c95ae63674149c22503ba73464fe1ecec5da343128a9b5673ba47681c2ac4bab5e7503dfb0fb743f761f807a3e87eb7a2489ebae61bf0482ac
7
+ data.tar.gz: 33649f5162aeec4b51ad59e191e5aba8938c403d07f432d1b3337eb8cabd82febc76b3b962ed095d28197747f5c55d56f9b6e5f6d4121f6b894dae9f6d4e789c
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.0.0-p353
1
+ 2.1.2
@@ -13,6 +13,7 @@ module IphotoBackup
13
13
  option :output, desc: 'directory to export albums to', aliases: '-o', default: DEFAULT_OUTPUT_DIRECTORY
14
14
  option :config, desc: 'iPhoto AlbumData.xml file to process', aliases: '-c', default: IPHOTO_ALBUM_PATH
15
15
  option :'include-date-prefix', desc: 'automatically include ISO8601 date prefix to exported events', aliases: '-d', default: false, type: :boolean
16
+ option :albums, desc: 'export albums instead of events', aliases: '-a', default: false, type: :boolean
16
17
  def export
17
18
  each_album do |folder_name, album_info|
18
19
  say "\n\nProcessing Roll: #{folder_name}..."
@@ -38,7 +39,7 @@ module IphotoBackup
38
39
  private
39
40
 
40
41
  def each_album(&block)
41
- albums = value_for_dictionary_key("List of Rolls").children.select {|n| n.name == 'dict' }
42
+ albums = value_for_dictionary_key(album_type).children.select {|n| n.name == 'dict' }
42
43
  albums.each do |album_info|
43
44
  folder_name = album_name album_info
44
45
 
@@ -50,6 +51,10 @@ module IphotoBackup
50
51
  end
51
52
  end
52
53
 
54
+ def album_type
55
+ options[:album] ? 'List of Albums' : 'List of Rolls'
56
+ end
57
+
53
58
  def album_name(album_info)
54
59
  folder_name = value_for_dictionary_key('RollName', album_info).content
55
60
 
@@ -1,3 +1,3 @@
1
1
  module IphotoBackup
2
- VERSION = "1.0.2"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -1,6 +1,26 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <plist version="1.0">
3
3
  <dict>
4
+ <key>List of Albums</key>
5
+ <array>
6
+ <dict>
7
+ <key>RollID</key>
8
+ <integer>640</integer>
9
+ <key>RollName</key>
10
+ <string>Summer Party</string>
11
+ <key>RollDateAsTimerInterval</key>
12
+ <real>21600.000000</real>
13
+ <key>KeyPhotoKey</key>
14
+ <string>1001</string>
15
+ <key>PhotoCount</key>
16
+ <integer>4</integer>
17
+ <key>KeyList</key>
18
+ <array>
19
+ <string>1001</string>
20
+ <string>1002</string>
21
+ </array>
22
+ </dict>
23
+ </array>
4
24
  <key>List of Rolls</key>
5
25
  <array>
6
26
  <dict>
@@ -37,10 +37,10 @@ describe IphotoBackup::CLI do
37
37
  end
38
38
  context 'with basic options' do
39
39
  it 'creates folder for first event' do
40
- expect(File.exists?('tmp/backup/Summer Party')).to be_true
40
+ expect(File.exists?('tmp/backup/Summer Party')).to eq true
41
41
  end
42
42
  it 'creates folder for second event' do
43
- expect(File.exists?('tmp/backup/2013-10-10 Fall Supper')).to be_true
43
+ expect(File.exists?('tmp/backup/2013-10-10 Fall Supper')).to eq true
44
44
  end
45
45
  it 'copies images for first event' do
46
46
  expect(Dir.glob('tmp/backup/Summer Party/*.jpg').length).to eq 2
@@ -58,13 +58,26 @@ describe IphotoBackup::CLI do
58
58
  }
59
59
  }
60
60
  it 'creates folder for first event' do
61
- expect(File.exists?('tmp/backup/Summer Party')).to be_true
61
+ expect(File.exists?('tmp/backup/Summer Party')).to eq true
62
62
  end
63
63
  it 'does not createfolder for second event' do
64
- expect(File.exists?('tmp/backup/2013-10-10 Fall Supper')).to be_false
64
+ expect(File.exists?('tmp/backup/2013-10-10 Fall Supper')).to eq false
65
65
  end
66
66
  end
67
- context 'with --include-date-prefix option', focus: true do
67
+ context 'with --albums option' do
68
+ let(:options) {
69
+ {
70
+ config: 'tmp/AlbumData.xml',
71
+ output: TMP_OUTPUT_DIRECTORY,
72
+ filter: '.*',
73
+ albums: true
74
+ }
75
+ }
76
+ it 'creates folder for album' do
77
+ expect(File.exists?('tmp/backup/Summer Party')).to eq true
78
+ end
79
+ end
80
+ context 'with --include-date-prefix option' do
68
81
  let(:options) {
69
82
  {
70
83
  config: 'tmp/AlbumData.xml',
@@ -74,10 +87,10 @@ describe IphotoBackup::CLI do
74
87
  }
75
88
  }
76
89
  it 'creates folder for first event and adds date prefix' do
77
- expect(File.exists?('tmp/backup/2013-10-02 Summer Party')).to be_true
90
+ expect(File.exists?('tmp/backup/2013-10-02 Summer Party')).to eq true
78
91
  end
79
92
  it 'creates folder for second event and uses existing date prefix' do
80
- expect(File.exists?('tmp/backup/2013-10-10 Fall Supper')).to be_true
93
+ expect(File.exists?('tmp/backup/2013-10-10 Fall Supper')).to eq true
81
94
  end
82
95
  end
83
96
  end
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iphoto_backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Sonnek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-02 00:00:00.000000000 Z
11
+ date: 2014-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: tool for backing up iPhoto files
@@ -102,10 +102,10 @@ executables:
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
- - .gitignore
106
- - .rspec
107
- - .ruby-version
108
- - .travis.yml
105
+ - ".gitignore"
106
+ - ".rspec"
107
+ - ".ruby-version"
108
+ - ".travis.yml"
109
109
  - Gemfile
110
110
  - LICENSE.txt
111
111
  - README.md
@@ -131,17 +131,17 @@ require_paths:
131
131
  - lib
132
132
  required_ruby_version: !ruby/object:Gem::Requirement
133
133
  requirements:
134
- - - '>='
134
+ - - ">="
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - '>='
139
+ - - ">="
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
143
  rubyforge_project:
144
- rubygems_version: 2.0.14
144
+ rubygems_version: 2.2.2
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: copy files out of iPhoto into a backup directory