spree_extension 1.0.0 → 1.0.1
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_extension/extension.rb +8 -0
- data/lib/spree_extension/templates/extension/.github/workflows/tests.yml +3 -3
- data/lib/spree_extension/templates/extension/.rubocop.yml +1 -1
- data/lib/spree_extension/templates/extension/Gemfile +13 -9
- data/lib/spree_extension/templates/extension/LICENSE.md +2 -2
- data/lib/spree_extension/templates/extension/Rakefile +3 -1
- data/lib/spree_extension/templates/extension/extension.gemspec +8 -6
- data/lib/spree_extension/templates/extension/lib/%file_name%/engine.rb.tt +0 -9
- data/lib/spree_extension/templates/extension/spec/spec_helper.rb.tt +0 -9
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f64f64ba06267f668e7e26516a39522281870b5a3a595ace68ca91273e3a7ed
|
|
4
|
+
data.tar.gz: 45f760dbfe62ce0f49abcbb651376445682ce271792fbbb1b97e818fce2f0f47
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 49e31671d307b78e8260f7dee751acc7c1147aba5a06bd8612d037c0be0bf4a2654ba94b320db02a1ea0b8813d93a5f626c17269349114f8c2a628524b791041
|
|
7
|
+
data.tar.gz: 452b5627b571bce6699a618ce3742a17853a03695e1ddd43d32ac5bd2f1ba1e3647ca8ce509017b0b2ea99b6cdbf2fefabfff2ae5c1056fcaa7c96e3a96598ce
|
|
@@ -75,6 +75,14 @@ module SpreeExtension
|
|
|
75
75
|
def use_prefix(prefix)
|
|
76
76
|
@file_name = prefix + Thor::Util.snake_case(file_name) unless file_name =~ /^#{prefix}/
|
|
77
77
|
end
|
|
78
|
+
|
|
79
|
+
def author_name
|
|
80
|
+
@author_name ||= `git config user.name`.strip.presence || 'TODO: Write your name'
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def author_email
|
|
84
|
+
@author_email ||= `git config user.email`.strip.presence || 'TODO: Write your email address'
|
|
85
|
+
end
|
|
78
86
|
end
|
|
79
87
|
end
|
|
80
88
|
end
|
|
@@ -41,7 +41,7 @@ jobs:
|
|
|
41
41
|
|
|
42
42
|
- uses: ruby/setup-ruby@v1
|
|
43
43
|
with:
|
|
44
|
-
ruby-version: '
|
|
44
|
+
ruby-version: '3.3'
|
|
45
45
|
bundler-cache: true
|
|
46
46
|
|
|
47
47
|
- name: Install libvips
|
|
@@ -80,7 +80,7 @@ jobs:
|
|
|
80
80
|
|
|
81
81
|
- uses: ruby/setup-ruby@v1
|
|
82
82
|
with:
|
|
83
|
-
ruby-version: '
|
|
83
|
+
ruby-version: '3.3'
|
|
84
84
|
bundler-cache: true
|
|
85
85
|
|
|
86
86
|
- name: Install libvips
|
|
@@ -100,7 +100,7 @@ jobs:
|
|
|
100
100
|
|
|
101
101
|
- uses: ruby/setup-ruby@v1
|
|
102
102
|
with:
|
|
103
|
-
ruby-version: '
|
|
103
|
+
ruby-version: '3.3'
|
|
104
104
|
bundler-cache: true
|
|
105
105
|
|
|
106
106
|
- name: Run Brakeman
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
|
-
git_source(:github) do |repo_name|
|
|
4
|
-
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
|
|
5
|
-
"https://github.com/#{repo_name}.git"
|
|
6
|
-
end
|
|
7
|
-
|
|
8
3
|
gem 'rails-controller-testing'
|
|
9
4
|
|
|
10
|
-
spree_opts =
|
|
5
|
+
spree_opts = if ENV['SPREE_PATH']
|
|
6
|
+
{ 'path': ENV['SPREE_PATH'] }
|
|
7
|
+
else
|
|
8
|
+
{ 'github': 'spree/spree', 'branch': 'main', 'glob': 'spree/**/*.gemspec' }
|
|
9
|
+
end
|
|
11
10
|
gem 'spree', spree_opts
|
|
12
11
|
gem 'spree_admin', spree_opts
|
|
13
12
|
|
|
14
|
-
gem '
|
|
15
|
-
gem 'pg' if ENV['DB'] == 'postgres' || ENV['CI']
|
|
13
|
+
gem 'spree_dev_tools', '>= 0.6.0.rc1'
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
if ENV['DB'] == 'mysql'
|
|
16
|
+
gem 'mysql2'
|
|
17
|
+
elsif ENV['DB'] == 'postgres'
|
|
18
|
+
gem 'pg'
|
|
19
|
+
else
|
|
20
|
+
gem 'sqlite3'
|
|
21
|
+
end
|
|
18
22
|
|
|
19
23
|
gem 'propshaft'
|
|
20
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) <%= Time.now.year %>
|
|
3
|
+
Copyright (c) <%= Time.now.year %> <%= author_name %>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
|
@@ -11,16 +11,18 @@ Gem::Specification.new do |s|
|
|
|
11
11
|
s.summary = "Spree Commerce <%= human_name %> Extension"
|
|
12
12
|
s.required_ruby_version = '>= 3.2'
|
|
13
13
|
|
|
14
|
-
s.author = '
|
|
15
|
-
s.email = '
|
|
16
|
-
s.homepage = 'https://github.com
|
|
17
|
-
s.license
|
|
14
|
+
s.author = '<%= author_name %>'
|
|
15
|
+
s.email = '<%= author_email %>'
|
|
16
|
+
s.homepage = 'https://github.com/<%= file_name %>'
|
|
17
|
+
s.license = 'MIT'
|
|
18
18
|
|
|
19
19
|
s.files = Dir["{app,config,db,lib,vendor}/**/*", "LICENSE.md", "Rakefile", "README.md"].reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
|
|
20
20
|
s.require_path = 'lib'
|
|
21
21
|
s.requirements << 'none'
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
s.add_dependency '
|
|
23
|
+
spree_version = '>= 5.4.0.beta'
|
|
24
|
+
s.add_dependency 'spree', spree_version
|
|
25
|
+
s.add_dependency 'spree_admin', spree_version
|
|
26
|
+
|
|
25
27
|
s.add_development_dependency 'spree_dev_tools'
|
|
26
28
|
end
|
|
@@ -4,7 +4,6 @@ module <%= class_name %>
|
|
|
4
4
|
isolate_namespace Spree
|
|
5
5
|
engine_name '<%= file_name %>'
|
|
6
6
|
|
|
7
|
-
# use rspec for tests
|
|
8
7
|
config.generators do |g|
|
|
9
8
|
g.test_framework :rspec
|
|
10
9
|
end
|
|
@@ -27,13 +26,5 @@ module <%= class_name %>
|
|
|
27
26
|
app.config.importmap.cache_sweepers << root.join('app/javascript')
|
|
28
27
|
end
|
|
29
28
|
end
|
|
30
|
-
|
|
31
|
-
def self.activate
|
|
32
|
-
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
|
|
33
|
-
Rails.configuration.cache_classes ? require(c) : load(c)
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
config.to_prepare(&method(:activate).to_proc)
|
|
38
29
|
end
|
|
39
30
|
end
|
|
@@ -11,12 +11,3 @@ require '<%= file_name %>/factories'
|
|
|
11
11
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
|
12
12
|
# in spec/support/ and its subdirectories.
|
|
13
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
|