interspire 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -20,7 +20,20 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ The API class requires 3 parameters; the API URL of your Interspire installation, a username, and that username's token.
24
+ This information can be found under the 'Users & Groups' menu on your Interspire installation.
25
+ You might have to enable API access for the user.
26
+
27
+ api_url = 'http://example.com/xml.php'
28
+ user = 'luser'
29
+ token = 'some_valid_api_token'
30
+
31
+ api = Interspire::API.new(api_url, user, token)
32
+
33
+ # Get an array of Interspire::ContactList objects:
34
+ api.get_lists # => [#<Interspire::ContactList:0x8bc6cb0 @id="7", @name="List Foo", ...
35
+
36
+ See the {Interspire::API} class for documentation on the available methods.
24
37
 
25
38
  ## Contributing
26
39
 
@@ -4,5 +4,5 @@ require "interspire/interspire_exception"
4
4
  require "interspire/subscriber"
5
5
 
6
6
  module Interspire
7
- VERSION = "0.1.0"
7
+ VERSION = "0.1.1"
8
8
  end
@@ -2,6 +2,7 @@ require 'net/http'
2
2
  require 'nokogiri'
3
3
 
4
4
  module Interspire
5
+ # TODO: The methods expecting a list ID should also accept a ContactList object.
5
6
  class API
6
7
 
7
8
  # @param api_url [String] The XML API of your Interspire installation; ex. http://example.com/xml.php
@@ -142,7 +143,7 @@ module Interspire
142
143
 
143
144
  if success?(response)
144
145
  subscribers = {}
145
- subscribers[:count] = response.xpath('response/data/count').first.content
146
+ subscribers[:count] = response.xpath('response/data/count').first.content.to_i
146
147
  subscribers[:subscribers] = []
147
148
 
148
149
  response.xpath('response/data').each do |data|
@@ -47,6 +47,7 @@ describe Interspire::API do
47
47
 
48
48
  # Make sure there's a count.
49
49
  subscribers[:count].should_not be_nil
50
+ subscribers[:count].should be_a(Integer)
50
51
 
51
52
  # Make sure the required values are there:
52
53
  subscribers[:subscribers].each do |subscriber|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interspire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2013-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &82085980 !ruby/object:Gem::Requirement
16
+ requirement: &80803630 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *82085980
24
+ version_requirements: *80803630
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &82085610 !ruby/object:Gem::Requirement
27
+ requirement: &80803380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *82085610
35
+ version_requirements: *80803380
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: webmock
38
- requirement: &82085360 !ruby/object:Gem::Requirement
38
+ requirement: &80803110 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *82085360
46
+ version_requirements: *80803110
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: yard
49
- requirement: &82085080 !ruby/object:Gem::Requirement
49
+ requirement: &80802850 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *82085080
57
+ version_requirements: *80802850
58
58
  description: Ruby library for the Interspire API.
59
59
  email:
60
60
  - oshuma@gmail.com
@@ -100,7 +100,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  segments:
102
102
  - 0
103
- hash: 942893455
103
+ hash: 316495037
104
104
  required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  segments:
111
111
  - 0
112
- hash: 942893455
112
+ hash: 316495037
113
113
  requirements: []
114
114
  rubyforge_project:
115
115
  rubygems_version: 1.8.10