ffi-gphoto2 0.4.1 → 0.5.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.
- checksums.yaml +4 -4
 - data/.rspec +2 -1
 - data/Rakefile +2 -0
 - data/examples/intervalometer.rb +9 -7
 - data/examples/list_config.rb +3 -5
 - data/examples/live_view.rb +6 -12
 - data/examples/record_movie.rb +10 -13
 - data/ffi-gphoto2.gemspec +2 -1
 - data/lib/ffi/gphoto2_port.rb +2 -2
 - data/lib/gphoto2/camera/capture.rb +59 -0
 - data/lib/gphoto2/camera/configuration.rb +136 -0
 - data/lib/gphoto2/camera/event.rb +56 -0
 - data/lib/gphoto2/camera/filesystem.rb +44 -0
 - data/lib/gphoto2/camera.rb +95 -166
 - data/lib/gphoto2/camera_abilities.rb +6 -6
 - data/lib/gphoto2/camera_abilities_list.rb +7 -6
 - data/lib/gphoto2/camera_event.rb +1 -8
 - data/lib/gphoto2/camera_file.rb +15 -5
 - data/lib/gphoto2/camera_file_path.rb +3 -5
 - data/lib/gphoto2/camera_folder.rb +11 -0
 - data/lib/gphoto2/camera_list.rb +3 -10
 - data/lib/gphoto2/camera_widgets/camera_widget.rb +27 -14
 - data/lib/gphoto2/camera_widgets/radio_camera_widget.rb +1 -0
 - data/lib/gphoto2/camera_widgets/range_camera_widget.rb +1 -0
 - data/lib/gphoto2/context.rb +2 -6
 - data/lib/gphoto2/entry.rb +2 -0
 - data/lib/gphoto2/port_info.rb +8 -6
 - data/lib/gphoto2/port_info_list.rb +5 -6
 - data/lib/gphoto2/port_result.rb +2 -0
 - data/lib/gphoto2/struct.rb +11 -0
 - data/lib/gphoto2/version.rb +1 -1
 - data/lib/gphoto2.rb +13 -0
 - data/spec/gphoto2/camera_abilities_list_spec.rb +5 -5
 - data/spec/gphoto2/camera_abilities_spec.rb +7 -7
 - data/spec/gphoto2/camera_file_path_spec.rb +2 -2
 - data/spec/gphoto2/camera_file_spec.rb +7 -7
 - data/spec/gphoto2/camera_folder_spec.rb +3 -3
 - data/spec/gphoto2/camera_list_spec.rb +3 -3
 - data/spec/gphoto2/camera_spec.rb +37 -272
 - data/spec/gphoto2/camera_widgets/date_camera_widget_spec.rb +1 -1
 - data/spec/gphoto2/camera_widgets/radio_camera_widget_spec.rb +4 -4
 - data/spec/gphoto2/camera_widgets/range_camera_widget_spec.rb +2 -2
 - data/spec/gphoto2/camera_widgets/text_camera_widget_spec.rb +1 -1
 - data/spec/gphoto2/camera_widgets/toggle_camera_widget_spec.rb +2 -2
 - data/spec/gphoto2/context_spec.rb +1 -1
 - data/spec/gphoto2/entry_spec.rb +2 -2
 - data/spec/gphoto2/port_info_list_spec.rb +4 -4
 - data/spec/gphoto2/port_info_spec.rb +9 -10
 - data/spec/spec_helper.rb +0 -7
 - data/spec/support/shared_examples/camera/capture_examples.rb +41 -0
 - data/spec/support/shared_examples/camera/configuration_examples.rb +161 -0
 - data/spec/support/shared_examples/camera/event_examples.rb +39 -0
 - data/spec/support/shared_examples/camera/filesystem_examples.rb +46 -0
 - data/spec/support/shared_examples/camera_widget_examples.rb +13 -13
 - metadata +32 -4
 
| 
         @@ -3,7 +3,7 @@ shared_examples_for GPhoto2::CameraWidget do |klass| 
     | 
|
| 
       3 
3 
     | 
    
         
             
                it 'returns the name of the widget' do
         
     | 
| 
       4 
4 
     | 
    
         
             
                  name = 'name'
         
     | 
| 
       5 
5 
     | 
    
         
             
                  widget = klass.new(nil)
         
     | 
| 
       6 
     | 
    
         
            -
                  widget. 
     | 
| 
      
 6 
     | 
    
         
            +
                  allow(widget).to receive(:get_name).and_return(name)
         
     | 
| 
       7 
7 
     | 
    
         
             
                  expect(widget.name).to eq(name)
         
     | 
| 
       8 
8 
     | 
    
         
             
                end
         
     | 
| 
       9 
9 
     | 
    
         
             
              end
         
     | 
| 
         @@ -12,7 +12,7 @@ shared_examples_for GPhoto2::CameraWidget do |klass| 
     | 
|
| 
       12 
12 
     | 
    
         
             
                it 'returns the value of the widget' do
         
     | 
| 
       13 
13 
     | 
    
         
             
                  value = 'value'
         
     | 
| 
       14 
14 
     | 
    
         
             
                  widget = klass.new(nil)
         
     | 
| 
       15 
     | 
    
         
            -
                  widget. 
     | 
| 
      
 15 
     | 
    
         
            +
                  allow(widget).to receive(:get_value).and_return(value)
         
     | 
| 
       16 
16 
     | 
    
         
             
                  expect(widget.value).to eq(value)
         
     | 
| 
       17 
17 
     | 
    
         
             
                end
         
     | 
| 
       18 
18 
     | 
    
         
             
              end
         
     | 
| 
         @@ -38,7 +38,7 @@ shared_examples_for GPhoto2::CameraWidget do |klass| 
     | 
|
| 
       38 
38 
     | 
    
         
             
                it 'returns the type of the widget' do
         
     | 
| 
       39 
39 
     | 
    
         
             
                  type = :window
         
     | 
| 
       40 
40 
     | 
    
         
             
                  widget = klass.new(nil)
         
     | 
| 
       41 
     | 
    
         
            -
                  widget. 
     | 
| 
      
 41 
     | 
    
         
            +
                  allow(widget).to receive(:get_type).and_return(type)
         
     | 
| 
       42 
42 
     | 
    
         
             
                  expect(widget.type).to eq(type)
         
     | 
| 
       43 
43 
     | 
    
         
             
                end
         
     | 
| 
       44 
44 
     | 
    
         
             
              end
         
     | 
| 
         @@ -47,7 +47,7 @@ shared_examples_for GPhoto2::CameraWidget do |klass| 
     | 
|
| 
       47 
47 
     | 
    
         
             
                it 'returns the label of the widget' do
         
     | 
| 
       48 
48 
     | 
    
         
             
                  label = 'Beep'
         
     | 
| 
       49 
49 
     | 
    
         
             
                  widget = klass.new(nil)
         
     | 
| 
       50 
     | 
    
         
            -
                  widget. 
     | 
| 
      
 50 
     | 
    
         
            +
                  allow(widget).to receive(:get_label).and_return(label)
         
     | 
| 
       51 
51 
     | 
    
         
             
                  expect(widget.label).to eq(label)
         
     | 
| 
       52 
52 
     | 
    
         
             
                end
         
     | 
| 
       53 
53 
     | 
    
         
             
              end
         
     | 
| 
         @@ -57,8 +57,8 @@ shared_examples_for GPhoto2::CameraWidget do |klass| 
     | 
|
| 
       57 
57 
     | 
    
         
             
                  size = 2
         
     | 
| 
       58 
58 
     | 
    
         | 
| 
       59 
59 
     | 
    
         
             
                  widget = klass.new(nil)
         
     | 
| 
       60 
     | 
    
         
            -
                  widget. 
     | 
| 
       61 
     | 
    
         
            -
                  widget. 
     | 
| 
      
 60 
     | 
    
         
            +
                  allow(widget).to receive(:count_children).and_return(size)
         
     | 
| 
      
 61 
     | 
    
         
            +
                  allow(widget).to receive(:get_child)
         
     | 
| 
       62 
62 
     | 
    
         | 
| 
       63 
63 
     | 
    
         
             
                  expect(widget).to receive(:get_child).exactly(size).times
         
     | 
| 
       64 
64 
     | 
    
         | 
| 
         @@ -70,18 +70,18 @@ shared_examples_for GPhoto2::CameraWidget do |klass| 
     | 
|
| 
       70 
70 
     | 
    
         
             
                %w[a b].each do |name|
         
     | 
| 
       71 
71 
     | 
    
         
             
                  let(name.to_sym) do
         
     | 
| 
       72 
72 
     | 
    
         
             
                    widget = GPhoto2::TextCameraWidget.new(nil)
         
     | 
| 
       73 
     | 
    
         
            -
                    widget. 
     | 
| 
       74 
     | 
    
         
            -
                    widget. 
     | 
| 
       75 
     | 
    
         
            -
                    widget. 
     | 
| 
      
 73 
     | 
    
         
            +
                    allow(widget).to receive(:name).and_return(name)
         
     | 
| 
      
 74 
     | 
    
         
            +
                    allow(widget).to receive(:type).and_return(:text)
         
     | 
| 
      
 75 
     | 
    
         
            +
                    allow(widget).to receive(:children).and_return([])
         
     | 
| 
       76 
76 
     | 
    
         
             
                    widget
         
     | 
| 
       77 
77 
     | 
    
         
             
                  end
         
     | 
| 
       78 
78 
     | 
    
         
             
                end
         
     | 
| 
       79 
79 
     | 
    
         | 
| 
       80 
80 
     | 
    
         
             
                it 'returns a map of name-widget pairs of its descendents' do
         
     | 
| 
       81 
81 
     | 
    
         
             
                  widget = klass.new(nil)
         
     | 
| 
       82 
     | 
    
         
            -
                  widget. 
     | 
| 
       83 
     | 
    
         
            -
                  widget. 
     | 
| 
       84 
     | 
    
         
            -
                  widget. 
     | 
| 
      
 82 
     | 
    
         
            +
                  allow(widget).to receive(:name).and_return('a')
         
     | 
| 
      
 83 
     | 
    
         
            +
                  allow(widget).to receive(:type).and_return(:section)
         
     | 
| 
      
 84 
     | 
    
         
            +
                  allow(widget).to receive(:children).and_return([a, b])
         
     | 
| 
       85 
85 
     | 
    
         | 
| 
       86 
86 
     | 
    
         
             
                  expect(widget.flatten).to eq({ 'a' => a, 'b' => b })
         
     | 
| 
       87 
87 
     | 
    
         
             
                end
         
     | 
| 
         @@ -91,7 +91,7 @@ shared_examples_for GPhoto2::CameraWidget do |klass| 
     | 
|
| 
       91 
91 
     | 
    
         
             
                it "returns the string value of the widget" do
         
     | 
| 
       92 
92 
     | 
    
         
             
                  value = 'value'
         
     | 
| 
       93 
93 
     | 
    
         
             
                  widget = klass.new(nil)
         
     | 
| 
       94 
     | 
    
         
            -
                  widget. 
     | 
| 
      
 94 
     | 
    
         
            +
                  allow(widget).to receive(:value).and_return(value)
         
     | 
| 
       95 
95 
     | 
    
         
             
                  expect(widget.to_s).to eq(value)
         
     | 
| 
       96 
96 
     | 
    
         
             
                end
         
     | 
| 
       97 
97 
     | 
    
         
             
              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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.5.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Michael Macias
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-08-16 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     | 
| 
         @@ -44,14 +44,28 @@ dependencies: 
     | 
|
| 
       44 
44 
     | 
    
         
             
                requirements:
         
     | 
| 
       45 
45 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       46 
46 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       47 
     | 
    
         
            -
                    version:  
     | 
| 
      
 47 
     | 
    
         
            +
                    version: 3.0.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:  
     | 
| 
      
 54 
     | 
    
         
            +
                    version: 3.0.0
         
     | 
| 
      
 55 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 56 
     | 
    
         
            +
              name: yard
         
     | 
| 
      
 57 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 58 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 59 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 60 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 61 
     | 
    
         
            +
                    version: 0.8.7
         
     | 
| 
      
 62 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 63 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 64 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 65 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 66 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 67 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 68 
     | 
    
         
            +
                    version: 0.8.7
         
     | 
| 
       55 
69 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       56 
70 
     | 
    
         
             
              name: ffi
         
     | 
| 
       57 
71 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -111,6 +125,10 @@ files: 
     | 
|
| 
       111 
125 
     | 
    
         
             
            - lib/ffi/gphoto2_port/gp_port_type.rb
         
     | 
| 
       112 
126 
     | 
    
         
             
            - lib/gphoto2.rb
         
     | 
| 
       113 
127 
     | 
    
         
             
            - lib/gphoto2/camera.rb
         
     | 
| 
      
 128 
     | 
    
         
            +
            - lib/gphoto2/camera/capture.rb
         
     | 
| 
      
 129 
     | 
    
         
            +
            - lib/gphoto2/camera/configuration.rb
         
     | 
| 
      
 130 
     | 
    
         
            +
            - lib/gphoto2/camera/event.rb
         
     | 
| 
      
 131 
     | 
    
         
            +
            - lib/gphoto2/camera/filesystem.rb
         
     | 
| 
       114 
132 
     | 
    
         
             
            - lib/gphoto2/camera_abilities.rb
         
     | 
| 
       115 
133 
     | 
    
         
             
            - lib/gphoto2/camera_abilities_list.rb
         
     | 
| 
       116 
134 
     | 
    
         
             
            - lib/gphoto2/camera_event.rb
         
     | 
| 
         @@ -132,6 +150,7 @@ files: 
     | 
|
| 
       132 
150 
     | 
    
         
             
            - lib/gphoto2/port_info.rb
         
     | 
| 
       133 
151 
     | 
    
         
             
            - lib/gphoto2/port_info_list.rb
         
     | 
| 
       134 
152 
     | 
    
         
             
            - lib/gphoto2/port_result.rb
         
     | 
| 
      
 153 
     | 
    
         
            +
            - lib/gphoto2/struct.rb
         
     | 
| 
       135 
154 
     | 
    
         
             
            - lib/gphoto2/version.rb
         
     | 
| 
       136 
155 
     | 
    
         
             
            - spec/gphoto2/camera_abilities_list_spec.rb
         
     | 
| 
       137 
156 
     | 
    
         
             
            - spec/gphoto2/camera_abilities_spec.rb
         
     | 
| 
         @@ -150,6 +169,10 @@ files: 
     | 
|
| 
       150 
169 
     | 
    
         
             
            - spec/gphoto2/port_info_list_spec.rb
         
     | 
| 
       151 
170 
     | 
    
         
             
            - spec/gphoto2/port_info_spec.rb
         
     | 
| 
       152 
171 
     | 
    
         
             
            - spec/spec_helper.rb
         
     | 
| 
      
 172 
     | 
    
         
            +
            - spec/support/shared_examples/camera/capture_examples.rb
         
     | 
| 
      
 173 
     | 
    
         
            +
            - spec/support/shared_examples/camera/configuration_examples.rb
         
     | 
| 
      
 174 
     | 
    
         
            +
            - spec/support/shared_examples/camera/event_examples.rb
         
     | 
| 
      
 175 
     | 
    
         
            +
            - spec/support/shared_examples/camera/filesystem_examples.rb
         
     | 
| 
       153 
176 
     | 
    
         
             
            - spec/support/shared_examples/camera_widget_examples.rb
         
     | 
| 
       154 
177 
     | 
    
         
             
            homepage: https://github.com/zaeleus/ffi-gphoto2
         
     | 
| 
       155 
178 
     | 
    
         
             
            licenses:
         
     | 
| 
         @@ -194,4 +217,9 @@ test_files: 
     | 
|
| 
       194 
217 
     | 
    
         
             
            - spec/gphoto2/port_info_list_spec.rb
         
     | 
| 
       195 
218 
     | 
    
         
             
            - spec/gphoto2/port_info_spec.rb
         
     | 
| 
       196 
219 
     | 
    
         
             
            - spec/spec_helper.rb
         
     | 
| 
      
 220 
     | 
    
         
            +
            - spec/support/shared_examples/camera/capture_examples.rb
         
     | 
| 
      
 221 
     | 
    
         
            +
            - spec/support/shared_examples/camera/configuration_examples.rb
         
     | 
| 
      
 222 
     | 
    
         
            +
            - spec/support/shared_examples/camera/event_examples.rb
         
     | 
| 
      
 223 
     | 
    
         
            +
            - spec/support/shared_examples/camera/filesystem_examples.rb
         
     | 
| 
       197 
224 
     | 
    
         
             
            - spec/support/shared_examples/camera_widget_examples.rb
         
     | 
| 
      
 225 
     | 
    
         
            +
            has_rdoc: 
         
     |