ffi-gphoto2 0.5.1 → 0.8.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.
Files changed (59) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +11 -0
  3. data/CHANGELOG.md +44 -0
  4. data/README.md +22 -12
  5. data/examples/autofocus.rb +21 -0
  6. data/examples/capture.rb +8 -0
  7. data/examples/continuous_burst.rb +27 -0
  8. data/examples/list_config.rb +1 -0
  9. data/examples/list_files.rb +52 -0
  10. data/ffi-gphoto2.gemspec +9 -8
  11. data/lib/ffi/gphoto2.rb +14 -4
  12. data/lib/ffi/gphoto2/camera_abilities_list.rb +1 -1
  13. data/lib/ffi/gphoto2/camera_file_info.rb +10 -0
  14. data/lib/ffi/gphoto2/camera_file_info_audio.rb +11 -0
  15. data/lib/ffi/gphoto2/camera_file_info_fields.rb +14 -0
  16. data/lib/ffi/gphoto2/camera_file_info_file.rb +15 -0
  17. data/lib/ffi/gphoto2/camera_file_info_preview.rb +13 -0
  18. data/lib/ffi/gphoto2/camera_file_permissions.rb +9 -0
  19. data/lib/ffi/gphoto2/camera_file_status.rb +7 -0
  20. data/lib/ffi/gphoto2/camera_list.rb +1 -1
  21. data/lib/ffi/gphoto2/camera_widget.rb +1 -1
  22. data/lib/ffi/gphoto2_port.rb +21 -1
  23. data/lib/ffi/gphoto2_port/gp_port.rb +17 -0
  24. data/lib/ffi/gphoto2_port/gp_port_info_list.rb +1 -1
  25. data/lib/ffi/gphoto2_port/gp_port_serial_parity.rb +6 -0
  26. data/lib/ffi/gphoto2_port/gp_port_settings.rb +11 -0
  27. data/lib/ffi/gphoto2_port/gp_port_settings_serial.rb +12 -0
  28. data/lib/ffi/gphoto2_port/gp_port_settings_usb.rb +15 -0
  29. data/lib/ffi/gphoto2_port/gp_port_settings_usb_disk_direct.rb +8 -0
  30. data/lib/ffi/gphoto2_port/gp_port_settings_usb_scsi.rb +8 -0
  31. data/lib/gphoto2.rb +24 -4
  32. data/lib/gphoto2/camera.rb +10 -2
  33. data/lib/gphoto2/camera/capture.rb +22 -0
  34. data/lib/gphoto2/camera/configuration.rb +2 -1
  35. data/lib/gphoto2/camera/event.rb +3 -6
  36. data/lib/gphoto2/camera_abilities.rb +9 -0
  37. data/lib/gphoto2/camera_abilities_list.rb +1 -1
  38. data/lib/gphoto2/camera_file.rb +26 -8
  39. data/lib/gphoto2/camera_file_info/camera_file_info.rb +52 -0
  40. data/lib/gphoto2/camera_file_info/file_camera_file_info.rb +30 -0
  41. data/lib/gphoto2/camera_list.rb +1 -1
  42. data/lib/gphoto2/camera_widgets/camera_widget.rb +3 -7
  43. data/lib/gphoto2/camera_widgets/radio_camera_widget.rb +0 -4
  44. data/lib/gphoto2/camera_widgets/text_camera_widget.rb +1 -3
  45. data/lib/gphoto2/entry.rb +0 -4
  46. data/lib/gphoto2/port.rb +61 -0
  47. data/lib/gphoto2/port_info.rb +0 -4
  48. data/lib/gphoto2/port_info_list.rb +1 -1
  49. data/lib/gphoto2/version.rb +1 -1
  50. data/spec/gphoto2/camera_abilities_spec.rb +23 -0
  51. data/spec/gphoto2/camera_file_info/file_camera_file_info_spec.rb +56 -0
  52. data/spec/gphoto2/camera_file_spec.rb +17 -0
  53. data/spec/gphoto2/camera_spec.rb +11 -5
  54. data/spec/gphoto2/port_spec.rb +22 -0
  55. data/spec/gphoto2_spec.rb +18 -0
  56. data/spec/support/shared_examples/camera/capture_examples.rb +13 -0
  57. data/spec/support/shared_examples/camera/configuration_examples.rb +26 -18
  58. data/spec/support/shared_examples/camera_file_info_examples.rb +42 -0
  59. metadata +54 -24
@@ -0,0 +1,42 @@
1
+ shared_examples_for GPhoto2::CameraFileInfo do
2
+ let(:camera_file_info) do
3
+ OpenStruct.new(
4
+ fields: 0xff,
5
+ status: :not_downloaded,
6
+ size: 7355608,
7
+ type: 'image/jpeg'
8
+ )
9
+ end
10
+
11
+ let(:info) { described_class.new(camera_file_info) }
12
+
13
+ describe '#fields' do
14
+ it 'returns a bit field of set fields' do
15
+ expect(info.fields).to eq(0xff)
16
+ end
17
+ end
18
+
19
+ describe '#has_field?' do
20
+ it 'returns whether a field is set' do
21
+ expect(info.has_field?(:size)).to be(true)
22
+ end
23
+ end
24
+
25
+ describe '#status' do
26
+ it 'returns the file status' do
27
+ expect(info.status).to eq(:not_downloaded)
28
+ end
29
+ end
30
+
31
+ describe '#size' do
32
+ it 'returns the filesize' do
33
+ expect(info.size).to eq(7355608)
34
+ end
35
+ end
36
+
37
+ describe '#type' do
38
+ it 'returns the file type' do
39
+ expect(info.type).to eq('image/jpeg')
40
+ end
41
+ end
42
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-gphoto2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Macias
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-11 00:00:00.000000000 Z
11
+ date: 2020-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,85 +16,91 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 3.2.0
47
+ version: 3.9.0
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
- version: 3.2.0
54
+ version: 3.9.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: yard
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.8.7
61
+ version: 0.9.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
- version: 0.8.7
68
+ version: 0.9.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: ffi
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.9.0
75
+ version: 1.12.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.9.0
83
- description:
82
+ version: 1.12.0
83
+ description:
84
84
  email:
85
- - mamacias@go.olemiss.edu
85
+ - zaeleus@gmail.com
86
86
  executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - ".gitignore"
91
91
  - ".rspec"
92
+ - ".travis.yml"
93
+ - CHANGELOG.md
92
94
  - Gemfile
93
95
  - LICENSE.txt
94
96
  - README.md
95
97
  - Rakefile
98
+ - examples/autofocus.rb
99
+ - examples/capture.rb
100
+ - examples/continuous_burst.rb
96
101
  - examples/intervalometer.rb
97
102
  - examples/list_config.rb
103
+ - examples/list_files.rb
98
104
  - examples/live_view.rb
99
105
  - examples/record_movie.rb
100
106
  - ffi-gphoto2.gemspec
@@ -107,8 +113,15 @@ files:
107
113
  - lib/ffi/gphoto2/camera_event_type.rb
108
114
  - lib/ffi/gphoto2/camera_file.rb
109
115
  - lib/ffi/gphoto2/camera_file_access_type.rb
116
+ - lib/ffi/gphoto2/camera_file_info.rb
117
+ - lib/ffi/gphoto2/camera_file_info_audio.rb
118
+ - lib/ffi/gphoto2/camera_file_info_fields.rb
119
+ - lib/ffi/gphoto2/camera_file_info_file.rb
120
+ - lib/ffi/gphoto2/camera_file_info_preview.rb
110
121
  - lib/ffi/gphoto2/camera_file_operation.rb
111
122
  - lib/ffi/gphoto2/camera_file_path.rb
123
+ - lib/ffi/gphoto2/camera_file_permissions.rb
124
+ - lib/ffi/gphoto2/camera_file_status.rb
112
125
  - lib/ffi/gphoto2/camera_file_type.rb
113
126
  - lib/ffi/gphoto2/camera_folder_operation.rb
114
127
  - lib/ffi/gphoto2/camera_list.rb
@@ -119,9 +132,16 @@ files:
119
132
  - lib/ffi/gphoto2/gp_context.rb
120
133
  - lib/ffi/gphoto2/gphoto_device_type.rb
121
134
  - lib/ffi/gphoto2_port.rb
135
+ - lib/ffi/gphoto2_port/gp_port.rb
122
136
  - lib/ffi/gphoto2_port/gp_port_info.rb
123
137
  - lib/ffi/gphoto2_port/gp_port_info_list.rb
124
138
  - lib/ffi/gphoto2_port/gp_port_result.rb
139
+ - lib/ffi/gphoto2_port/gp_port_serial_parity.rb
140
+ - lib/ffi/gphoto2_port/gp_port_settings.rb
141
+ - lib/ffi/gphoto2_port/gp_port_settings_serial.rb
142
+ - lib/ffi/gphoto2_port/gp_port_settings_usb.rb
143
+ - lib/ffi/gphoto2_port/gp_port_settings_usb_disk_direct.rb
144
+ - lib/ffi/gphoto2_port/gp_port_settings_usb_scsi.rb
125
145
  - lib/ffi/gphoto2_port/gp_port_type.rb
126
146
  - lib/gphoto2.rb
127
147
  - lib/gphoto2/camera.rb
@@ -133,6 +153,8 @@ files:
133
153
  - lib/gphoto2/camera_abilities_list.rb
134
154
  - lib/gphoto2/camera_event.rb
135
155
  - lib/gphoto2/camera_file.rb
156
+ - lib/gphoto2/camera_file_info/camera_file_info.rb
157
+ - lib/gphoto2/camera_file_info/file_camera_file_info.rb
136
158
  - lib/gphoto2/camera_file_path.rb
137
159
  - lib/gphoto2/camera_folder.rb
138
160
  - lib/gphoto2/camera_list.rb
@@ -147,6 +169,7 @@ files:
147
169
  - lib/gphoto2/camera_widgets/window_camera_widget.rb
148
170
  - lib/gphoto2/context.rb
149
171
  - lib/gphoto2/entry.rb
172
+ - lib/gphoto2/port.rb
150
173
  - lib/gphoto2/port_info.rb
151
174
  - lib/gphoto2/port_info_list.rb
152
175
  - lib/gphoto2/port_result.rb
@@ -154,6 +177,7 @@ files:
154
177
  - lib/gphoto2/version.rb
155
178
  - spec/gphoto2/camera_abilities_list_spec.rb
156
179
  - spec/gphoto2/camera_abilities_spec.rb
180
+ - spec/gphoto2/camera_file_info/file_camera_file_info_spec.rb
157
181
  - spec/gphoto2/camera_file_path_spec.rb
158
182
  - spec/gphoto2/camera_file_spec.rb
159
183
  - spec/gphoto2/camera_folder_spec.rb
@@ -168,17 +192,20 @@ files:
168
192
  - spec/gphoto2/entry_spec.rb
169
193
  - spec/gphoto2/port_info_list_spec.rb
170
194
  - spec/gphoto2/port_info_spec.rb
195
+ - spec/gphoto2/port_spec.rb
196
+ - spec/gphoto2_spec.rb
171
197
  - spec/spec_helper.rb
172
198
  - spec/support/shared_examples/camera/capture_examples.rb
173
199
  - spec/support/shared_examples/camera/configuration_examples.rb
174
200
  - spec/support/shared_examples/camera/event_examples.rb
175
201
  - spec/support/shared_examples/camera/filesystem_examples.rb
202
+ - spec/support/shared_examples/camera_file_info_examples.rb
176
203
  - spec/support/shared_examples/camera_widget_examples.rb
177
204
  homepage: https://github.com/zaeleus/ffi-gphoto2
178
205
  licenses:
179
206
  - MIT
180
207
  metadata: {}
181
- post_install_message:
208
+ post_install_message:
182
209
  rdoc_options: []
183
210
  require_paths:
184
211
  - lib
@@ -186,22 +213,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
213
  requirements:
187
214
  - - ">="
188
215
  - !ruby/object:Gem::Version
189
- version: '1.9'
216
+ version: '2.0'
190
217
  required_rubygems_version: !ruby/object:Gem::Requirement
191
218
  requirements:
192
219
  - - ">="
193
220
  - !ruby/object:Gem::Version
194
221
  version: '0'
195
222
  requirements:
196
- - libgphoto2 >= 2.5.0
197
- rubyforge_project:
198
- rubygems_version: 2.4.6
199
- signing_key:
223
+ - libgphoto2 >= 2.5.2
224
+ - libgphoto2_port >= 0.10.1
225
+ rubygems_version: 3.1.2
226
+ signing_key:
200
227
  specification_version: 4
201
228
  summary: A Ruby FFI for common functions in libgphoto2
202
229
  test_files:
203
230
  - spec/gphoto2/camera_abilities_list_spec.rb
204
231
  - spec/gphoto2/camera_abilities_spec.rb
232
+ - spec/gphoto2/camera_file_info/file_camera_file_info_spec.rb
205
233
  - spec/gphoto2/camera_file_path_spec.rb
206
234
  - spec/gphoto2/camera_file_spec.rb
207
235
  - spec/gphoto2/camera_folder_spec.rb
@@ -216,10 +244,12 @@ test_files:
216
244
  - spec/gphoto2/entry_spec.rb
217
245
  - spec/gphoto2/port_info_list_spec.rb
218
246
  - spec/gphoto2/port_info_spec.rb
247
+ - spec/gphoto2/port_spec.rb
248
+ - spec/gphoto2_spec.rb
219
249
  - spec/spec_helper.rb
220
250
  - spec/support/shared_examples/camera/capture_examples.rb
221
251
  - spec/support/shared_examples/camera/configuration_examples.rb
222
252
  - spec/support/shared_examples/camera/event_examples.rb
223
253
  - spec/support/shared_examples/camera/filesystem_examples.rb
254
+ - spec/support/shared_examples/camera_file_info_examples.rb
224
255
  - spec/support/shared_examples/camera_widget_examples.rb
225
- has_rdoc: