-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-Authored-By: Nicolò Rebughini <[email protected]>
- Loading branch information
Showing
6 changed files
with
50 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,16 @@ | ||
require: | ||
- solidus_dev_support/rubocop | ||
|
||
AllCops: | ||
NewCops: enable | ||
|
||
RSpec/MultipleExpectations: | ||
Enabled: false | ||
|
||
Layout/LineLength: | ||
Exclude: | ||
- spec/lib/solidus_feeds/generators/google_merchant_spec.rb | ||
|
||
# Waiting for https://github.com/rubocop-hq/rubocop/pull/8874 to be merged | ||
Style/RedundantBegin: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
class SolidusFeeds::Feed | ||
attr_accessor :generator, :publisher | ||
# frozen_string_literal: true | ||
|
||
def generate(output) | ||
generator.call(output) | ||
end | ||
module SolidusFeeds | ||
class Feed | ||
attr_accessor :generator, :publisher | ||
|
||
def generate(output) | ||
generator.call(output) | ||
end | ||
|
||
def publish | ||
publisher.call do |output| | ||
generate(output) | ||
def publish | ||
publisher.call do |output| | ||
generate(output) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
module SolidusFeeds::Feeds | ||
def feeds | ||
@feeds ||= {} | ||
end | ||
# frozen_string_literal: true | ||
|
||
def register name, &block | ||
feeds[name] = block | ||
end | ||
module SolidusFeeds | ||
module Feeds | ||
def feeds | ||
@feeds ||= {} | ||
end | ||
|
||
def find(name) | ||
SolidusFeeds::Feed.new.tap { |feed| feeds[name].call(feed) } | ||
end | ||
def register(name, &block) | ||
feeds[name] = block | ||
end | ||
|
||
SolidusFeeds.extend self | ||
def find(name) | ||
SolidusFeeds::Feed.new.tap { |feed| feeds[name].call(feed) } | ||
end | ||
|
||
SolidusFeeds.extend self | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# lib/google_merchant.rb | ||
# frozen_string_literal: true | ||
|
||
require 'builder' | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters