point 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,7 +15,7 @@ require 'point/zone'
15
15
  require 'point/zone_record'
16
16
 
17
17
  module Point
18
- VERSION = '1.0.0'
18
+ VERSION = '1.0.2'
19
19
 
20
20
  class << self
21
21
  attr_accessor :username
@@ -25,6 +25,8 @@ module Point
25
25
  case type
26
26
  when :all then find_all(params)
27
27
  when Integer then find_single(type, params)
28
+ when String then find_all(params).select {|r| r.attributes["name"] == type}.first
29
+ else raise Point::Error, "Find requires :all, a string or an integer.'
28
30
  end
29
31
  end
30
32
 
@@ -21,7 +21,7 @@ module Point
21
21
  ## Hashes will be converted to JSON before being sent to the remote service.
22
22
  def make
23
23
  uri = URI.parse([Point.site, @path].join('/'))
24
- http_request = http_class.new(uri.path)
24
+ http_request = http_class.new(uri.request_uri)
25
25
  http_request.basic_auth(Point.username, Point.apitoken)
26
26
  http_request.add_field("Accept", "application/json")
27
27
  http_request.add_field("Content-type", "application/json")
@@ -1,5 +1,11 @@
1
1
  module Point
2
2
  class Zone < Base
3
+
4
+ class << self
5
+ def collection_path(params = {})
6
+ params[:group] ? "zones?group=#{params[:group]}" : 'zones'
7
+ end
8
+ end
3
9
 
4
10
  def apply!
5
11
  $stderr.puts "Zone information does not need to be applied manually. Point::Zone#apply! method will be deprecated soon."
@@ -1,5 +1,7 @@
1
1
  module Point
2
2
  class ZoneRecord < Base
3
+
4
+ RECORD_TYPES = ["A", "CNAME", "MX", "TXT", "SRV", "AAAA", 'SSHFP', 'PTR']
3
5
 
4
6
  class << self
5
7
  def collection_path(params = {})
metadata CHANGED
@@ -1,80 +1,66 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: point
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 0
8
- - 1
9
- version: 1.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Adam Cooke
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2010-05-18 00:00:00 +01:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2013-10-24 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: json
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 1
29
- - 1
30
- - 5
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
31
21
  version: 1.1.5
32
22
  type: :runtime
33
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.1.5
34
30
  description:
35
31
  email: adam@atechmedia.com
36
32
  executables: []
37
-
38
33
  extensions: []
39
-
40
34
  extra_rdoc_files: []
41
-
42
- files:
35
+ files:
43
36
  - lib/point/base.rb
44
37
  - lib/point/errors.rb
45
38
  - lib/point/request.rb
46
39
  - lib/point/zone.rb
47
40
  - lib/point/zone_record.rb
48
41
  - lib/point.rb
49
- has_rdoc: true
50
42
  homepage: http://www.pointhq.com
51
43
  licenses: []
52
-
53
44
  post_install_message:
54
45
  rdoc_options: []
55
-
56
- require_paths:
46
+ require_paths:
57
47
  - lib
58
- required_ruby_version: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- segments:
63
- - 0
64
- version: "0"
65
- required_rubygems_version: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- segments:
70
- - 0
71
- version: "0"
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
72
60
  requirements: []
73
-
74
61
  rubyforge_project:
75
- rubygems_version: 1.3.6
62
+ rubygems_version: 1.8.23
76
63
  signing_key:
77
64
  specification_version: 3
78
65
  summary: API client for the PointHQ DNS Hosting System
79
66
  test_files: []
80
-