solidus_product_feed 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +35 -0
  3. data/.gem_release.yml +5 -0
  4. data/.github/stale.yml +17 -0
  5. data/.gitignore +10 -2
  6. data/.rspec +2 -1
  7. data/.rubocop.yml +3 -149
  8. data/.rubocop_todo.yml +50 -0
  9. data/CHANGELOG.md +63 -0
  10. data/Gemfile +28 -9
  11. data/LICENSE +2 -2
  12. data/README.md +71 -26
  13. data/Rakefile +4 -19
  14. data/app/decorators/controllers/solidus_product_feed/spree/products_controller_decorator.rb +25 -0
  15. data/app/models/spree/feed_product.rb +39 -10
  16. data/app/overrides/rss_link.rb +2 -0
  17. data/app/views/spree/products/index.rss.builder +10 -12
  18. data/bin/console +17 -0
  19. data/bin/r +13 -0
  20. data/bin/rails +15 -0
  21. data/bin/rake +7 -0
  22. data/bin/sandbox +84 -0
  23. data/bin/sandbox_rails +18 -0
  24. data/bin/setup +8 -0
  25. data/config/locales/en.yml +5 -0
  26. data/config/routes.rb +3 -1
  27. data/lib/generators/solidus_product_feed/install/install_generator.rb +6 -8
  28. data/lib/solidus_product_feed.rb +42 -1
  29. data/lib/solidus_product_feed/engine.rb +9 -10
  30. data/lib/solidus_product_feed/factories.rb +4 -0
  31. data/lib/solidus_product_feed/version.rb +3 -1
  32. data/lib/spree_product_feed.rb +2 -0
  33. data/solidus_product_feed.gemspec +36 -30
  34. data/spec/controllers/products_controller_spec.rb +14 -2
  35. data/spec/models/spree/feed_product_spec.rb +10 -1
  36. data/spec/spec_helper.rb +23 -13
  37. data/spec/support/devise.rb +5 -0
  38. metadata +53 -92
  39. data/.travis.yml +0 -21
  40. data/Guardfile +0 -10
  41. data/app/assets/javascripts/admin/solidus_product_feed.js +0 -1
  42. data/app/assets/javascripts/spree/backend/solidus_product_feed.js +0 -0
  43. data/app/assets/javascripts/spree/backend/spree_product_feed.js +0 -0
  44. data/app/assets/javascripts/spree/frontend/solidus_product_feed.js +0 -0
  45. data/app/assets/javascripts/spree/frontend/spree_product_feed.js +0 -0
  46. data/app/assets/javascripts/store/solidus_product_feed.js +0 -1
  47. data/app/assets/stylesheets/admin/solidus_product_feed.css +0 -3
  48. data/app/assets/stylesheets/spree/backend/solidus_product_feed.css +0 -0
  49. data/app/assets/stylesheets/spree/backend/spree_product_feed.css +0 -0
  50. data/app/assets/stylesheets/spree/frontend/solidus_product_feed.css +0 -0
  51. data/app/assets/stylesheets/spree/frontend/spree_product_feed.css +0 -0
  52. data/app/assets/stylesheets/store/solidus_product_feed.css +0 -3
  53. data/app/controllers/spree/products_controller_decorator.rb +0 -18
  54. data/script/rails +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: be2f9f7cc2d18d5a7378987fc39bf1cd8c1d6aeb
4
- data.tar.gz: bedae2c876c2da7cc7a7c0fcabcb571d731d196d
2
+ SHA256:
3
+ metadata.gz: ce324fceb2c25c2e9099d69ba76e0b03ea5dd00ff02447a87b12d662dc694aa6
4
+ data.tar.gz: 2bf5fd20d9dcdf286391e33fe4376118e49e86341ad5a6cdf871a4f1f6d76da6
5
5
  SHA512:
6
- metadata.gz: 44f3c3e13bd3e8edc0bee99561ffa9949fa0c71975b1dd4b4b98d4987b16b3f01d02eeff2d3bdccc3d48eb885e1bea5dd0927696957a2209c1f13b2462a2f1bf
7
- data.tar.gz: 0ca8f25a3f15966b8df37d5c697d35f686d7143a06cb9e1331f6777d625a330d7e600189e6c3498270e73d0eb171f54e9a1440f33388f1b401ab9140d8b9d545
6
+ metadata.gz: 2bd0231bb2fa56111602ee89dc001ad6303868812626700edf908ab52793b40d74249098a436c8174a26a5a3349473817c406fb9579d6602dce3ad64129913b5
7
+ data.tar.gz: db7f8948fd6bf0952cce55e5356ccd0cd857a6c2d25f1f445889535a69dcc4910590d1b418af57e09044f3b1a676d556b605e9f451264977c2364739d6d20141
@@ -0,0 +1,35 @@
1
+ version: 2.1
2
+
3
+ orbs:
4
+ # Always take the latest version of the orb, this allows us to
5
+ # run specs against Solidus supported versions only without the need
6
+ # to change this configuration every time a Solidus version is released
7
+ # or goes EOL.
8
+ solidusio_extensions: solidusio/extensions@volatile
9
+
10
+ jobs:
11
+ run-specs-with-postgres:
12
+ executor: solidusio_extensions/postgres
13
+ steps:
14
+ - solidusio_extensions/run-tests
15
+ run-specs-with-mysql:
16
+ executor: solidusio_extensions/mysql
17
+ steps:
18
+ - solidusio_extensions/run-tests
19
+
20
+ workflows:
21
+ "Run specs on supported Solidus versions":
22
+ jobs:
23
+ - run-specs-with-postgres
24
+ - run-specs-with-mysql
25
+ "Weekly run specs against master":
26
+ triggers:
27
+ - schedule:
28
+ cron: "0 0 * * 4" # every Thursday
29
+ filters:
30
+ branches:
31
+ only:
32
+ - master
33
+ jobs:
34
+ - run-specs-with-postgres
35
+ - run-specs-with-mysql
@@ -0,0 +1,5 @@
1
+ bump:
2
+ recurse: false
3
+ file: 'lib/solidus_product_feed/version.rb'
4
+ message: Bump SolidusProductFeed to %{version}
5
+ tag: true
@@ -0,0 +1,17 @@
1
+ # Number of days of inactivity before an issue becomes stale
2
+ daysUntilStale: 60
3
+ # Number of days of inactivity before a stale issue is closed
4
+ daysUntilClose: 7
5
+ # Issues with these labels will never be considered stale
6
+ exemptLabels:
7
+ - pinned
8
+ - security
9
+ # Label to use when marking an issue as stale
10
+ staleLabel: wontfix
11
+ # Comment to post when marking an issue as stale. Set to `false` to disable
12
+ markComment: >
13
+ This issue has been automatically marked as stale because it has not had
14
+ recent activity. It will be closed if no further activity occurs. Thank you
15
+ for your contributions.
16
+ # Comment to post when closing a stale issue. Set to `false` to disable
17
+ closeComment: false
data/.gitignore CHANGED
@@ -1,12 +1,20 @@
1
+ *.gem
1
2
  \#*
2
3
  *~
3
4
  .#*
4
5
  .DS_Store
5
6
  .idea
6
7
  .project
8
+ .sass-cache
9
+ coverage
10
+ Gemfile.lock
7
11
  tmp
8
12
  nbproject
13
+ pkg
9
14
  *.swp
10
15
  spec/dummy
11
- pkg
12
- Gemfile.lock
16
+ spec/examples.txt
17
+ /sandbox
18
+ .rvmrc
19
+ .ruby-version
20
+ .ruby-gemset
data/.rspec CHANGED
@@ -1 +1,2 @@
1
- --colour
1
+ --color
2
+ --require spec_helper
@@ -1,150 +1,4 @@
1
- AllCops:
2
- Exclude:
3
- - spec/dummy/**/*
4
- - script/*
5
- - Guardfile
6
- - vendor/**/*
1
+ require:
2
+ - solidus_dev_support/rubocop
7
3
 
8
- Style/MutableConstant:
9
- Enabled: false
10
-
11
- # Relaxed.Ruby.Style
12
-
13
- Style/Alias:
14
- Enabled: false
15
- StyleGuide: http://relaxed.ruby.style/#stylealias
16
-
17
- Style/BeginBlock:
18
- Enabled: false
19
- StyleGuide: http://relaxed.ruby.style/#stylebeginblock
20
-
21
- Style/BlockDelimiters:
22
- Enabled: false
23
- StyleGuide: http://relaxed.ruby.style/#styleblockdelimiters
24
-
25
- Style/Documentation:
26
- Enabled: false
27
- StyleGuide: http://relaxed.ruby.style/#styledocumentation
28
-
29
- Style/DotPosition:
30
- Enabled: false
31
- StyleGuide: http://relaxed.ruby.style/#styledotposition
32
-
33
- Style/DoubleNegation:
34
- Enabled: false
35
- StyleGuide: http://relaxed.ruby.style/#styledoublenegation
36
-
37
- Style/EndBlock:
38
- Enabled: false
39
- StyleGuide: http://relaxed.ruby.style/#styleendblock
40
-
41
- Style/FormatString:
42
- Enabled: false
43
- StyleGuide: http://relaxed.ruby.style/#styleformatstring
44
-
45
- Style/IfUnlessModifier:
46
- Enabled: false
47
- StyleGuide: http://relaxed.ruby.style/#styleifunlessmodifier
48
-
49
- Style/Lambda:
50
- Enabled: false
51
- StyleGuide: http://relaxed.ruby.style/#stylelambda
52
-
53
- Style/ModuleFunction:
54
- Enabled: false
55
- StyleGuide: http://relaxed.ruby.style/#stylemodulefunction
56
-
57
- Style/MultilineBlockChain:
58
- Enabled: false
59
- StyleGuide: http://relaxed.ruby.style/#stylemultilineblockchain
60
-
61
- Style/NegatedIf:
62
- Enabled: false
63
- StyleGuide: http://relaxed.ruby.style/#stylenegatedif
64
-
65
- Style/NegatedWhile:
66
- Enabled: false
67
- StyleGuide: http://relaxed.ruby.style/#stylenegatedwhile
68
-
69
- Style/ParallelAssignment:
70
- Enabled: false
71
- StyleGuide: http://relaxed.ruby.style/#styleparallelassignment
72
-
73
- Style/PercentLiteralDelimiters:
74
- Enabled: false
75
- StyleGuide: http://relaxed.ruby.style/#stylepercentliteraldelimiters
76
-
77
- Style/PerlBackrefs:
78
- Enabled: false
79
- StyleGuide: http://relaxed.ruby.style/#styleperlbackrefs
80
-
81
- Style/Semicolon:
82
- Enabled: false
83
- StyleGuide: http://relaxed.ruby.style/#stylesemicolon
84
-
85
- Style/SignalException:
86
- Enabled: false
87
- StyleGuide: http://relaxed.ruby.style/#stylesignalexception
88
-
89
- Style/SingleLineBlockParams:
90
- Enabled: false
91
- StyleGuide: http://relaxed.ruby.style/#stylesinglelineblockparams
92
-
93
- Style/SingleLineMethods:
94
- Enabled: false
95
- StyleGuide: http://relaxed.ruby.style/#stylesinglelinemethods
96
-
97
- Style/SpaceBeforeBlockBraces:
98
- Enabled: false
99
- StyleGuide: http://relaxed.ruby.style/#stylespacebeforeblockbraces
100
-
101
- Style/SpaceInsideParens:
102
- Enabled: false
103
- StyleGuide: http://relaxed.ruby.style/#stylespaceinsideparens
104
-
105
- Style/SpecialGlobalVars:
106
- Enabled: false
107
- StyleGuide: http://relaxed.ruby.style/#stylespecialglobalvars
108
-
109
- Style/StringLiterals:
110
- Enabled: false
111
- StyleGuide: http://relaxed.ruby.style/#stylestringliterals
112
-
113
- Style/WhileUntilModifier:
114
- Enabled: false
115
- StyleGuide: http://relaxed.ruby.style/#stylewhileuntilmodifier
116
-
117
- Lint/AmbiguousRegexpLiteral:
118
- Enabled: false
119
- StyleGuide: http://relaxed.ruby.style/#lintambiguousregexpliteral
120
-
121
- Lint/AssignmentInCondition:
122
- Enabled: false
123
- StyleGuide: http://relaxed.ruby.style/#lintassignmentincondition
124
-
125
- Metrics/AbcSize:
126
- Enabled: false
127
-
128
- Metrics/BlockNesting:
129
- Enabled: false
130
-
131
- Metrics/ClassLength:
132
- Enabled: false
133
-
134
- Metrics/ModuleLength:
135
- Enabled: false
136
-
137
- Metrics/CyclomaticComplexity:
138
- Enabled: false
139
-
140
- Metrics/LineLength:
141
- Enabled: false
142
-
143
- Metrics/MethodLength:
144
- Enabled: false
145
-
146
- Metrics/ParameterLists:
147
- Enabled: false
148
-
149
- Metrics/PerceivedComplexity:
150
- Enabled: false
4
+ inherit_from: .rubocop_todo.yml
@@ -0,0 +1,50 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-01-23 16:16:15 +0100 using RuboCop version 0.76.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ Lint/InterpolationCheck:
11
+ Exclude:
12
+ - 'app/overrides/rss_link.rb'
13
+
14
+ # Offense count: 1
15
+ # Cop supports --auto-correct.
16
+ Lint/RedundantCopDisableDirective:
17
+ Exclude:
18
+ - 'solidus_product_feed.gemspec'
19
+
20
+ # Offense count: 2
21
+ # Configuration parameters: Prefixes.
22
+ # Prefixes: when, with, without
23
+ RSpec/ContextWording:
24
+ Exclude:
25
+ - 'spec/controllers/products_controller_spec.rb'
26
+
27
+ # Offense count: 1
28
+ # Configuration parameters: CustomTransform, IgnoreMethods.
29
+ RSpec/FilePath:
30
+ Exclude:
31
+ - 'spec/controllers/products_controller_spec.rb'
32
+
33
+ # Offense count: 2
34
+ RSpec/LetSetup:
35
+ Exclude:
36
+ - 'spec/controllers/products_controller_spec.rb'
37
+
38
+ # Offense count: 3
39
+ # Configuration parameters: IgnoreSharedExamples.
40
+ RSpec/NamedSubject:
41
+ Exclude:
42
+ - 'spec/controllers/products_controller_spec.rb'
43
+ - 'spec/models/spree/feed_product_spec.rb'
44
+
45
+ # Offense count: 4
46
+ # Cop supports --auto-correct.
47
+ # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
48
+ # URISchemes: http, https
49
+ Metrics/LineLength:
50
+ Max: 152
@@ -0,0 +1,63 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased](https://github.com/solidusio-contrib/solidus_product_feed/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_product_feed/compare/v1.0.0...HEAD)
6
+
7
+ **Closed issues:**
8
+
9
+ - Dependabot couldn't find a Gemfile-local for this project [\#49](https://github.com/solidusio-contrib/solidus_product_feed/issues/49)
10
+ - Dependabot can't resolve your Ruby dependency files [\#47](https://github.com/solidusio-contrib/solidus_product_feed/issues/47)
11
+ - Dependabot can't resolve your Ruby dependency files [\#46](https://github.com/solidusio-contrib/solidus_product_feed/issues/46)
12
+ - Dependabot can't resolve your Ruby dependency files [\#45](https://github.com/solidusio-contrib/solidus_product_feed/issues/45)
13
+ - Dependabot can't resolve your Ruby dependency files [\#44](https://github.com/solidusio-contrib/solidus_product_feed/issues/44)
14
+ - Dependabot can't resolve your Ruby dependency files [\#43](https://github.com/solidusio-contrib/solidus_product_feed/issues/43)
15
+ - Dependabot can't resolve your Ruby dependency files [\#42](https://github.com/solidusio-contrib/solidus_product_feed/issues/42)
16
+ - Dependabot can't resolve your Ruby dependency files [\#41](https://github.com/solidusio-contrib/solidus_product_feed/issues/41)
17
+ - Dependabot can't resolve your Ruby dependency files [\#40](https://github.com/solidusio-contrib/solidus_product_feed/issues/40)
18
+
19
+ **Merged pull requests:**
20
+
21
+ - Update gem to the latest version of solidus\_dev\_support [\#55](https://github.com/solidusio-contrib/solidus_product_feed/pull/55) ([aldesantis](https://github.com/aldesantis))
22
+ - Relax solidus\_support dependency [\#53](https://github.com/solidusio-contrib/solidus_product_feed/pull/53) ([kennyadsl](https://github.com/kennyadsl))
23
+ - Fix Dependabot looking for Gemfile-local [\#51](https://github.com/solidusio-contrib/solidus_product_feed/pull/51) ([aldesantis](https://github.com/aldesantis))
24
+ - Upgrade the extension using solidus\_dev\_support [\#48](https://github.com/solidusio-contrib/solidus_product_feed/pull/48) ([blocknotes](https://github.com/blocknotes))
25
+ - Verify Request Format [\#39](https://github.com/solidusio-contrib/solidus_product_feed/pull/39) ([mamhoff](https://github.com/mamhoff))
26
+ - Adopt solidus\_extension\_dev\_tools [\#38](https://github.com/solidusio-contrib/solidus_product_feed/pull/38) ([aldesantis](https://github.com/aldesantis))
27
+ - Adopt CircleCI instead of Travis [\#31](https://github.com/solidusio-contrib/solidus_product_feed/pull/31) ([aldesantis](https://github.com/aldesantis))
28
+ - Update Ruby and Solidus versions [\#30](https://github.com/solidusio-contrib/solidus_product_feed/pull/30) ([aldesantis](https://github.com/aldesantis))
29
+ - Update travis and rakefile [\#29](https://github.com/solidusio-contrib/solidus_product_feed/pull/29) ([jtapia](https://github.com/jtapia))
30
+ - Add support for latest Solidus versions [\#27](https://github.com/solidusio-contrib/solidus_product_feed/pull/27) ([jtapia](https://github.com/jtapia))
31
+ - Dynamic schema [\#26](https://github.com/solidusio-contrib/solidus_product_feed/pull/26) ([aldesantis](https://github.com/aldesantis))
32
+ - Make feed headers configurable [\#25](https://github.com/solidusio-contrib/solidus_product_feed/pull/25) ([aldesantis](https://github.com/aldesantis))
33
+ - Add brand and MPN tags for Google Merchant feed [\#24](https://github.com/solidusio-contrib/solidus_product_feed/pull/24) ([aldesantis](https://github.com/aldesantis))
34
+ - Remove Solidus v2.3 from Travis config \(EOL\) [\#23](https://github.com/solidusio-contrib/solidus_product_feed/pull/23) ([aitbw](https://github.com/aitbw))
35
+ - Extension maintenance [\#22](https://github.com/solidusio-contrib/solidus_product_feed/pull/22) ([aitbw](https://github.com/aitbw))
36
+ - Fix specs [\#20](https://github.com/solidusio-contrib/solidus_product_feed/pull/20) ([kennyadsl](https://github.com/kennyadsl))
37
+ - Remove versions past EOL from .travis.yml [\#19](https://github.com/solidusio-contrib/solidus_product_feed/pull/19) ([jacobherrington](https://github.com/jacobherrington))
38
+ - Add Solidus 2.7 to .travis.yml [\#18](https://github.com/solidusio-contrib/solidus_product_feed/pull/18) ([jacobherrington](https://github.com/jacobherrington))
39
+ - Use ffaker instead of faker [\#17](https://github.com/solidusio-contrib/solidus_product_feed/pull/17) ([jhawthorn](https://github.com/jhawthorn))
40
+
41
+ ## [v1.0.0](https://github.com/solidusio-contrib/solidus_product_feed/tree/v1.0.0) (2016-08-24)
42
+
43
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_product_feed/compare/v0.1.0...v1.0.0)
44
+
45
+ **Merged pull requests:**
46
+
47
+ - Add support for Solidus 2.0 and Rails 5 [\#12](https://github.com/solidusio-contrib/solidus_product_feed/pull/12) ([jhawthorn](https://github.com/jhawthorn))
48
+ - Bring the feed more in line with the spec [\#10](https://github.com/solidusio-contrib/solidus_product_feed/pull/10) ([jarednorman](https://github.com/jarednorman))
49
+ - Add a note on versions [\#9](https://github.com/solidusio-contrib/solidus_product_feed/pull/9) ([jhawthorn](https://github.com/jhawthorn))
50
+ - Extract feed logic to class [\#7](https://github.com/solidusio-contrib/solidus_product_feed/pull/7) ([jarednorman](https://github.com/jarednorman))
51
+
52
+ ## [v0.1.0](https://github.com/solidusio-contrib/solidus_product_feed/tree/v0.1.0) (2016-05-10)
53
+
54
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_product_feed/compare/ab9d93c2af70a24bfb2a7ab75f3fdf33ddaef3aa...v0.1.0)
55
+
56
+ **Merged pull requests:**
57
+
58
+ - Rename to solidus\_product\_feed [\#4](https://github.com/solidusio-contrib/solidus_product_feed/pull/4) ([Sinetheta](https://github.com/Sinetheta))
59
+ - Upgrade 2-4-stable to Solidus [\#3](https://github.com/solidusio-contrib/solidus_product_feed/pull/3) ([Sinetheta](https://github.com/Sinetheta))
60
+
61
+
62
+
63
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile CHANGED
@@ -1,18 +1,37 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
2
5
 
3
6
  branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
4
- gem "solidus", github: "solidusio/solidus", branch: branch
7
+ gem 'solidus', github: 'solidusio/solidus', branch: branch
8
+
9
+ # Needed to help Bundler figure out how to resolve dependencies,
10
+ # otherwise it takes forever to resolve them.
11
+ # See https://github.com/bundler/bundler/issues/6677
12
+ gem 'rails', '>0.a'
13
+
14
+ # Provides basic authentication functionality for testing parts of your engine
5
15
  gem 'solidus_auth_devise'
6
16
 
7
- if branch == 'master' || branch >= "v2.0"
8
- gem "rails-controller-testing", group: :test
17
+ case ENV['DB']
18
+ when 'mysql'
19
+ gem 'mysql2'
20
+ when 'postgresql'
21
+ gem 'pg'
22
+ else
23
+ gem 'sqlite3'
9
24
  end
10
25
 
11
- gem 'pg'
12
- gem 'mysql2'
13
-
14
- group :development, :test do
15
- gem "pry-rails"
26
+ group :test do
27
+ gem 'rails-controller-testing'
16
28
  end
17
29
 
18
30
  gemspec
31
+
32
+ # Use a local Gemfile to include development dependencies that might not be
33
+ # relevant for the project or for other contributors, e.g. pry-byebug.
34
+ #
35
+ # We use `send` instead of calling `eval_gemfile` to work around an issue with
36
+ # how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658.
37
+ send(:eval_gemfile, 'Gemfile-local') if File.exist? 'Gemfile-local'
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 [name of plugin creator]
1
+ Copyright (c) 2011 Joshua Nussbaum and other contributors
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
@@ -9,7 +9,7 @@ are permitted provided that the following conditions are met:
9
9
  * Redistributions in binary form must reproduce the above copyright notice,
10
10
  this list of conditions and the following disclaimer in the documentation
11
11
  and/or other materials provided with the distribution.
12
- * Neither the name Spree nor the names of its contributors may be used to
12
+ * Neither the name Solidus nor the names of its contributors may be used to
13
13
  endorse or promote products derived from this software without specific
14
14
  prior written permission.
15
15
 
data/README.md CHANGED
@@ -1,44 +1,89 @@
1
- Solidus Product Feed
2
- ================
1
+ # Solidus Product Feed
3
2
 
4
- [![Build Status](https://travis-ci.org/solidusio-contrib/solidus_product_feed.svg?branch=master)](https://travis-ci.org/solidusio-contrib/solidus_product_feed)
3
+ [![CircleCI](https://circleci.com/gh/solidusio-contrib/solidus_product_feed.svg?style=svg)](https://circleci.com/gh/solidusio-contrib/solidus_product_feed)
5
4
 
6
- An extension that provides an RSS feed for products. Google Shopper attributes are also implemented.
7
- An RSS link is automatically appended to the `<head>` tag in the `layouts/spree_application` file.
5
+ An extension that provides an RSS feed for products. Google Merchant Feed attributes are also
6
+ implemented. An RSS link is automatically appended to the `<head>` tag in the
7
+ `layouts/spree_application` file.
8
8
 
9
- Note on Versions
10
- ================
9
+ ## Installation
11
10
 
12
- The master branch tracks the 1.0 version of this gem, which has some major changes from it's predecessor `spree_product_feed`.
13
- The 1.0 version is cleaner, more extensible, and more correct at the expense of compatibility.
11
+ Add the gem to your `Gemfile`:
14
12
 
15
- We also have a [`~> 0.1.0` version](https://github.com/solidusio-contrib/solidus_product_feed/tree/v0.1) which is a direct port of `spree_product_feed` with minimal changes.
13
+ ```ruby
14
+ gem 'solidus_product_feed'
15
+ ````
16
16
 
17
+ Install the gem:
17
18
 
18
- Installation
19
- ===============
19
+ ```console
20
+ $ bundle install
21
+ ```
20
22
 
21
- 1) add the gem to your `Gemfile`:
23
+ You're done! You can now see your RSS feed at `/products.rss`.
22
24
 
23
- `gem 'solidus_product_feed'`
25
+ ## Usage
24
26
 
25
- 2) run bundler:
27
+ The feed ships with sensible defaults for your products, but customization is very easy.
26
28
 
27
- `bundle install`
29
+ ### Headers
28
30
 
29
- 3) BOOOM, you're done
31
+ You can easily change the feed's headers by putting the following in your Rails initializer:
30
32
 
31
- Viewing Product RSS
32
- ============
33
+ ```ruby
34
+ SolidusProductFeed.configure do |config|
35
+ config.title = 'My Awesome Store'
36
+ config.link = 'https://www.awesomestore.com'
37
+ config.description = 'Find out about new products on https://www.awesomestore.com first!'
38
+ config.language = 'en-us'
39
+ end
40
+ ```
33
41
 
34
- `http://yourdomain.tld/products.rss`
42
+ Note that you can also pass a Proc for each of these options. The Proc will be passed the view
43
+ context as its only argument, so that you can use all your helpers:
35
44
 
36
- Testing
37
- =======
45
+ ```ruby
46
+ SolidusProductFeed.configure do |config|
47
+ config.title = -> (view) { view.current_store.name }
48
+ config.link = -> (view) { "http://#{view.current_store.url}" }
49
+ config.description = -> (view) { "Find out about new products on http://#{view.current_store.url} first!" }
50
+ config.language = -> (view) { view.lang_from_store(current_store.language) }
51
+ end
52
+ ```
38
53
 
39
- Be sure to add the rspec-rails gem to your Gemfile and then create a dummy test app for the specs to run against.
54
+ ### Item schema
40
55
 
41
- $ bundle exec rake test app
42
- $ bundle exec rspec spec
56
+ If you need to alter the XML schema of a product (e.g. to add/remove a tag), you can do it by
57
+ subclassing `Spree::FeedProduct` in your app and overriding the `schema` method:
43
58
 
44
- Copyright (c) 2011 Joshua Nussbaum, released under the New BSD License
59
+ ```ruby
60
+ module AwesomeStore
61
+ class FeedProduct < Spree::FeedProduct
62
+ def schema
63
+ super.merge('g:brand' => 'Awesome Store Inc.')
64
+ end
65
+ end
66
+ end
67
+ ```
68
+
69
+ Then set your custom class in an initializer:
70
+
71
+ ```ruby
72
+ SolidusProductFeed.configure do |config|
73
+ config.feed_product_class = 'AwesomeStore::FeedProduct'
74
+ end
75
+ ```
76
+
77
+ If you want to change the value of an existing tag, you can also simply override the corresponding
78
+ tag method (`link`, `price` etc.). Check the [source code](https://github.com/solidusio-contrib/solidus_product_feed/blob/master/app/models/spree/feed_product.rb)
79
+ for more details.
80
+
81
+ ## Testing
82
+
83
+ Be sure to add the `rspec-rails` gem to your Gemfile and then create a dummy test app for the specs
84
+ to run against.
85
+
86
+ ```console
87
+ $ bundle exec rake test app
88
+ $ bundle exec rspec spec
89
+ ```