aperture 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. data/.document +5 -0
  2. data/.gitignore +22 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +20 -0
  5. data/Rakefile +69 -0
  6. data/VERSION +1 -0
  7. data/aperture.gemspec +198 -0
  8. data/lib/aperture.rb +20 -0
  9. data/lib/aperture/album.rb +17 -0
  10. data/lib/aperture/library.rb +95 -0
  11. data/lib/aperture/photo.rb +27 -0
  12. data/lib/aperture/photo_set.rb +88 -0
  13. data/lib/aperture/project.rb +16 -0
  14. data/lib/aperture/version.rb +20 -0
  15. data/test/data/ Built-in Smart Albums/.implicitAlbum +123 -0
  16. data/test/data/ Built-in Smart Albums/090-entireLibraryQuery.apsmartalbum +159 -0
  17. data/test/data/ Built-in Smart Albums/100-selectsQuery.apsmartalbum +159 -0
  18. data/test/data/ Built-in Smart Albums/200-oneStarQuery.apsmartalbum +159 -0
  19. data/test/data/ Built-in Smart Albums/300-rejectedQuery.apsmartalbum +159 -0
  20. data/test/data/ Built-in Smart Albums/400-inTheLastWeekQuery.apsmartalbum +159 -0
  21. data/test/data/ Built-in Smart Albums/500-inTheLastMonthQuery.apsmartalbum +159 -0
  22. data/test/data/ Built-in Smart Albums/Info.apfolder +26 -0
  23. data/test/data/.implicitAlbum +123 -0
  24. data/test/data/DSLR.approject/2009-12-11 @ 10:09:42 AM - 1.apimportgroup/CRW_0001 - 2008-07-04 at 11-34-52/CRW_0001 - 2008-07-04 at 11-34-52.CRW.apfile +40 -0
  25. data/test/data/DSLR.approject/2009-12-11 @ 10:09:42 AM - 1.apimportgroup/CRW_0001 - 2008-07-04 at 11-34-52/Info.apmaster +18 -0
  26. data/test/data/DSLR.approject/2009-12-11 @ 10:09:42 AM - 1.apimportgroup/CRW_0001 - 2008-07-04 at 11-34-52/OriginalVersionInfo.apversion +162 -0
  27. data/test/data/DSLR.approject/2009-12-11 @ 10:09:42 AM - 1.apimportgroup/CRW_0001 - 2008-07-04 at 11-34-52/Version-1.apversion +215 -0
  28. data/test/data/DSLR.approject/2009-12-11 @ 10:09:52 AM - 2.apimportgroup/CRW_0002 - 2008-07-04 at 11-36-00/CRW_0002 - 2008-07-04 at 11-36-00.CRW.apfile +40 -0
  29. data/test/data/DSLR.approject/2009-12-11 @ 10:09:52 AM - 2.apimportgroup/CRW_0002 - 2008-07-04 at 11-36-00/Info.apmaster +18 -0
  30. data/test/data/DSLR.approject/2009-12-11 @ 10:09:52 AM - 2.apimportgroup/CRW_0002 - 2008-07-04 at 11-36-00/OriginalVersionInfo.apversion +162 -0
  31. data/test/data/DSLR.approject/2009-12-11 @ 10:09:52 AM - 2.apimportgroup/CRW_0002 - 2008-07-04 at 11-36-00/Version-1.apversion +215 -0
  32. data/test/data/DSLR.approject/2009-12-11 @ 10:10:03 AM - 3.apimportgroup/CRW_0003 - 2008-07-04 at 11-36-00/CRW_0003 - 2008-07-04 at 11-36-00.CRW.apfile +40 -0
  33. data/test/data/DSLR.approject/2009-12-11 @ 10:10:03 AM - 3.apimportgroup/CRW_0003 - 2008-07-04 at 11-36-00/Info.apmaster +18 -0
  34. data/test/data/DSLR.approject/2009-12-11 @ 10:10:03 AM - 3.apimportgroup/CRW_0003 - 2008-07-04 at 11-36-00/OriginalVersionInfo.apversion +162 -0
  35. data/test/data/DSLR.approject/2009-12-11 @ 10:10:03 AM - 3.apimportgroup/CRW_0003 - 2008-07-04 at 11-36-00/Version-1.apversion +215 -0
  36. data/test/data/DSLR.approject/2009-12-11 @ 10:10:11 AM - 4.apimportgroup/CRW_0004 - 2008-07-04 at 11-36-02/CRW_0004 - 2008-07-04 at 11-36-02.CRW.apfile +40 -0
  37. data/test/data/DSLR.approject/2009-12-11 @ 10:10:11 AM - 4.apimportgroup/CRW_0004 - 2008-07-04 at 11-36-02/Info.apmaster +18 -0
  38. data/test/data/DSLR.approject/2009-12-11 @ 10:10:11 AM - 4.apimportgroup/CRW_0004 - 2008-07-04 at 11-36-02/OriginalVersionInfo.apversion +162 -0
  39. data/test/data/DSLR.approject/2009-12-11 @ 10:10:11 AM - 4.apimportgroup/CRW_0004 - 2008-07-04 at 11-36-02/Version-1.apversion +215 -0
  40. data/test/data/DSLR.approject/2009-12-11 @ 10:10:21 AM - 5.apimportgroup/CRW_0005 - 2008-07-04 at 11-36-38/CRW_0005 - 2008-07-04 at 11-36-38.CRW.apfile +40 -0
  41. data/test/data/DSLR.approject/2009-12-11 @ 10:10:21 AM - 5.apimportgroup/CRW_0005 - 2008-07-04 at 11-36-38/Info.apmaster +18 -0
  42. data/test/data/DSLR.approject/2009-12-11 @ 10:10:21 AM - 5.apimportgroup/CRW_0005 - 2008-07-04 at 11-36-38/OriginalVersionInfo.apversion +162 -0
  43. data/test/data/DSLR.approject/2009-12-11 @ 10:10:21 AM - 5.apimportgroup/CRW_0005 - 2008-07-04 at 11-36-38/Version-1.apversion +215 -0
  44. data/test/data/DSLR.approject/2009-12-11 @ 10:10:30 AM - 6.apimportgroup/CRW_0006 - 2008-07-04 at 11-40-50/CRW_0006 - 2008-07-04 at 11-40-50.CRW.apfile +40 -0
  45. data/test/data/DSLR.approject/2009-12-11 @ 10:10:30 AM - 6.apimportgroup/CRW_0006 - 2008-07-04 at 11-40-50/Info.apmaster +18 -0
  46. data/test/data/DSLR.approject/2009-12-11 @ 10:10:30 AM - 6.apimportgroup/CRW_0006 - 2008-07-04 at 11-40-50/OriginalVersionInfo.apversion +162 -0
  47. data/test/data/DSLR.approject/2009-12-11 @ 10:10:30 AM - 6.apimportgroup/CRW_0006 - 2008-07-04 at 11-40-50/Version-1.apversion +215 -0
  48. data/test/data/DSLR.approject/2009-12-11 @ 10:10:39 AM - 7.apimportgroup/CRW_0007 - 2008-07-04 at 11-54-00/CRW_0007 - 2008-07-04 at 11-54-00.CRW.apfile +40 -0
  49. data/test/data/DSLR.approject/2009-12-11 @ 10:10:39 AM - 7.apimportgroup/CRW_0007 - 2008-07-04 at 11-54-00/Info.apmaster +18 -0
  50. data/test/data/DSLR.approject/2009-12-11 @ 10:10:39 AM - 7.apimportgroup/CRW_0007 - 2008-07-04 at 11-54-00/OriginalVersionInfo.apversion +162 -0
  51. data/test/data/DSLR.approject/2009-12-11 @ 10:10:39 AM - 7.apimportgroup/CRW_0007 - 2008-07-04 at 11-54-00/Version-1.apversion +215 -0
  52. data/test/data/DSLR.approject/2009-12-11 @ 10:10:51 AM - 8.apimportgroup/CRW_0008 - 2008-07-04 at 11-54-02/CRW_0008 - 2008-07-04 at 11-54-02.CRW.apfile +40 -0
  53. data/test/data/DSLR.approject/2009-12-11 @ 10:10:51 AM - 8.apimportgroup/CRW_0008 - 2008-07-04 at 11-54-02/Info.apmaster +18 -0
  54. data/test/data/DSLR.approject/2009-12-11 @ 10:10:51 AM - 8.apimportgroup/CRW_0008 - 2008-07-04 at 11-54-02/OriginalVersionInfo.apversion +162 -0
  55. data/test/data/DSLR.approject/2009-12-11 @ 10:10:51 AM - 8.apimportgroup/CRW_0008 - 2008-07-04 at 11-54-02/Version-1.apversion +215 -0
  56. data/test/data/DSLR.approject/2009-12-11 @ 10:10:59 AM - 9.apimportgroup/CRW_0009 - 2008-07-04 at 11-54-48/CRW_0009 - 2008-07-04 at 11-54-48.CRW.apfile +40 -0
  57. data/test/data/DSLR.approject/2009-12-11 @ 10:10:59 AM - 9.apimportgroup/CRW_0009 - 2008-07-04 at 11-54-48/Info.apmaster +18 -0
  58. data/test/data/DSLR.approject/2009-12-11 @ 10:10:59 AM - 9.apimportgroup/CRW_0009 - 2008-07-04 at 11-54-48/OriginalVersionInfo.apversion +162 -0
  59. data/test/data/DSLR.approject/2009-12-11 @ 10:10:59 AM - 9.apimportgroup/CRW_0009 - 2008-07-04 at 11-54-48/Version-1.apversion +215 -0
  60. data/test/data/DSLR.approject/Album.implicitAlbum +123 -0
  61. data/test/data/DSLR.approject/Info.apfolder +36 -0
  62. data/test/data/Info.apfolder +24 -0
  63. data/test/data/Misc.approject/2009-12-10 @ 04:09:41 PM - 1.apimportgroup/IMG_0459/IMG_0459 - 2009-12-01 at 22-51-38.PNG.apfile +40 -0
  64. data/test/data/Misc.approject/2009-12-10 @ 04:09:41 PM - 1.apimportgroup/IMG_0459/Info.apmaster +18 -0
  65. data/test/data/Misc.approject/2009-12-10 @ 04:09:41 PM - 1.apimportgroup/IMG_0459/OriginalVersionInfo.apversion +95 -0
  66. data/test/data/Misc.approject/2009-12-10 @ 04:09:41 PM - 1.apimportgroup/IMG_0459/Version-1.apversion +107 -0
  67. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/2008-Costume Contest 030.jpg.apfile +40 -0
  68. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Info.apmaster +18 -0
  69. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/OriginalVersionInfo.apversion +137 -0
  70. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-1.apversion +164 -0
  71. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-10.apversion +162 -0
  72. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-11.apversion +162 -0
  73. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-2.apversion +162 -0
  74. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-3.apversion +162 -0
  75. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-4.apversion +162 -0
  76. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-5.apversion +162 -0
  77. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-6.apversion +162 -0
  78. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-7.apversion +162 -0
  79. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-8.apversion +162 -0
  80. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-9.apversion +162 -0
  81. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/IMG_3690/IMG_3690.jpg.apfile +40 -0
  82. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/IMG_3690/Info.apmaster +18 -0
  83. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/IMG_3690/OriginalVersionInfo.apversion +131 -0
  84. data/test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/IMG_3690/Version-1.apversion +152 -0
  85. data/test/data/Misc.approject/Album.implicitAlbum +132 -0
  86. data/test/data/Misc.approject/Halloween.apalbum +145 -0
  87. data/test/data/Misc.approject/Info.apfolder +36 -0
  88. data/test/data/TestFolder/.implicitAlbum +123 -0
  89. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1753/IMG_1753.JPG.apfile +40 -0
  90. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1753/Info.apmaster +18 -0
  91. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1753/OriginalVersionInfo.apversion +139 -0
  92. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1753/Version-1.apversion +160 -0
  93. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1754/IMG_1754.JPG.apfile +40 -0
  94. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1754/Info.apmaster +18 -0
  95. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1754/OriginalVersionInfo.apversion +139 -0
  96. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1754/Version-1.apversion +160 -0
  97. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1755/IMG_1755.JPG.apfile +40 -0
  98. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1755/Info.apmaster +18 -0
  99. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1755/OriginalVersionInfo.apversion +139 -0
  100. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1755/Version-1.apversion +160 -0
  101. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1756/IMG_1756.JPG.apfile +40 -0
  102. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1756/Info.apmaster +18 -0
  103. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1756/OriginalVersionInfo.apversion +139 -0
  104. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1756/Version-1.apversion +160 -0
  105. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1757/IMG_1757.JPG.apfile +40 -0
  106. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1757/Info.apmaster +18 -0
  107. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1757/OriginalVersionInfo.apversion +139 -0
  108. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1757/Version-1.apversion +160 -0
  109. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1758/IMG_1758.JPG.apfile +40 -0
  110. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1758/Info.apmaster +18 -0
  111. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1758/OriginalVersionInfo.apversion +139 -0
  112. data/test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1758/Version-1.apversion +160 -0
  113. data/test/data/TestFolder/Fireworks.approject/Album.implicitAlbum +123 -0
  114. data/test/data/TestFolder/Fireworks.approject/Info.apfolder +36 -0
  115. data/test/data/TestFolder/Info.apfolder +26 -0
  116. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1943/IMG_1943.JPG.apfile +40 -0
  117. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1943/Info.apmaster +18 -0
  118. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1943/OriginalVersionInfo.apversion +139 -0
  119. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1943/Version-1.apversion +162 -0
  120. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1944/IMG_1944.JPG.apfile +40 -0
  121. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1944/Info.apmaster +18 -0
  122. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1944/OriginalVersionInfo.apversion +139 -0
  123. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1944/Version-1.apversion +162 -0
  124. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1945/IMG_1945.JPG.apfile +40 -0
  125. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1945/Info.apmaster +18 -0
  126. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1945/OriginalVersionInfo.apversion +139 -0
  127. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1945/Version-1.apversion +162 -0
  128. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1946/IMG_1946.JPG.apfile +40 -0
  129. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1946/Info.apmaster +18 -0
  130. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1946/OriginalVersionInfo.apversion +139 -0
  131. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1946/Version-1.apversion +162 -0
  132. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1947/IMG_1947.JPG.apfile +40 -0
  133. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1947/Info.apmaster +18 -0
  134. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1947/OriginalVersionInfo.apversion +139 -0
  135. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1947/Version-1.apversion +162 -0
  136. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1948/IMG_1948.JPG.apfile +40 -0
  137. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1948/Info.apmaster +18 -0
  138. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1948/OriginalVersionInfo.apversion +139 -0
  139. data/test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1948/Version-1.apversion +162 -0
  140. data/test/data/TestFolder/PAX.approject/Album.implicitAlbum +123 -0
  141. data/test/data/TestFolder/PAX.approject/Info.apfolder +36 -0
  142. data/test/data/TestRootAlbum.apalbum +135 -0
  143. data/test/data/dotMacWebGalleryProject.approject/Album.implicitAlbum +123 -0
  144. data/test/data/dotMacWebGalleryProject.approject/Info.apfolder +34 -0
  145. data/test/data/iPhone.apsmartalbum +280 -0
  146. data/test/helper.rb +20 -0
  147. data/test/test_album.rb +18 -0
  148. data/test/test_library.rb +85 -0
  149. data/test/test_photo.rb +48 -0
  150. data/test/test_photo_set.rb +92 -0
  151. data/test/test_project.rb +19 -0
  152. data/test/test_version.rb +39 -0
  153. metadata +213 -0
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ doc
19
+ rdoc
20
+ pkg
21
+
22
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Kyle Burckhard
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,20 @@
1
+ = aperture
2
+
3
+ Library that converts the set of plist files from a Aperture photo library into ruby objects. Everything is parsed from a root location into projects, albums, photos and versions. Also gives you access to statistical information for the library as a whole, as well as projects and albums, see +Aperture::PhotoSet+.
4
+
5
+ This gem requires the +plist+ gem.
6
+
7
+ == Note on Patches/Pull Requests
8
+
9
+ * Fork the project.
10
+ * Make your feature addition or bug fix.
11
+ * Add tests for it. This is important so I don't break it in a
12
+ future version unintentionally.
13
+ * Commit, do not mess with rakefile, version, or history.
14
+ (if you want to have your own version, that is fine but
15
+ bump version in a commit by itself I can ignore when I pull)
16
+ * Send me a pull request. Bonus points for topic branches.
17
+
18
+ == Copyright
19
+
20
+ Copyright (c) 2009 Kyle Burckhard. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,69 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "aperture"
8
+ gem.summary = %Q{Statistical analysis library for Aperture Photo Libraries}
9
+ gem.description = %Q{Parses out the files from a Aperture Photo Library to give useful figures and check consistancy of the Library itself.}
10
+ gem.email = "kyle.burckhard@gmail.com"
11
+ gem.homepage = "http://github.com/talaris/aperture"
12
+ gem.authors = ["Kyle Burckhard"]
13
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
14
+ end
15
+ Jeweler::GemcutterTasks.new
16
+ rescue LoadError
17
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
18
+ end
19
+
20
+ require 'rake/testtask'
21
+ Rake::TestTask.new(:test) do |test|
22
+ test.libs << 'lib' << 'test'
23
+ test.pattern = 'test/**/test_*.rb'
24
+ test.verbose = true
25
+ end
26
+
27
+ begin
28
+ require 'rcov/rcovtask'
29
+ Rcov::RcovTask.new do |test|
30
+ test.libs << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
33
+ end
34
+ rescue LoadError
35
+ task :rcov do
36
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
37
+ end
38
+ end
39
+
40
+ task :test => :check_dependencies
41
+
42
+ task :default => :test
43
+
44
+ require 'fileutils'
45
+ require 'find'
46
+ namespace "library" do
47
+ desc "Copies key directories and metadata files from an Aperture library into 'test/data'. Defaults to cloning your entire Aperture Library."
48
+ task :clone, [:library_path, :test_path] do |t, args|
49
+ args.with_defaults(
50
+ :library_path => File.join(ENV['HOME'], 'Pictures', 'Aperture Library.aplibrary'),
51
+ :test_path => File.join(File.dirname(__FILE__), 'test', 'data')
52
+ )
53
+ library_path, test_path = args[:library_path], args[:test_path]
54
+
55
+ raise ArgumentError, "Requires valid directory path" unless File.directory?(library_path)
56
+ FileUtils.mkdir_p(test_path)
57
+
58
+
59
+ Find.find(library_path) do |path|
60
+ clone_path = File.join(test_path, path.partition(library_path)[2])
61
+ Find.prune if path =~ /Thumbnails|Previews/
62
+ FileUtils.mkdir_p(clone_path) if File.directory?(path)
63
+ if path =~ /\.apfolder|\.implicitAlbum|\.apsmartalbum|\.apmaster|\.apversion|\.apfile|\.apalbum/
64
+ FileUtils.cp(path, clone_path)
65
+ end
66
+ end
67
+
68
+ end
69
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.3.0
data/aperture.gemspec ADDED
@@ -0,0 +1,198 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{aperture}
8
+ s.version = "0.3.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Kyle Burckhard"]
12
+ s.date = %q{2009-12-16}
13
+ s.description = %q{Parses out the files from a Aperture Photo Library to give useful figures and check consistancy of the Library itself.}
14
+ s.email = %q{kyle.burckhard@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "aperture.gemspec",
27
+ "lib/aperture.rb",
28
+ "lib/aperture/album.rb",
29
+ "lib/aperture/library.rb",
30
+ "lib/aperture/photo.rb",
31
+ "lib/aperture/photo_set.rb",
32
+ "lib/aperture/project.rb",
33
+ "lib/aperture/version.rb",
34
+ "test/data/ Built-in Smart Albums/.implicitAlbum",
35
+ "test/data/ Built-in Smart Albums/090-entireLibraryQuery.apsmartalbum",
36
+ "test/data/ Built-in Smart Albums/100-selectsQuery.apsmartalbum",
37
+ "test/data/ Built-in Smart Albums/200-oneStarQuery.apsmartalbum",
38
+ "test/data/ Built-in Smart Albums/300-rejectedQuery.apsmartalbum",
39
+ "test/data/ Built-in Smart Albums/400-inTheLastWeekQuery.apsmartalbum",
40
+ "test/data/ Built-in Smart Albums/500-inTheLastMonthQuery.apsmartalbum",
41
+ "test/data/ Built-in Smart Albums/Info.apfolder",
42
+ "test/data/.implicitAlbum",
43
+ "test/data/DSLR.approject/2009-12-11 @ 10:09:42 AM - 1.apimportgroup/CRW_0001 - 2008-07-04 at 11-34-52/CRW_0001 - 2008-07-04 at 11-34-52.CRW.apfile",
44
+ "test/data/DSLR.approject/2009-12-11 @ 10:09:42 AM - 1.apimportgroup/CRW_0001 - 2008-07-04 at 11-34-52/Info.apmaster",
45
+ "test/data/DSLR.approject/2009-12-11 @ 10:09:42 AM - 1.apimportgroup/CRW_0001 - 2008-07-04 at 11-34-52/OriginalVersionInfo.apversion",
46
+ "test/data/DSLR.approject/2009-12-11 @ 10:09:42 AM - 1.apimportgroup/CRW_0001 - 2008-07-04 at 11-34-52/Version-1.apversion",
47
+ "test/data/DSLR.approject/2009-12-11 @ 10:09:52 AM - 2.apimportgroup/CRW_0002 - 2008-07-04 at 11-36-00/CRW_0002 - 2008-07-04 at 11-36-00.CRW.apfile",
48
+ "test/data/DSLR.approject/2009-12-11 @ 10:09:52 AM - 2.apimportgroup/CRW_0002 - 2008-07-04 at 11-36-00/Info.apmaster",
49
+ "test/data/DSLR.approject/2009-12-11 @ 10:09:52 AM - 2.apimportgroup/CRW_0002 - 2008-07-04 at 11-36-00/OriginalVersionInfo.apversion",
50
+ "test/data/DSLR.approject/2009-12-11 @ 10:09:52 AM - 2.apimportgroup/CRW_0002 - 2008-07-04 at 11-36-00/Version-1.apversion",
51
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:03 AM - 3.apimportgroup/CRW_0003 - 2008-07-04 at 11-36-00/CRW_0003 - 2008-07-04 at 11-36-00.CRW.apfile",
52
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:03 AM - 3.apimportgroup/CRW_0003 - 2008-07-04 at 11-36-00/Info.apmaster",
53
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:03 AM - 3.apimportgroup/CRW_0003 - 2008-07-04 at 11-36-00/OriginalVersionInfo.apversion",
54
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:03 AM - 3.apimportgroup/CRW_0003 - 2008-07-04 at 11-36-00/Version-1.apversion",
55
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:11 AM - 4.apimportgroup/CRW_0004 - 2008-07-04 at 11-36-02/CRW_0004 - 2008-07-04 at 11-36-02.CRW.apfile",
56
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:11 AM - 4.apimportgroup/CRW_0004 - 2008-07-04 at 11-36-02/Info.apmaster",
57
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:11 AM - 4.apimportgroup/CRW_0004 - 2008-07-04 at 11-36-02/OriginalVersionInfo.apversion",
58
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:11 AM - 4.apimportgroup/CRW_0004 - 2008-07-04 at 11-36-02/Version-1.apversion",
59
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:21 AM - 5.apimportgroup/CRW_0005 - 2008-07-04 at 11-36-38/CRW_0005 - 2008-07-04 at 11-36-38.CRW.apfile",
60
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:21 AM - 5.apimportgroup/CRW_0005 - 2008-07-04 at 11-36-38/Info.apmaster",
61
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:21 AM - 5.apimportgroup/CRW_0005 - 2008-07-04 at 11-36-38/OriginalVersionInfo.apversion",
62
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:21 AM - 5.apimportgroup/CRW_0005 - 2008-07-04 at 11-36-38/Version-1.apversion",
63
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:30 AM - 6.apimportgroup/CRW_0006 - 2008-07-04 at 11-40-50/CRW_0006 - 2008-07-04 at 11-40-50.CRW.apfile",
64
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:30 AM - 6.apimportgroup/CRW_0006 - 2008-07-04 at 11-40-50/Info.apmaster",
65
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:30 AM - 6.apimportgroup/CRW_0006 - 2008-07-04 at 11-40-50/OriginalVersionInfo.apversion",
66
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:30 AM - 6.apimportgroup/CRW_0006 - 2008-07-04 at 11-40-50/Version-1.apversion",
67
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:39 AM - 7.apimportgroup/CRW_0007 - 2008-07-04 at 11-54-00/CRW_0007 - 2008-07-04 at 11-54-00.CRW.apfile",
68
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:39 AM - 7.apimportgroup/CRW_0007 - 2008-07-04 at 11-54-00/Info.apmaster",
69
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:39 AM - 7.apimportgroup/CRW_0007 - 2008-07-04 at 11-54-00/OriginalVersionInfo.apversion",
70
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:39 AM - 7.apimportgroup/CRW_0007 - 2008-07-04 at 11-54-00/Version-1.apversion",
71
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:51 AM - 8.apimportgroup/CRW_0008 - 2008-07-04 at 11-54-02/CRW_0008 - 2008-07-04 at 11-54-02.CRW.apfile",
72
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:51 AM - 8.apimportgroup/CRW_0008 - 2008-07-04 at 11-54-02/Info.apmaster",
73
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:51 AM - 8.apimportgroup/CRW_0008 - 2008-07-04 at 11-54-02/OriginalVersionInfo.apversion",
74
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:51 AM - 8.apimportgroup/CRW_0008 - 2008-07-04 at 11-54-02/Version-1.apversion",
75
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:59 AM - 9.apimportgroup/CRW_0009 - 2008-07-04 at 11-54-48/CRW_0009 - 2008-07-04 at 11-54-48.CRW.apfile",
76
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:59 AM - 9.apimportgroup/CRW_0009 - 2008-07-04 at 11-54-48/Info.apmaster",
77
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:59 AM - 9.apimportgroup/CRW_0009 - 2008-07-04 at 11-54-48/OriginalVersionInfo.apversion",
78
+ "test/data/DSLR.approject/2009-12-11 @ 10:10:59 AM - 9.apimportgroup/CRW_0009 - 2008-07-04 at 11-54-48/Version-1.apversion",
79
+ "test/data/DSLR.approject/Album.implicitAlbum",
80
+ "test/data/DSLR.approject/Info.apfolder",
81
+ "test/data/Info.apfolder",
82
+ "test/data/Misc.approject/2009-12-10 @ 04:09:41 PM - 1.apimportgroup/IMG_0459/IMG_0459 - 2009-12-01 at 22-51-38.PNG.apfile",
83
+ "test/data/Misc.approject/2009-12-10 @ 04:09:41 PM - 1.apimportgroup/IMG_0459/Info.apmaster",
84
+ "test/data/Misc.approject/2009-12-10 @ 04:09:41 PM - 1.apimportgroup/IMG_0459/OriginalVersionInfo.apversion",
85
+ "test/data/Misc.approject/2009-12-10 @ 04:09:41 PM - 1.apimportgroup/IMG_0459/Version-1.apversion",
86
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/2008-Costume Contest 030.jpg.apfile",
87
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Info.apmaster",
88
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/OriginalVersionInfo.apversion",
89
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-1.apversion",
90
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-10.apversion",
91
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-11.apversion",
92
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-2.apversion",
93
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-3.apversion",
94
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-4.apversion",
95
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-5.apversion",
96
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-6.apversion",
97
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-7.apversion",
98
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-8.apversion",
99
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/2008-Costume Contest 030/Version-9.apversion",
100
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/IMG_3690/IMG_3690.jpg.apfile",
101
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/IMG_3690/Info.apmaster",
102
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/IMG_3690/OriginalVersionInfo.apversion",
103
+ "test/data/Misc.approject/2009-12-10 @ 04:11:58 PM - 2.apimportgroup/IMG_3690/Version-1.apversion",
104
+ "test/data/Misc.approject/Album.implicitAlbum",
105
+ "test/data/Misc.approject/Halloween.apalbum",
106
+ "test/data/Misc.approject/Info.apfolder",
107
+ "test/data/TestFolder/.implicitAlbum",
108
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1753/IMG_1753.JPG.apfile",
109
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1753/Info.apmaster",
110
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1753/OriginalVersionInfo.apversion",
111
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1753/Version-1.apversion",
112
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1754/IMG_1754.JPG.apfile",
113
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1754/Info.apmaster",
114
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1754/OriginalVersionInfo.apversion",
115
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1754/Version-1.apversion",
116
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1755/IMG_1755.JPG.apfile",
117
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1755/Info.apmaster",
118
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1755/OriginalVersionInfo.apversion",
119
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1755/Version-1.apversion",
120
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1756/IMG_1756.JPG.apfile",
121
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1756/Info.apmaster",
122
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1756/OriginalVersionInfo.apversion",
123
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1756/Version-1.apversion",
124
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1757/IMG_1757.JPG.apfile",
125
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1757/Info.apmaster",
126
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1757/OriginalVersionInfo.apversion",
127
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1757/Version-1.apversion",
128
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1758/IMG_1758.JPG.apfile",
129
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1758/Info.apmaster",
130
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1758/OriginalVersionInfo.apversion",
131
+ "test/data/TestFolder/Fireworks.approject/2009-12-10 @ 04:13:45 PM - 1.apimportgroup/IMG_1758/Version-1.apversion",
132
+ "test/data/TestFolder/Fireworks.approject/Album.implicitAlbum",
133
+ "test/data/TestFolder/Fireworks.approject/Info.apfolder",
134
+ "test/data/TestFolder/Info.apfolder",
135
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1943/IMG_1943.JPG.apfile",
136
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1943/Info.apmaster",
137
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1943/OriginalVersionInfo.apversion",
138
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1943/Version-1.apversion",
139
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1944/IMG_1944.JPG.apfile",
140
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1944/Info.apmaster",
141
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1944/OriginalVersionInfo.apversion",
142
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1944/Version-1.apversion",
143
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1945/IMG_1945.JPG.apfile",
144
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1945/Info.apmaster",
145
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1945/OriginalVersionInfo.apversion",
146
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1945/Version-1.apversion",
147
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1946/IMG_1946.JPG.apfile",
148
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1946/Info.apmaster",
149
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1946/OriginalVersionInfo.apversion",
150
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1946/Version-1.apversion",
151
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1947/IMG_1947.JPG.apfile",
152
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1947/Info.apmaster",
153
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1947/OriginalVersionInfo.apversion",
154
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1947/Version-1.apversion",
155
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1948/IMG_1948.JPG.apfile",
156
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1948/Info.apmaster",
157
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1948/OriginalVersionInfo.apversion",
158
+ "test/data/TestFolder/PAX.approject/2009-12-10 @ 04:19:15 PM - 1.apimportgroup/IMG_1948/Version-1.apversion",
159
+ "test/data/TestFolder/PAX.approject/Album.implicitAlbum",
160
+ "test/data/TestFolder/PAX.approject/Info.apfolder",
161
+ "test/data/TestRootAlbum.apalbum",
162
+ "test/data/dotMacWebGalleryProject.approject/Album.implicitAlbum",
163
+ "test/data/dotMacWebGalleryProject.approject/Info.apfolder",
164
+ "test/data/iPhone.apsmartalbum",
165
+ "test/helper.rb",
166
+ "test/test_album.rb",
167
+ "test/test_library.rb",
168
+ "test/test_photo.rb",
169
+ "test/test_photo_set.rb",
170
+ "test/test_project.rb",
171
+ "test/test_version.rb"
172
+ ]
173
+ s.homepage = %q{http://github.com/talaris/aperture}
174
+ s.rdoc_options = ["--charset=UTF-8"]
175
+ s.require_paths = ["lib"]
176
+ s.rubygems_version = %q{1.3.5}
177
+ s.summary = %q{Statistical analysis library for Aperture Photo Libraries}
178
+ s.test_files = [
179
+ "test/helper.rb",
180
+ "test/test_album.rb",
181
+ "test/test_library.rb",
182
+ "test/test_photo.rb",
183
+ "test/test_photo_set.rb",
184
+ "test/test_project.rb",
185
+ "test/test_version.rb"
186
+ ]
187
+
188
+ if s.respond_to? :specification_version then
189
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
190
+ s.specification_version = 3
191
+
192
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
193
+ else
194
+ end
195
+ else
196
+ end
197
+ end
198
+
data/lib/aperture.rb ADDED
@@ -0,0 +1,20 @@
1
+ # = Overview
2
+ # To use this libray check the Aperture::Library documentation and Library#parse
3
+ module Aperture
4
+ VERSION = "0.2.0"
5
+ end
6
+
7
+
8
+ begin
9
+ require 'plist'
10
+ rescue LoadError
11
+ require 'rubygems'
12
+ require 'plist'
13
+ end
14
+
15
+ require 'aperture/library'
16
+ require 'aperture/version'
17
+ require 'aperture/photo'
18
+ require 'aperture/photo_set'
19
+ require 'aperture/album'
20
+ require 'aperture/project'
@@ -0,0 +1,17 @@
1
+
2
+ module Aperture
3
+
4
+ # = Overview
5
+ # The Album object matches up with Album entries from an Aperture Library. Albums cotain
6
+ # Aperture::Photo objects through an Aperture::PhotoSet.
7
+ class Album
8
+ attr_accessor :photos, :attributes
9
+
10
+ # Creates a new Album object given a hash of attributes, this should be the hash returned
11
+ # from parsing the .apablum file by the plist gem.
12
+ def initialize(attributes)
13
+ @attributes = attributes
14
+ @photos = PhotoSet.new
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,95 @@
1
+ require 'find'
2
+
3
+ module Aperture
4
+
5
+ # = Overview
6
+ # The Library object parses and organizes the collection of objects that make up an aperture
7
+ # photo library. From the object you can access information about the Versions, Photos,
8
+ # Albums and Projects contained in the Library.
9
+ #
10
+ # *Note* Depending on the size of the Aperture photo library parsing it into ruby objects
11
+ # may take serveral minutes.
12
+ class Library
13
+ attr_reader :root, :photos, :albums, :projects, :versions
14
+
15
+ def initialize(root) # :nodoc:
16
+ raise ArgumentError, "Requires valid directory path" unless File.directory?(root)
17
+ @root = root
18
+ @photos = Aperture::PhotoSet.new
19
+ @albums = {}
20
+ @projects = {}
21
+ @versions = {}
22
+ end
23
+
24
+ # This the key method for parsing the library, it requires the path of where the library
25
+ # exists on disk. It returns a fully parsed Library object.
26
+ def self.parse(root_path)
27
+ library = new(root_path)
28
+ files = []
29
+ Find.find(library.root) do |path|
30
+ files << path
31
+ end
32
+
33
+ # Projects
34
+ files.select {|p| p =~ /\.approject$/ }.each do |path|
35
+ project = Project.new
36
+ project.attributes = Plist::parse_xml(File.join(path, 'Info.apfolder'))
37
+ library.projects[project.attributes['uuid']] = project
38
+ end
39
+
40
+ # Photo Masters
41
+ files.select {|p| p =~ /Info\.apmaster$/}.each do |path|
42
+ photo = Photo.new(File.dirname(path))
43
+ photo.master_attributes = Plist::parse_xml(path)
44
+ photo.master_attributes['path']
45
+ library.photos << photo
46
+ end
47
+
48
+ # Photo Files
49
+ files.select {|p| p =~ /\.apfile$/}.each do |path|
50
+ file_attributes = Plist::parse_xml(path)
51
+ library.photos[file_attributes['masterUuid']].file_attributes = file_attributes
52
+ end
53
+
54
+ # Versions
55
+ files.select {|p| p =~ /Version-.+\.apversion$/}.each do |path|
56
+ directory, filename = File.dirname(path), File.basename(path)
57
+ attributes = Plist::parse_xml(path)
58
+
59
+ # find associated photo
60
+ photo = library.photos[attributes['masterUuid']]
61
+
62
+ # build version object
63
+ version = Version.new(filename, attributes, photo)
64
+
65
+ # add version to photo
66
+ photo.versions << version
67
+
68
+ # add verion to library
69
+ library.versions[version.attributes['uuid']] = version
70
+
71
+ # add version's photo to project
72
+ library.projects[version.attributes['projectUuid']].photos << version.photo
73
+ end
74
+
75
+ # Albums
76
+ files.select {|p| p =~ /\.apalbum/ }.each do |path|
77
+ attributes = Plist::parse_xml(path)
78
+ attributes['directory'] = File.dirname(path)
79
+ attributes['filename'] = File.basename(path)
80
+ album = Album.new(attributes)
81
+
82
+ library.albums[album.attributes['InfoDictionary']['uuid']] = album
83
+
84
+ if version_ids = album.attributes['InfoDictionary'] && album.attributes['InfoDictionary']['versionUuids']
85
+ version_ids.each do |id|
86
+ album.photos[library.versions[id].attributes['masterUuid']] = library.versions[id].photo
87
+ library.versions[id].photo.albums << album unless library.versions[id].photo.albums.include?(album)
88
+ end
89
+ end
90
+ end
91
+
92
+ return library
93
+ end
94
+ end
95
+ end