spree_channable 0.0.18.alpha → 0.0.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc45055d9e1bef626d21f196471a45402d5c220cc05d0db9f7488630addc54a6
4
- data.tar.gz: 0ef0d52b27cce58f5fe3edbc8fac265163b517ae4354c671513689d0dbe8ee3b
3
+ metadata.gz: 3840e7c43e722ecebd2511cc599d62b8ac8b4a6b944e243251724aa027fccca9
4
+ data.tar.gz: 3dfa6b96115649bb7212c0c611b9bf8f8269e6d69489f3cd622d5306f321e35a
5
5
  SHA512:
6
- metadata.gz: c83193ff3364edc06054c6ecea2fe661c6d30de3af8f01aa4f95998b72d99dbcab4a633bce31c6736104519992a8443bd67696f7f38fce81f3e044b7913f717f
7
- data.tar.gz: 43dac314d47fb2fdd16374b6a6ace86df645655accb6e63d9e20c1241b36b9fca52fac39fda740276a7ad3abd81d3437ed69ecd6b77f040e70069d8ebc09c2a6
6
+ metadata.gz: b6c1d138fd02cecd83357430f6b47d67e7629309b736b37186a5fcd7e7c5da6f7fbdf19fa2f53b52f40b7bb3fb58ea577dd2f15e91c5356c5632e180e3fc22e6
7
+ data.tar.gz: b3699c0f10843efa9da4fe986634cc9e1beb553dc3e0fdabde82168815455a2723dd42a030b9dd21e00958b86d9f7889f4f5077affec9134e7a2fa63face838a
data/.gitignore CHANGED
@@ -21,3 +21,4 @@ public/spree
21
21
  .ruby-gemset
22
22
  gemfiles/*.gemfile.lock
23
23
  *.gem
24
+ .byebug_history
data/.travis.yml CHANGED
@@ -1,35 +1,35 @@
1
1
  sudo: required
2
2
  dist: trusty
3
-
4
3
  language: ruby
5
-
6
4
  env:
7
- - DB=postgres
8
- - DB=mysql
9
-
5
+ - DB=mysql
10
6
  gemfile:
11
- - gemfiles/spree_3_2.gemfile
12
- - gemfiles/spree_3_5.gemfile
13
- - gemfiles/spree_3_7.gemfile
14
- - gemfiles/spree_master.gemfile
15
-
7
+ - gemfiles/spree_3_2.gemfile
8
+ - gemfiles/spree_3_5.gemfile
9
+ - gemfiles/spree_3_7.gemfile
10
+ - gemfiles/spree_master.gemfile
16
11
  script:
17
- - bundle exec rake test_app
18
- - bundle exec rake spec
19
-
12
+ - bundle exec rake test_app
13
+ - bundle exec rake spec
20
14
  rvm:
21
- - 2.5.1
22
- - 2.4.2
23
-
15
+ - 2.5.1
16
+ - 2.4.2
24
17
  matrix:
25
18
  allow_failures:
26
- - gemfile: gemfiles/spree_master.gemfile
27
-
19
+ - gemfile: gemfiles/spree_master.gemfile
28
20
  before_install:
29
- - mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
30
- - wget -N https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip -P ~/
31
- - unzip ~/chromedriver_linux64.zip -d ~/
32
- - rm ~/chromedriver_linux64.zip
33
- - sudo mv -f ~/chromedriver /usr/local/share/
34
- - sudo chmod +x /usr/local/share/chromedriver
35
- - sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
21
+ - mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
22
+ - wget -N https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip
23
+ -P ~/
24
+ - unzip ~/chromedriver_linux64.zip -d ~/
25
+ - rm ~/chromedriver_linux64.zip
26
+ - sudo mv -f ~/chromedriver /usr/local/share/
27
+ - sudo chmod +x /usr/local/share/chromedriver
28
+ - sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
29
+ deploy:
30
+ provider: rubygems
31
+ api_key: GoR3CYhCOd/Pw+wwBR36qeEo+6cl+ZetrWInSaoz0mVNe8vGe4NHli4t/jdZXbPn8Yp56tCajiiGIPddj5s6oT8AZ7B0sbfC9RNwL49Z99FiwR81J911qG1YHVlyBeWymBk3CliPNpCpYFmDwcAXX07u9NVza4SyevIB29vjNZD1NhYd/ObOB0QUynGxQ91Q5WmY9MNXrtMrWtImc3UZwfjA6Eo9Po7e/sG2RTvnv06nHLPraZ7jdTj42UQu+FLn7TYdQSBSAmxvXdjYjhdmj9bQt0qJTs89ESB6fK7S7LfgsfZexeNL3OZQC9jDbVqKFBV7YW4tCnLKFcmNdVQbXMmiLFa+3oimHp43+6zuaRFMB4tWOgnSrWhh+N8OE9bKcPb4cZ5tj+P1fcs5eclUGZX+QT2CMPl2bRoBe3nol3HggOGlvDdA/VhEwWFznZr3Qpo3kniZtYFQwLQgR3fTD8LvaGH3ScGno7iRWLsy+Gw2iuzjM3lQ5KjH2Rz76RbMzQGfj/b7zR2wN+WnWADjRODEAt5RPhh9VJthFrpHLVwvpwo7Mt+22+AK87YylznDgnzwhrUMcyw34MN0UismRoz7QEP8tNds7JwwP2UEyOJoqrumPxGFm4pcTrZWvnVVZsGjYfHKaqs7ZzOumRSkcGdMWWHyKQEPeY3VBYYRDzM=
32
+ gem: spree_channable
33
+ on:
34
+ tags: true
35
+ repo: Oldharlem/spree_channable
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
- # SpreeChannable
1
+ <h1 align="center">Channable integration for Spree Commerce</h1>
2
+
3
+ [![Build Status](https://travis-ci.com/Oldharlem/spree_channable.svg?branch=master)](https://travis-ci.com/Oldharlem/spree_channable)
4
+ [![Gem Version](https://badge.fury.io/rb/spree_channable.svg)](https://badge.fury.io/rb/spree_channable)
2
5
 
3
6
  Channable offers many ways to transform a product feed to many marketplace formats. On top channable offers an order connection to accept incoming orders from connected marketplaces. This gem connects your spree store to the channable platform. The feeds are configurable and can be directly loaded into channable.
4
7
  The order connection can be enabled by channable on request and can be easily configured through the spree admin panel.
@@ -7,7 +10,7 @@ The order connection can be enabled by channable on request and can be easily co
7
10
 
8
11
  1. Add this extension to your Gemfile with this line:
9
12
  ```ruby
10
- gem 'spree_channable', github: 'Oldharlem/spree_channable'
13
+ gem 'spree_channable'
11
14
  ```
12
15
 
13
16
  2. Install the gem using Bundler:
@@ -13,12 +13,15 @@ module Spree
13
13
  xml.link(rel: 'self', href: ::SpreeChannable.configuration.host)
14
14
  xml.updated DateTime.now.strftime('%Y-%m-%dT%H:%M:%S%z')
15
15
 
16
- Parallel.map(products) {|product| product.to_channable_variant_xml}.each do |products_xml|
17
- products_xml.each do |variant_xml|
18
- xml.parent << Nokogiri::XML(variant_xml).at('product')
16
+ xml.variants do
17
+ products.map {|product| product.to_channable_variant_xml}.each do |variants_xml|
18
+ variants_xml.each do |variant_xml|
19
+ xml.parent << Nokogiri::XML(variant_xml).at('variant')
20
+ end
19
21
  end
20
22
  end
21
23
 
24
+
22
25
  end
23
26
  end
24
27
 
@@ -33,7 +36,7 @@ module Spree
33
36
  xml.updated DateTime.now.strftime('%Y-%m-%dT%H:%M:%S%z')
34
37
 
35
38
  xml.products do
36
- Parallel.map(products) {|product| product.to_channable_product_xml}.each do |product_xml|
39
+ products.map {|product| product.to_channable_product_xml}.each do |product_xml|
37
40
  xml.parent << Nokogiri::XML(product_xml).at('product')
38
41
  end
39
42
  end
@@ -59,10 +62,16 @@ module Spree
59
62
  xml.id id
60
63
  xml.title "#{name}"
61
64
  xml.description ActionController::Base.helpers.strip_tags(normalized_description)
62
- xml.link URI.join(::SpreeChannable.configuration.host, "/#{::SpreeChannable.configuration.url_prefix}/" + slug).to_s
65
+ xml.link URI.join(::SpreeChannable.configuration.host, "/#{::SpreeChannable.configuration.url_prefix}/" + "#{slug}").to_s
63
66
  (xml.image_link URI.join(::SpreeChannable.configuration.image_host, images.first.attachment.url(:large)).to_s) if images.any?
64
67
  xml.condition property('product_condition') || ::SpreeChannable.configuration.product_condition
65
68
 
69
+ xml.images do
70
+ images.each do |image|
71
+ xml.image URI.join(::SpreeChannable.configuration.image_host, image.attachment.url(:large)).to_s
72
+ end
73
+ end
74
+
66
75
  xml.price price
67
76
 
68
77
  xml.brand property('brand') || ::SpreeChannable.configuration.brand
@@ -111,6 +120,14 @@ module Spree
111
120
  end.to_xml
112
121
  end
113
122
 
123
+ def normalized_description
124
+ if description.blank? || description.length < 3
125
+ name
126
+ else
127
+ description
128
+ end
129
+ end
130
+
114
131
  end
115
132
  end
116
133
  end
@@ -10,7 +10,7 @@ module Spree
10
10
  return nil if price.blank?
11
11
 
12
12
  Nokogiri::XML::Builder.new do |xml|
13
- xml.product {
13
+ xml.variant {
14
14
  xml.id id
15
15
  xml.product_id product.id
16
16
  xml.title "#{product.name}"
@@ -19,6 +19,12 @@ module Spree
19
19
  (xml.image_link URI.join(::SpreeChannable.configuration.image_host, get_images.first.attachment.url(:large)).to_s) unless get_images.empty?
20
20
  xml.condition product.property('product_condition') || ::SpreeChannable.configuration.product_condition
21
21
 
22
+ xml.images do
23
+ get_images.each do |image|
24
+ xml.image URI.join(::SpreeChannable.configuration.image_host, image.attachment.url(:large)).to_s
25
+ end
26
+ end
27
+
22
28
  xml.availability can_supply?
23
29
  xml.stock total_on_hand
24
30
  xml.price price
@@ -10,9 +10,8 @@ module SpreeChannable
10
10
  module VERSION
11
11
  MAJOR = 0
12
12
  MINOR = 0
13
- TINY = 18
14
- PRE = 'alpha'.freeze
13
+ TINY = 20
15
14
 
16
- STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
15
+ STRING = [MAJOR, MINOR, TINY].compact.join('.')
17
16
  end
18
17
  end
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
30
30
  s.add_dependency 'httparty'
31
31
  s.add_dependency 'whenever'
32
32
 
33
+
33
34
  s.add_development_dependency 'appraisal'
34
35
  s.add_development_dependency 'awesome_print'
35
36
  s.add_development_dependency 'capybara'
@@ -47,4 +48,5 @@ Gem::Specification.new do |s|
47
48
  s.add_development_dependency 'simplecov'
48
49
  s.add_development_dependency 'sqlite3', '~> 1.3.6'
49
50
  s.add_development_dependency 'webdrivers', '~> 3.8.0'
51
+ s.add_development_dependency 'byebug'
50
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_channable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18.alpha
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabian Oudhaarlem
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-12 00:00:00.000000000 Z
11
+ date: 2019-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -358,6 +358,20 @@ dependencies:
358
358
  - - "~>"
359
359
  - !ruby/object:Gem::Version
360
360
  version: 3.8.0
361
+ - !ruby/object:Gem::Dependency
362
+ name: byebug
363
+ requirement: !ruby/object:Gem::Requirement
364
+ requirements:
365
+ - - ">="
366
+ - !ruby/object:Gem::Version
367
+ version: '0'
368
+ type: :development
369
+ prerelease: false
370
+ version_requirements: !ruby/object:Gem::Requirement
371
+ requirements:
372
+ - - ">="
373
+ - !ruby/object:Gem::Version
374
+ version: '0'
361
375
  description: Connect your spree store to channable. Receive orders, generate product
362
376
  feeds and send shipment updates.
363
377
  email: fabian@oldharlem.nl
@@ -439,9 +453,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
439
453
  version: 2.2.7
440
454
  required_rubygems_version: !ruby/object:Gem::Requirement
441
455
  requirements:
442
- - - ">"
456
+ - - ">="
443
457
  - !ruby/object:Gem::Version
444
- version: 1.3.1
458
+ version: '0'
445
459
  requirements:
446
460
  - none
447
461
  rubygems_version: 3.0.2