axis-netcam 0.2.0 → 0.2.1

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.
@@ -7,6 +7,10 @@
7
7
  * Added method for fetching the camera's PTZ limits.
8
8
  * snapshot_jpeg method now takes an optional hash of parameters to send
9
9
  with the snapshot request.
10
+ * Added method to manually disconnect from the camera (i.e. close the http
11
+ connection).
12
+ * The username is now logged in the action calls, along with the hostname
13
+ of the camera.
10
14
 
11
15
  === 0.1.0 :: 2007-07-26
12
16
 
data/README.txt CHANGED
@@ -3,14 +3,18 @@
3
3
  <b>AxisNetcam provides a Ruby interface for interacting with network cameras
4
4
  from Axis Communications.</b>
5
5
 
6
- === Copyright & Contact Info
7
-
8
6
  <i>Copyright 2007 Urbacon Ltd.</i>
9
7
 
8
+ === Contact Info
9
+
10
10
  For info and downloads please see:
11
11
 
12
12
  http://rubyforge.org/projects/axis-netcam/
13
13
 
14
+ For source code:
15
+
16
+ http://github.com/DefV/axis-netcam
17
+
14
18
  You can contact the author at:
15
19
 
16
20
  matt at roughest dot net
@@ -63,4 +67,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
63
67
  GNU General Public License for more details.
64
68
 
65
69
  You should have received a copy of the GNU Lesser General Public License
66
- along with this program. If not, see <http://www.gnu.org/licenses/>.
70
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -107,6 +107,12 @@ module AxisNetcam
107
107
  axis_action("com/ptz.cgi", {'pan' => d})
108
108
  end
109
109
 
110
+ # Move the camera one 'tick' in the given direction.
111
+ # Possible values are 'up', 'down', 'left', 'right'
112
+ def move(direction)
113
+ axis_action("com/ptz.cgi", {'move' => direction})
114
+ end
115
+
110
116
  # Zooms the camera (in/out) to the given zoom factor.
111
117
  def zoom(n)
112
118
  axis_action("com/ptz.cgi", {'zoom' => n})
@@ -500,8 +506,17 @@ module AxisNetcam
500
506
  include Info
501
507
 
502
508
  def to_s
503
- s = super
504
- s.gsub(">", %{ @hostname=#{hostname.inspect}>})
509
+ "#<#{self.class}:#{self.hostname}:#{self.object_id}>"
510
+ end
511
+
512
+ def disconnect
513
+ if @http && @http.active?
514
+ @log.debug "AXIS REMOTE API closing HTTP connection #{@http}"
515
+ @http.close
516
+ @http = nil
517
+ else
518
+ @log.warn "AXIS REMOTE API cannot disconnect because the HTTP connection is not open"
519
+ end
505
520
  end
506
521
 
507
522
  private
@@ -531,7 +546,7 @@ module AxisNetcam
531
546
 
532
547
  req.basic_auth @username, @password
533
548
 
534
- @log.info "AXIS REMOTE API CALL [#{hostname}]: #{cmd_uri}"
549
+ @log.info "AXIS REMOTE API CALL [#{@username}@#{hostname}]: #{cmd_uri}"
535
550
  res = http.request(req)
536
551
  @log.debug "AXIS REMOTE API CALL FINISHED"
537
552
 
@@ -2,7 +2,7 @@ module AxisNetcam #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,33 +1,59 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
3
- specification_version: 1
4
2
  name: axis-netcam
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.2.0
7
- date: 2007-08-13 00:00:00 -04:00
8
- summary: Provides a Ruby interface for interacting with network cameras from Axis Communications.
9
- require_paths:
10
- - lib
11
- email: matt@roughest.net
12
- homepage: http://axis-netcam.rubyforge.org
13
- rubyforge_project: axis-netcam
14
- description: Provides a Ruby interface for interacting with network cameras from Axis Communications.
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.2.1
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Matt Zukowski
8
+ - Jan De Poorter
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2010-02-08 00:00:00 -05:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rubyforge
18
+ type: :development
19
+ version_requirement:
20
+ version_requirements: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: 2.0.3
25
+ version:
26
+ - !ruby/object:Gem::Dependency
27
+ name: gemcutter
28
+ type: :development
29
+ version_requirement:
30
+ version_requirements: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 0.2.1
35
+ version:
36
+ - !ruby/object:Gem::Dependency
37
+ name: hoe
38
+ type: :development
39
+ version_requirement:
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: 2.5.0
45
+ version:
46
+ description: Provides a Ruby interface for interacting with network cameras from Axis Communications.
47
+ email: matt@roughest.net
48
+ executables: []
49
+
50
+ extensions: []
51
+
52
+ extra_rdoc_files:
53
+ - CHANGELOG.txt
54
+ - LICENSE.txt
55
+ - Manifest.txt
56
+ - README.txt
31
57
  files:
32
58
  - CHANGELOG.txt
33
59
  - LICENSE.txt
@@ -40,17 +66,34 @@ files:
40
66
  - setup.rb
41
67
  - test/axis-netcam_test.rb
42
68
  - test/test_helper.rb
43
- test_files:
44
- - test/axis-netcam_test.rb
45
- rdoc_options: []
46
-
47
- extra_rdoc_files: []
48
-
49
- executables: []
50
-
51
- extensions: []
69
+ has_rdoc: true
70
+ homepage: http://github.com/DefV/axis-netcam
71
+ licenses: []
52
72
 
73
+ post_install_message:
74
+ rdoc_options:
75
+ - --main
76
+ - README.txt
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: "0"
84
+ version:
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: "0"
90
+ version:
53
91
  requirements: []
54
92
 
55
- dependencies: []
56
-
93
+ rubyforge_project: axis-netcam
94
+ rubygems_version: 1.3.5
95
+ signing_key:
96
+ specification_version: 3
97
+ summary: Provides a Ruby interface for interacting with network cameras from Axis Communications.
98
+ test_files:
99
+ - test/axis-netcam_test.rb