periodic_table 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - jruby-18mode # JRuby in 1.8 mode
7
+ - jruby-19mode # JRuby in 1.9 mode
8
+ - rbx-18mode
9
+ - rbx-19mode
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Periodic Table
1
+ # Periodic Table [![Build Status](https://secure.travis-ci.org/sdball/periodic_table.png?branch=master)](http://travis-ci.org/sdball/periodic_table)
2
2
 
3
3
  ## Installation
4
4
 
@@ -17,31 +17,18 @@ module PeriodicTable
17
17
  end
18
18
  end
19
19
 
20
- # Wow, this is ugly. I did not expect nested XML.
21
20
  class ApiResponse
22
- attr_reader :atomic_weight,
23
- :symbol,
24
- :atomic_number,
25
- :element_name,
26
- :boiling_point,
27
- :ionisation_potential,
28
- :electro_negativity,
29
- :atomic_radius,
30
- :melting_point,
31
- :density
32
-
33
21
  def initialize(result)
34
22
  xml = Nokogiri::XML.parse(result)
35
- @atomic_weight = xml.at('AtomicWeight').text
36
- @symbol = xml.at('Symbol').text
37
- @atomic_number = xml.at('AtomicNumber').text
38
- @element_name = xml.at('ElementName').text
39
- @boiling_point = xml.at('BoilingPoint').text
40
- @ionisation_potential = xml.at('IonisationPotential').text
41
- @electro_negativity = xml.at('EletroNegativity').text
42
- @atomic_radius = xml.at('AtomicRadius').text
43
- @melting_point = xml.at('MeltingPoint').text
44
- @density = xml.at('Density').text
23
+ @data = xml.xpath("NewDataSet/Table").first.element_children
24
+ end
25
+
26
+ def method_missing(method)
27
+ method = method.to_s
28
+ # the webservicex api mispells "electronegativity"
29
+ method = 'eletronegativity' if method == 'electronegativity'
30
+ element = @data.find { |e| e.name =~ /#{method.gsub('_', '')}/i }
31
+ element.text if element
45
32
  end
46
33
  end
47
34
  end
@@ -1,3 +1,3 @@
1
1
  module PeriodicTable
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -21,6 +21,8 @@ Gem::Specification.new do |s|
21
21
  # specify any dependencies here; for example:
22
22
  s.add_development_dependency 'rake'
23
23
  s.add_development_dependency 'rspec'
24
+ s.add_development_dependency 'fakeweb'
25
+ s.add_development_dependency 'vcr'
24
26
 
25
27
  s.add_runtime_dependency 'savon'
26
28
  end
@@ -1,10 +1,52 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe PeriodicTable do
4
+ use_vcr_cassette 'periodic_table'
5
+ before :each do
6
+ @element_data = PeriodicTable.lookup('oxygen')
7
+ end
8
+
4
9
  it "should return data for a named element" do
5
- element_data = PeriodicTable.lookup('oxygen')
6
- element_data.should_not be_nil
7
- element_data.symbol.should == 'O'
8
- element_data.atomic_weight.should == '15.9994'
10
+ @element_data.should_not be_nil
11
+ end
12
+
13
+ it "should return the correct atomic symbol" do
14
+ @element_data.symbol.should == 'O'
15
+ end
16
+
17
+ it "should return the correct atomic weight" do
18
+ @element_data.atomic_weight.should == '15.9994'
19
+ end
20
+
21
+ it "should return the correct atomic number" do
22
+ @element_data.atomic_number.should == '8'
23
+ end
24
+
25
+ it "should return the correct element name" do
26
+ @element_data.element_name.should == 'Oxygen'
27
+ end
28
+
29
+ it "should return the correct boiling point" do
30
+ @element_data.boiling_point.should == '90.2'
31
+ end
32
+
33
+ it "should return the correct ionisation potential" do
34
+ @element_data.ionisation_potential.should == '13.61'
35
+ end
36
+
37
+ it "should return the correct electronegativity" do
38
+ @element_data.electronegativity.should == '3.5'
39
+ end
40
+
41
+ it "should return the correct atomic radius" do
42
+ @element_data.atomic_radius.should == '0.74'
43
+ end
44
+
45
+ it "should return the correct melting point" do
46
+ @element_data.melting_point.should == '55'
47
+ end
48
+
49
+ it "should return the correct density" do
50
+ @element_data.density.should == '1.3318'
9
51
  end
10
52
  end
data/spec/spec_helper.rb CHANGED
@@ -1 +1,11 @@
1
1
  require 'periodic_table'
2
+ require 'vcr'
3
+
4
+ VCR.config do |c|
5
+ c.cassette_library_dir = 'spec/support/cassettes'
6
+ c.stub_with :fakeweb
7
+ end
8
+
9
+ RSpec.configure do |config|
10
+ config.extend VCR::RSpec::Macros
11
+ end
@@ -0,0 +1,258 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://www.webservicex.net:80/periodictable.asmx?WSDL
6
+ body:
7
+ headers:
8
+ response: !ruby/struct:VCR::Response
9
+ status: !ruby/struct:VCR::ResponseStatus
10
+ code: 200
11
+ message: OK
12
+ headers:
13
+ cache-control:
14
+ - private, max-age=0
15
+ content-length:
16
+ - '15756'
17
+ content-type:
18
+ - text/xml; charset=utf-8
19
+ server:
20
+ - Microsoft-IIS/7.0
21
+ x-aspnet-version:
22
+ - 4.0.30319
23
+ x-powered-by:
24
+ - ASP.NET
25
+ date:
26
+ - Thu, 01 Mar 2012 00:29:10 GMT
27
+ body: ! "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<wsdl:definitions xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\"
28
+ xmlns:tm=\"http://microsoft.com/wsdl/mime/textMatching/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"
29
+ xmlns:mime=\"http://schemas.xmlsoap.org/wsdl/mime/\" xmlns:tns=\"http://www.webserviceX.NET\"
30
+ xmlns:s=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://schemas.xmlsoap.org/wsdl/soap12/\"
31
+ xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\" targetNamespace=\"http://www.webserviceX.NET\"
32
+ xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">\r\n <wsdl:types>\r\n <s:schema
33
+ elementFormDefault=\"qualified\" targetNamespace=\"http://www.webserviceX.NET\">\r\n
34
+ \ <s:element name=\"GetAtoms\">\r\n <s:complexType />\r\n </s:element>\r\n
35
+ \ <s:element name=\"GetAtomsResponse\">\r\n <s:complexType>\r\n <s:sequence>\r\n
36
+ \ <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"GetAtomsResult\"
37
+ type=\"s:string\" />\r\n </s:sequence>\r\n </s:complexType>\r\n
38
+ \ </s:element>\r\n <s:element name=\"GetAtomicWeight\">\r\n <s:complexType>\r\n
39
+ \ <s:sequence>\r\n <s:element minOccurs=\"0\" maxOccurs=\"1\"
40
+ name=\"ElementName\" type=\"s:string\" />\r\n </s:sequence>\r\n </s:complexType>\r\n
41
+ \ </s:element>\r\n <s:element name=\"GetAtomicWeightResponse\">\r\n
42
+ \ <s:complexType>\r\n <s:sequence>\r\n <s:element
43
+ minOccurs=\"0\" maxOccurs=\"1\" name=\"GetAtomicWeightResult\" type=\"s:string\"
44
+ />\r\n </s:sequence>\r\n </s:complexType>\r\n </s:element>\r\n
45
+ \ <s:element name=\"GetAtomicNumber\">\r\n <s:complexType>\r\n <s:sequence>\r\n
46
+ \ <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ElementName\"
47
+ type=\"s:string\" />\r\n </s:sequence>\r\n </s:complexType>\r\n
48
+ \ </s:element>\r\n <s:element name=\"GetAtomicNumberResponse\">\r\n
49
+ \ <s:complexType>\r\n <s:sequence>\r\n <s:element
50
+ minOccurs=\"0\" maxOccurs=\"1\" name=\"GetAtomicNumberResult\" type=\"s:string\"
51
+ />\r\n </s:sequence>\r\n </s:complexType>\r\n </s:element>\r\n
52
+ \ <s:element name=\"GetElementSymbol\">\r\n <s:complexType>\r\n <s:sequence>\r\n
53
+ \ <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"ElementName\"
54
+ type=\"s:string\" />\r\n </s:sequence>\r\n </s:complexType>\r\n
55
+ \ </s:element>\r\n <s:element name=\"GetElementSymbolResponse\">\r\n
56
+ \ <s:complexType>\r\n <s:sequence>\r\n <s:element
57
+ minOccurs=\"0\" maxOccurs=\"1\" name=\"GetElementSymbolResult\" type=\"s:string\"
58
+ />\r\n </s:sequence>\r\n </s:complexType>\r\n </s:element>\r\n
59
+ \ <s:element name=\"string\" nillable=\"true\" type=\"s:string\" />\r\n
60
+ \ </s:schema>\r\n </wsdl:types>\r\n <wsdl:message name=\"GetAtomsSoapIn\">\r\n
61
+ \ <wsdl:part name=\"parameters\" element=\"tns:GetAtoms\" />\r\n </wsdl:message>\r\n
62
+ \ <wsdl:message name=\"GetAtomsSoapOut\">\r\n <wsdl:part name=\"parameters\"
63
+ element=\"tns:GetAtomsResponse\" />\r\n </wsdl:message>\r\n <wsdl:message
64
+ name=\"GetAtomicWeightSoapIn\">\r\n <wsdl:part name=\"parameters\" element=\"tns:GetAtomicWeight\"
65
+ />\r\n </wsdl:message>\r\n <wsdl:message name=\"GetAtomicWeightSoapOut\">\r\n
66
+ \ <wsdl:part name=\"parameters\" element=\"tns:GetAtomicWeightResponse\" />\r\n
67
+ \ </wsdl:message>\r\n <wsdl:message name=\"GetAtomicNumberSoapIn\">\r\n <wsdl:part
68
+ name=\"parameters\" element=\"tns:GetAtomicNumber\" />\r\n </wsdl:message>\r\n
69
+ \ <wsdl:message name=\"GetAtomicNumberSoapOut\">\r\n <wsdl:part name=\"parameters\"
70
+ element=\"tns:GetAtomicNumberResponse\" />\r\n </wsdl:message>\r\n <wsdl:message
71
+ name=\"GetElementSymbolSoapIn\">\r\n <wsdl:part name=\"parameters\" element=\"tns:GetElementSymbol\"
72
+ />\r\n </wsdl:message>\r\n <wsdl:message name=\"GetElementSymbolSoapOut\">\r\n
73
+ \ <wsdl:part name=\"parameters\" element=\"tns:GetElementSymbolResponse\"
74
+ />\r\n </wsdl:message>\r\n <wsdl:message name=\"GetAtomsHttpGetIn\" />\r\n
75
+ \ <wsdl:message name=\"GetAtomsHttpGetOut\">\r\n <wsdl:part name=\"Body\"
76
+ element=\"tns:string\" />\r\n </wsdl:message>\r\n <wsdl:message name=\"GetAtomicWeightHttpGetIn\">\r\n
77
+ \ <wsdl:part name=\"ElementName\" type=\"s:string\" />\r\n </wsdl:message>\r\n
78
+ \ <wsdl:message name=\"GetAtomicWeightHttpGetOut\">\r\n <wsdl:part name=\"Body\"
79
+ element=\"tns:string\" />\r\n </wsdl:message>\r\n <wsdl:message name=\"GetAtomicNumberHttpGetIn\">\r\n
80
+ \ <wsdl:part name=\"ElementName\" type=\"s:string\" />\r\n </wsdl:message>\r\n
81
+ \ <wsdl:message name=\"GetAtomicNumberHttpGetOut\">\r\n <wsdl:part name=\"Body\"
82
+ element=\"tns:string\" />\r\n </wsdl:message>\r\n <wsdl:message name=\"GetElementSymbolHttpGetIn\">\r\n
83
+ \ <wsdl:part name=\"ElementName\" type=\"s:string\" />\r\n </wsdl:message>\r\n
84
+ \ <wsdl:message name=\"GetElementSymbolHttpGetOut\">\r\n <wsdl:part name=\"Body\"
85
+ element=\"tns:string\" />\r\n </wsdl:message>\r\n <wsdl:message name=\"GetAtomsHttpPostIn\"
86
+ />\r\n <wsdl:message name=\"GetAtomsHttpPostOut\">\r\n <wsdl:part name=\"Body\"
87
+ element=\"tns:string\" />\r\n </wsdl:message>\r\n <wsdl:message name=\"GetAtomicWeightHttpPostIn\">\r\n
88
+ \ <wsdl:part name=\"ElementName\" type=\"s:string\" />\r\n </wsdl:message>\r\n
89
+ \ <wsdl:message name=\"GetAtomicWeightHttpPostOut\">\r\n <wsdl:part name=\"Body\"
90
+ element=\"tns:string\" />\r\n </wsdl:message>\r\n <wsdl:message name=\"GetAtomicNumberHttpPostIn\">\r\n
91
+ \ <wsdl:part name=\"ElementName\" type=\"s:string\" />\r\n </wsdl:message>\r\n
92
+ \ <wsdl:message name=\"GetAtomicNumberHttpPostOut\">\r\n <wsdl:part name=\"Body\"
93
+ element=\"tns:string\" />\r\n </wsdl:message>\r\n <wsdl:message name=\"GetElementSymbolHttpPostIn\">\r\n
94
+ \ <wsdl:part name=\"ElementName\" type=\"s:string\" />\r\n </wsdl:message>\r\n
95
+ \ <wsdl:message name=\"GetElementSymbolHttpPostOut\">\r\n <wsdl:part name=\"Body\"
96
+ element=\"tns:string\" />\r\n </wsdl:message>\r\n <wsdl:portType name=\"periodictableSoap\">\r\n
97
+ \ <wsdl:operation name=\"GetAtoms\">\r\n <wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">Get
98
+ element </wsdl:documentation>\r\n <wsdl:input message=\"tns:GetAtomsSoapIn\"
99
+ />\r\n <wsdl:output message=\"tns:GetAtomsSoapOut\" />\r\n </wsdl:operation>\r\n
100
+ \ <wsdl:operation name=\"GetAtomicWeight\">\r\n <wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">Get
101
+ atomic wieght by element name </wsdl:documentation>\r\n <wsdl:input message=\"tns:GetAtomicWeightSoapIn\"
102
+ />\r\n <wsdl:output message=\"tns:GetAtomicWeightSoapOut\" />\r\n </wsdl:operation>\r\n
103
+ \ <wsdl:operation name=\"GetAtomicNumber\">\r\n <wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">Get
104
+ atomic Number by element name </wsdl:documentation>\r\n <wsdl:input message=\"tns:GetAtomicNumberSoapIn\"
105
+ />\r\n <wsdl:output message=\"tns:GetAtomicNumberSoapOut\" />\r\n </wsdl:operation>\r\n
106
+ \ <wsdl:operation name=\"GetElementSymbol\">\r\n <wsdl:documentation
107
+ xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">Get atomic symbol by element
108
+ name </wsdl:documentation>\r\n <wsdl:input message=\"tns:GetElementSymbolSoapIn\"
109
+ />\r\n <wsdl:output message=\"tns:GetElementSymbolSoapOut\" />\r\n </wsdl:operation>\r\n
110
+ \ </wsdl:portType>\r\n <wsdl:portType name=\"periodictableHttpGet\">\r\n <wsdl:operation
111
+ name=\"GetAtoms\">\r\n <wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">Get
112
+ element </wsdl:documentation>\r\n <wsdl:input message=\"tns:GetAtomsHttpGetIn\"
113
+ />\r\n <wsdl:output message=\"tns:GetAtomsHttpGetOut\" />\r\n </wsdl:operation>\r\n
114
+ \ <wsdl:operation name=\"GetAtomicWeight\">\r\n <wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">Get
115
+ atomic wieght by element name </wsdl:documentation>\r\n <wsdl:input message=\"tns:GetAtomicWeightHttpGetIn\"
116
+ />\r\n <wsdl:output message=\"tns:GetAtomicWeightHttpGetOut\" />\r\n </wsdl:operation>\r\n
117
+ \ <wsdl:operation name=\"GetAtomicNumber\">\r\n <wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">Get
118
+ atomic Number by element name </wsdl:documentation>\r\n <wsdl:input message=\"tns:GetAtomicNumberHttpGetIn\"
119
+ />\r\n <wsdl:output message=\"tns:GetAtomicNumberHttpGetOut\" />\r\n </wsdl:operation>\r\n
120
+ \ <wsdl:operation name=\"GetElementSymbol\">\r\n <wsdl:documentation
121
+ xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">Get atomic symbol by element
122
+ name </wsdl:documentation>\r\n <wsdl:input message=\"tns:GetElementSymbolHttpGetIn\"
123
+ />\r\n <wsdl:output message=\"tns:GetElementSymbolHttpGetOut\" />\r\n </wsdl:operation>\r\n
124
+ \ </wsdl:portType>\r\n <wsdl:portType name=\"periodictableHttpPost\">\r\n <wsdl:operation
125
+ name=\"GetAtoms\">\r\n <wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">Get
126
+ element </wsdl:documentation>\r\n <wsdl:input message=\"tns:GetAtomsHttpPostIn\"
127
+ />\r\n <wsdl:output message=\"tns:GetAtomsHttpPostOut\" />\r\n </wsdl:operation>\r\n
128
+ \ <wsdl:operation name=\"GetAtomicWeight\">\r\n <wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">Get
129
+ atomic wieght by element name </wsdl:documentation>\r\n <wsdl:input message=\"tns:GetAtomicWeightHttpPostIn\"
130
+ />\r\n <wsdl:output message=\"tns:GetAtomicWeightHttpPostOut\" />\r\n </wsdl:operation>\r\n
131
+ \ <wsdl:operation name=\"GetAtomicNumber\">\r\n <wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">Get
132
+ atomic Number by element name </wsdl:documentation>\r\n <wsdl:input message=\"tns:GetAtomicNumberHttpPostIn\"
133
+ />\r\n <wsdl:output message=\"tns:GetAtomicNumberHttpPostOut\" />\r\n </wsdl:operation>\r\n
134
+ \ <wsdl:operation name=\"GetElementSymbol\">\r\n <wsdl:documentation
135
+ xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">Get atomic symbol by element
136
+ name </wsdl:documentation>\r\n <wsdl:input message=\"tns:GetElementSymbolHttpPostIn\"
137
+ />\r\n <wsdl:output message=\"tns:GetElementSymbolHttpPostOut\" />\r\n
138
+ \ </wsdl:operation>\r\n </wsdl:portType>\r\n <wsdl:binding name=\"periodictableSoap\"
139
+ type=\"tns:periodictableSoap\">\r\n <soap:binding transport=\"http://schemas.xmlsoap.org/soap/http\"
140
+ />\r\n <wsdl:operation name=\"GetAtoms\">\r\n <soap:operation soapAction=\"http://www.webserviceX.NET/GetAtoms\"
141
+ style=\"document\" />\r\n <wsdl:input>\r\n <soap:body use=\"literal\"
142
+ />\r\n </wsdl:input>\r\n <wsdl:output>\r\n <soap:body use=\"literal\"
143
+ />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n <wsdl:operation name=\"GetAtomicWeight\">\r\n
144
+ \ <soap:operation soapAction=\"http://www.webserviceX.NET/GetAtomicWeight\"
145
+ style=\"document\" />\r\n <wsdl:input>\r\n <soap:body use=\"literal\"
146
+ />\r\n </wsdl:input>\r\n <wsdl:output>\r\n <soap:body use=\"literal\"
147
+ />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n <wsdl:operation name=\"GetAtomicNumber\">\r\n
148
+ \ <soap:operation soapAction=\"http://www.webserviceX.NET/GetAtomicNumber\"
149
+ style=\"document\" />\r\n <wsdl:input>\r\n <soap:body use=\"literal\"
150
+ />\r\n </wsdl:input>\r\n <wsdl:output>\r\n <soap:body use=\"literal\"
151
+ />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n <wsdl:operation name=\"GetElementSymbol\">\r\n
152
+ \ <soap:operation soapAction=\"http://www.webserviceX.NET/GetElementSymbol\"
153
+ style=\"document\" />\r\n <wsdl:input>\r\n <soap:body use=\"literal\"
154
+ />\r\n </wsdl:input>\r\n <wsdl:output>\r\n <soap:body use=\"literal\"
155
+ />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n </wsdl:binding>\r\n
156
+ \ <wsdl:binding name=\"periodictableSoap12\" type=\"tns:periodictableSoap\">\r\n
157
+ \ <soap12:binding transport=\"http://schemas.xmlsoap.org/soap/http\" />\r\n
158
+ \ <wsdl:operation name=\"GetAtoms\">\r\n <soap12:operation soapAction=\"http://www.webserviceX.NET/GetAtoms\"
159
+ style=\"document\" />\r\n <wsdl:input>\r\n <soap12:body use=\"literal\"
160
+ />\r\n </wsdl:input>\r\n <wsdl:output>\r\n <soap12:body use=\"literal\"
161
+ />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n <wsdl:operation name=\"GetAtomicWeight\">\r\n
162
+ \ <soap12:operation soapAction=\"http://www.webserviceX.NET/GetAtomicWeight\"
163
+ style=\"document\" />\r\n <wsdl:input>\r\n <soap12:body use=\"literal\"
164
+ />\r\n </wsdl:input>\r\n <wsdl:output>\r\n <soap12:body use=\"literal\"
165
+ />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n <wsdl:operation name=\"GetAtomicNumber\">\r\n
166
+ \ <soap12:operation soapAction=\"http://www.webserviceX.NET/GetAtomicNumber\"
167
+ style=\"document\" />\r\n <wsdl:input>\r\n <soap12:body use=\"literal\"
168
+ />\r\n </wsdl:input>\r\n <wsdl:output>\r\n <soap12:body use=\"literal\"
169
+ />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n <wsdl:operation name=\"GetElementSymbol\">\r\n
170
+ \ <soap12:operation soapAction=\"http://www.webserviceX.NET/GetElementSymbol\"
171
+ style=\"document\" />\r\n <wsdl:input>\r\n <soap12:body use=\"literal\"
172
+ />\r\n </wsdl:input>\r\n <wsdl:output>\r\n <soap12:body use=\"literal\"
173
+ />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n </wsdl:binding>\r\n
174
+ \ <wsdl:binding name=\"periodictableHttpGet\" type=\"tns:periodictableHttpGet\">\r\n
175
+ \ <http:binding verb=\"GET\" />\r\n <wsdl:operation name=\"GetAtoms\">\r\n
176
+ \ <http:operation location=\"/GetAtoms\" />\r\n <wsdl:input>\r\n <http:urlEncoded
177
+ />\r\n </wsdl:input>\r\n <wsdl:output>\r\n <mime:mimeXml part=\"Body\"
178
+ />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n <wsdl:operation name=\"GetAtomicWeight\">\r\n
179
+ \ <http:operation location=\"/GetAtomicWeight\" />\r\n <wsdl:input>\r\n
180
+ \ <http:urlEncoded />\r\n </wsdl:input>\r\n <wsdl:output>\r\n
181
+ \ <mime:mimeXml part=\"Body\" />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n
182
+ \ <wsdl:operation name=\"GetAtomicNumber\">\r\n <http:operation location=\"/GetAtomicNumber\"
183
+ />\r\n <wsdl:input>\r\n <http:urlEncoded />\r\n </wsdl:input>\r\n
184
+ \ <wsdl:output>\r\n <mime:mimeXml part=\"Body\" />\r\n </wsdl:output>\r\n
185
+ \ </wsdl:operation>\r\n <wsdl:operation name=\"GetElementSymbol\">\r\n
186
+ \ <http:operation location=\"/GetElementSymbol\" />\r\n <wsdl:input>\r\n
187
+ \ <http:urlEncoded />\r\n </wsdl:input>\r\n <wsdl:output>\r\n
188
+ \ <mime:mimeXml part=\"Body\" />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n
189
+ \ </wsdl:binding>\r\n <wsdl:binding name=\"periodictableHttpPost\" type=\"tns:periodictableHttpPost\">\r\n
190
+ \ <http:binding verb=\"POST\" />\r\n <wsdl:operation name=\"GetAtoms\">\r\n
191
+ \ <http:operation location=\"/GetAtoms\" />\r\n <wsdl:input>\r\n <mime:content
192
+ type=\"application/x-www-form-urlencoded\" />\r\n </wsdl:input>\r\n <wsdl:output>\r\n
193
+ \ <mime:mimeXml part=\"Body\" />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n
194
+ \ <wsdl:operation name=\"GetAtomicWeight\">\r\n <http:operation location=\"/GetAtomicWeight\"
195
+ />\r\n <wsdl:input>\r\n <mime:content type=\"application/x-www-form-urlencoded\"
196
+ />\r\n </wsdl:input>\r\n <wsdl:output>\r\n <mime:mimeXml part=\"Body\"
197
+ />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n <wsdl:operation name=\"GetAtomicNumber\">\r\n
198
+ \ <http:operation location=\"/GetAtomicNumber\" />\r\n <wsdl:input>\r\n
199
+ \ <mime:content type=\"application/x-www-form-urlencoded\" />\r\n </wsdl:input>\r\n
200
+ \ <wsdl:output>\r\n <mime:mimeXml part=\"Body\" />\r\n </wsdl:output>\r\n
201
+ \ </wsdl:operation>\r\n <wsdl:operation name=\"GetElementSymbol\">\r\n
202
+ \ <http:operation location=\"/GetElementSymbol\" />\r\n <wsdl:input>\r\n
203
+ \ <mime:content type=\"application/x-www-form-urlencoded\" />\r\n </wsdl:input>\r\n
204
+ \ <wsdl:output>\r\n <mime:mimeXml part=\"Body\" />\r\n </wsdl:output>\r\n
205
+ \ </wsdl:operation>\r\n </wsdl:binding>\r\n <wsdl:service name=\"periodictable\">\r\n
206
+ \ <wsdl:port name=\"periodictableSoap\" binding=\"tns:periodictableSoap\">\r\n
207
+ \ <soap:address location=\"http://www.webservicex.net/periodictable.asmx\"
208
+ />\r\n </wsdl:port>\r\n <wsdl:port name=\"periodictableSoap12\" binding=\"tns:periodictableSoap12\">\r\n
209
+ \ <soap12:address location=\"http://www.webservicex.net/periodictable.asmx\"
210
+ />\r\n </wsdl:port>\r\n <wsdl:port name=\"periodictableHttpGet\" binding=\"tns:periodictableHttpGet\">\r\n
211
+ \ <http:address location=\"http://www.webservicex.net/periodictable.asmx\"
212
+ />\r\n </wsdl:port>\r\n <wsdl:port name=\"periodictableHttpPost\" binding=\"tns:periodictableHttpPost\">\r\n
213
+ \ <http:address location=\"http://www.webservicex.net/periodictable.asmx\"
214
+ />\r\n </wsdl:port>\r\n </wsdl:service>\r\n</wsdl:definitions>"
215
+ http_version: '1.1'
216
+ - !ruby/struct:VCR::HTTPInteraction
217
+ request: !ruby/struct:VCR::Request
218
+ method: :post
219
+ uri: http://www.webservicex.net:80/periodictable.asmx
220
+ body: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
221
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://www.webserviceX.NET"
222
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="http://www.webserviceX.NET"><env:Body><ins0:GetAtomicNumber><ins0:ElementName>oxygen</ins0:ElementName></ins0:GetAtomicNumber></env:Body></env:Envelope>
223
+ headers:
224
+ soapaction:
225
+ - ! '"http://www.webserviceX.NET/GetAtomicNumber"'
226
+ content-type:
227
+ - text/xml;charset=UTF-8
228
+ content-length:
229
+ - '409'
230
+ response: !ruby/struct:VCR::Response
231
+ status: !ruby/struct:VCR::ResponseStatus
232
+ code: 200
233
+ message: OK
234
+ headers:
235
+ cache-control:
236
+ - private, max-age=0
237
+ content-length:
238
+ - '960'
239
+ content-type:
240
+ - text/xml; charset=utf-8
241
+ server:
242
+ - Microsoft-IIS/7.0
243
+ x-aspnet-version:
244
+ - 4.0.30319
245
+ x-powered-by:
246
+ - ASP.NET
247
+ date:
248
+ - Thu, 01 Mar 2012 00:29:11 GMT
249
+ body: ! "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"
250
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><soap:Body><GetAtomicNumberResponse
251
+ xmlns=\"http://www.webserviceX.NET\"><GetAtomicNumberResult>&lt;NewDataSet&gt;\r\n
252
+ \ &lt;Table&gt;\r\n &lt;AtomicNumber&gt;8&lt;/AtomicNumber&gt;\r\n &lt;ElementName&gt;Oxygen&lt;/ElementName&gt;\r\n
253
+ \ &lt;Symbol&gt;O&lt;/Symbol&gt;\r\n &lt;AtomicWeight&gt;15.9994&lt;/AtomicWeight&gt;\r\n
254
+ \ &lt;BoilingPoint&gt;90.2&lt;/BoilingPoint&gt;\r\n &lt;IonisationPotential&gt;13.61&lt;/IonisationPotential&gt;\r\n
255
+ \ &lt;EletroNegativity&gt;3.5&lt;/EletroNegativity&gt;\r\n &lt;AtomicRadius&gt;0.74&lt;/AtomicRadius&gt;\r\n
256
+ \ &lt;MeltingPoint&gt;55&lt;/MeltingPoint&gt;\r\n &lt;Density&gt;1.3318&lt;/Density&gt;\r\n
257
+ \ &lt;/Table&gt;\r\n&lt;/NewDataSet&gt;</GetAtomicNumberResult></GetAtomicNumberResponse></soap:Body></soap:Envelope>"
258
+ http_version: '1.1'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: periodic_table
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-22 00:00:00.000000000 Z
12
+ date: 2012-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &2156033980 !ruby/object:Gem::Requirement
16
+ requirement: &2151919680 !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: :development
23
23
  prerelease: false
24
- version_requirements: *2156033980
24
+ version_requirements: *2151919680
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &2156033160 !ruby/object:Gem::Requirement
27
+ requirement: &2151918760 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,32 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2156033160
35
+ version_requirements: *2151918760
36
+ - !ruby/object:Gem::Dependency
37
+ name: fakeweb
38
+ requirement: &2151918060 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *2151918060
47
+ - !ruby/object:Gem::Dependency
48
+ name: vcr
49
+ requirement: &2151917380 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *2151917380
36
58
  - !ruby/object:Gem::Dependency
37
59
  name: savon
38
- requirement: &2156031580 !ruby/object:Gem::Requirement
60
+ requirement: &2151916720 !ruby/object:Gem::Requirement
39
61
  none: false
40
62
  requirements:
41
63
  - - ! '>='
@@ -43,7 +65,7 @@ dependencies:
43
65
  version: '0'
44
66
  type: :runtime
45
67
  prerelease: false
46
- version_requirements: *2156031580
68
+ version_requirements: *2151916720
47
69
  description: Provide data on elements in the periodic table.
48
70
  email:
49
71
  - sdball@gmail.com
@@ -53,6 +75,7 @@ extra_rdoc_files: []
53
75
  files:
54
76
  - .gitignore
55
77
  - .rvmrc
78
+ - .travis.yml
56
79
  - Gemfile
57
80
  - README.md
58
81
  - Rakefile
@@ -62,6 +85,7 @@ files:
62
85
  - periodic_table.gemspec
63
86
  - spec/lib/periodic_table_spec.rb
64
87
  - spec/spec_helper.rb
88
+ - spec/support/cassettes/periodic_table.yml
65
89
  homepage: https://github.com/sdball/periodic_table
66
90
  licenses: []
67
91
  post_install_message:
@@ -89,3 +113,4 @@ summary: Provide periodic table data.
89
113
  test_files:
90
114
  - spec/lib/periodic_table_spec.rb
91
115
  - spec/spec_helper.rb
116
+ - spec/support/cassettes/periodic_table.yml