hugs 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. data/Gemfile +1 -0
  2. data/Gemfile.lock +2 -0
  3. data/README.md +4 -1
  4. data/VERSION +1 -1
  5. data/hugs.gemspec +5 -2
  6. data/lib/hugs.rb +5 -1
  7. metadata +28 -13
data/Gemfile CHANGED
@@ -1,6 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gem "yajl-ruby", "~> 0.7.8"
4
+ gem "nokogiri", "~> 1.4.4"
4
5
  gem "net-http-persistent", "~> 1.4.1"
5
6
 
6
7
  group :development do
data/Gemfile.lock CHANGED
@@ -10,6 +10,7 @@ GEM
10
10
  mocha (0.9.10)
11
11
  rake
12
12
  net-http-persistent (1.4.1)
13
+ nokogiri (1.4.4)
13
14
  rake (0.8.7)
14
15
  yajl-ruby (0.7.8)
15
16
 
@@ -21,5 +22,6 @@ DEPENDENCIES
21
22
  minitest (~> 2.0.0)
22
23
  mocha (~> 0.9.10)
23
24
  net-http-persistent (~> 1.4.1)
25
+ nokogiri (~> 1.4.4)
24
26
  rake
25
27
  yajl-ruby (~> 0.7.8)
data/README.md CHANGED
@@ -13,6 +13,9 @@ Opted to write this gem for four reasons:
13
13
  compatible with [VCR](https://github.com/myronmarston/vcr).
14
14
  * Wanted to learn how to handle this pattern.
15
15
 
16
+ The XML usage of this gem will probably change. In the next couple of weeks Hugs
17
+ will be implemented against an XML OCCI API.
18
+
16
19
  ## Assumptions
17
20
 
18
21
  * The webservice returns JSON or XML.
@@ -26,7 +29,7 @@ Opted to write this gem for four reasons:
26
29
 
27
30
  ### Examples
28
31
 
29
- See the 'Examples' section in the [wiki](http://github.com/retr0h/rubineti/wiki/).
32
+ See the 'Examples' section in the [wiki](http://github.com/retr0h/hugs/wiki/).
30
33
 
31
34
  ### TODO
32
35
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.3.0
data/hugs.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{hugs}
8
- s.version = "1.2.0"
8
+ s.version = "1.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["retr0h"]
12
- s.date = %q{2010-12-12}
12
+ s.date = %q{2010-12-15}
13
13
  s.email = %q{john@dewey.ws}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
@@ -43,6 +43,7 @@ Gem::Specification.new do |s|
43
43
 
44
44
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
45
45
  s.add_runtime_dependency(%q<yajl-ruby>, ["~> 0.7.8"])
46
+ s.add_runtime_dependency(%q<nokogiri>, ["~> 1.4.4"])
46
47
  s.add_runtime_dependency(%q<net-http-persistent>, ["~> 1.4.1"])
47
48
  s.add_development_dependency(%q<rake>, [">= 0"])
48
49
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
@@ -50,6 +51,7 @@ Gem::Specification.new do |s|
50
51
  s.add_development_dependency(%q<mocha>, ["~> 0.9.10"])
51
52
  else
52
53
  s.add_dependency(%q<yajl-ruby>, ["~> 0.7.8"])
54
+ s.add_dependency(%q<nokogiri>, ["~> 1.4.4"])
53
55
  s.add_dependency(%q<net-http-persistent>, ["~> 1.4.1"])
54
56
  s.add_dependency(%q<rake>, [">= 0"])
55
57
  s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
@@ -58,6 +60,7 @@ Gem::Specification.new do |s|
58
60
  end
59
61
  else
60
62
  s.add_dependency(%q<yajl-ruby>, ["~> 0.7.8"])
63
+ s.add_dependency(%q<nokogiri>, ["~> 1.4.4"])
61
64
  s.add_dependency(%q<net-http-persistent>, ["~> 1.4.1"])
62
65
  s.add_dependency(%q<rake>, [">= 0"])
63
66
  s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
data/lib/hugs.rb CHANGED
@@ -86,7 +86,11 @@ private
86
86
  end
87
87
 
88
88
  def parse data
89
- ::Yajl::Parser.parse data if is_json?
89
+ if is_json?
90
+ ::Yajl::Parser.parse data
91
+ elsif is_xml?
92
+ ::Nokogiri::XML.parse data
93
+ end
90
94
  end
91
95
 
92
96
  def encode hash
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 2
7
+ - 3
8
8
  - 0
9
- version: 1.2.0
9
+ version: 1.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - retr0h
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-12 00:00:00 -08:00
17
+ date: 2010-12-15 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -33,8 +33,23 @@ dependencies:
33
33
  prerelease: false
34
34
  version_requirements: *id001
35
35
  - !ruby/object:Gem::Dependency
36
- name: net-http-persistent
36
+ name: nokogiri
37
37
  requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 1
44
+ - 4
45
+ - 4
46
+ version: 1.4.4
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: net-http-persistent
52
+ requirement: &id003 !ruby/object:Gem::Requirement
38
53
  none: false
39
54
  requirements:
40
55
  - - ~>
@@ -46,10 +61,10 @@ dependencies:
46
61
  version: 1.4.1
47
62
  type: :runtime
48
63
  prerelease: false
49
- version_requirements: *id002
64
+ version_requirements: *id003
50
65
  - !ruby/object:Gem::Dependency
51
66
  name: rake
52
- requirement: &id003 !ruby/object:Gem::Requirement
67
+ requirement: &id004 !ruby/object:Gem::Requirement
53
68
  none: false
54
69
  requirements:
55
70
  - - ">="
@@ -59,10 +74,10 @@ dependencies:
59
74
  version: "0"
60
75
  type: :development
61
76
  prerelease: false
62
- version_requirements: *id003
77
+ version_requirements: *id004
63
78
  - !ruby/object:Gem::Dependency
64
79
  name: jeweler
65
- requirement: &id004 !ruby/object:Gem::Requirement
80
+ requirement: &id005 !ruby/object:Gem::Requirement
66
81
  none: false
67
82
  requirements:
68
83
  - - ~>
@@ -74,10 +89,10 @@ dependencies:
74
89
  version: 1.5.1
75
90
  type: :development
76
91
  prerelease: false
77
- version_requirements: *id004
92
+ version_requirements: *id005
78
93
  - !ruby/object:Gem::Dependency
79
94
  name: minitest
80
- requirement: &id005 !ruby/object:Gem::Requirement
95
+ requirement: &id006 !ruby/object:Gem::Requirement
81
96
  none: false
82
97
  requirements:
83
98
  - - ~>
@@ -89,10 +104,10 @@ dependencies:
89
104
  version: 2.0.0
90
105
  type: :development
91
106
  prerelease: false
92
- version_requirements: *id005
107
+ version_requirements: *id006
93
108
  - !ruby/object:Gem::Dependency
94
109
  name: mocha
95
- requirement: &id006 !ruby/object:Gem::Requirement
110
+ requirement: &id007 !ruby/object:Gem::Requirement
96
111
  none: false
97
112
  requirements:
98
113
  - - ~>
@@ -104,7 +119,7 @@ dependencies:
104
119
  version: 0.9.10
105
120
  type: :development
106
121
  prerelease: false
107
- version_requirements: *id006
122
+ version_requirements: *id007
108
123
  description:
109
124
  email: john@dewey.ws
110
125
  executables: []