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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67c781fe4a3f36f4bd053578c281d5bc99e4e5960f4ea43cccede5d45ccfb149
4
- data.tar.gz: 12f93c0da0c64f95fb8489d8e5c30478148596fcd38ef2ad20b4da7b774f097e
3
+ metadata.gz: 2f64f64ba06267f668e7e26516a39522281870b5a3a595ace68ca91273e3a7ed
4
+ data.tar.gz: 45f760dbfe62ce0f49abcbb651376445682ce271792fbbb1b97e818fce2f0f47
5
5
  SHA512:
6
- metadata.gz: 63f2739a80d323367f976c9366b319b159db9feb48b7b2e233a2d2c83a98c5f31e37002b662ab5e79c9207cfae7a85e0c2c56357c127bbe51a4da3b796d60df4
7
- data.tar.gz: 8d68d1f4038ec9a1d2b721407e40e82bb6b14d2ca1a27ed7ba1883965fb14da844c12a2f88d364f35b83c307357933e5094565c6e044584f36dda9d74efbd419
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: '4.0'
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: '4.0'
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: '4.0'
103
+ ruby-version: '3.3'
104
104
  bundler-cache: true
105
105
 
106
106
  - name: Run Brakeman
@@ -3,7 +3,7 @@ plugins:
3
3
 
4
4
  AllCops:
5
5
  DisplayCopNames: true
6
- TargetRubyVersion: 3.3
6
+ TargetRubyVersion: 3.2
7
7
  Include:
8
8
  - '**/Gemfile'
9
9
  - '**/Rakefile'
@@ -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 = { github: 'spree/spree', branch: 'main' }
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 'mysql2' if ENV['DB'] == 'mysql' || ENV['CI']
15
- gem 'pg' if ENV['DB'] == 'postgres' || ENV['CI']
13
+ gem 'spree_dev_tools', '>= 0.6.0.rc1'
16
14
 
17
- gem 'sqlite3', '>= 2.0'
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
- # LICENSE
1
+ MIT License
2
2
 
3
- Copyright (c) <%= Time.now.year %> [name of plugin creator]
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
 
@@ -17,5 +17,7 @@ end
17
17
  desc 'Generates a dummy app for testing'
18
18
  task :test_app do
19
19
  ENV['LIB_NAME'] = '<%=file_name%>'
20
- Rake::Task['extension:test_app'].invoke
20
+ Rake::Task['extension:test_app'].execute(
21
+ install_admin: true
22
+ )
21
23
  end
@@ -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 = 'You'
15
- s.email = 'you@example.com'
16
- s.homepage = 'https://github.com/your-github-handle/<%= file_name %>'
17
- s.license = 'MIT'
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
- s.add_dependency 'spree', '>= <%= Gem.loaded_specs['spree_extension'].version %>'
24
- s.add_dependency 'spree_admin', '>= <%= Gem.loaded_specs['spree_extension'].version %>'
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spark Solutions Sp. z o.o.