pagseguro_catcher 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  rvm:
2
2
  - 1.8.7
3
- - 1.9.2
3
+ - 1.9.2
data/Gemfile CHANGED
@@ -6,14 +6,15 @@ source "http://rubygems.org"
6
6
  # Add dependencies to develop your gem here.
7
7
  # Include everything needed to run rake, tests, features, etc.
8
8
 
9
- gem "httparty"
10
- gem "activesupport"
9
+ gem "httparty", "~> 0.10.0"
10
+ gem "activesupport", "~> 3.2.11"
11
11
  gem "i18n"
12
12
 
13
13
  group :development do
14
+ gem "rake", "~> 0.9.2"
14
15
  gem "rspec", "~> 2.3.0"
15
- gem "bundler", "~> 1.0.0"
16
+ gem "bundler", "~> 1.2.3"
16
17
  gem "jeweler", "~> 1.6.4"
17
- gem "rcov", ">= 0"
18
+ gem "simplecov", "~> 0.7.1"
18
19
  gem "fakeweb"
19
20
  end
data/Gemfile.lock CHANGED
@@ -1,23 +1,23 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (3.1.0)
4
+ activesupport (3.2.11)
5
+ i18n (~> 0.6)
5
6
  multi_json (~> 1.0)
6
7
  diff-lcs (1.1.3)
7
8
  fakeweb (1.3.0)
8
9
  git (1.2.5)
9
- httparty (0.8.0)
10
- multi_json
10
+ httparty (0.10.0)
11
+ multi_json (~> 1.0)
11
12
  multi_xml
12
- i18n (0.6.0)
13
+ i18n (0.6.1)
13
14
  jeweler (1.6.4)
14
15
  bundler (~> 1.0)
15
16
  git (>= 1.2.5)
16
17
  rake
17
- multi_json (1.0.3)
18
- multi_xml (0.4.1)
19
- rake (0.9.2)
20
- rcov (0.9.10)
18
+ multi_json (1.5.0)
19
+ multi_xml (0.5.2)
20
+ rake (0.9.6)
21
21
  rspec (2.3.0)
22
22
  rspec-core (~> 2.3.0)
23
23
  rspec-expectations (~> 2.3.0)
@@ -26,16 +26,21 @@ GEM
26
26
  rspec-expectations (2.3.0)
27
27
  diff-lcs (~> 1.1.2)
28
28
  rspec-mocks (2.3.0)
29
+ simplecov (0.7.1)
30
+ multi_json (~> 1.0)
31
+ simplecov-html (~> 0.7.1)
32
+ simplecov-html (0.7.1)
29
33
 
30
34
  PLATFORMS
31
35
  ruby
32
36
 
33
37
  DEPENDENCIES
34
- activesupport
35
- bundler (~> 1.0.0)
38
+ activesupport (~> 3.2.11)
39
+ bundler (~> 1.2.3)
36
40
  fakeweb
37
- httparty
41
+ httparty (~> 0.10.0)
38
42
  i18n
39
43
  jeweler (~> 1.6.4)
40
- rcov
44
+ rake (~> 0.9.2)
41
45
  rspec (~> 2.3.0)
46
+ simplecov (~> 0.7.1)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -1,24 +1,50 @@
1
1
  module PagseguroCatcher
2
2
  module Transaction
3
3
 
4
+ # This class is responsable for parsing the shipping values of the xml.
5
+ #
6
+ # The part that it parsers is the following:
7
+ #
8
+ # <shipping>
9
+ # <address>
10
+ # <street>Av. Brig. Faria Lima</street>
11
+ # <number>1384</number>
12
+ # <complement>5o andar</complement>
13
+ # <district>Jardim Paulistano</district>
14
+ # <postalCode>01452002</postalCode>
15
+ # <city>Sao Paulo</city>
16
+ # <state>SP</state>
17
+ # <country>BRA</country>
18
+ # </address>
19
+ # <type>1</type>
20
+ # <cost>21.50</cost>
21
+ # </shipping>
4
22
  class Shipping < Transaction::Body
5
23
 
6
24
  def initialize(body)
7
25
  self.body = body[:shipping]
8
26
  end
9
27
 
28
+ # Returns the zip number as a string
29
+ # shipping.zip # => "012345"
10
30
  def zip
11
31
  self[:address][:postalCode]
12
32
  end
13
33
 
34
+ # The human readable value for the shipping type
35
+ # shipping.human_type # => "Encomenda normal (PAC)"
14
36
  def human_type
15
37
  SHIPPING_TYPES[self[:type].to_i]
16
38
  end
17
39
 
40
+ # The the shipping cost as a float
41
+ # shipping.cost # => 21.50
18
42
  def cost
19
43
  self[:cost].to_f
20
44
  end
21
45
 
46
+ # method_missing will try to find anything inside the address node
47
+ # shipping.street # => "Av. Brig. Faria Lima"
22
48
  def method_missing(name, *args)
23
49
  return self[:address][name] if self.body[:address].has_key?(name.to_sym)
24
50
  super
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{pagseguro_catcher}
8
- s.version = "0.1.1"
7
+ s.name = "pagseguro_catcher"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matias H. Leidemer"]
12
- s.date = %q{2011-10-24}
13
- s.description = %q{This gem provides a simple way to check and parse the PagSeguro transaction notification.}
14
- s.email = %q{matiasleidemer@gmail.com}
12
+ s.date = "2013-01-13"
13
+ s.description = "This gem provides a simple way to check and parse the PagSeguro transaction notification."
14
+ s.email = "matiasleidemer@gmail.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.textile"
@@ -48,43 +48,45 @@ Gem::Specification.new do |s|
48
48
  "spec/transaction/sender_spec.rb",
49
49
  "spec/transaction/shipping_spec.rb"
50
50
  ]
51
- s.homepage = %q{http://github.com/matiasleidemer/pagseguro_catcher}
51
+ s.homepage = "http://github.com/matiasleidemer/pagseguro_catcher"
52
52
  s.licenses = ["MIT"]
53
53
  s.require_paths = ["lib"]
54
- s.rubygems_version = %q{1.3.7}
55
- s.summary = %q{A simple gem to parse PagSeguro transaction notification.}
54
+ s.rubygems_version = "1.8.24"
55
+ s.summary = "A simple gem to parse PagSeguro transaction notification."
56
56
 
57
57
  if s.respond_to? :specification_version then
58
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
59
58
  s.specification_version = 3
60
59
 
61
60
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
62
- s.add_runtime_dependency(%q<httparty>, [">= 0"])
63
- s.add_runtime_dependency(%q<activesupport>, [">= 0"])
61
+ s.add_runtime_dependency(%q<httparty>, ["~> 0.10.0"])
62
+ s.add_runtime_dependency(%q<activesupport>, ["~> 3.2.11"])
64
63
  s.add_runtime_dependency(%q<i18n>, [">= 0"])
64
+ s.add_development_dependency(%q<rake>, ["~> 0.9.2"])
65
65
  s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
66
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
66
+ s.add_development_dependency(%q<bundler>, ["~> 1.2.3"])
67
67
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
68
- s.add_development_dependency(%q<rcov>, [">= 0"])
68
+ s.add_development_dependency(%q<simplecov>, ["~> 0.7.1"])
69
69
  s.add_development_dependency(%q<fakeweb>, [">= 0"])
70
70
  else
71
- s.add_dependency(%q<httparty>, [">= 0"])
72
- s.add_dependency(%q<activesupport>, [">= 0"])
71
+ s.add_dependency(%q<httparty>, ["~> 0.10.0"])
72
+ s.add_dependency(%q<activesupport>, ["~> 3.2.11"])
73
73
  s.add_dependency(%q<i18n>, [">= 0"])
74
+ s.add_dependency(%q<rake>, ["~> 0.9.2"])
74
75
  s.add_dependency(%q<rspec>, ["~> 2.3.0"])
75
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
76
+ s.add_dependency(%q<bundler>, ["~> 1.2.3"])
76
77
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
77
- s.add_dependency(%q<rcov>, [">= 0"])
78
+ s.add_dependency(%q<simplecov>, ["~> 0.7.1"])
78
79
  s.add_dependency(%q<fakeweb>, [">= 0"])
79
80
  end
80
81
  else
81
- s.add_dependency(%q<httparty>, [">= 0"])
82
- s.add_dependency(%q<activesupport>, [">= 0"])
82
+ s.add_dependency(%q<httparty>, ["~> 0.10.0"])
83
+ s.add_dependency(%q<activesupport>, ["~> 3.2.11"])
83
84
  s.add_dependency(%q<i18n>, [">= 0"])
85
+ s.add_dependency(%q<rake>, ["~> 0.9.2"])
84
86
  s.add_dependency(%q<rspec>, ["~> 2.3.0"])
85
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
87
+ s.add_dependency(%q<bundler>, ["~> 1.2.3"])
86
88
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
87
- s.add_dependency(%q<rcov>, [">= 0"])
89
+ s.add_dependency(%q<simplecov>, ["~> 0.7.1"])
88
90
  s.add_dependency(%q<fakeweb>, [">= 0"])
89
91
  end
90
92
  end
metadata CHANGED
@@ -1,151 +1,169 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: pagseguro_catcher
3
- version: !ruby/object:Gem::Version
4
- hash: 25
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Matias H. Leidemer
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-10-24 00:00:00 -02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- type: :runtime
23
- prerelease: false
12
+ date: 2013-01-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
24
15
  name: httparty
25
- version_requirements: &id001 !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- hash: 3
31
- segments:
32
- - 0
33
- version: "0"
34
- requirement: *id001
35
- - !ruby/object:Gem::Dependency
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 0.10.0
36
22
  type: :runtime
37
23
  prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 0.10.0
30
+ - !ruby/object:Gem::Dependency
38
31
  name: activesupport
39
- version_requirements: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
48
- requirement: *id002
49
- - !ruby/object:Gem::Dependency
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 3.2.11
50
38
  type: :runtime
51
39
  prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 3.2.11
46
+ - !ruby/object:Gem::Dependency
52
47
  name: i18n
53
- version_requirements: &id003 !ruby/object:Gem::Requirement
54
- none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 0
61
- version: "0"
62
- requirement: *id003
63
- - !ruby/object:Gem::Dependency
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 0.9.2
64
70
  type: :development
65
71
  prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.9.2
78
+ - !ruby/object:Gem::Dependency
66
79
  name: rspec
67
- version_requirements: &id004 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
68
81
  none: false
69
- requirements:
82
+ requirements:
70
83
  - - ~>
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 2
75
- - 3
76
- - 0
84
+ - !ruby/object:Gem::Version
77
85
  version: 2.3.0
78
- requirement: *id004
79
- - !ruby/object:Gem::Dependency
80
86
  type: :development
81
87
  prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 2.3.0
94
+ - !ruby/object:Gem::Dependency
82
95
  name: bundler
83
- version_requirements: &id005 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
84
97
  none: false
85
- requirements:
98
+ requirements:
86
99
  - - ~>
87
- - !ruby/object:Gem::Version
88
- hash: 23
89
- segments:
90
- - 1
91
- - 0
92
- - 0
93
- version: 1.0.0
94
- requirement: *id005
95
- - !ruby/object:Gem::Dependency
100
+ - !ruby/object:Gem::Version
101
+ version: 1.2.3
96
102
  type: :development
97
103
  prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.2.3
110
+ - !ruby/object:Gem::Dependency
98
111
  name: jeweler
99
- version_requirements: &id006 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
100
113
  none: false
101
- requirements:
114
+ requirements:
102
115
  - - ~>
103
- - !ruby/object:Gem::Version
104
- hash: 7
105
- segments:
106
- - 1
107
- - 6
108
- - 4
116
+ - !ruby/object:Gem::Version
109
117
  version: 1.6.4
110
- requirement: *id006
111
- - !ruby/object:Gem::Dependency
112
118
  type: :development
113
119
  prerelease: false
114
- name: rcov
115
- version_requirements: &id007 !ruby/object:Gem::Requirement
116
- none: false
117
- requirements:
118
- - - ">="
119
- - !ruby/object:Gem::Version
120
- hash: 3
121
- segments:
122
- - 0
123
- version: "0"
124
- requirement: *id007
125
- - !ruby/object:Gem::Dependency
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 1.6.4
126
+ - !ruby/object:Gem::Dependency
127
+ name: simplecov
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ~>
132
+ - !ruby/object:Gem::Version
133
+ version: 0.7.1
126
134
  type: :development
127
135
  prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ~>
140
+ - !ruby/object:Gem::Version
141
+ version: 0.7.1
142
+ - !ruby/object:Gem::Dependency
128
143
  name: fakeweb
129
- version_requirements: &id008 !ruby/object:Gem::Requirement
130
- none: false
131
- requirements:
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- hash: 3
135
- segments:
136
- - 0
137
- version: "0"
138
- requirement: *id008
139
- description: This gem provides a simple way to check and parse the PagSeguro transaction notification.
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ description: This gem provides a simple way to check and parse the PagSeguro transaction
159
+ notification.
140
160
  email: matiasleidemer@gmail.com
141
161
  executables: []
142
-
143
162
  extensions: []
144
-
145
- extra_rdoc_files:
163
+ extra_rdoc_files:
146
164
  - LICENSE.txt
147
165
  - README.textile
148
- files:
166
+ files:
149
167
  - .document
150
168
  - .rspec
151
169
  - .travis.yml
@@ -176,39 +194,32 @@ files:
176
194
  - spec/transaction/item_spec.rb
177
195
  - spec/transaction/sender_spec.rb
178
196
  - spec/transaction/shipping_spec.rb
179
- has_rdoc: true
180
197
  homepage: http://github.com/matiasleidemer/pagseguro_catcher
181
- licenses:
198
+ licenses:
182
199
  - MIT
183
200
  post_install_message:
184
201
  rdoc_options: []
185
-
186
- require_paths:
202
+ require_paths:
187
203
  - lib
188
- required_ruby_version: !ruby/object:Gem::Requirement
204
+ required_ruby_version: !ruby/object:Gem::Requirement
189
205
  none: false
190
- requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- hash: 3
194
- segments:
206
+ requirements:
207
+ - - ! '>='
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
210
+ segments:
195
211
  - 0
196
- version: "0"
197
- required_rubygems_version: !ruby/object:Gem::Requirement
212
+ hash: 3382344726634979689
213
+ required_rubygems_version: !ruby/object:Gem::Requirement
198
214
  none: false
199
- requirements:
200
- - - ">="
201
- - !ruby/object:Gem::Version
202
- hash: 3
203
- segments:
204
- - 0
205
- version: "0"
215
+ requirements:
216
+ - - ! '>='
217
+ - !ruby/object:Gem::Version
218
+ version: '0'
206
219
  requirements: []
207
-
208
220
  rubyforge_project:
209
- rubygems_version: 1.3.7
221
+ rubygems_version: 1.8.24
210
222
  signing_key:
211
223
  specification_version: 3
212
224
  summary: A simple gem to parse PagSeguro transaction notification.
213
225
  test_files: []
214
-