workarea-shipping_estimation 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +20 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  4. data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. data/.gitignore +13 -0
  7. data/CHANGELOG.md +58 -0
  8. data/CODE_OF_CONDUCT.md +3 -0
  9. data/CONTRIBUTING.md +3 -0
  10. data/Gemfile +6 -0
  11. data/LICENSE +52 -0
  12. data/README.md +62 -0
  13. data/Rakefile +52 -0
  14. data/app/assets/stylesheets/workarea/storefront/shipping_estimation/components/_shipping_estimation.scss +7 -0
  15. data/app/controllers/workarea/storefront/carts_controller.decorator +17 -0
  16. data/app/controllers/workarea/storefront/shipping_estimations_controller.rb +17 -0
  17. data/app/models/workarea/shipping/address.decorator +30 -0
  18. data/app/services/workarea/set_shipping_estimation_address.rb +48 -0
  19. data/app/views/workarea/storefront/carts/_shipping_estimation_form.html.haml +12 -0
  20. data/bin/rails +19 -0
  21. data/config/initializers/appends.rb +9 -0
  22. data/config/initializers/configuration.rb +8 -0
  23. data/config/locales/en.yml +5 -0
  24. data/config/routes.rb +5 -0
  25. data/lib/tasks/shipping_estimation_tasks.rake +4 -0
  26. data/lib/workarea/shipping_estimation.rb +10 -0
  27. data/lib/workarea/shipping_estimation/engine.rb +8 -0
  28. data/lib/workarea/shipping_estimation/version.rb +5 -0
  29. data/test/dummy/Rakefile +6 -0
  30. data/test/dummy/app/controllers/application_controller.rb +3 -0
  31. data/test/dummy/app/controllers/concerns/.keep +0 -0
  32. data/test/dummy/app/helpers/application_helper.rb +2 -0
  33. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  34. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  35. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  36. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  37. data/test/dummy/bin/bundle +3 -0
  38. data/test/dummy/bin/rails +4 -0
  39. data/test/dummy/bin/rake +4 -0
  40. data/test/dummy/bin/setup +34 -0
  41. data/test/dummy/bin/update +29 -0
  42. data/test/dummy/config.ru +5 -0
  43. data/test/dummy/config/application.rb +30 -0
  44. data/test/dummy/config/boot.rb +5 -0
  45. data/test/dummy/config/cable.yml +9 -0
  46. data/test/dummy/config/environment.rb +5 -0
  47. data/test/dummy/config/environments/development.rb +54 -0
  48. data/test/dummy/config/environments/production.rb +86 -0
  49. data/test/dummy/config/environments/test.rb +43 -0
  50. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  51. data/test/dummy/config/initializers/assets.rb +11 -0
  52. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  53. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  54. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  55. data/test/dummy/config/initializers/inflections.rb +16 -0
  56. data/test/dummy/config/initializers/mime_types.rb +4 -0
  57. data/test/dummy/config/initializers/new_framework_defaults.rb +18 -0
  58. data/test/dummy/config/initializers/session_store.rb +3 -0
  59. data/test/dummy/config/initializers/workarea.rb +5 -0
  60. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  61. data/test/dummy/config/puma.rb +47 -0
  62. data/test/dummy/config/routes.rb +5 -0
  63. data/test/dummy/config/secrets.yml +22 -0
  64. data/test/dummy/config/spring.rb +6 -0
  65. data/test/dummy/lib/assets/.keep +0 -0
  66. data/test/dummy/log/.keep +0 -0
  67. data/test/models/shipping/address_estimation_validation_test.rb +42 -0
  68. data/test/services/workarea/set_shipping_estimation_address_test.rb +114 -0
  69. data/test/system/workarea/storefront/shipping_estimation_system_test.rb +100 -0
  70. data/test/test_helper.rb +10 -0
  71. data/test/vcr_cassettes/geolocation.yml +205 -0
  72. data/test/vcr_cassettes/geolocation_19106.yml +104 -0
  73. data/workarea-shipping_estimation.gemspec +21 -0
  74. metadata +129 -0
@@ -0,0 +1,10 @@
1
+ # Configure Rails Environment
2
+ ENV['RAILS_ENV'] = 'test'
3
+
4
+ require File.expand_path('../../test/dummy/config/environment.rb', __FILE__)
5
+ require 'rails/test_help'
6
+ require 'workarea/test_help'
7
+
8
+ # Filter out Minitest backtrace while allowing backtrace from other libraries
9
+ # to be shown.
10
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
@@ -0,0 +1,205 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://maps.googleapis.com/maps/api/geocode/json?address=19143&language=en&sensor=false
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Date:
24
+ - Tue, 25 Feb 2014 15:11:05 GMT
25
+ Expires:
26
+ - Wed, 26 Feb 2014 15:11:05 GMT
27
+ Cache-Control:
28
+ - public, max-age=86400
29
+ Access-Control-Allow-Origin:
30
+ - '*'
31
+ Server:
32
+ - mafe
33
+ X-Xss-Protection:
34
+ - 1; mode=block
35
+ X-Frame-Options:
36
+ - SAMEORIGIN
37
+ Alternate-Protocol:
38
+ - 80:quic
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: UTF-8
43
+ string: |
44
+ {
45
+ "results" : [
46
+ {
47
+ "address_components" : [
48
+ {
49
+ "long_name" : "19143",
50
+ "short_name" : "19143",
51
+ "types" : [ "postal_code" ]
52
+ },
53
+ {
54
+ "long_name" : "Philadelphia",
55
+ "short_name" : "Philadelphia",
56
+ "types" : [ "locality", "political" ]
57
+ },
58
+ {
59
+ "long_name" : "Pennsylvania",
60
+ "short_name" : "PA",
61
+ "types" : [ "administrative_area_level_1", "political" ]
62
+ },
63
+ {
64
+ "long_name" : "United States",
65
+ "short_name" : "US",
66
+ "types" : [ "country", "political" ]
67
+ }
68
+ ],
69
+ "formatted_address" : "Philadelphia, PA 19143, USA",
70
+ "geometry" : {
71
+ "bounds" : {
72
+ "northeast" : {
73
+ "lat" : 39.95728889999999,
74
+ "lng" : -75.20478799999999
75
+ },
76
+ "southwest" : {
77
+ "lat" : 39.9234091,
78
+ "lng" : -75.25161199999999
79
+ }
80
+ },
81
+ "location" : {
82
+ "lat" : 39.9412882,
83
+ "lng" : -75.21873459999999
84
+ },
85
+ "location_type" : "APPROXIMATE",
86
+ "viewport" : {
87
+ "northeast" : {
88
+ "lat" : 39.95728889999999,
89
+ "lng" : -75.20478799999999
90
+ },
91
+ "southwest" : {
92
+ "lat" : 39.9234091,
93
+ "lng" : -75.25161199999999
94
+ }
95
+ }
96
+ },
97
+ "types" : [ "postal_code" ]
98
+ }
99
+ ],
100
+ "status" : "OK"
101
+ }
102
+ http_version:
103
+ recorded_at: Tue, 25 Feb 2014 15:11:05 GMT
104
+ - request:
105
+ method: get
106
+ uri: http://maps.googleapis.com/maps/api/geocode/json?address=19143&language=en&sensor=false
107
+ body:
108
+ encoding: US-ASCII
109
+ string: ''
110
+ headers:
111
+ Accept-Encoding:
112
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
113
+ Accept:
114
+ - '*/*'
115
+ User-Agent:
116
+ - Ruby
117
+ response:
118
+ status:
119
+ code: 200
120
+ message: OK
121
+ headers:
122
+ Content-Type:
123
+ - application/json; charset=UTF-8
124
+ Date:
125
+ - Tue, 25 Feb 2014 15:11:05 GMT
126
+ Expires:
127
+ - Wed, 26 Feb 2014 15:11:05 GMT
128
+ Cache-Control:
129
+ - public, max-age=86400
130
+ Access-Control-Allow-Origin:
131
+ - '*'
132
+ Server:
133
+ - mafe
134
+ X-Xss-Protection:
135
+ - 1; mode=block
136
+ X-Frame-Options:
137
+ - SAMEORIGIN
138
+ Alternate-Protocol:
139
+ - 80:quic
140
+ Transfer-Encoding:
141
+ - chunked
142
+ body:
143
+ encoding: UTF-8
144
+ string: |
145
+ {
146
+ "results" : [
147
+ {
148
+ "address_components" : [
149
+ {
150
+ "long_name" : "19143",
151
+ "short_name" : "19143",
152
+ "types" : [ "postal_code" ]
153
+ },
154
+ {
155
+ "long_name" : "Philadelphia",
156
+ "short_name" : "Philadelphia",
157
+ "types" : [ "locality", "political" ]
158
+ },
159
+ {
160
+ "long_name" : "Pennsylvania",
161
+ "short_name" : "PA",
162
+ "types" : [ "administrative_area_level_1", "political" ]
163
+ },
164
+ {
165
+ "long_name" : "United States",
166
+ "short_name" : "US",
167
+ "types" : [ "country", "political" ]
168
+ }
169
+ ],
170
+ "formatted_address" : "Philadelphia, PA 19143, USA",
171
+ "geometry" : {
172
+ "bounds" : {
173
+ "northeast" : {
174
+ "lat" : 39.95728889999999,
175
+ "lng" : -75.20478799999999
176
+ },
177
+ "southwest" : {
178
+ "lat" : 39.9234091,
179
+ "lng" : -75.25161199999999
180
+ }
181
+ },
182
+ "location" : {
183
+ "lat" : 39.9412882,
184
+ "lng" : -75.21873459999999
185
+ },
186
+ "location_type" : "APPROXIMATE",
187
+ "viewport" : {
188
+ "northeast" : {
189
+ "lat" : 39.95728889999999,
190
+ "lng" : -75.20478799999999
191
+ },
192
+ "southwest" : {
193
+ "lat" : 39.9234091,
194
+ "lng" : -75.25161199999999
195
+ }
196
+ }
197
+ },
198
+ "types" : [ "postal_code" ]
199
+ }
200
+ ],
201
+ "status" : "OK"
202
+ }
203
+ http_version:
204
+ recorded_at: Tue, 25 Feb 2014 15:11:05 GMT
205
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,104 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://maps.googleapis.com/maps/api/geocode/json?address=19106&language=en&sensor=false
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Date:
24
+ - Tue, 25 Feb 2014 15:11:05 GMT
25
+ Expires:
26
+ - Wed, 26 Feb 2014 15:11:05 GMT
27
+ Cache-Control:
28
+ - public, max-age=86400
29
+ Access-Control-Allow-Origin:
30
+ - '*'
31
+ Server:
32
+ - mafe
33
+ X-Xss-Protection:
34
+ - 1; mode=block
35
+ X-Frame-Options:
36
+ - SAMEORIGIN
37
+ Alternate-Protocol:
38
+ - 80:quic
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: UTF-8
43
+ string: |
44
+ {
45
+ "results" : [
46
+ {
47
+ "address_components" : [
48
+ {
49
+ "long_name" : "19106",
50
+ "short_name" : "19106",
51
+ "types" : [ "postal_code" ]
52
+ },
53
+ {
54
+ "long_name" : "Philadelphia",
55
+ "short_name" : "Philadelphia",
56
+ "types" : [ "locality", "political" ]
57
+ },
58
+ {
59
+ "long_name" : "Pennsylvania",
60
+ "short_name" : "PA",
61
+ "types" : [ "administrative_area_level_1", "political" ]
62
+ },
63
+ {
64
+ "long_name" : "United States",
65
+ "short_name" : "US",
66
+ "types" : [ "country", "political" ]
67
+ }
68
+ ],
69
+ "formatted_address" : "Philadelphia, PA 19106, USA",
70
+ "geometry" : {
71
+ "bounds" : {
72
+ "northeast" : {
73
+ "lat" : 39.95728889999999,
74
+ "lng" : -75.20478799999999
75
+ },
76
+ "southwest" : {
77
+ "lat" : 39.9234091,
78
+ "lng" : -75.25161199999999
79
+ }
80
+ },
81
+ "location" : {
82
+ "lat" : 39.9412882,
83
+ "lng" : -75.21873459999999
84
+ },
85
+ "location_type" : "APPROXIMATE",
86
+ "viewport" : {
87
+ "northeast" : {
88
+ "lat" : 39.95728889999999,
89
+ "lng" : -75.20478799999999
90
+ },
91
+ "southwest" : {
92
+ "lat" : 39.9234091,
93
+ "lng" : -75.25161199999999
94
+ }
95
+ }
96
+ },
97
+ "types" : [ "postal_code" ]
98
+ }
99
+ ],
100
+ "status" : "OK"
101
+ }
102
+ http_version:
103
+ recorded_at: Tue, 25 Feb 2014 15:11:05 GMT
104
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,21 @@
1
+ $:.push File.expand_path('../lib', __FILE__)
2
+
3
+ # Maintain your gem's version:
4
+ require 'workarea/shipping_estimation/version'
5
+
6
+ # Describe your gem and declare its dependencies:
7
+ Gem::Specification.new do |s|
8
+ s.name = 'workarea-shipping_estimation'
9
+ s.version = Workarea::ShippingEstimation::VERSION
10
+ s.authors = ['Matt Duffy']
11
+ s.email = ['mduffy@workarea.com']
12
+ s.homepage = 'https://github.com/workarea-commerce/workarea-shipping-estimation'
13
+ s.summary = 'Shipping estimation plugin for the Workarea Commerce platform.'
14
+ s.description = 'Shipping estimation plugin for the Workarea Commerce platform.'
15
+ s.files = `git ls-files`.split("\n")
16
+ s.license = 'Business Software License'
17
+
18
+ s.required_ruby_version = '>= 2.3.0'
19
+
20
+ s.add_dependency 'workarea', '~> 3.x'
21
+ end
metadata ADDED
@@ -0,0 +1,129 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: workarea-shipping_estimation
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Matt Duffy
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-08-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: workarea
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.x
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.x
27
+ description: Shipping estimation plugin for the Workarea Commerce platform.
28
+ email:
29
+ - mduffy@workarea.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".editorconfig"
35
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
36
+ - ".github/ISSUE_TEMPLATE/documentation-request.md"
37
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
38
+ - ".gitignore"
39
+ - CHANGELOG.md
40
+ - CODE_OF_CONDUCT.md
41
+ - CONTRIBUTING.md
42
+ - Gemfile
43
+ - LICENSE
44
+ - README.md
45
+ - Rakefile
46
+ - app/assets/stylesheets/workarea/storefront/shipping_estimation/components/_shipping_estimation.scss
47
+ - app/controllers/workarea/storefront/carts_controller.decorator
48
+ - app/controllers/workarea/storefront/shipping_estimations_controller.rb
49
+ - app/models/workarea/shipping/address.decorator
50
+ - app/services/workarea/set_shipping_estimation_address.rb
51
+ - app/views/workarea/storefront/carts/_shipping_estimation_form.html.haml
52
+ - bin/rails
53
+ - config/initializers/appends.rb
54
+ - config/initializers/configuration.rb
55
+ - config/locales/en.yml
56
+ - config/routes.rb
57
+ - lib/tasks/shipping_estimation_tasks.rake
58
+ - lib/workarea/shipping_estimation.rb
59
+ - lib/workarea/shipping_estimation/engine.rb
60
+ - lib/workarea/shipping_estimation/version.rb
61
+ - test/dummy/Rakefile
62
+ - test/dummy/app/controllers/application_controller.rb
63
+ - test/dummy/app/controllers/concerns/.keep
64
+ - test/dummy/app/helpers/application_helper.rb
65
+ - test/dummy/app/mailers/application_mailer.rb
66
+ - test/dummy/app/views/layouts/application.html.erb
67
+ - test/dummy/app/views/layouts/mailer.html.erb
68
+ - test/dummy/app/views/layouts/mailer.text.erb
69
+ - test/dummy/bin/bundle
70
+ - test/dummy/bin/rails
71
+ - test/dummy/bin/rake
72
+ - test/dummy/bin/setup
73
+ - test/dummy/bin/update
74
+ - test/dummy/config.ru
75
+ - test/dummy/config/application.rb
76
+ - test/dummy/config/boot.rb
77
+ - test/dummy/config/cable.yml
78
+ - test/dummy/config/environment.rb
79
+ - test/dummy/config/environments/development.rb
80
+ - test/dummy/config/environments/production.rb
81
+ - test/dummy/config/environments/test.rb
82
+ - test/dummy/config/initializers/application_controller_renderer.rb
83
+ - test/dummy/config/initializers/assets.rb
84
+ - test/dummy/config/initializers/backtrace_silencers.rb
85
+ - test/dummy/config/initializers/cookies_serializer.rb
86
+ - test/dummy/config/initializers/filter_parameter_logging.rb
87
+ - test/dummy/config/initializers/inflections.rb
88
+ - test/dummy/config/initializers/mime_types.rb
89
+ - test/dummy/config/initializers/new_framework_defaults.rb
90
+ - test/dummy/config/initializers/session_store.rb
91
+ - test/dummy/config/initializers/workarea.rb
92
+ - test/dummy/config/initializers/wrap_parameters.rb
93
+ - test/dummy/config/puma.rb
94
+ - test/dummy/config/routes.rb
95
+ - test/dummy/config/secrets.yml
96
+ - test/dummy/config/spring.rb
97
+ - test/dummy/lib/assets/.keep
98
+ - test/dummy/log/.keep
99
+ - test/models/shipping/address_estimation_validation_test.rb
100
+ - test/services/workarea/set_shipping_estimation_address_test.rb
101
+ - test/system/workarea/storefront/shipping_estimation_system_test.rb
102
+ - test/test_helper.rb
103
+ - test/vcr_cassettes/geolocation.yml
104
+ - test/vcr_cassettes/geolocation_19106.yml
105
+ - workarea-shipping_estimation.gemspec
106
+ homepage: https://github.com/workarea-commerce/workarea-shipping-estimation
107
+ licenses:
108
+ - Business Software License
109
+ metadata: {}
110
+ post_install_message:
111
+ rdoc_options: []
112
+ require_paths:
113
+ - lib
114
+ required_ruby_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: 2.3.0
119
+ required_rubygems_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ requirements: []
125
+ rubygems_version: 3.0.4
126
+ signing_key:
127
+ specification_version: 4
128
+ summary: Shipping estimation plugin for the Workarea Commerce platform.
129
+ test_files: []