spree_cli 5.0.3 → 5.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/spree_cli/extension.rb +7 -3
- data/lib/spree_cli/templates/extension/.circleci/config.yml +28 -0
- data/lib/spree_cli/templates/extension/.rubocop.yml +4 -4
- data/lib/spree_cli/templates/extension/app/assets/config/%file_name%_manifest.js.tt +4 -0
- data/lib/spree_cli/templates/extension/app/javascript/%file_name%/application.js.tt +16 -0
- data/lib/spree_cli/templates/extension/app/javascript/%file_name%/controllers/%file_name%_controller.js.tt +7 -0
- data/lib/spree_cli/templates/extension/app/jobs/%file_name%/base_job.rb.tt +5 -0
- data/lib/spree_cli/templates/extension/app/views/%file_name%/_head.html.erb.tt +1 -0
- data/lib/spree_cli/templates/extension/config/i18n-tasks.yml +173 -0
- data/lib/spree_cli/templates/extension/config/importmap.rb.tt +6 -0
- data/lib/spree_cli/templates/extension/config/initializers/spree.rb.tt +32 -0
- data/lib/spree_cli/templates/extension/config/locales/{en.yml → en.yml.tt} +3 -1
- data/lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt +12 -0
- data/lib/spree_cli/templates/extension/lib/%file_name%.rb.tt +6 -0
- data/lib/spree_cli/templates/extension/spec/feature/home_page_spec.rb +15 -0
- data/lib/spree_cli/templates/extension/spec/i18n_spec.rb +27 -0
- data/lib/spree_cli/templates/extension/spec/{spec_helper.rb → spec_helper.rb.tt} +12 -0
- data/lib/spree_cli/templates/extension/spec/zeitwerk_spec.rb +9 -0
- metadata +18 -10
- data/lib/spree_cli/templates/extension/app/models/.gitkeep +0 -0
- data/lib/spree_cli/templates/extension/app/serializers/.gitkeep +0 -0
- data/lib/spree_cli/templates/extension/app/services/.gitkeep +0 -0
- /data/lib/spree_cli/templates/extension/app/{controllers/.gitkeep → assets/images/.keep} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b0fd922b4fd79fb2c838eed70e54157cd58e979892c2c8fd5a36402ca265f3b
|
4
|
+
data.tar.gz: 2dd95521eaa210420e46704416c5a1cbadb153a3cef813836177a956770e5136
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 703260e5c4ff40b81b3d29aa9809fdf8dd485a14031d401b8d76332ce82b8ec062a0c2481d4c3ff2fa846bdade6ffddb0b17431f2c550df512606f1d0b40481c
|
7
|
+
data.tar.gz: 7533d4210d8c2f1d4fb3514ac7da1f6669734900a4e3e6314a44be397fd3ad6be1194dddb58f8544ad1c049a32ef160891b098e86924373048e5c6509c4f92ab
|
data/lib/spree_cli/extension.rb
CHANGED
@@ -19,14 +19,15 @@ module SpreeCli
|
|
19
19
|
directory 'bin', "#{file_name}/bin"
|
20
20
|
directory 'spec', "#{file_name}/spec"
|
21
21
|
|
22
|
-
empty_directory "#{file_name}/app/models/spree"
|
23
22
|
empty_directory "#{file_name}/app/models/#{file_name}"
|
24
23
|
empty_directory "#{file_name}/app/views/spree"
|
25
24
|
empty_directory "#{file_name}/app/views/#{file_name}"
|
26
|
-
empty_directory "#{file_name}/app/controllers/spree"
|
25
|
+
empty_directory "#{file_name}/app/controllers/spree/admin"
|
27
26
|
empty_directory "#{file_name}/app/controllers/#{file_name}"
|
28
|
-
empty_directory "#{file_name}/app/services/spree"
|
29
27
|
empty_directory "#{file_name}/app/services/#{file_name}"
|
28
|
+
empty_directory "#{file_name}/app/serializers/spree/v2/storefront"
|
29
|
+
empty_directory "#{file_name}/app/serializers/spree/api/v2/platform"
|
30
|
+
empty_directory "#{file_name}/vendor/javascript"
|
30
31
|
|
31
32
|
chmod "#{file_name}/bin/rails", 0o755
|
32
33
|
|
@@ -38,6 +39,9 @@ module SpreeCli
|
|
38
39
|
template 'README.md', "#{file_name}/README.md"
|
39
40
|
template 'config/routes.rb', "#{file_name}/config/routes.rb"
|
40
41
|
template 'config/locales/en.yml', "#{file_name}/config/locales/en.yml"
|
42
|
+
template 'config/initializers/spree.rb', "#{file_name}/config/initializers/spree.rb"
|
43
|
+
template 'config/importmap.rb', "#{file_name}/config/importmap.rb"
|
44
|
+
|
41
45
|
template 'rspec', "#{file_name}/.rspec"
|
42
46
|
template '.circleci/config.yml', "#{file_name}/.circleci/config.yml"
|
43
47
|
template '.github/.dependabot.yml', "#{file_name}/.github/.dependabot.yml"
|
@@ -102,6 +102,31 @@ jobs:
|
|
102
102
|
- image: *ruby_image
|
103
103
|
- image: &mysql_image cimg/mysql:8.0
|
104
104
|
|
105
|
+
brakeman:
|
106
|
+
<<: *defaults
|
107
|
+
steps:
|
108
|
+
- checkout
|
109
|
+
- restore_cache:
|
110
|
+
keys:
|
111
|
+
- spree-bundle-{{ .Branch }}
|
112
|
+
- spree-bundle
|
113
|
+
- run:
|
114
|
+
name: Add keyserver
|
115
|
+
command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
|
116
|
+
- run:
|
117
|
+
name: Install libvips
|
118
|
+
command: sudo apt-get update && sudo apt-get install libvips
|
119
|
+
- run:
|
120
|
+
name: Set bundle path
|
121
|
+
command: bundle config --local path vendor/bundle
|
122
|
+
- run:
|
123
|
+
name: Ensure bundle Install
|
124
|
+
command: |
|
125
|
+
bundle check || bundle install
|
126
|
+
- run:
|
127
|
+
name: Brakeman
|
128
|
+
command: bundle exec brakeman --exit-on-warn --exit-on-error
|
129
|
+
|
105
130
|
workflows:
|
106
131
|
version: 2
|
107
132
|
main:
|
@@ -113,3 +138,6 @@ workflows:
|
|
113
138
|
- tests_mysql:
|
114
139
|
requires:
|
115
140
|
- bundle
|
141
|
+
- brakeman:
|
142
|
+
requires:
|
143
|
+
- bundle
|
@@ -1,3 +1,6 @@
|
|
1
|
+
plugins:
|
2
|
+
- rubocop-rails
|
3
|
+
|
1
4
|
AllCops:
|
2
5
|
DisplayCopNames: true
|
3
6
|
TargetRubyVersion: 3.3
|
@@ -9,10 +12,7 @@ AllCops:
|
|
9
12
|
- 'spec/dummy/**/*'
|
10
13
|
- 'lib/generators/**/*'
|
11
14
|
|
12
|
-
|
13
|
-
Enabled: true
|
14
|
-
|
15
|
-
Metrics/LineLength:
|
15
|
+
Layout/LineLength:
|
16
16
|
Max: 150
|
17
17
|
|
18
18
|
# DISABLED
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import '@hotwired/turbo-rails'
|
2
|
+
import { Application } from '@hotwired/stimulus'
|
3
|
+
|
4
|
+
let application
|
5
|
+
|
6
|
+
if (typeof window.Stimulus === "undefined") {
|
7
|
+
application = Application.start()
|
8
|
+
application.debug = false
|
9
|
+
window.Stimulus = application
|
10
|
+
} else {
|
11
|
+
application = window.Stimulus
|
12
|
+
}
|
13
|
+
|
14
|
+
import <%= class_name %>Controller from '<%= file_name %>/controllers/<%= file_name %>_controller'
|
15
|
+
|
16
|
+
application.register('<%= file_name %>', <%= class_name %>Controller)
|
@@ -0,0 +1 @@
|
|
1
|
+
<%%= javascript_import_module_tag 'application-<%= file_name.gsub('_', '-') %>' %>
|
@@ -0,0 +1,173 @@
|
|
1
|
+
# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
|
2
|
+
|
3
|
+
# The "main" locale.
|
4
|
+
base_locale: en
|
5
|
+
## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
|
6
|
+
# locales: [es, fr]
|
7
|
+
## Reporting locale, default: en. Available: en, ru.
|
8
|
+
# internal_locale: en
|
9
|
+
|
10
|
+
# Read and write translations.
|
11
|
+
data:
|
12
|
+
## Translations are read from the file system. Supported format: YAML, JSON.
|
13
|
+
## Provide a custom adapter:
|
14
|
+
# adapter: I18n::Tasks::Data::FileSystem
|
15
|
+
|
16
|
+
# Locale files or `Dir.glob` patterns where translations are read from:
|
17
|
+
read:
|
18
|
+
## Default:
|
19
|
+
- config/locales/%{locale}.yml
|
20
|
+
## More files:
|
21
|
+
# - config/locales/**/*.%{locale}.yml
|
22
|
+
|
23
|
+
# Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
|
24
|
+
# `i18n-tasks normalize -p` will force move the keys according to these rules
|
25
|
+
write:
|
26
|
+
## For example, write devise and simple form keys to their respective files:
|
27
|
+
# - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
|
28
|
+
## Catch-all default:
|
29
|
+
# - config/locales/%{locale}.yml
|
30
|
+
|
31
|
+
# External locale data (e.g. gems).
|
32
|
+
# This data is not considered unused and is never written to.
|
33
|
+
external:
|
34
|
+
## Example (replace %#= with %=):
|
35
|
+
# - "<%#= %x[bundle info vagrant --path].chomp %>/templates/locales/%{locale}.yml"
|
36
|
+
- "<%= %x[bundle info spree_core --path].chomp %>/config/locales/%{locale}.yml"
|
37
|
+
- "<%= %x[bundle info spree_storefront --path].chomp %>/config/locales/%{locale}.yml"
|
38
|
+
## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
|
39
|
+
# router: conservative_router
|
40
|
+
|
41
|
+
yaml:
|
42
|
+
write:
|
43
|
+
# do not wrap lines at 80 characters
|
44
|
+
line_width: -1
|
45
|
+
|
46
|
+
## Pretty-print JSON:
|
47
|
+
# json:
|
48
|
+
# write:
|
49
|
+
# indent: ' '
|
50
|
+
# space: ' '
|
51
|
+
# object_nl: "\n"
|
52
|
+
# array_nl: "\n"
|
53
|
+
|
54
|
+
# Find translate calls
|
55
|
+
search:
|
56
|
+
## Paths or `Find.find` patterns to search in:
|
57
|
+
# paths:
|
58
|
+
# - app/
|
59
|
+
|
60
|
+
## Root directories for relative keys resolution.
|
61
|
+
# relative_roots:
|
62
|
+
# - app/controllers
|
63
|
+
# - app/helpers
|
64
|
+
# - app/mailers
|
65
|
+
# - app/presenters
|
66
|
+
# - app/views
|
67
|
+
|
68
|
+
## Directories where method names which should not be part of a relative key resolution.
|
69
|
+
# By default, if a relative translation is used inside a method, the name of the method will be considered part of the resolved key.
|
70
|
+
# Directories listed here will not consider the name of the method part of the resolved key
|
71
|
+
#
|
72
|
+
# relative_exclude_method_name_paths:
|
73
|
+
# -
|
74
|
+
|
75
|
+
## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
|
76
|
+
## *.jpg *.jpeg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less
|
77
|
+
## *.yml *.json *.zip *.tar.gz *.swf *.flv *.mp3 *.wav *.flac *.webm *.mp4 *.ogg *.opus *.webp *.map *.xlsx
|
78
|
+
exclude:
|
79
|
+
- app/assets/images
|
80
|
+
- app/assets/fonts
|
81
|
+
- app/assets/videos
|
82
|
+
- app/assets/builds
|
83
|
+
|
84
|
+
## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
|
85
|
+
## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
|
86
|
+
# only: ["*.rb", "*.html.slim"]
|
87
|
+
|
88
|
+
## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
|
89
|
+
strict: false
|
90
|
+
|
91
|
+
## Allows adding ast_matchers for finding translations using the AST-scanners
|
92
|
+
## The available matchers are:
|
93
|
+
## - RailsModelMatcher
|
94
|
+
## Matches ActiveRecord translations like
|
95
|
+
## User.human_attribute_name(:email) and User.model_name.human
|
96
|
+
## - DefaultI18nSubjectMatcher
|
97
|
+
## Matches ActionMailer's default_i18n_subject method
|
98
|
+
##
|
99
|
+
## To implement your own, please see `I18n::Tasks::Scanners::AstMatchers::BaseMatcher`.
|
100
|
+
# ast_matchers:
|
101
|
+
# - 'I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher'
|
102
|
+
# - 'I18n::Tasks::Scanners::AstMatchers::DefaultI18nSubjectMatcher'
|
103
|
+
|
104
|
+
## Multiple scanners can be used. Their results are merged.
|
105
|
+
## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
|
106
|
+
## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
|
107
|
+
|
108
|
+
## Translation Services
|
109
|
+
# translation:
|
110
|
+
# # Google Translate
|
111
|
+
# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
|
112
|
+
# google_translate_api_key: "AbC-dEf5"
|
113
|
+
# # DeepL Pro Translate
|
114
|
+
# # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
|
115
|
+
# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
|
116
|
+
# # deepl_host: "https://api.deepl.com"
|
117
|
+
# # deepl_version: "v2"
|
118
|
+
# # deepl_glossary_ids:
|
119
|
+
# # - f28106eb-0e06-489e-82c6-8215d6f95089
|
120
|
+
# # - 2c6415be-1852-4f54-9e1b-d800463496b4
|
121
|
+
# # add additional options to the DeepL.translate call: https://www.deepl.com/docs-api/translate-text/translate-text/
|
122
|
+
# deepl_options:
|
123
|
+
# formality: prefer_less
|
124
|
+
# # OpenAI
|
125
|
+
# openai_api_key: "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
126
|
+
# # openai_model: "gpt-3.5-turbo" # see https://platform.openai.com/docs/models
|
127
|
+
# # may contain `%{from}` and `%{to}`, which will be replaced by source and target locale codes, respectively (using `Kernel.format`)
|
128
|
+
# # openai_system_prompt: >-
|
129
|
+
# # You are a professional translator that translates content from the %{from} locale
|
130
|
+
# # to the %{to} locale in an i18n locale array.
|
131
|
+
# #
|
132
|
+
# # The array has a structured format and contains multiple strings. Your task is to translate
|
133
|
+
# # each of these strings and create a new array with the translated strings.
|
134
|
+
# #
|
135
|
+
# # HTML markups (enclosed in < and > characters) must not be changed under any circumstance.
|
136
|
+
# # Variables (starting with %%{ and ending with }) must not be changed under any circumstance.
|
137
|
+
# #
|
138
|
+
# # Keep in mind the context of all the strings for a more accurate translation.
|
139
|
+
|
140
|
+
## Do not consider these keys missing:
|
141
|
+
# ignore_missing:
|
142
|
+
# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
|
143
|
+
# - '{devise,simple_form}.*'
|
144
|
+
|
145
|
+
## Consider these keys used:
|
146
|
+
# ignore_unused:
|
147
|
+
|
148
|
+
## Exclude these keys from the `i18n-tasks eq-base' report:
|
149
|
+
# ignore_eq_base:
|
150
|
+
# all:
|
151
|
+
# - common.ok
|
152
|
+
# fr,es:
|
153
|
+
# - common.brand
|
154
|
+
|
155
|
+
## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report:
|
156
|
+
# ignore_inconsistent_interpolations:
|
157
|
+
# - 'activerecord.attributes.*'
|
158
|
+
|
159
|
+
## Ignore these keys completely:
|
160
|
+
# ignore:
|
161
|
+
# - kaminari.*
|
162
|
+
|
163
|
+
## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
|
164
|
+
## e.g. in case of a relative key defined in a helper method.
|
165
|
+
## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:
|
166
|
+
#
|
167
|
+
# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
|
168
|
+
# only: %w(*.html.haml *.html.slim),
|
169
|
+
# patterns: [['= title\b', '.page_title']] %>
|
170
|
+
#
|
171
|
+
# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:
|
172
|
+
#
|
173
|
+
<% I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
pin 'application-<%= file_name.tr("_","-") %>', to: '<%= file_name %>/application.js', preload: false
|
2
|
+
|
3
|
+
pin_all_from <%= class_name %>::Engine.root.join('app/javascript/<%= file_name %>/controllers'),
|
4
|
+
under: '<%= file_name %>/controllers',
|
5
|
+
to: '<%= file_name %>/controllers',
|
6
|
+
preload: 'application-<%= file_name.tr("_","-") %>'
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Uncomment lines below to add your own custom business logic
|
2
|
+
# such as promotions, shipping methods, etc.
|
3
|
+
Rails.application.config.after_initialize do
|
4
|
+
# Rails.application.config.spree.shipping_methods << Spree::ShippingMethods::SuperExpensiveNotVeryFastShipping
|
5
|
+
# Rails.application.config.spree.payment_methods << Spree::PaymentMethods::VerySafeAndReliablePaymentMethod
|
6
|
+
|
7
|
+
# Rails.application.config.spree.calculators.tax_rates << Spree::TaxRates::FinanceTeamForcedMeToCodeThis
|
8
|
+
|
9
|
+
# Rails.application.config.spree.stock_splitters << Spree::Stock::Splitters::SecretLogicSplitter
|
10
|
+
|
11
|
+
# Rails.application.config.spree.adjusters << Spree::Adjustable::Adjuster::TaxTheRich
|
12
|
+
|
13
|
+
# Custom promotions
|
14
|
+
# Rails.application.config.spree.calculators.promotion_actions_create_adjustments << Spree::Calculators::PromotionActions::CreateAdjustments::AddDiscountForFriends
|
15
|
+
# Rails.application.config.spree.calculators.promotion_actions_create_item_adjustments << Spree::Calculators::PromotionActions::CreateItemAdjustments::FinanceTeamForcedMeToCodeThis
|
16
|
+
# Rails.application.config.spree.promotions.rules << Spree::Promotions::Rules::OnlyForVIPCustomers
|
17
|
+
# Rails.application.config.spree.promotions.actions << Spree::Promotions::Actions::GiftWithPurchase
|
18
|
+
|
19
|
+
# Rails.application.config.spree.taxon_rules << Spree::TaxonRules::ProductsWithColor
|
20
|
+
|
21
|
+
# Rails.application.config.spree.exports << Spree::Exports::Payments
|
22
|
+
# Rails.application.config.spree.reports << Spree::Reports::MassivelyOvercomplexReportForCfo
|
23
|
+
|
24
|
+
# Themes and page builder
|
25
|
+
# Rails.application.config.spree.themes << Spree::Themes::NewShinyTheme
|
26
|
+
# Rails.application.config.spree.theme_layout_sections << Spree::PageSections::SuperImportantCeoBio
|
27
|
+
# Rails.application.config.spree.page_sections << Spree::PageSections::ContactFormToGetInTouch
|
28
|
+
# Rails.application.config.spree.page_blocks << Spree::PageBlocks::BigRedButtonToCallSales
|
29
|
+
|
30
|
+
# Storefront partials
|
31
|
+
Rails.application.config.spree_storefront.head_partials << '<%= file_name %>/head'
|
32
|
+
end
|
@@ -13,6 +13,18 @@ module <%= class_name %>
|
|
13
13
|
<%= class_name %>::Config = <%= class_name %>::Configuration.new
|
14
14
|
end
|
15
15
|
|
16
|
+
initializer '<%= file_name %>.assets' do |app|
|
17
|
+
app.config.assets.paths << root.join('app/javascript')
|
18
|
+
app.config.assets.paths << root.join('vendor/javascript')
|
19
|
+
app.config.assets.precompile += %w[<%= file_name %>_manifest]
|
20
|
+
end
|
21
|
+
|
22
|
+
initializer '<%= file_name %>.importmap', before: 'importmap' do |app|
|
23
|
+
app.config.importmap.paths << root.join('config/importmap.rb')
|
24
|
+
# https://github.com/rails/importmap-rails?tab=readme-ov-file#sweeping-the-cache-in-development-and-test
|
25
|
+
app.config.importmap.cache_sweepers << root.join('app/javascript')
|
26
|
+
end
|
27
|
+
|
16
28
|
def self.activate
|
17
29
|
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
|
18
30
|
Rails.configuration.cache_classes ? require(c) : load(c)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe 'Home Page', type: :feature, js: true do
|
4
|
+
let(:store) { Spree::Store.default }
|
5
|
+
|
6
|
+
describe 'visiting the home page' do
|
7
|
+
before do
|
8
|
+
visit '/'
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'loads successfully' do
|
12
|
+
expect(page).to have_content(store.name)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'i18n/tasks'
|
3
|
+
|
4
|
+
RSpec.describe I18n do
|
5
|
+
let(:i18n) { I18n::Tasks::BaseTask.new }
|
6
|
+
let(:missing_keys) { i18n.missing_keys }
|
7
|
+
let(:inconsistent_interpolations) { i18n.inconsistent_interpolations }
|
8
|
+
|
9
|
+
it 'does not have missing keys' do
|
10
|
+
expect(missing_keys).to be_empty,
|
11
|
+
"Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them"
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'files are normalized' do
|
15
|
+
non_normalized = i18n.non_normalized_paths
|
16
|
+
error_message = "The following files need to be normalized:\n" \
|
17
|
+
"#{non_normalized.map { |path| " #{path}" }.join("\n")}\n" \
|
18
|
+
"Please run `i18n-tasks normalize' to fix"
|
19
|
+
expect(non_normalized).to be_empty, error_message
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'does not have inconsistent interpolations' do
|
23
|
+
error_message = "#{inconsistent_interpolations.leaves.count} i18n keys have inconsistent interpolations.\n" \
|
24
|
+
"Run `i18n-tasks check-consistent-interpolations' to show them"
|
25
|
+
expect(inconsistent_interpolations).to be_empty, error_message
|
26
|
+
end
|
27
|
+
end
|
@@ -1,10 +1,22 @@
|
|
1
1
|
# Configure Rails Environment
|
2
2
|
ENV['RAILS_ENV'] = 'test'
|
3
3
|
|
4
|
+
require 'dotenv/load'
|
5
|
+
|
4
6
|
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
5
7
|
|
6
8
|
require 'spree_dev_tools/rspec/spec_helper'
|
9
|
+
require '<%= file_name %>/factories'
|
7
10
|
|
8
11
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
9
12
|
# in spec/support/ and its subdirectories.
|
10
13
|
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].sort.each { |f| require f }
|
14
|
+
|
15
|
+
def json_response
|
16
|
+
case body = JSON.parse(response.body)
|
17
|
+
when Hash
|
18
|
+
body.with_indifferent_access
|
19
|
+
when Array
|
20
|
+
body
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Mar
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-
|
13
|
+
date: 2025-06-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|
@@ -52,12 +52,17 @@ files:
|
|
52
52
|
- lib/spree_cli/templates/extension/README.md
|
53
53
|
- lib/spree_cli/templates/extension/Rakefile
|
54
54
|
- lib/spree_cli/templates/extension/app/.gitkeep
|
55
|
-
- lib/spree_cli/templates/extension/app/
|
56
|
-
- lib/spree_cli/templates/extension/app/
|
57
|
-
- lib/spree_cli/templates/extension/app/
|
58
|
-
- lib/spree_cli/templates/extension/app/
|
55
|
+
- lib/spree_cli/templates/extension/app/assets/config/%file_name%_manifest.js.tt
|
56
|
+
- lib/spree_cli/templates/extension/app/assets/images/.keep
|
57
|
+
- lib/spree_cli/templates/extension/app/javascript/%file_name%/application.js.tt
|
58
|
+
- lib/spree_cli/templates/extension/app/javascript/%file_name%/controllers/%file_name%_controller.js.tt
|
59
|
+
- lib/spree_cli/templates/extension/app/jobs/%file_name%/base_job.rb.tt
|
60
|
+
- lib/spree_cli/templates/extension/app/views/%file_name%/_head.html.erb.tt
|
59
61
|
- lib/spree_cli/templates/extension/bin/rails.tt
|
60
|
-
- lib/spree_cli/templates/extension/config/
|
62
|
+
- lib/spree_cli/templates/extension/config/i18n-tasks.yml
|
63
|
+
- lib/spree_cli/templates/extension/config/importmap.rb.tt
|
64
|
+
- lib/spree_cli/templates/extension/config/initializers/spree.rb.tt
|
65
|
+
- lib/spree_cli/templates/extension/config/locales/en.yml.tt
|
61
66
|
- lib/spree_cli/templates/extension/config/routes.rb
|
62
67
|
- lib/spree_cli/templates/extension/extension.gemspec
|
63
68
|
- lib/spree_cli/templates/extension/gitignore
|
@@ -69,16 +74,19 @@ files:
|
|
69
74
|
- lib/spree_cli/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
|
70
75
|
- lib/spree_cli/templates/extension/rspec
|
71
76
|
- lib/spree_cli/templates/extension/spec/.rubocop.yml
|
72
|
-
- lib/spree_cli/templates/extension/spec/
|
77
|
+
- lib/spree_cli/templates/extension/spec/feature/home_page_spec.rb
|
78
|
+
- lib/spree_cli/templates/extension/spec/i18n_spec.rb
|
79
|
+
- lib/spree_cli/templates/extension/spec/spec_helper.rb.tt
|
80
|
+
- lib/spree_cli/templates/extension/spec/zeitwerk_spec.rb
|
73
81
|
homepage: https://spreecommerce.org
|
74
82
|
licenses:
|
75
83
|
- AGPL-3.0-or-later
|
76
84
|
- BSD-3-Clause
|
77
85
|
metadata:
|
78
86
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
79
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.0.
|
87
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.0.5
|
80
88
|
documentation_uri: https://docs.spreecommerce.org/
|
81
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.0.
|
89
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.0.5
|
82
90
|
post_install_message:
|
83
91
|
rdoc_options: []
|
84
92
|
require_paths:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|