spree_fosdick_integration 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +28 -0
  3. data/Gemfile +21 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +76 -0
  6. data/Rakefile +15 -0
  7. data/app/controllers/spree/admin/fosdick_shipments_controller.rb +18 -0
  8. data/app/mailers/spree/fosdick_shipment_mailer.rb +13 -0
  9. data/app/models/spree/fosdick_exception.rb +15 -0
  10. data/app/models/spree/fosdick_shipment.rb +8 -0
  11. data/app/models/spree/shipment_decorator.rb +17 -0
  12. data/app/overrides/add_fosdick_panel.rb +8 -0
  13. data/app/serializers/address_serializer.rb +18 -0
  14. data/app/serializers/inventory_unit_serializer.rb +21 -0
  15. data/app/serializers/shipment_serializer.rb +104 -0
  16. data/app/services/exception_logger.rb +21 -0
  17. data/app/views/spree/admin/fosdick_shipments/_filters_bar.html.haml +36 -0
  18. data/app/views/spree/admin/fosdick_shipments/_fosdick_shipments_list.html.haml +28 -0
  19. data/app/views/spree/admin/fosdick_shipments/_fosdick_shipments_list_respond.js.erb +1 -0
  20. data/app/views/spree/admin/fosdick_shipments/_titles.html.haml +5 -0
  21. data/app/views/spree/admin/fosdick_shipments/index.html.haml +3 -0
  22. data/app/views/spree/admin/fosdick_shipments/index.js.haml +1 -0
  23. data/app/views/spree/fosdick_shipment_mailer/order_shipped.html.erb +135 -0
  24. data/config/locales/en.yml +14 -0
  25. data/config/locales/ru.yml +14 -0
  26. data/config/routes.rb +10 -0
  27. data/db/migrate/20151013153126_create_spree_fosdick_shipment.rb +17 -0
  28. data/db/migrate/20151015122038_create_fosdick_exceptions.rb +15 -0
  29. data/db/migrate/20151028105216_add_fosdick_atempt_and_state_spree_shipments.rb +6 -0
  30. data/lib/fosdick/documents/shipment.rb +89 -0
  31. data/lib/fosdick/processor.rb +64 -0
  32. data/lib/fosdick/receiver.rb +49 -0
  33. data/lib/fosdick/sender.rb +39 -0
  34. data/lib/generators/spree_fosdick_integration/install/install_generator.rb +32 -0
  35. data/lib/generators/spree_fosdick_integration/install/templates/fosdick.rb +6 -0
  36. data/lib/generators/spree_fosdick_integration/install/templates/fosdick.yml.template +18 -0
  37. data/lib/spree_fosdick_integration.rb +8 -0
  38. data/lib/spree_fosdick_integration/engine.rb +22 -0
  39. data/lib/spree_fosdick_integration/factories.rb +31 -0
  40. data/lib/spree_fosdick_integration/version.rb +3 -0
  41. data/script/rails +7 -0
  42. data/spec/controllers/admin/fosdick_shipments_controller_spec.rb +16 -0
  43. data/spec/models/spree/fosdick_exception_spec.rb +21 -0
  44. data/spec/models/spree/fosdick_shipment_spec.rb +9 -0
  45. data/spec/models/spree/shipment_spec.rb +50 -0
  46. data/spec/services/exception_logger_spec.rb +11 -0
  47. data/spec/services/fosdick/processor_spec.rb +94 -0
  48. data/spec/services/fosdick/receiver_spec.rb +43 -0
  49. data/spec/services/fosdick/sender_spec.rb +34 -0
  50. data/spec/spec_helper.rb +99 -0
  51. data/spree_fosdick_integration.gemspec +37 -0
  52. metadata +286 -0
@@ -0,0 +1,99 @@
1
+ # Run Coverage report
2
+ require 'simplecov'
3
+ SimpleCov.start do
4
+ add_group 'Controllers', 'app/controllers'
5
+ add_group 'Helpers', 'app/helpers'
6
+ add_group 'Mailers', 'app/mailers'
7
+ add_group 'Models', 'app/models'
8
+ add_group 'Views', 'app/views'
9
+ add_group 'Libraries', 'lib'
10
+ end
11
+
12
+ # Configure Rails Environment
13
+ ENV['RAILS_ENV'] = 'test'
14
+
15
+ require File.expand_path('../dummy/config/environment.rb', __FILE__)
16
+
17
+ require 'rspec/rails'
18
+ require 'database_cleaner'
19
+ require 'ffaker'
20
+ require 'shoulda/matchers'
21
+
22
+ Shoulda::Matchers.configure do |config|
23
+ config.integrate do |with|
24
+ # Choose a test framework:
25
+ with.test_framework :rspec
26
+
27
+ # Choose one or more libraries:
28
+ with.library :active_record
29
+ with.library :active_model
30
+ with.library :action_controller
31
+ # Or, choose the following (which implies all of the above):
32
+ with.library :rails
33
+ end
34
+ end
35
+
36
+ # Requires supporting ruby files with custom matchers and macros, etc,
37
+ # in spec/support/ and its subdirectories.
38
+ Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
39
+
40
+ # Requires factories defined in spree_core
41
+ require 'spree/testing_support/factories'
42
+ require 'spree/testing_support/controller_requests'
43
+ require 'spree/testing_support/authorization_helpers'
44
+ require 'spree/testing_support/url_helpers'
45
+
46
+ require 'spree_fosdick_integration/factories'
47
+ require 'webmock/rspec'
48
+
49
+ RSpec.configure do |config|
50
+ config.include FactoryGirl::Syntax::Methods
51
+
52
+ config.include Devise::TestHelpers, type: :controller
53
+ # == URL Helpers
54
+ #
55
+ # Allows access to Spree's routes in specs:
56
+ #
57
+ # visit spree.admin_path
58
+ # current_path.should eql(spree.products_path)
59
+ config.include Spree::TestingSupport::UrlHelpers
60
+
61
+ # == Mock Framework
62
+ #
63
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
64
+ #
65
+ # config.mock_with :mocha
66
+ # config.mock_with :flexmock
67
+ # config.mock_with :rr
68
+ config.mock_with :rspec
69
+ config.color = true
70
+
71
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
72
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
73
+
74
+ # Capybara javascript drivers require transactional fixtures set to false, and we use DatabaseCleaner
75
+ # to cleanup after each test instead. Without transactional fixtures set to false the records created
76
+ # to setup a test will be unavailable to the browser, which runs under a seperate server instance.
77
+ config.use_transactional_fixtures = false
78
+
79
+ # Ensure Suite is set to use transactions for speed.
80
+ config.before(:suite) do
81
+ DatabaseCleaner.clean_with :truncation
82
+ end
83
+
84
+ config.before(:each) do
85
+ if Capybara.current_driver == :rack_test
86
+ DatabaseCleaner.strategy = :transaction
87
+ else
88
+ DatabaseCleaner.strategy = :truncation
89
+ end
90
+
91
+ DatabaseCleaner.start
92
+ end
93
+
94
+ config.after(:each) do
95
+ DatabaseCleaner.clean
96
+ end
97
+
98
+ config.fail_fast = ENV['FAIL_FAST'] || false
99
+ end
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'spree_fosdick_integration/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.platform = Gem::Platform::RUBY
8
+ spec.name = 'spree_fosdick_integration'
9
+ spec.version = SpreeFosdickIntegration::VERSION
10
+ spec.authors = ['anatolii-volodko']
11
+ spec.summary = 'Integration Spree Commerce with Fosdick API'
12
+ spec.description = 'Integration Spree Commerce with Fosdick API (full service fulfillment services)'
13
+ spec.email = 'info@jetruby.com'
14
+ spec.homepage = 'http://jetruby.com/'
15
+ spec.license = 'MIT'
16
+ spec.required_ruby_version = '>= 2.1.0'
17
+
18
+ spec.files = `git ls-files -z`.split("\x0")
19
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
+ spec.require_paths = ['lib']
22
+
23
+ spec.add_dependency 'spree_core', '~> 3.1.0'
24
+
25
+ spec.add_development_dependency 'bundler', '~> 1.7'
26
+ spec.add_development_dependency 'rake', '~> 10.0'
27
+ spec.add_development_dependency 'rspec-rails', '~> 3.3'
28
+ spec.add_development_dependency 'capybara', '~> 2.4'
29
+ spec.add_development_dependency 'coffee-rails'
30
+ spec.add_development_dependency 'database_cleaner'
31
+ spec.add_development_dependency 'factory_girl', '~> 4.2'
32
+ spec.add_development_dependency 'ffaker', '~> 2.2.0'
33
+ spec.add_development_dependency 'sass-rails'
34
+ spec.add_development_dependency 'selenium-webdriver'
35
+ spec.add_development_dependency 'simplecov', '~> 0.9.0'
36
+ spec.add_development_dependency 'sqlite3', '~> 1.3.10'
37
+ end
metadata ADDED
@@ -0,0 +1,286 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spree_fosdick_integration
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - anatolii-volodko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-01-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: spree_core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: capybara
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.4'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.4'
83
+ - !ruby/object:Gem::Dependency
84
+ name: coffee-rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: database_cleaner
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: factory_girl
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '4.2'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '4.2'
125
+ - !ruby/object:Gem::Dependency
126
+ name: ffaker
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 2.2.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 2.2.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: sass-rails
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: selenium-webdriver
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: simplecov
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 0.9.0
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 0.9.0
181
+ - !ruby/object:Gem::Dependency
182
+ name: sqlite3
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 1.3.10
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 1.3.10
195
+ description: Integration Spree Commerce with Fosdick API (full service fulfillment
196
+ services)
197
+ email: info@jetruby.com
198
+ executables: []
199
+ extensions: []
200
+ extra_rdoc_files: []
201
+ files:
202
+ - ".gitignore"
203
+ - Gemfile
204
+ - LICENSE.txt
205
+ - README.md
206
+ - Rakefile
207
+ - app/controllers/spree/admin/fosdick_shipments_controller.rb
208
+ - app/mailers/spree/fosdick_shipment_mailer.rb
209
+ - app/models/spree/fosdick_exception.rb
210
+ - app/models/spree/fosdick_shipment.rb
211
+ - app/models/spree/shipment_decorator.rb
212
+ - app/overrides/add_fosdick_panel.rb
213
+ - app/serializers/address_serializer.rb
214
+ - app/serializers/inventory_unit_serializer.rb
215
+ - app/serializers/shipment_serializer.rb
216
+ - app/services/exception_logger.rb
217
+ - app/views/spree/admin/fosdick_shipments/_filters_bar.html.haml
218
+ - app/views/spree/admin/fosdick_shipments/_fosdick_shipments_list.html.haml
219
+ - app/views/spree/admin/fosdick_shipments/_fosdick_shipments_list_respond.js.erb
220
+ - app/views/spree/admin/fosdick_shipments/_titles.html.haml
221
+ - app/views/spree/admin/fosdick_shipments/index.html.haml
222
+ - app/views/spree/admin/fosdick_shipments/index.js.haml
223
+ - app/views/spree/fosdick_shipment_mailer/order_shipped.html.erb
224
+ - config/locales/en.yml
225
+ - config/locales/ru.yml
226
+ - config/routes.rb
227
+ - db/migrate/20151013153126_create_spree_fosdick_shipment.rb
228
+ - db/migrate/20151015122038_create_fosdick_exceptions.rb
229
+ - db/migrate/20151028105216_add_fosdick_atempt_and_state_spree_shipments.rb
230
+ - lib/fosdick/documents/shipment.rb
231
+ - lib/fosdick/processor.rb
232
+ - lib/fosdick/receiver.rb
233
+ - lib/fosdick/sender.rb
234
+ - lib/generators/spree_fosdick_integration/install/install_generator.rb
235
+ - lib/generators/spree_fosdick_integration/install/templates/fosdick.rb
236
+ - lib/generators/spree_fosdick_integration/install/templates/fosdick.yml.template
237
+ - lib/spree_fosdick_integration.rb
238
+ - lib/spree_fosdick_integration/engine.rb
239
+ - lib/spree_fosdick_integration/factories.rb
240
+ - lib/spree_fosdick_integration/version.rb
241
+ - script/rails
242
+ - spec/controllers/admin/fosdick_shipments_controller_spec.rb
243
+ - spec/models/spree/fosdick_exception_spec.rb
244
+ - spec/models/spree/fosdick_shipment_spec.rb
245
+ - spec/models/spree/shipment_spec.rb
246
+ - spec/services/exception_logger_spec.rb
247
+ - spec/services/fosdick/processor_spec.rb
248
+ - spec/services/fosdick/receiver_spec.rb
249
+ - spec/services/fosdick/sender_spec.rb
250
+ - spec/spec_helper.rb
251
+ - spree_fosdick_integration.gemspec
252
+ homepage: http://jetruby.com/
253
+ licenses:
254
+ - MIT
255
+ metadata: {}
256
+ post_install_message:
257
+ rdoc_options: []
258
+ require_paths:
259
+ - lib
260
+ required_ruby_version: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: 2.1.0
265
+ required_rubygems_version: !ruby/object:Gem::Requirement
266
+ requirements:
267
+ - - ">="
268
+ - !ruby/object:Gem::Version
269
+ version: '0'
270
+ requirements: []
271
+ rubyforge_project:
272
+ rubygems_version: 2.4.5
273
+ signing_key:
274
+ specification_version: 4
275
+ summary: Integration Spree Commerce with Fosdick API
276
+ test_files:
277
+ - spec/controllers/admin/fosdick_shipments_controller_spec.rb
278
+ - spec/models/spree/fosdick_exception_spec.rb
279
+ - spec/models/spree/fosdick_shipment_spec.rb
280
+ - spec/models/spree/shipment_spec.rb
281
+ - spec/services/exception_logger_spec.rb
282
+ - spec/services/fosdick/processor_spec.rb
283
+ - spec/services/fosdick/receiver_spec.rb
284
+ - spec/services/fosdick/sender_spec.rb
285
+ - spec/spec_helper.rb
286
+ has_rdoc: