solidus_sample 4.6.2 → 4.7.0

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: 0d9125b73d36f7718ad4a3ec69c3680cf715afa5ae69f276f9c56b4aa11ec235
4
- data.tar.gz: 66b238dbc2b0e45bac1c57d0bba570532e2c4f29d1d4393e08b53bc8378250a9
3
+ metadata.gz: f13dc509c181490ad26520c33f8ecf9413c6dabe74875efcd578ae9681de5e91
4
+ data.tar.gz: 7aab34d9570eea5f6fd3af9e2d28d004a204c6c6476072740ebb8a564bd7e334
5
5
  SHA512:
6
- metadata.gz: 81d0699a4cc431b8044202df7d6626ea645af2d03cb74f122788953d4ee9db0a35b6186488a3eb082c820a542c8db38463d9fca4cb2dbf460d3b9df669da34fc
7
- data.tar.gz: 569d69033302e347d088060f11497295ef34af86e2289500dc08dc46eba0bcb39f07268355e2ac4878730f85a65b6723d5f459445dcf1167afa9524939228893
6
+ metadata.gz: 03b53a33feb894e4a5566e6181684e7680e0b2fe39d0c3965a7affcd858c4aef8db897a13735d017b751ec892bb20277fb085e2098f0cce581816665668dc2b2
7
+ data.tar.gz: aa9bd68ccad0a5e49ce30a3add7855447039d9837dbc350e90efdb21c8f7db6de2caeb818f0a39e919da23319e68bcfa4049968f50196abd38946ea15e4a2018
data/Rakefile CHANGED
@@ -1,17 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rake'
4
- require 'rake/testtask'
5
- require 'rspec/core/rake_task'
6
- require 'spree/testing_support/dummy_app/rake_tasks'
7
- require 'bundler/gem_tasks'
3
+ require "rake"
4
+ require "rake/testtask"
5
+ require "rspec/core/rake_task"
6
+ require "spree/testing_support/dummy_app/rake_tasks"
7
+ require "bundler/gem_tasks"
8
8
 
9
9
  RSpec::Core::RakeTask.new
10
10
  task default: :spec
11
11
 
12
12
  DummyApp::RakeTasks.new(
13
13
  gem_root: File.expand_path(__dir__),
14
- lib_name: 'solidus_sample'
14
+ lib_name: "solidus_sample"
15
15
  )
16
16
 
17
- task test_app: 'db:reset'
17
+ task test_app: "db:reset"
@@ -4,25 +4,25 @@ united_states = Spree::Country.find_by!(iso: "US")
4
4
  new_york = Spree::State.find_by!(name: "New York")
5
5
 
6
6
  names = ["Sterling Torp", "Jennette Vandervort", "Salome Stroman", "Lyla Lang",
7
- "Lola Zulauf", "Cheree Bruen", "Hettie Torp", "Barbie Gutmann",
8
- "Amelia Renner", "Marceline Bergstrom", "Keeley Sauer", "Mi Gaylord",
9
- "Karon Mills", "Jessika Daugherty", "Emmy Stark"]
7
+ "Lola Zulauf", "Cheree Bruen", "Hettie Torp", "Barbie Gutmann",
8
+ "Amelia Renner", "Marceline Bergstrom", "Keeley Sauer", "Mi Gaylord",
9
+ "Karon Mills", "Jessika Daugherty", "Emmy Stark"]
10
10
  street_addresses = ["7377 Jacobi Passage", "4725 Serena Ridges",
11
- "79832 Hamill Creek", "0746 Genoveva Villages",
12
- "86717 D'Amore Hollow", "8529 Delena Well",
13
- "959 Lockman Ferry", "67016 Murphy Fork",
14
- "193 Larkin Divide", "80697 Cole Parks"]
11
+ "79832 Hamill Creek", "0746 Genoveva Villages",
12
+ "86717 D'Amore Hollow", "8529 Delena Well",
13
+ "959 Lockman Ferry", "67016 Murphy Fork",
14
+ "193 Larkin Divide", "80697 Cole Parks"]
15
15
  secondary_addresses = ["Suite 918", "Suite 374", "Apt. 714", "Apt. 351",
16
- "Suite 274", "Suite 240", "Suite 892", "Apt. 176",
17
- "Apt. 986", "Apt. 583"]
16
+ "Suite 274", "Suite 240", "Suite 892", "Apt. 176",
17
+ "Apt. 986", "Apt. 583"]
18
18
  cities = ["Lake Laurenceview", "Lucilefurt", "South Jannetteport",
19
- "Leannonport", "Legrosburgh", "Willmsberg", "Karoleside",
20
- "Lake German", "Keeblerfort", "Lemkehaven"]
19
+ "Leannonport", "Legrosburgh", "Willmsberg", "Karoleside",
20
+ "Lake German", "Keeblerfort", "Lemkehaven"]
21
21
  phone_numbers = ["(392)859-7319 x670", "738-831-3210 x6047",
22
- "(441)881-8127 x030", "1-744-701-0536 x30504",
23
- "(992)432-8273 x97676", "482.249.0178 x532",
24
- "(855)317-6523", "1-529-214-7315 x90865",
25
- "(662)877-7894 x703", "689.578.8564 x72399"]
22
+ "(441)881-8127 x030", "1-744-701-0536 x30504",
23
+ "(992)432-8273 x97676", "482.249.0178 x532",
24
+ "(855)317-6523", "1-529-214-7315 x90865",
25
+ "(662)877-7894 x703", "689.578.8564 x72399"]
26
26
 
27
27
  2.times do
28
28
  Spree::Address.create!(
data/db/samples/assets.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'thor'
3
+ require "thor"
4
4
  shell = Thor::Base.shell.new
5
5
 
6
6
  Spree::Sample.load_sample("products")
@@ -94,7 +94,7 @@ images = {
94
94
  {
95
95
  attachment: image("solidus_cap_black_1")
96
96
  }
97
- ],
97
+ ]
98
98
  }
99
99
 
100
100
  products.each do |key, product|
@@ -103,7 +103,7 @@ products.each do |key, product|
103
103
  index = 1
104
104
 
105
105
  loop do
106
- image_path = image("#{key}_#{color}_#{index}", 'png')
106
+ image_path = image("#{key}_#{color}_#{index}", "png")
107
107
  break unless image_path
108
108
 
109
109
  File.open(image_path) do |f|
@@ -53,5 +53,5 @@ Spree::OptionValue.create!([
53
53
  presentation: "Red",
54
54
  position: 4,
55
55
  option_type: color
56
- },
56
+ }
57
57
  ])
data/db/samples/orders.rb CHANGED
@@ -44,6 +44,6 @@ orders.each do |order|
44
44
  order.payments.create!(payment_method:)
45
45
  order.update(store:)
46
46
 
47
- order.next! while !order.can_complete?
47
+ order.next! until order.can_complete?
48
48
  order.complete!
49
49
  end
@@ -1,17 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # create payments based on the totals since they can't be known in YAML (quantities are random)
4
- method = Spree::PaymentMethod.where(name: 'Credit Card', active: true).first
4
+ method = Spree::PaymentMethod.where(name: "Credit Card", active: true).first
5
5
 
6
6
  # This table was previously called spree_creditcards, and older migrations
7
7
  # reference it as such. Make it explicit here that this table has been renamed.
8
- Spree::CreditCard.table_name = 'spree_credit_cards'
8
+ Spree::CreditCard.table_name = "spree_credit_cards"
9
9
 
10
- creditcard = Spree::CreditCard.create(cc_type: 'visa', month: 12, year: 2.years.from_now.year, last_digits: '1111',
11
- name: 'Sean Schofield', gateway_customer_profile_id: 'BGS-1234')
10
+ creditcard = Spree::CreditCard.create(cc_type: "visa", month: 12, year: 2.years.from_now.year, last_digits: "1111",
11
+ name: "Sean Schofield", gateway_customer_profile_id: "BGS-1234")
12
12
 
13
13
  Spree::Order.all.each_with_index do |order, _index|
14
14
  order.recalculate
15
15
  payment = order.payments.create!(amount: order.total, source: creditcard.clone, payment_method: method)
16
- payment.update_columns(state: 'pending', response_code: '12345')
16
+ payment.update_columns(state: "pending", response_code: "12345")
17
17
  end
@@ -5,13 +5,13 @@ products =
5
5
  "Solidus tote" =>
6
6
  {
7
7
  "Type" => "Tote",
8
- "Size" => %{15" x 18" x 6"},
8
+ "Size" => %(15" x 18" x 6"),
9
9
  "Material" => "Canvas"
10
10
  },
11
11
  "Solidus canvas tote bag" =>
12
12
  {
13
13
  "Type" => "Tote",
14
- "Size" => %{15" x 18" x 6"},
14
+ "Size" => %(15" x 18" x 6"),
15
15
  "Material" => "Canvas"
16
16
  },
17
17
  "Solidus cap" =>
@@ -67,7 +67,7 @@ products =
67
67
  "Solidus Water Bottle" =>
68
68
  {
69
69
  "Type" => "Insulated Water Bottle",
70
- "Size" => %{4.5" tall, 3.25" dia.}
70
+ "Size" => %(4.5" tall, 3.25" dia.)
71
71
  }
72
72
  }
73
73
 
@@ -12,7 +12,7 @@ descriptions = [
12
12
  "Perferendis sed voluptatem error ipsam voluptatem esse ipsa incidunt. Doloremque quos ratione quia voluptas consequatur mollitia optio. Optio sed iure aut aliquid voluptatum facilis mollitia cum. Dignissimos in saepe consequatur et consequatur dolorem blanditiis.",
13
13
  "Necessitatibus optio quod ullam itaque quis corporis occaecati. Saepe harum voluptates consectetur rerum dolorum. Corrupti officiis reprehenderit quo excepturi cumque. Soluta eos perspiciatis aut et ea nulla amet dolores. Dolores distinctio nesciunt libero voluptas molestiae consequatur aut veritatis.",
14
14
  "Soluta sed error debitis repellendus et. Voluptates unde enim qui velit. Libero earum tenetur nulla similique temporibus quod repellendus quibusdam.",
15
- "Recusandae animi deserunt provident dignissimos ullam harum alias et. Itaque dicta maxime consectetur ut nemo non voluptatem. Voluptatem ipsum ut culpa eaque dolores.",
15
+ "Recusandae animi deserunt provident dignissimos ullam harum alias et. Itaque dicta maxime consectetur ut nemo non voluptatem. Voluptatem ipsum ut culpa eaque dolores."
16
16
  ]
17
17
 
18
18
  default_attrs = {
@@ -32,7 +32,7 @@ products = [
32
32
  weight: 0.5,
33
33
  height: 20,
34
34
  width: 10,
35
- depth: 5,
35
+ depth: 5
36
36
  },
37
37
  {
38
38
  name: "Solidus tote",
@@ -45,7 +45,7 @@ products = [
45
45
  weight: 0.5,
46
46
  height: 20,
47
47
  width: 10,
48
- depth: 5,
48
+ depth: 5
49
49
  },
50
50
  {
51
51
  name: "Solidus hoodie",
@@ -58,7 +58,7 @@ products = [
58
58
  weight: 1,
59
59
  height: 20,
60
60
  width: 10,
61
- depth: 5,
61
+ depth: 5
62
62
  },
63
63
  {
64
64
  name: "Solidus mug set",
@@ -6,11 +6,11 @@ order = Spree::Order.last
6
6
  inventory_unit = order.inventory_units.take!
7
7
  stock_location = inventory_unit.find_stock_item.stock_location
8
8
  return_reason = Spree::ReturnReason.active.take!
9
- preferred_reimbursement_type = Spree::ReimbursementType.where(name: 'Original').take!
9
+ preferred_reimbursement_type = Spree::ReimbursementType.where(name: "Original").take!
10
10
  admin_user = if defined?(Spree::Auth)
11
11
  Spree.user_class.admin.take!
12
12
  else
13
- Spree.user_class.find_or_create_by!(email: 'admin@example.com')
13
+ Spree.user_class.find_or_create_by!(email: "admin@example.com")
14
14
  end
15
15
 
16
16
  # Mark the order paid and shipped
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  begin
4
- north_america = Spree::Zone.find_by!(name: "North America")
4
+ north_america = Spree::Zone.find_by!(name: "North America")
5
5
  rescue ActiveRecord::RecordNotFound
6
6
  puts "Couldn't find 'North America' zone. Did you run `rake db:seed` first?"
7
7
  puts "That task will set up the countries, states and zones required for Spree."
@@ -10,7 +10,7 @@ end
10
10
 
11
11
  tax_category = Spree::TaxCategory.find_by!(name: "Default")
12
12
  europe_vat = Spree::Zone.find_by!(name: "EU_VAT")
13
- shipping_category = Spree::ShippingCategory.find_or_create_by!(name: 'Default')
13
+ shipping_category = Spree::ShippingCategory.find_or_create_by!(name: "Default")
14
14
 
15
15
  Spree::ShippingMethod.create!([
16
16
  {
data/db/samples/stock.rb CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Spree::Sample.load_sample("variants")
4
4
 
5
- country = Spree::Country.find_by(iso: 'US')
6
- location = Spree::StockLocation.first_or_create! name: 'default', address1: 'Example Street', city: 'City', zipcode: '12345', country:, state: country.states.first
5
+ country = Spree::Country.find_by(iso: "US")
6
+ location = Spree::StockLocation.first_or_create! name: "default", address1: "Example Street", city: "City", zipcode: "12345", country:, state: country.states.first
7
7
  location.active = true
8
8
  location.save!
9
9
 
data/db/samples/stores.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- unless Spree::Store.where(code: 'sample-store').exists?
3
+ unless Spree::Store.where(code: "sample-store").exists?
4
4
  Spree::Store.create!(
5
5
  name: "Sample Store",
6
6
  code: "sample-store",
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  taxonomies = [
4
- { name: "Categories" },
5
- { name: "Brands" }
4
+ {name: "Categories"},
5
+ {name: "Brands"}
6
6
  ]
7
7
 
8
8
  taxonomies.each do |taxonomy_attrs|
data/db/samples/taxons.rb CHANGED
@@ -28,7 +28,7 @@ end
28
28
  taxons = [
29
29
  {
30
30
  name: "Categories",
31
- taxonomy: categories,
31
+ taxonomy: categories
32
32
  },
33
33
  {
34
34
  name: "Brands",
@@ -94,7 +94,7 @@ taxons = [
94
94
  taxonomy: categories,
95
95
  parent: "Accessories",
96
96
  products: [
97
- products[:solidus_bottles],
97
+ products[:solidus_bottles]
98
98
  ]
99
99
  },
100
100
  {
@@ -105,14 +105,14 @@ taxons = [
105
105
  products[:solidus_tshirt],
106
106
  products[:solidus_dark_tee],
107
107
  products[:solidus_long_sleeve_tee]
108
- ],
108
+ ]
109
109
  },
110
110
  {
111
111
  name: "Hoodies",
112
112
  taxonomy: categories,
113
113
  parent: "Clothing",
114
114
  products: [
115
- products[:solidus_hoodie],
115
+ products[:solidus_hoodie]
116
116
  ]
117
117
  }
118
118
  ]
@@ -318,7 +318,7 @@ masters = {
318
318
  },
319
319
  solidus_cap => {
320
320
  sku: "SOL-CAP99",
321
- cost_price: 24,
321
+ cost_price: 24
322
322
  }
323
323
  }
324
324
 
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree_sample'
3
+ require "spree_sample"
data/lib/spree/sample.rb CHANGED
@@ -1,18 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'thor'
4
- require 'spree_core'
3
+ require "thor"
4
+ require "spree_core"
5
5
 
6
6
  module Spree
7
7
  module Sample
8
8
  class << self
9
9
  def load_sample(file, shell: Thor::Base.shell.new)
10
10
  # If file is exists within application it takes precendence.
11
- if File.exist?(File.join(Rails.root, 'db', 'samples', "#{file}.rb"))
12
- path = File.expand_path(File.join(Rails.root, 'db', 'samples', "#{file}.rb"))
11
+ path = if File.exist?(File.join(Rails.root, "db", "samples", "#{file}.rb"))
12
+ File.expand_path(File.join(Rails.root, "db", "samples", "#{file}.rb"))
13
13
  else
14
14
  # Otherwise we will use this gems default file.
15
- path = File.expand_path(samples_path + "#{file}.rb")
15
+ File.expand_path(samples_path + "#{file}.rb")
16
16
  end
17
17
  # Check to see if the specified file has been loaded before
18
18
  unless $LOADED_FEATURES.include?(path)
@@ -24,7 +24,7 @@ module Spree
24
24
  private
25
25
 
26
26
  def samples_path
27
- Pathname.new(File.join(File.dirname(__FILE__), '..', '..', 'db', 'samples'))
27
+ Pathname.new(File.join(File.dirname(__FILE__), "..", "..", "db", "samples"))
28
28
  end
29
29
  end
30
30
  end
data/lib/spree_sample.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spree_core'
4
- require 'spree/sample'
3
+ require "spree_core"
4
+ require "spree/sample"
5
5
 
6
6
  module SpreeSample
7
7
  class Engine < Rails::Engine
8
- engine_name 'spree_sample'
8
+ engine_name "spree_sample"
9
9
 
10
10
  # Needs to be here so we can access it inside the tests
11
11
  def self.load_samples
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'pathname'
4
- require 'spree/sample'
3
+ require "pathname"
4
+ require "spree/sample"
5
5
 
6
6
  namespace :spree_sample do
7
- desc 'Loads sample data'
7
+ desc "Loads sample data"
8
8
  task load: :environment do
9
9
  if ARGV.include?("db:migrate")
10
10
  puts <<~TEXT
@@ -1,27 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../core/lib/spree/core/version.rb'
3
+ require_relative "../core/lib/spree/core/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
- s.platform = Gem::Platform::RUBY
7
- s.name = 'solidus_sample'
8
- s.version = Spree.solidus_version
9
- s.summary = 'Sample data (including images) for use with Solidus.'
6
+ s.platform = Gem::Platform::RUBY
7
+ s.name = "solidus_sample"
8
+ s.version = Spree.solidus_version
9
+ s.summary = "Sample data (including images) for use with Solidus."
10
10
  s.description = s.summary
11
11
 
12
- s.author = 'Solidus Team'
13
- s.email = 'contact@solidus.io'
14
- s.homepage = 'http://solidus.io'
15
- s.license = 'BSD-3-Clause'
12
+ s.author = "Solidus Team"
13
+ s.email = "contact@solidus.io"
14
+ s.homepage = "http://solidus.io"
15
+ s.license = "BSD-3-Clause"
16
16
 
17
- s.metadata['rubygems_mfa_required'] = 'true'
17
+ s.metadata["rubygems_mfa_required"] = "true"
18
18
 
19
19
  s.files = `git ls-files -z`.split("\x0").reject do |f|
20
20
  f.match(%r{^(spec|script)/})
21
21
  end
22
22
 
23
- s.required_ruby_version = '>= 3.1.0'
24
- s.required_rubygems_version = '>= 1.8.23'
23
+ s.required_ruby_version = ">= 3.2.0"
24
+ s.required_rubygems_version = ">= 1.8.23"
25
25
 
26
- s.add_dependency 'solidus_core', s.version
26
+ s.add_dependency "solidus_core", s.version
27
27
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_sample
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.2
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-04-15 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: solidus_core
@@ -15,14 +16,14 @@ dependencies:
15
16
  requirements:
16
17
  - - '='
17
18
  - !ruby/object:Gem::Version
18
- version: 4.6.2
19
+ version: 4.7.0
19
20
  type: :runtime
20
21
  prerelease: false
21
22
  version_requirements: !ruby/object:Gem::Requirement
22
23
  requirements:
23
24
  - - '='
24
25
  - !ruby/object:Gem::Version
25
- version: 4.6.2
26
+ version: 4.7.0
26
27
  description: Sample data (including images) for use with Solidus.
27
28
  email: contact@solidus.io
28
29
  executables: []
@@ -86,6 +87,7 @@ licenses:
86
87
  - BSD-3-Clause
87
88
  metadata:
88
89
  rubygems_mfa_required: 'true'
90
+ post_install_message:
89
91
  rdoc_options: []
90
92
  require_paths:
91
93
  - lib
@@ -93,14 +95,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
95
  requirements:
94
96
  - - ">="
95
97
  - !ruby/object:Gem::Version
96
- version: 3.1.0
98
+ version: 3.2.0
97
99
  required_rubygems_version: !ruby/object:Gem::Requirement
98
100
  requirements:
99
101
  - - ">="
100
102
  - !ruby/object:Gem::Version
101
103
  version: 1.8.23
102
104
  requirements: []
103
- rubygems_version: 3.7.2
105
+ rubygems_version: 3.5.22
106
+ signing_key:
104
107
  specification_version: 4
105
108
  summary: Sample data (including images) for use with Solidus.
106
109
  test_files: []