fleakr 0.6.3 → 0.7.0
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.
- data/README.rdoc +88 -57
- data/Rakefile +28 -9
- data/lib/fleakr.rb +25 -31
- data/lib/fleakr/api/option.rb +34 -34
- data/lib/fleakr/api/parameter_list.rb +23 -23
- data/lib/fleakr/objects.rb +4 -1
- data/lib/fleakr/objects/metadata.rb +35 -0
- data/lib/fleakr/objects/metadata_collection.rb +36 -0
- data/lib/fleakr/objects/photo.rb +15 -11
- data/lib/fleakr/objects/set.rb +17 -13
- data/lib/fleakr/objects/url.rb +83 -0
- data/lib/fleakr/objects/user.rb +8 -0
- data/lib/fleakr/support.rb +3 -1
- data/lib/fleakr/support/attribute.rb +2 -2
- data/lib/fleakr/support/object.rb +44 -29
- data/lib/fleakr/support/url_expander.rb +37 -0
- data/lib/fleakr/support/utility.rb +66 -0
- data/lib/fleakr/version.rb +5 -5
- data/test/fixtures/photos.getExif.xml +362 -0
- data/test/test_helper.rb +44 -47
- data/test/unit/fleakr/api/authentication_request_test.rb +12 -12
- data/test/unit/fleakr/api/file_parameter_test.rb +15 -15
- data/test/unit/fleakr/api/method_request_test.rb +1 -1
- data/test/unit/fleakr/api/option_test.rb +44 -44
- data/test/unit/fleakr/api/parameter_list_test.rb +40 -40
- data/test/unit/fleakr/api/response_test.rb +10 -10
- data/test/unit/fleakr/api/upload_request_test.rb +28 -28
- data/test/unit/fleakr/api/value_parameter_test.rb +10 -10
- data/test/unit/fleakr/core_ext/false_class_test.rb +5 -5
- data/test/unit/fleakr/core_ext/hash_test.rb +9 -9
- data/test/unit/fleakr/core_ext/true_class_test.rb +5 -5
- data/test/unit/fleakr/objects/authentication_token_test.rb +23 -23
- data/test/unit/fleakr/objects/collection_test.rb +23 -23
- data/test/unit/fleakr/objects/comment_test.rb +15 -15
- data/test/unit/fleakr/objects/contact_test.rb +11 -11
- data/test/unit/fleakr/objects/error_test.rb +8 -8
- data/test/unit/fleakr/objects/group_test.rb +13 -13
- data/test/unit/fleakr/objects/image_test.rb +4 -4
- data/test/unit/fleakr/objects/metadata_collection_test.rb +55 -0
- data/test/unit/fleakr/objects/metadata_test.rb +27 -0
- data/test/unit/fleakr/objects/photo_context_test.rb +23 -23
- data/test/unit/fleakr/objects/photo_test.rb +71 -64
- data/test/unit/fleakr/objects/search_test.rb +22 -22
- data/test/unit/fleakr/objects/set_test.rb +62 -40
- data/test/unit/fleakr/objects/tag_test.rb +32 -31
- data/test/unit/fleakr/objects/url_test.rb +185 -0
- data/test/unit/fleakr/objects/user_test.rb +43 -16
- data/test/unit/fleakr/support/attribute_test.rb +15 -15
- data/test/unit/fleakr/support/object_test.rb +77 -33
- data/test/unit/fleakr/support/request_test.rb +12 -12
- data/test/unit/fleakr/support/url_expander_test.rb +44 -0
- data/test/unit/fleakr/support/utility_test.rb +70 -0
- data/test/unit/fleakr_test.rb +48 -41
- metadata +43 -23
data/lib/fleakr/version.rb
CHANGED
@@ -0,0 +1,362 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
2
|
+
<rsp stat="ok">
|
3
|
+
<photo id="1" secret="37efb9102f" server="2683" farm="3">
|
4
|
+
<exif tagspace="System" tagspaceid="0" tag="FileName" label="FileName">
|
5
|
+
<raw>ORI9141194487814365231.img</raw>
|
6
|
+
</exif>
|
7
|
+
<exif tagspace="System" tagspaceid="0" tag="Directory" label="Directory">
|
8
|
+
<raw>/home/y/tmp/3</raw>
|
9
|
+
</exif>
|
10
|
+
<exif tagspace="System" tagspaceid="0" tag="FileSize" label="File Size">
|
11
|
+
<raw>3.2 MB</raw>
|
12
|
+
</exif>
|
13
|
+
<exif tagspace="System" tagspaceid="0" tag="FileModifyDate" label="FileModifyDate">
|
14
|
+
<raw>2010:04:10 11:55:56+00:00</raw>
|
15
|
+
</exif>
|
16
|
+
<exif tagspace="File" tagspaceid="0" tag="FileType" label="File Type">
|
17
|
+
<raw>JPEG</raw>
|
18
|
+
</exif>
|
19
|
+
<exif tagspace="File" tagspaceid="0" tag="MIMEType" label="MIME Type">
|
20
|
+
<raw>image/jpeg</raw>
|
21
|
+
</exif>
|
22
|
+
<exif tagspace="File" tagspaceid="0" tag="ImageWidth" label="Image Width">
|
23
|
+
<raw>3264</raw>
|
24
|
+
</exif>
|
25
|
+
<exif tagspace="File" tagspaceid="0" tag="ImageHeight" label="Image Height">
|
26
|
+
<raw>2448</raw>
|
27
|
+
</exif>
|
28
|
+
<exif tagspace="File" tagspaceid="0" tag="EncodingProcess" label="Encoding Process">
|
29
|
+
<raw>Baseline DCT, Huffman coding</raw>
|
30
|
+
</exif>
|
31
|
+
<exif tagspace="File" tagspaceid="0" tag="BitsPerSample" label="Bits Per Sample">
|
32
|
+
<raw>8</raw>
|
33
|
+
</exif>
|
34
|
+
<exif tagspace="File" tagspaceid="0" tag="ColorComponents" label="Color Components">
|
35
|
+
<raw>3</raw>
|
36
|
+
</exif>
|
37
|
+
<exif tagspace="File" tagspaceid="0" tag="YCbCrSubSampling" label="YCbCrSubSampling">
|
38
|
+
<raw>YCbCr4:2:2 (2 1)</raw>
|
39
|
+
</exif>
|
40
|
+
<exif tagspace="IFD0" tagspaceid="0" tag="Make" label="Make">
|
41
|
+
<raw>Panasonic</raw>
|
42
|
+
</exif>
|
43
|
+
<exif tagspace="IFD0" tagspaceid="0" tag="Model" label="Model">
|
44
|
+
<raw>DMC-LZ8</raw>
|
45
|
+
</exif>
|
46
|
+
<exif tagspace="IFD0" tagspaceid="0" tag="Orientation" label="Orientation">
|
47
|
+
<raw>Horizontal (normal)</raw>
|
48
|
+
</exif>
|
49
|
+
<exif tagspace="IFD0" tagspaceid="0" tag="XResolution" label="X-Resolution">
|
50
|
+
<raw>180</raw>
|
51
|
+
<clean>180 dpi</clean>
|
52
|
+
</exif>
|
53
|
+
<exif tagspace="IFD0" tagspaceid="0" tag="YResolution" label="Y-Resolution">
|
54
|
+
<raw>180</raw>
|
55
|
+
<clean>180 dpi</clean>
|
56
|
+
</exif>
|
57
|
+
<exif tagspace="IFD0" tagspaceid="0" tag="ResolutionUnit" label="ResolutionUnit">
|
58
|
+
<raw>inches</raw>
|
59
|
+
</exif>
|
60
|
+
<exif tagspace="IFD0" tagspaceid="0" tag="Software" label="Software">
|
61
|
+
<raw>Ver.1.0 </raw>
|
62
|
+
</exif>
|
63
|
+
<exif tagspace="IFD0" tagspaceid="0" tag="ModifyDate" label="Date and Time (Modified)">
|
64
|
+
<raw>2010:04:08 12:19:06</raw>
|
65
|
+
</exif>
|
66
|
+
<exif tagspace="IFD0" tagspaceid="0" tag="YCbCrPositioning" label="YCbCr Positioning">
|
67
|
+
<raw>Co-sited</raw>
|
68
|
+
</exif>
|
69
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="ExposureTime" label="Exposure">
|
70
|
+
<raw>1/400</raw>
|
71
|
+
<clean>0.003 sec (1/400)</clean>
|
72
|
+
</exif>
|
73
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="FNumber" label="Aperture">
|
74
|
+
<raw>5.9</raw>
|
75
|
+
<clean>f/5.9</clean>
|
76
|
+
</exif>
|
77
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="ExposureProgram" label="Exposure Program">
|
78
|
+
<raw>Program AE</raw>
|
79
|
+
</exif>
|
80
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="ISO" label="ISO Speed">
|
81
|
+
<raw>200</raw>
|
82
|
+
</exif>
|
83
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="ExifVersion" label="ExifVersion">
|
84
|
+
<raw>0221</raw>
|
85
|
+
</exif>
|
86
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="DateTimeOriginal" label="Date and Time (Original)">
|
87
|
+
<raw>2010:04:08 12:19:06</raw>
|
88
|
+
</exif>
|
89
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="CreateDate" label="Date and Time (Digitized)">
|
90
|
+
<raw>2010:04:08 12:19:06</raw>
|
91
|
+
</exif>
|
92
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="ComponentsConfiguration" label="ComponentsConfiguration">
|
93
|
+
<raw>Y, Cb, Cr, -</raw>
|
94
|
+
</exif>
|
95
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="CompressedBitsPerPixel" label="Compressed Bits Per Pixel">
|
96
|
+
<raw>4</raw>
|
97
|
+
</exif>
|
98
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="ExposureCompensation" label="Exposure Bias">
|
99
|
+
<raw>0</raw>
|
100
|
+
<clean>0 EV</clean>
|
101
|
+
</exif>
|
102
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="MaxApertureValue" label="Max Aperture Value">
|
103
|
+
<raw>3.3</raw>
|
104
|
+
</exif>
|
105
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="MeteringMode" label="Metering Mode">
|
106
|
+
<raw>Multi-segment</raw>
|
107
|
+
</exif>
|
108
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="LightSource" label="Light Source">
|
109
|
+
<raw>Unknown</raw>
|
110
|
+
</exif>
|
111
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="Flash" label="Flash">
|
112
|
+
<raw>Off, Did not fire</raw>
|
113
|
+
</exif>
|
114
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="FocalLength" label="Focal Length">
|
115
|
+
<raw>26.0 mm</raw>
|
116
|
+
<clean>26 mm</clean>
|
117
|
+
</exif>
|
118
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="FlashpixVersion" label="FlashpixVersion">
|
119
|
+
<raw>0100</raw>
|
120
|
+
</exif>
|
121
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="ColorSpace" label="Color Space">
|
122
|
+
<raw>sRGB</raw>
|
123
|
+
</exif>
|
124
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="ExifImageWidth" label="ExifImageWidth">
|
125
|
+
<raw>3264</raw>
|
126
|
+
</exif>
|
127
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="ExifImageHeight" label="ExifImageHeight">
|
128
|
+
<raw>2448</raw>
|
129
|
+
</exif>
|
130
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="SensingMethod" label="Sensing Method">
|
131
|
+
<raw>One-chip color area</raw>
|
132
|
+
</exif>
|
133
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="FileSource" label="FileSource">
|
134
|
+
<raw>Digital Camera</raw>
|
135
|
+
</exif>
|
136
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="SceneType" label="SceneType">
|
137
|
+
<raw>Directly photographed</raw>
|
138
|
+
</exif>
|
139
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="CustomRendered" label="Custom Rendered">
|
140
|
+
<raw>Normal</raw>
|
141
|
+
</exif>
|
142
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="ExposureMode" label="Exposure Mode">
|
143
|
+
<raw>Auto</raw>
|
144
|
+
</exif>
|
145
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="WhiteBalance" label="White Balance">
|
146
|
+
<raw>Auto</raw>
|
147
|
+
</exif>
|
148
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="DigitalZoomRatio" label="Digital Zoom Ratio">
|
149
|
+
<raw>0</raw>
|
150
|
+
</exif>
|
151
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="FocalLengthIn35mmFormat" label="Focal Length In35mm Format">
|
152
|
+
<raw>160 mm</raw>
|
153
|
+
</exif>
|
154
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="SceneCaptureType" label="Scene Capture Type">
|
155
|
+
<raw>Standard</raw>
|
156
|
+
</exif>
|
157
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="GainControl" label="Gain Control">
|
158
|
+
<raw>Low gain up</raw>
|
159
|
+
</exif>
|
160
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="Contrast" label="Contrast">
|
161
|
+
<raw>Normal</raw>
|
162
|
+
</exif>
|
163
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="Saturation" label="Saturation">
|
164
|
+
<raw>Normal</raw>
|
165
|
+
</exif>
|
166
|
+
<exif tagspace="ExifIFD" tagspaceid="0" tag="Sharpness" label="Sharpness">
|
167
|
+
<raw>Normal</raw>
|
168
|
+
</exif>
|
169
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="ImageQuality" label="Image Quality">
|
170
|
+
<raw>High</raw>
|
171
|
+
</exif>
|
172
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="FirmwareVersion" label="Firmware Version">
|
173
|
+
<raw>0.1.0.8</raw>
|
174
|
+
</exif>
|
175
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="WhiteBalance" label="White Balance">
|
176
|
+
<raw>Auto</raw>
|
177
|
+
</exif>
|
178
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="FocusMode" label="Focus Mode">
|
179
|
+
<raw>Auto</raw>
|
180
|
+
</exif>
|
181
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="AFMode" label="AFMode">
|
182
|
+
<raw>Auto or Face Detect</raw>
|
183
|
+
</exif>
|
184
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="ImageStabilization" label="Image Stabilization">
|
185
|
+
<raw>On, Mode 1</raw>
|
186
|
+
</exif>
|
187
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="MacroMode" label="Macro Mode">
|
188
|
+
<raw>Off</raw>
|
189
|
+
</exif>
|
190
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="ShootingMode" label="Shooting Mode">
|
191
|
+
<raw>Intelligent Auto</raw>
|
192
|
+
</exif>
|
193
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="Audio" label="Audio">
|
194
|
+
<raw>No</raw>
|
195
|
+
</exif>
|
196
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="DataDump" label="Data Dump">
|
197
|
+
<raw>(Binary data 8200 bytes, use -b option to extract)</raw>
|
198
|
+
</exif>
|
199
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="WhiteBalanceBias" label="White Balance Bias">
|
200
|
+
<raw>0</raw>
|
201
|
+
</exif>
|
202
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="FlashBias" label="Flash Bias">
|
203
|
+
<raw>0</raw>
|
204
|
+
</exif>
|
205
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="InternalSerialNumber" label="Internal Serial Number">
|
206
|
+
<raw>(X02) 2008:03:07 no. 0037</raw>
|
207
|
+
</exif>
|
208
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="PanasonicExifVersion" label="Panasonic Exif Version">
|
209
|
+
<raw>0260</raw>
|
210
|
+
</exif>
|
211
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="ColorEffect" label="Color Effect">
|
212
|
+
<raw>Off</raw>
|
213
|
+
</exif>
|
214
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="TimeSincePowerOn" label="Time Since Power On">
|
215
|
+
<raw>00:00:25.53</raw>
|
216
|
+
</exif>
|
217
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="BurstMode" label="Burst Mode">
|
218
|
+
<raw>Off</raw>
|
219
|
+
</exif>
|
220
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="SequenceNumber" label="Sequence Number">
|
221
|
+
<raw>0</raw>
|
222
|
+
</exif>
|
223
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="Contrast" label="Contrast">
|
224
|
+
<raw>Normal</raw>
|
225
|
+
</exif>
|
226
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="NoiseReduction" label="Noise Reduction">
|
227
|
+
<raw>Standard</raw>
|
228
|
+
</exif>
|
229
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="SelfTimer" label="Self Timer">
|
230
|
+
<raw>Off</raw>
|
231
|
+
</exif>
|
232
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="Rotation" label="Rotation">
|
233
|
+
<raw>Horizontal (normal)</raw>
|
234
|
+
</exif>
|
235
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="AFAssistLamp" label="AFAssist Lamp">
|
236
|
+
<raw>Enabled but Not Used</raw>
|
237
|
+
</exif>
|
238
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="ColorMode" label="Color Mode">
|
239
|
+
<raw>Normal</raw>
|
240
|
+
</exif>
|
241
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="BabyAge" label="Baby Age">
|
242
|
+
<raw>(not set)</raw>
|
243
|
+
</exif>
|
244
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="OpticalZoomMode" label="Optical Zoom Mode">
|
245
|
+
<raw>Standard</raw>
|
246
|
+
</exif>
|
247
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="ConversionLens" label="Conversion Lens">
|
248
|
+
<raw>Off</raw>
|
249
|
+
</exif>
|
250
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="TravelDay" label="Travel Day">
|
251
|
+
<raw>n/a</raw>
|
252
|
+
</exif>
|
253
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="WorldTimeLocation" label="World Time Location">
|
254
|
+
<raw>Home</raw>
|
255
|
+
</exif>
|
256
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="TextStamp" label="Text Stamp">
|
257
|
+
<raw>Off</raw>
|
258
|
+
</exif>
|
259
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="ProgramISO" label="Program ISO">
|
260
|
+
<raw>n/a</raw>
|
261
|
+
</exif>
|
262
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="AdvancedSceneMode" label="Advanced Scene Mode">
|
263
|
+
<raw>Auto</raw>
|
264
|
+
</exif>
|
265
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="FacesDetected" label="Faces Detected">
|
266
|
+
<raw>0</raw>
|
267
|
+
</exif>
|
268
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="Saturation" label="Saturation">
|
269
|
+
<raw>Normal</raw>
|
270
|
+
</exif>
|
271
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="Sharpness" label="Sharpness">
|
272
|
+
<raw>Normal</raw>
|
273
|
+
</exif>
|
274
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="AFPointPosition" label="AFPoint Position">
|
275
|
+
<raw>0.5 0.5</raw>
|
276
|
+
</exif>
|
277
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="NumFacePositions" label="Num Face Positions">
|
278
|
+
<raw>0</raw>
|
279
|
+
</exif>
|
280
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="MakerNoteVersion" label="Maker Note Version">
|
281
|
+
<raw>0121</raw>
|
282
|
+
</exif>
|
283
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="SceneMode" label="Scene Mode">
|
284
|
+
<raw>Intelligent Auto</raw>
|
285
|
+
</exif>
|
286
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="WBRedLevel" label="WBRed Level">
|
287
|
+
<raw>1713</raw>
|
288
|
+
</exif>
|
289
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="WBGreenLevel" label="WBGreen Level">
|
290
|
+
<raw>1054</raw>
|
291
|
+
</exif>
|
292
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="WBBlueLevel" label="WBBlue Level">
|
293
|
+
<raw>1905</raw>
|
294
|
+
</exif>
|
295
|
+
<exif tagspace="Panasonic" tagspaceid="0" tag="FlashFired" label="Flash Fired">
|
296
|
+
<raw>No</raw>
|
297
|
+
</exif>
|
298
|
+
<exif tagspace="InteropIFD" tagspaceid="0" tag="InteropIndex" label="InteropIndex">
|
299
|
+
<raw>R98 - DCF basic file (sRGB)</raw>
|
300
|
+
</exif>
|
301
|
+
<exif tagspace="InteropIFD" tagspaceid="0" tag="InteropVersion" label="InteropVersion">
|
302
|
+
<raw>0100</raw>
|
303
|
+
</exif>
|
304
|
+
<exif tagspace="IFD1" tagspaceid="0" tag="Compression" label="Compression">
|
305
|
+
<raw>JPEG (old-style)</raw>
|
306
|
+
</exif>
|
307
|
+
<exif tagspace="IFD1" tagspaceid="0" tag="Orientation" label="Orientation">
|
308
|
+
<raw>Horizontal (normal)</raw>
|
309
|
+
</exif>
|
310
|
+
<exif tagspace="IFD1" tagspaceid="0" tag="XResolution" label="XResolution">
|
311
|
+
<raw>180</raw>
|
312
|
+
</exif>
|
313
|
+
<exif tagspace="IFD1" tagspaceid="0" tag="YResolution" label="YResolution">
|
314
|
+
<raw>180</raw>
|
315
|
+
</exif>
|
316
|
+
<exif tagspace="IFD1" tagspaceid="0" tag="ResolutionUnit" label="ResolutionUnit">
|
317
|
+
<raw>inches</raw>
|
318
|
+
</exif>
|
319
|
+
<exif tagspace="IFD1" tagspaceid="0" tag="ThumbnailOffset" label="ThumbnailOffset">
|
320
|
+
<raw>10176</raw>
|
321
|
+
</exif>
|
322
|
+
<exif tagspace="IFD1" tagspaceid="0" tag="ThumbnailLength" label="ThumbnailLength">
|
323
|
+
<raw>8121</raw>
|
324
|
+
</exif>
|
325
|
+
<exif tagspace="IFD1" tagspaceid="0" tag="YCbCrPositioning" label="YCbCrPositioning">
|
326
|
+
<raw>Co-sited</raw>
|
327
|
+
</exif>
|
328
|
+
<exif tagspace="Composite" tagspaceid="0" tag="Aperture" label="Aperture">
|
329
|
+
<raw>5.9</raw>
|
330
|
+
</exif>
|
331
|
+
<exif tagspace="Composite" tagspaceid="0" tag="BlueBalance" label="BlueBalance">
|
332
|
+
<raw>1.8074</raw>
|
333
|
+
</exif>
|
334
|
+
<exif tagspace="Composite" tagspaceid="0" tag="ImageSize" label="ImageSize">
|
335
|
+
<raw>3264x2448</raw>
|
336
|
+
</exif>
|
337
|
+
<exif tagspace="Composite" tagspaceid="0" tag="RedBalance" label="RedBalance">
|
338
|
+
<raw>1.625237</raw>
|
339
|
+
</exif>
|
340
|
+
<exif tagspace="Composite" tagspaceid="0" tag="ScaleFactor35efl" label="ScaleFactor35efl">
|
341
|
+
<raw>6.2</raw>
|
342
|
+
</exif>
|
343
|
+
<exif tagspace="Composite" tagspaceid="0" tag="ShutterSpeed" label="ShutterSpeed">
|
344
|
+
<raw>1/400</raw>
|
345
|
+
</exif>
|
346
|
+
<exif tagspace="Composite" tagspaceid="0" tag="CircleOfConfusion" label="CircleOfConfusion">
|
347
|
+
<raw>0.005 mm</raw>
|
348
|
+
</exif>
|
349
|
+
<exif tagspace="Composite" tagspaceid="0" tag="FOV" label="FOV">
|
350
|
+
<raw>12.8 deg</raw>
|
351
|
+
</exif>
|
352
|
+
<exif tagspace="Composite" tagspaceid="0" tag="FocalLength35efl" label="FocalLength35efl">
|
353
|
+
<raw>26.0 mm (35 mm equivalent: 160.0 mm)</raw>
|
354
|
+
</exif>
|
355
|
+
<exif tagspace="Composite" tagspaceid="0" tag="HyperfocalDistance" label="HyperfocalDistance">
|
356
|
+
<raw>23.47 m</raw>
|
357
|
+
</exif>
|
358
|
+
<exif tagspace="Composite" tagspaceid="0" tag="LightValue" label="LightValue">
|
359
|
+
<raw>12.8</raw>
|
360
|
+
</exif>
|
361
|
+
</photo>
|
362
|
+
</rsp>
|
data/test/test_helper.rb
CHANGED
@@ -11,11 +11,13 @@ require File.dirname(__FILE__) + '/../lib/fleakr'
|
|
11
11
|
class Test::Unit::TestCase
|
12
12
|
|
13
13
|
def self.should_autoload_when_accessing(*attributes)
|
14
|
-
options =
|
14
|
+
attributes, options = Fleakr::Support::Utility.extract_options(attributes)
|
15
|
+
|
15
16
|
attributes.each do |accessor_name|
|
16
17
|
should "load the additional user information when accessing the :#{accessor_name} attribute" do
|
17
|
-
|
18
|
-
|
18
|
+
class_name = self.class.name.match(/([^:]+)Test$/)[1]
|
19
|
+
klass = Fleakr::Objects.const_get(class_name)
|
20
|
+
|
19
21
|
object = klass.new
|
20
22
|
object.expects(options[:with]).with()
|
21
23
|
object.send(accessor_name)
|
@@ -33,51 +35,51 @@ class Test::Unit::TestCase
|
|
33
35
|
should "be able to perform a scoped search by :#{key}" do
|
34
36
|
photos = [stub()]
|
35
37
|
search = stub(:results => photos)
|
36
|
-
|
37
|
-
|
38
|
-
|
38
|
+
|
39
|
+
class_name = self.class.name.match(/([^:]+)Test$/)[1]
|
40
|
+
klass = Fleakr::Objects.const_get(class_name)
|
41
|
+
|
39
42
|
instance = klass.new
|
40
43
|
instance.stubs(:id).with().returns('1')
|
41
|
-
|
44
|
+
|
42
45
|
Fleakr::Objects::Search.expects(:new).with('foo', key => '1').returns(search)
|
43
|
-
|
46
|
+
|
44
47
|
instance.search('foo').should == photos
|
45
48
|
end
|
46
49
|
end
|
47
50
|
|
48
51
|
def self.should_have_many(*attributes)
|
49
|
-
|
50
|
-
|
52
|
+
attributes, options = Fleakr::Support::Utility.extract_options(attributes)
|
53
|
+
|
54
|
+
class_name = self.name.to_s.match(/([^:]+)Test$/)[1]
|
55
|
+
klass = Fleakr::Objects.const_get(class_name)
|
56
|
+
|
57
|
+
association_class = options[:class]
|
58
|
+
|
59
|
+
finder_attribute = options[:using].nil? ? Fleakr::Support::Utility.id_attribute_for(class_name) : options[:using]
|
51
60
|
|
52
|
-
options = attributes.extract_options!
|
53
|
-
finder_attribute = options[:using].nil? ? "#{class_name.downcase}_id" : options[:using]
|
54
|
-
|
55
61
|
attributes.each do |attribute|
|
56
|
-
|
62
|
+
|
57
63
|
should "be able to retrieve the #{class_name.downcase}'s #{attribute}" do
|
58
64
|
results = [stub()]
|
59
|
-
object =
|
65
|
+
object = klass.new
|
60
66
|
object.stubs(:id).with().returns('1')
|
61
67
|
|
62
|
-
|
68
|
+
association_class.expects("find_all_by_#{finder_attribute}".to_sym).with('1', {}).returns(results)
|
63
69
|
object.send(attribute).should == results
|
64
70
|
end
|
65
|
-
|
71
|
+
|
66
72
|
should "memoize the results for the #{class_name.downcase}'s #{attribute}" do
|
67
|
-
object =
|
68
|
-
|
69
|
-
|
73
|
+
object = klass.new
|
74
|
+
|
75
|
+
association_class.expects("find_all_by_#{finder_attribute}".to_sym).once.returns([])
|
70
76
|
2.times { object.send(attribute) }
|
71
77
|
end
|
72
|
-
|
78
|
+
|
73
79
|
end
|
74
80
|
end
|
75
81
|
|
76
82
|
def self.should_find_one(thing, options)
|
77
|
-
class_name = thing.to_s.singularize.camelcase
|
78
|
-
klass = "Fleakr::Objects::#{class_name}".constantize
|
79
|
-
object_type = class_name.downcase
|
80
|
-
|
81
83
|
condition_value = '1'
|
82
84
|
|
83
85
|
options[:with] = options[:by] if options[:with].nil?
|
@@ -87,55 +89,50 @@ class Test::Unit::TestCase
|
|
87
89
|
stub = stub()
|
88
90
|
response = mock_request_cycle :for => options[:call], :with => params
|
89
91
|
|
90
|
-
|
91
|
-
|
92
|
+
options[:class].expects(:new).with(response.body, params).returns(stub)
|
93
|
+
options[:class].send("find_by_#{options[:by]}".to_sym, condition_value).should == stub
|
92
94
|
end
|
93
95
|
end
|
94
96
|
|
95
97
|
def self.should_find_all(thing, options)
|
96
|
-
class_name = thing.to_s.singularize.camelcase
|
97
|
-
klass = "Fleakr::Objects::#{class_name}".constantize
|
98
|
-
object_type = class_name.downcase
|
99
|
-
|
100
98
|
should "be able to find all #{thing} by #{options[:by]}" do
|
101
99
|
condition_value = '1'
|
102
100
|
finder_options = {(options[:using] || options[:by]) => condition_value}
|
103
|
-
|
101
|
+
|
104
102
|
response = mock_request_cycle :for => options[:call], :with => finder_options
|
105
|
-
|
103
|
+
|
106
104
|
stubs = []
|
107
105
|
elements = (response.body/options[:path]).map
|
108
|
-
|
109
|
-
|
106
|
+
|
110
107
|
elements.each do |element|
|
111
108
|
stub = stub()
|
112
109
|
stubs << stub
|
113
|
-
|
114
|
-
|
110
|
+
|
111
|
+
options[:class].expects(:new).with(element, finder_options).returns(stub)
|
115
112
|
end
|
116
|
-
|
117
|
-
|
113
|
+
|
114
|
+
options[:class].send("find_all_by_#{options[:by]}".to_sym, condition_value).should == stubs
|
118
115
|
end
|
119
|
-
|
116
|
+
|
120
117
|
end
|
121
|
-
|
118
|
+
|
122
119
|
def read_fixture(method_call)
|
123
120
|
fixture_path = File.dirname(__FILE__) + '/fixtures'
|
124
121
|
File.read("#{fixture_path}/#{method_call}.xml")
|
125
122
|
end
|
126
|
-
|
123
|
+
|
127
124
|
def mock_request_cycle(options)
|
128
125
|
response = stub(:body => Hpricot.XML(read_fixture(options[:for])))
|
129
126
|
Fleakr::Api::MethodRequest.expects(:with_response!).with(options[:for], options[:with]).returns(response)
|
130
|
-
|
127
|
+
|
131
128
|
response
|
132
129
|
end
|
133
|
-
|
130
|
+
|
134
131
|
def create_temp_directory
|
135
132
|
tmp_dir = File.dirname(__FILE__) + '/tmp'
|
136
|
-
FileUtils.mkdir(tmp_dir)
|
137
|
-
|
133
|
+
FileUtils.mkdir(tmp_dir)
|
134
|
+
|
138
135
|
tmp_dir
|
139
136
|
end
|
140
|
-
|
137
|
+
|
141
138
|
end
|