ups-ruby 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/.hound.yml +2 -0
  4. data/.rubocop.yml +1064 -0
  5. data/.travis.yml +10 -0
  6. data/Gemfile +10 -0
  7. data/Gemfile.lock +46 -0
  8. data/LICENSE.txt +14 -0
  9. data/README.md +78 -0
  10. data/Rakefile +17 -0
  11. data/lib/ups-ruby.rb +2 -0
  12. data/lib/ups.rb +33 -0
  13. data/lib/ups/builders/address_builder.rb +135 -0
  14. data/lib/ups/builders/builder_base.rb +216 -0
  15. data/lib/ups/builders/organisation_builder.rb +74 -0
  16. data/lib/ups/builders/rate_builder.rb +21 -0
  17. data/lib/ups/builders/ship_accept_builder.rb +30 -0
  18. data/lib/ups/builders/ship_confirm_builder.rb +103 -0
  19. data/lib/ups/builders/shipper_builder.rb +88 -0
  20. data/lib/ups/connection.rb +124 -0
  21. data/lib/ups/data.rb +50 -0
  22. data/lib/ups/data/canadian_states.rb +21 -0
  23. data/lib/ups/data/ie_counties.rb +10 -0
  24. data/lib/ups/data/ie_county_prefixes.rb +15 -0
  25. data/lib/ups/data/us_states.rb +59 -0
  26. data/lib/ups/exceptions.rb +7 -0
  27. data/lib/ups/packaging.rb +27 -0
  28. data/lib/ups/parsers/parser_base.rb +48 -0
  29. data/lib/ups/parsers/rates_parser.rb +60 -0
  30. data/lib/ups/parsers/ship_accept_parser.rb +52 -0
  31. data/lib/ups/parsers/ship_confirm_parser.rb +16 -0
  32. data/lib/ups/services.rb +21 -0
  33. data/lib/ups/version.rb +10 -0
  34. data/spec/spec_helper.rb +18 -0
  35. data/spec/stubs/rates_negotiated_success.xml +227 -0
  36. data/spec/stubs/rates_success.xml +196 -0
  37. data/spec/stubs/ship_accept_failure.xml +12 -0
  38. data/spec/stubs/ship_accept_success.xml +56 -0
  39. data/spec/stubs/ship_confirm_failure.xml +12 -0
  40. data/spec/stubs/ship_confirm_success.xml +50 -0
  41. data/spec/support/RateRequest.xsd +1 -0
  42. data/spec/support/ShipAcceptRequest.xsd +36 -0
  43. data/spec/support/ShipConfirmRequest.xsd +996 -0
  44. data/spec/support/schema_path.rb +5 -0
  45. data/spec/support/shipping_options.rb +48 -0
  46. data/spec/support/xsd_validator.rb +11 -0
  47. data/spec/ups/builders/address_builder_spec.rb +97 -0
  48. data/spec/ups/builders/rate_builder_spec.rb +20 -0
  49. data/spec/ups/builders/ship_accept_builder_spec.rb +16 -0
  50. data/spec/ups/builders/ship_confirm_builder_spec.rb +23 -0
  51. data/spec/ups/connection/rates_negotiated_spec.rb +69 -0
  52. data/spec/ups/connection/rates_standard_spec.rb +71 -0
  53. data/spec/ups/connection/ship_spec.rb +111 -0
  54. data/spec/ups/connection_spec.rb +20 -0
  55. data/ups.gemspec +24 -0
  56. metadata +166 -0
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+ require 'support/shipping_options'
3
+
4
+ describe UPS::Connection do
5
+ describe "when setting test mode" do
6
+ subject { UPS::Connection.new(test_mode: true) }
7
+
8
+ it "should set the uri to the test url" do
9
+ subject.url.must_equal UPS::Connection::TEST_URL
10
+ end
11
+ end
12
+
13
+ describe "when setting live mode" do
14
+ subject { UPS::Connection.new }
15
+
16
+ it "should set the uri to the live url" do
17
+ subject.url.must_equal UPS::Connection::LIVE_URL
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ require File.expand_path('../lib/ups/version', __FILE__)
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = 'ups-ruby'
5
+ gem.version = UPS::Version::STRING
6
+ gem.platform = Gem::Platform::RUBY
7
+ gem.authors = ['Veeqo']
8
+ gem.email = ['helpme@veeqo.com']
9
+ gem.homepage = 'https://github.com/veeqo/ups-ruby'
10
+ gem.summary = 'UPS'
11
+ gem.description = 'UPS Gem for accessing the UPS API from Ruby'
12
+
13
+ gem.license = 'AGPL-3.0'
14
+
15
+ gem.required_rubygems_version = '>= 1.3.6'
16
+
17
+ gem.add_runtime_dependency 'ox', '~> 2.2', '>= 2.2.0'
18
+ gem.add_runtime_dependency 'excon', '~> 0.45', '>= 0.45.3'
19
+ gem.add_runtime_dependency 'insensitive_hash', '~> 0.3.3'
20
+ gem.add_runtime_dependency 'levenshtein-ffi', '~> 1.1'
21
+
22
+ gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
23
+ gem.require_path = 'lib'
24
+ end
metadata ADDED
@@ -0,0 +1,166 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ups-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.3
5
+ platform: ruby
6
+ authors:
7
+ - Veeqo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-08-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ox
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.2'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.2.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '2.2'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 2.2.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: excon
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.45'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 0.45.3
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '0.45'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 0.45.3
53
+ - !ruby/object:Gem::Dependency
54
+ name: insensitive_hash
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: 0.3.3
60
+ type: :runtime
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: 0.3.3
67
+ - !ruby/object:Gem::Dependency
68
+ name: levenshtein-ffi
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '1.1'
74
+ type: :runtime
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '1.1'
81
+ description: UPS Gem for accessing the UPS API from Ruby
82
+ email:
83
+ - helpme@veeqo.com
84
+ executables: []
85
+ extensions: []
86
+ extra_rdoc_files: []
87
+ files:
88
+ - ".gitignore"
89
+ - ".hound.yml"
90
+ - ".rubocop.yml"
91
+ - ".travis.yml"
92
+ - Gemfile
93
+ - Gemfile.lock
94
+ - LICENSE.txt
95
+ - README.md
96
+ - Rakefile
97
+ - lib/ups-ruby.rb
98
+ - lib/ups.rb
99
+ - lib/ups/builders/address_builder.rb
100
+ - lib/ups/builders/builder_base.rb
101
+ - lib/ups/builders/organisation_builder.rb
102
+ - lib/ups/builders/rate_builder.rb
103
+ - lib/ups/builders/ship_accept_builder.rb
104
+ - lib/ups/builders/ship_confirm_builder.rb
105
+ - lib/ups/builders/shipper_builder.rb
106
+ - lib/ups/connection.rb
107
+ - lib/ups/data.rb
108
+ - lib/ups/data/canadian_states.rb
109
+ - lib/ups/data/ie_counties.rb
110
+ - lib/ups/data/ie_county_prefixes.rb
111
+ - lib/ups/data/us_states.rb
112
+ - lib/ups/exceptions.rb
113
+ - lib/ups/packaging.rb
114
+ - lib/ups/parsers/parser_base.rb
115
+ - lib/ups/parsers/rates_parser.rb
116
+ - lib/ups/parsers/ship_accept_parser.rb
117
+ - lib/ups/parsers/ship_confirm_parser.rb
118
+ - lib/ups/services.rb
119
+ - lib/ups/version.rb
120
+ - spec/spec_helper.rb
121
+ - spec/stubs/rates_negotiated_success.xml
122
+ - spec/stubs/rates_success.xml
123
+ - spec/stubs/ship_accept_failure.xml
124
+ - spec/stubs/ship_accept_success.xml
125
+ - spec/stubs/ship_confirm_failure.xml
126
+ - spec/stubs/ship_confirm_success.xml
127
+ - spec/support/RateRequest.xsd
128
+ - spec/support/ShipAcceptRequest.xsd
129
+ - spec/support/ShipConfirmRequest.xsd
130
+ - spec/support/schema_path.rb
131
+ - spec/support/shipping_options.rb
132
+ - spec/support/xsd_validator.rb
133
+ - spec/ups/builders/address_builder_spec.rb
134
+ - spec/ups/builders/rate_builder_spec.rb
135
+ - spec/ups/builders/ship_accept_builder_spec.rb
136
+ - spec/ups/builders/ship_confirm_builder_spec.rb
137
+ - spec/ups/connection/rates_negotiated_spec.rb
138
+ - spec/ups/connection/rates_standard_spec.rb
139
+ - spec/ups/connection/ship_spec.rb
140
+ - spec/ups/connection_spec.rb
141
+ - ups.gemspec
142
+ homepage: https://github.com/veeqo/ups-ruby
143
+ licenses:
144
+ - AGPL-3.0
145
+ metadata: {}
146
+ post_install_message:
147
+ rdoc_options: []
148
+ require_paths:
149
+ - lib
150
+ required_ruby_version: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
155
+ required_rubygems_version: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: 1.3.6
160
+ requirements: []
161
+ rubyforge_project:
162
+ rubygems_version: 2.5.2
163
+ signing_key:
164
+ specification_version: 4
165
+ summary: UPS
166
+ test_files: []