solidus_sample 1.1.4 → 1.2.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b171bb4c83b67ac2f6b10284fdd8e733ac7911eb
4
- data.tar.gz: de13302e6faa8c61195d2ef6eda0d66c8c2edf32
3
+ metadata.gz: 52cced5af8242ea063a5d5d8de3a66595e6b0cf3
4
+ data.tar.gz: 9244ba2f5a3d7f4e3af525151a3d3a3a8053af57
5
5
  SHA512:
6
- metadata.gz: 923e9319af84fcf206bb38e25dd36a9ee1aebcaf42bfa707023c7c0f5884497d6a2f7d03606d16a378e76c6552b2ce4cc6843f90f462aabc692c7cbbfd9f4448
7
- data.tar.gz: 7022e120ca69f547018313a30057b3b66812bf2ff93fb6f9403b280743898955c5f7fd673adc884aa9699567b2fb30508944b5259ea3b19a86959b6babd7439a
6
+ metadata.gz: 00e5bfd48ffe47cad0627d344fb18844d3e86cd71ec186157778200504462052731e52dfe862541181d18b4b1088e5b3a2ecc82c0267a6d0e7e017f81fac0c1d
7
+ data.tar.gz: b4efdcda0893ee07e82874ef2b993af5a8b3e8cfab3eff847e9633243ed8635057a4a4c4b0a56afb58bfecb1fdd55955a3e77cdd94ad797491cf01a6396636d5
@@ -1,4 +1,4 @@
1
- united_states = Spree::Country.find_by_name!("United States")
1
+ united_states = Spree::Country.find_by_iso!("US")
2
2
  new_york = Spree::State.find_by_name!("New York")
3
3
 
4
4
  # Billing address
data/db/samples/assets.rb CHANGED
@@ -17,7 +17,7 @@ def image(name, type="jpeg")
17
17
  images_path = Pathname.new(File.dirname(__FILE__)) + "images"
18
18
  path = images_path + "#{name}.#{type}"
19
19
  return false if !File.exist?(path)
20
- File.open(path)
20
+ path
21
21
  end
22
22
 
23
23
  images = {
@@ -26,7 +26,7 @@ images = {
26
26
  :attachment => image("ror_tote")
27
27
  },
28
28
  {
29
- :attachment => image("ror_tote_back")
29
+ :attachment => image("ror_tote_back")
30
30
  }
31
31
  ],
32
32
  products[:ror_bag].master => [
@@ -86,17 +86,23 @@ images = {
86
86
  products[:ror_baseball_jersey].variants.each do |variant|
87
87
  color = variant.option_value("tshirt-color").downcase
88
88
  main_image = image("ror_baseball_jersey_#{color}", "png")
89
- variant.images.create!(:attachment => main_image)
89
+ File.open(main_image) do |f|
90
+ variant.images.create!(:attachment => f)
91
+ end
90
92
  back_image = image("ror_baseball_jersey_back_#{color}", "png")
91
93
  if back_image
92
- variant.images.create!(:attachment => back_image)
94
+ File.open(back_image) do |f|
95
+ variant.images.create!(:attachment => f)
96
+ end
93
97
  end
94
98
  end
95
99
 
96
100
  images.each do |variant, attachments|
97
101
  puts "Loading images for #{variant.product.name}"
98
102
  attachments.each do |attachment|
99
- variant.images.create!(attachment)
103
+ File.open(attachment[:attachment]) do |f|
104
+ variant.images.create!(attachment: f)
105
+ end
100
106
  end
101
107
  end
102
108
 
@@ -5,8 +5,8 @@ tax_category = Spree::TaxCategory.find_by_name!("Default")
5
5
  shipping_category = Spree::ShippingCategory.find_by_name!("Default")
6
6
 
7
7
  default_attrs = {
8
- :description => Faker::Lorem.paragraph,
9
- :available_on => Time.zone.now
8
+ description: Faker::Lorem.paragraph,
9
+ available_on: Time.current
10
10
  }
11
11
 
12
12
  products = [
@@ -78,12 +78,11 @@ products.each do |product_attrs|
78
78
  eur_price = product_attrs.delete(:eur_price)
79
79
  Spree::Config[:currency] = "USD"
80
80
 
81
- default_shipping_category = Spree::ShippingCategory.find_by_name!("Default")
82
81
  product = Spree::Product.create!(default_attrs.merge(product_attrs))
83
82
  Spree::Config[:currency] = "EUR"
84
83
  product.reload
85
84
  product.price = eur_price
86
- product.shipping_category = default_shipping_category
85
+ product.shipping_category = shipping_category
87
86
  product.save!
88
87
  end
89
88
 
@@ -1,10 +1,10 @@
1
1
  # encoding: UTF-8
2
- version = File.read(File.expand_path("../../SOLIDUS_VERSION", __FILE__)).strip
2
+ require_relative '../core/lib/spree/core/version.rb'
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.name = 'solidus_sample'
7
- s.version = version
7
+ s.version = Spree.solidus_version
8
8
  s.summary = 'Sample data (including images) for use with Solidus.'
9
9
  s.description = s.summary
10
10
 
@@ -18,5 +18,5 @@ Gem::Specification.new do |s|
18
18
  s.require_path = 'lib'
19
19
  s.requirements << 'none'
20
20
 
21
- s.add_dependency 'solidus_core', version
21
+ s.add_dependency 'solidus_core', s.version
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_sample
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.2.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-12 00:00:00.000000000 Z
11
+ date: 2016-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.1.4
19
+ version: 1.2.0.beta1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.1.4
26
+ version: 1.2.0.beta1
27
27
  description: Sample data (including images) for use with Solidus.
28
28
  email: contact@solidus.io
29
29
  executables: []
@@ -96,13 +96,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
96
  version: 2.1.0
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - ">="
99
+ - - ">"
100
100
  - !ruby/object:Gem::Version
101
- version: '0'
101
+ version: 1.3.1
102
102
  requirements:
103
103
  - none
104
104
  rubyforge_project:
105
- rubygems_version: 2.6.11
105
+ rubygems_version: 2.5.1
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Sample data (including images) for use with Solidus.