solidify 0.0.1.alpha
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 +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.rubocop.yml +40 -0
- data/.travis.yml +10 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +3 -0
- data/Guardfile +51 -0
- data/LICENSE.txt +21 -0
- data/README.md +75 -0
- data/Rakefile +42 -0
- data/app/controllers/concerns/solidify/liquid.rb +26 -0
- data/app/controllers/solidify/addresses_controller.rb +15 -0
- data/app/controllers/solidify/carts_controller.rb +15 -0
- data/app/controllers/solidify/collections_controller.rb +26 -0
- data/app/controllers/solidify/customers_controller.rb +16 -0
- data/app/controllers/solidify/home_controller.rb +15 -0
- data/app/controllers/solidify/liquid_controller.rb +25 -0
- data/app/controllers/solidify/orders_controller.rb +19 -0
- data/app/controllers/solidify/pages_controller.rb +22 -0
- data/app/controllers/solidify/products_controller.rb +34 -0
- data/app/controllers/solidify/registrations_controller.rb +25 -0
- data/app/controllers/solidify/responders/solidify/liquid_responder.rb +29 -0
- data/app/controllers/solidify/search_controller.rb +41 -0
- data/app/controllers/solidify/sessions_controller.rb +15 -0
- data/app/drops/rails_settings/scoped_settings_drop.rb +11 -0
- data/app/drops/solidify/errors_drop.rb +14 -0
- data/app/drops/solidify/link_drop.rb +15 -0
- data/app/drops/solidify/link_list_drop.rb +7 -0
- data/app/drops/solidify/nil_drop.rb +7 -0
- data/app/drops/solidify/page_drop.rb +7 -0
- data/app/drops/solidify/search_drop.rb +7 -0
- data/app/drops/spree/address_drop.rb +28 -0
- data/app/drops/spree/image_drop.rb +32 -0
- data/app/drops/spree/line_item_drop.rb +98 -0
- data/app/drops/spree/option_type_drop.rb +4 -0
- data/app/drops/spree/order_drop.rb +64 -0
- data/app/drops/spree/product_drop.rb +97 -0
- data/app/drops/spree/taxon_drop.rb +53 -0
- data/app/drops/spree/user_drop.rb +54 -0
- data/app/drops/spree/variant_drop.rb +111 -0
- data/app/fields/spree/address_fields.rb +18 -0
- data/app/fields/spree/image_fields.rb +12 -0
- data/app/fields/spree/line_item_fields.rb +21 -0
- data/app/fields/spree/order_fields.rb +22 -0
- data/app/fields/spree/product_fields.rb +22 -0
- data/app/fields/spree/taxon_fields.rb +18 -0
- data/app/fields/spree/user_fields.rb +14 -0
- data/app/fields/spree/variant_fields.rb +19 -0
- data/app/filters/solidify/additional_filters.rb +22 -0
- data/app/filters/solidify/html_filters.rb +16 -0
- data/app/filters/solidify/money_filters.rb +39 -0
- data/app/filters/solidify/string_filters.rb +47 -0
- data/app/filters/solidify/url_filters.rb +59 -0
- data/app/helpers/solidify/liquid_helper.rb +111 -0
- data/app/helpers/solidify/shop_helper.rb +7 -0
- data/app/models/concerns/solidify/address.rb +15 -0
- data/app/models/concerns/solidify/full_name.rb +11 -0
- data/app/models/concerns/solidify/handle.rb +25 -0
- data/app/models/concerns/solidify/inventory_policy.rb +7 -0
- data/app/models/concerns/solidify/validation_cancel.rb +33 -0
- data/app/models/concerns/spree/order_state.rb +19 -0
- data/app/models/solidify/asset.rb +12 -0
- data/app/models/solidify/link.rb +10 -0
- data/app/models/solidify/link_list.rb +7 -0
- data/app/models/solidify/page.rb +5 -0
- data/app/models/solidify/setting.rb +8 -0
- data/app/models/solidify/theme.rb +19 -0
- data/app/models/spree/address_decorator.rb +13 -0
- data/app/models/spree/image_decorator.rb +7 -0
- data/app/models/spree/line_item_decorator.rb +7 -0
- data/app/models/spree/order_decorator.rb +10 -0
- data/app/models/spree/product_decorator.rb +8 -0
- data/app/models/spree/taxon_decorator.rb +20 -0
- data/app/models/spree/user_decorator.rb +9 -0
- data/app/models/spree/variant_decorator.rb +11 -0
- data/app/poro/solidify/search.rb +14 -0
- data/app/services/solidify/app_specific_string_io.rb +15 -0
- data/app/services/solidify/asset_compiler.rb +11 -0
- data/app/services/solidify/asset_postprocessor.rb +53 -0
- data/app/services/solidify/collections_all_builder.rb +12 -0
- data/app/services/solidify/link_list_seeder.rb +26 -0
- data/app/services/solidify/liquid_asset_compiler.rb +19 -0
- data/app/services/solidify/scss_asset_compiler.rb +15 -0
- data/app/services/solidify/shop_settings_seeder.rb +26 -0
- data/app/services/solidify/theme_mechanic.rb +30 -0
- data/app/uploaders/solidify/asset_uploader.rb +10 -0
- data/app/views/solidify/global/content_for_header.html.erb +0 -0
- data/app/views/solidify/themes/skeleton-theme/README.md +54 -0
- data/app/views/solidify/themes/skeleton-theme/assets/arrow-down.svg.liquid +3 -0
- data/app/views/solidify/themes/skeleton-theme/assets/cart.svg.liquid +4 -0
- data/app/views/solidify/themes/skeleton-theme/assets/shop.js.liquid +75 -0
- data/app/views/solidify/themes/skeleton-theme/assets/shopify_common.js +14 -0
- data/app/views/solidify/themes/skeleton-theme/assets/style.scss.liquid +768 -0
- data/app/views/solidify/themes/skeleton-theme/config/settings.html +217 -0
- data/app/views/solidify/themes/skeleton-theme/config/settings_data.json +26 -0
- data/app/views/solidify/themes/skeleton-theme/layout/theme.liquid +181 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/article-grid-item.liquid +73 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/collection-grid-item.liquid +46 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/collection-listing.liquid +46 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/open-graph-tags.liquid +35 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/product-grid-item.liquid +70 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/site-nav.liquid +57 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/social-links.liquid +42 -0
- data/app/views/solidify/themes/skeleton-theme/snippets/twitter-card.liquid +41 -0
- data/app/views/solidify/themes/skeleton-theme/templates/404.liquid +2 -0
- data/app/views/solidify/themes/skeleton-theme/templates/article.liquid +160 -0
- data/app/views/solidify/themes/skeleton-theme/templates/blog.grid.liquid +30 -0
- data/app/views/solidify/themes/skeleton-theme/templates/blog.liquid +92 -0
- data/app/views/solidify/themes/skeleton-theme/templates/cart.liquid +123 -0
- data/app/views/solidify/themes/skeleton-theme/templates/collection.liquid +102 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/account.liquid +57 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/activate_account.liquid +26 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/addresses.liquid +173 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/login.liquid +90 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/order.liquid +103 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/register.liquid +32 -0
- data/app/views/solidify/themes/skeleton-theme/templates/customers/reset_password.liquid +27 -0
- data/app/views/solidify/themes/skeleton-theme/templates/index.liquid +39 -0
- data/app/views/solidify/themes/skeleton-theme/templates/list-collections.liquid +19 -0
- data/app/views/solidify/themes/skeleton-theme/templates/page.liquid +16 -0
- data/app/views/solidify/themes/skeleton-theme/templates/product.liquid +202 -0
- data/app/views/solidify/themes/skeleton-theme/templates/search.liquid +72 -0
- data/bin/rails +12 -0
- data/config/app.yml +0 -0
- data/config/initializers/carrierwave.rb +25 -0
- data/config/initializers/devise.rb +286 -0
- data/config/initializers/form_tag.rb +43 -0
- data/config/initializers/liquid.rb +213 -0
- data/config/initializers/sass.rb +15 -0
- data/config/initializers/spree.rb +7 -0
- data/config/initializers/theme_settings.rb +29 -0
- data/config/routes.rb +52 -0
- data/config/spring.rb +2 -0
- data/db/migrate/20170223064316_create_solidify_assets.solidify.rb +14 -0
- data/db/migrate/20170223064317_create_solidify_themes.solidify.rb +10 -0
- data/db/migrate/20170223064318_create_solidify_link_lists.solidify.rb +12 -0
- data/db/migrate/20170223064319_create_solidify_links.solidify.rb +13 -0
- data/db/migrate/20170223064320_create_solidify_settings.solidify.rb +22 -0
- data/db/migrate/20170223064321_create_solidify_pages.solidify.rb +16 -0
- data/db/migrate/20170223064322_add_attributes_to_spree_users.solidify.rb +7 -0
- data/db/migrate/20170223064323_add_handle_to_spree_taxons.solidify.rb +7 -0
- data/db/migrate/20170228115149_add_state_and_country_fields_to_spree_addresses.solidify.rb +7 -0
- data/lib/generators/solidify/install/install_generator.rb +23 -0
- data/lib/solidify.rb +11 -0
- data/lib/solidify/configuration.rb +21 -0
- data/lib/solidify/engine.rb +24 -0
- data/lib/solidify/testing_support/factories.rb +5 -0
- data/lib/solidify/testing_support/factories/assets.rb +75 -0
- data/lib/solidify/testing_support/factories/solidify_pages.rb +10 -0
- data/lib/solidify/testing_support/factories/spree_addresses.rb +9 -0
- data/lib/solidify/testing_support/factories/spree_line_items.rb +10 -0
- data/lib/solidify/testing_support/factories/spree_orders.rb +9 -0
- data/lib/solidify/testing_support/factories/spree_products.rb +8 -0
- data/lib/solidify/testing_support/factories/spree_taxons.rb +7 -0
- data/lib/solidify/testing_support/factories/spree_variants.rb +7 -0
- data/lib/solidify/testing_support/factories/themes.rb +7 -0
- data/lib/solidify/version.rb +3 -0
- data/lib/tasks/download_theme.rake +18 -0
- data/lib/tasks/seed_default_theme.rake +8 -0
- data/lib/tasks/seed_everything.rake +12 -0
- data/lib/tasks/seed_link_list.rake +8 -0
- data/lib/tasks/seed_shop_settings.rake +8 -0
- data/solidify.gemspec +61 -0
- metadata +668 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 5d31725c68cd0a010a576ed9b11c5d131c844276
|
|
4
|
+
data.tar.gz: 91a1b12282e26c409889ee29430a4972d73aa3f8
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 8f88be72ab00dc21517c024172433549bb15e2ec9a5d07d76148dda71c2325a8c718201ba70239d87f532b445a71298c21789de781b1d06b1c79a08ac3f493fc
|
|
7
|
+
data.tar.gz: 1bfdcf0408cb98e0001168b3d58e8616cdc77084c188a71e3e8fdac5ef9e4a59b52957fda8eb29452ac3379947e551f3893f4892a71b75cc9242161b270c593a
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
DisplayCopNames: true
|
|
3
|
+
Exclude:
|
|
4
|
+
- 'bin/*'
|
|
5
|
+
- 'db/schema.rb'
|
|
6
|
+
- 'vendor/bundle/**/*'
|
|
7
|
+
- 'spec/dummy/**/*'
|
|
8
|
+
Include:
|
|
9
|
+
- 'lib/tasks/**/*'
|
|
10
|
+
- '**/Gemfile'
|
|
11
|
+
- '**/Rakefile'
|
|
12
|
+
- '**/Guardfile'
|
|
13
|
+
TargetRubyVersion: 2.3
|
|
14
|
+
Documentation:
|
|
15
|
+
Enabled: false
|
|
16
|
+
Metrics/AbcSize:
|
|
17
|
+
Exclude:
|
|
18
|
+
- 'db/migrate/**'
|
|
19
|
+
Metrics/BlockLength:
|
|
20
|
+
Exclude:
|
|
21
|
+
- config/environments/production.rb
|
|
22
|
+
- '**/*_spec.rb'
|
|
23
|
+
- 'spec/shared_examples/**'
|
|
24
|
+
Metrics/MethodLength:
|
|
25
|
+
Exclude:
|
|
26
|
+
- 'db/migrate/**'
|
|
27
|
+
Metrics/ModuleLength:
|
|
28
|
+
Exclude:
|
|
29
|
+
- '**/*_spec.rb'
|
|
30
|
+
- 'spec/shared_examples/**'
|
|
31
|
+
Lint/Debugger:
|
|
32
|
+
Enabled: false
|
|
33
|
+
Lint/DefEndAlignment:
|
|
34
|
+
AutoCorrect: true
|
|
35
|
+
Lint/EndAlignment:
|
|
36
|
+
AutoCorrect: true
|
|
37
|
+
Rails:
|
|
38
|
+
Enabled: true
|
|
39
|
+
Style/FrozenStringLiteralComment:
|
|
40
|
+
Enabled: false
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
* Using welcoming and inclusive language
|
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
|
19
|
+
* Gracefully accepting constructive criticism
|
|
20
|
+
* Focusing on what is best for the community
|
|
21
|
+
* Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
* Public or private harassment
|
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
+
reported by contacting the project team at viktor.fonic@gmail.com. All
|
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
|
63
|
+
|
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
+
members of the project's leadership.
|
|
67
|
+
|
|
68
|
+
## Attribution
|
|
69
|
+
|
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
|
72
|
+
|
|
73
|
+
[homepage]: http://contributor-covenant.org
|
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Guardfile
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
guard :bundler do
|
|
2
|
+
require 'guard/bundler'
|
|
3
|
+
require 'guard/bundler/verify'
|
|
4
|
+
helper = Guard::Bundler::Verify.new
|
|
5
|
+
|
|
6
|
+
files = ['Gemfile']
|
|
7
|
+
files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
|
|
8
|
+
|
|
9
|
+
# Assume files are symlinked from somewhere
|
|
10
|
+
files.each { |file| watch(helper.real_path(file)) }
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
guard :rubocop, all_on_start: false, cli: '-aDERS' do
|
|
14
|
+
watch(/.+\.rb$/)
|
|
15
|
+
watch(/.+\.rake$/)
|
|
16
|
+
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
guard :rspec, cmd: 'spring rspec', failed_mode: :keep do
|
|
20
|
+
require 'guard/rspec/dsl'
|
|
21
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
|
22
|
+
|
|
23
|
+
# RSpec files
|
|
24
|
+
rspec = dsl.rspec
|
|
25
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
|
26
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
|
27
|
+
watch(rspec.spec_files)
|
|
28
|
+
|
|
29
|
+
# Ruby files
|
|
30
|
+
ruby = dsl.ruby
|
|
31
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
|
32
|
+
|
|
33
|
+
# watch /app files
|
|
34
|
+
watch(%r{^app/(.+)/solidify/(.+).rb$}) do |m|
|
|
35
|
+
"spec/#{m[1]}/solidify/#{m[2]}_spec.rb"
|
|
36
|
+
end
|
|
37
|
+
watch(%r{^app/(.+)/spree/(.+).rb$}) do |m|
|
|
38
|
+
"spec/#{m[1]}/spree/#{m[2]}_spec.rb"
|
|
39
|
+
end
|
|
40
|
+
watch(%r{^app/(.+)/spree/(.+)_decorator.rb$}) do |m|
|
|
41
|
+
"spec/#{m[1]}/spree/#{m[2]}_spec.rb"
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
guard 'spring', bundler: true do
|
|
46
|
+
watch('Gemfile.lock')
|
|
47
|
+
watch(%r{^config/})
|
|
48
|
+
watch(%r{^lib/})
|
|
49
|
+
watch(%r{^spec/(support|factories)/})
|
|
50
|
+
watch(%r{^spec/factory.rb})
|
|
51
|
+
end
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Viktor Fonic
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Solidify
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/vfonic/solidify)
|
|
4
|
+
[](https://codeclimate.com/github/vfonic/solidify)
|
|
5
|
+
[](https://codeclimate.com/github/vfonic/solidify/coverage)
|
|
6
|
+
[](https://hakiri.io/github/vfonic/solidify/master)
|
|
7
|
+
[](https://git.legal/projects/3620)
|
|
8
|
+
|
|
9
|
+
Rails meets Shopify liquid theme files.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Add this line to your application's Gemfile:
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
gem 'solidify'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
And then execute:
|
|
20
|
+
|
|
21
|
+
$ bundle install
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
To get the necessary migrations into your app, run the following
|
|
26
|
+
(this assumes you have already set `solidus` with `solidus_auth_devise`):
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
$ rails generate solidify:install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Add these ENV variables so that Carrierwave gem can store your theme files to S3:
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
AWS_ACCESS_KEY_ID: ''
|
|
36
|
+
AWS_SECRET_ACCESS_KEY: ''
|
|
37
|
+
AWS_S3_REGION: 'us-east-1'
|
|
38
|
+
AWS_S3_BUCKET_NAME: 'solid5-shop'
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Run this command to seed the default theme, shop settings and link lists:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
$ rails solidify:shop:seed_everything
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
To download theme files, run:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
$ rails solidify:theme:download_all_themes
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Running tests
|
|
54
|
+
|
|
55
|
+
To run the tests, you first need to create a test app. This can be done by running:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
$ bundle exec rake
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This will create a dummy app in `/spec/dummy` directory and run rubocop and all rspec tests. To run the tests second time, you don't need to run it through rake, but can run it normally via:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
$ rspec
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
or
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
$ spring rspec
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
[MIT License](http://opensource.org/licenses/MIT)
|
data/Rakefile
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
begin
|
|
2
|
+
require 'bundler/setup'
|
|
3
|
+
rescue LoadError
|
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
load 'rails/tasks/statistics.rake'
|
|
8
|
+
|
|
9
|
+
Bundler::GemHelper.install_tasks
|
|
10
|
+
|
|
11
|
+
require 'rspec/core'
|
|
12
|
+
require 'rspec/core/rake_task'
|
|
13
|
+
require 'spree/testing_support/common_rake'
|
|
14
|
+
|
|
15
|
+
require 'solidus_core'
|
|
16
|
+
|
|
17
|
+
desc 'Run all specs in spec directory (excluding plugin specs)'
|
|
18
|
+
RSpec::Core::RakeTask.new
|
|
19
|
+
|
|
20
|
+
task :default do
|
|
21
|
+
if Dir['spec/dummy'].empty?
|
|
22
|
+
Rake::Task[:test_app].invoke
|
|
23
|
+
Dir.chdir('../../')
|
|
24
|
+
end
|
|
25
|
+
require 'rubocop/rake_task'
|
|
26
|
+
RuboCop::RakeTask.new
|
|
27
|
+
Rake::Task['rubocop:auto_correct'].invoke
|
|
28
|
+
Rake::Task[:spec].invoke
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
desc 'Generates a dummy app for testing'
|
|
32
|
+
task :test_app do
|
|
33
|
+
ENV['LIB_NAME'] = 'solidify'
|
|
34
|
+
Rake::Task['common:test_app'].invoke('Spree::User')
|
|
35
|
+
|
|
36
|
+
# we can not run this as a Rake::Task because it depends on environment
|
|
37
|
+
# and environment is not ready from the just created dummy app for some reason
|
|
38
|
+
# rubocop:disable Metric/LineLength
|
|
39
|
+
sh 'bundle exec rake solidify:themes:seed_default_theme RAILS_ENV=test AWS_S3_BUCKET_NAME=solidify'
|
|
40
|
+
# rubocop:enable Metric/LineLength
|
|
41
|
+
sh 'bundle exec rake solidify:themes:download_all_themes RAILS_ENV=test'
|
|
42
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
module Liquid
|
|
3
|
+
extend ActiveSupport::Concern
|
|
4
|
+
|
|
5
|
+
included do
|
|
6
|
+
include LiquidHelper
|
|
7
|
+
include ShopHelper
|
|
8
|
+
prepend_before_action :set_active_theme
|
|
9
|
+
before_action :set_liquid_assigns
|
|
10
|
+
|
|
11
|
+
layout :theme_layout_file
|
|
12
|
+
|
|
13
|
+
def liquid_assigns
|
|
14
|
+
# merge example:
|
|
15
|
+
# { nested: { one: 1 } }.merge({ nested: { two: 2 } })
|
|
16
|
+
# => { nested: { two: 2 } }
|
|
17
|
+
# deep_merge example:
|
|
18
|
+
# { nested: { one: 1 } }.merge({ nested: { two: 2 } })
|
|
19
|
+
# => { nested: { one: 1, two: 2 } }
|
|
20
|
+
super.merge(@liquid_assigns)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
alias_method :customer, :current_customer
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class AddressesController < LiquidController
|
|
3
|
+
def index
|
|
4
|
+
render controller_action_to_liquid_file_path
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def set_liquid_assigns
|
|
8
|
+
@liquid_assigns = {
|
|
9
|
+
'canonical_url' => "#{request.base_url}#{customer_addresses_path}",
|
|
10
|
+
'page_title' => 'addresses.title',
|
|
11
|
+
'template' => 'page'
|
|
12
|
+
}
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class CartsController < LiquidController
|
|
3
|
+
def show
|
|
4
|
+
render controller_action_to_liquid_file_path
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def set_liquid_assigns
|
|
8
|
+
@liquid_assigns = {
|
|
9
|
+
'canonical_url' => request.base_url.to_s,
|
|
10
|
+
'page_title' => 'cart',
|
|
11
|
+
'template' => 'cart'
|
|
12
|
+
}
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class CollectionsController < LiquidController
|
|
3
|
+
def show
|
|
4
|
+
render controller_action_to_liquid_file_path(collection)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def set_liquid_assigns
|
|
8
|
+
@liquid_assigns = {
|
|
9
|
+
'canonical_url' => "#{request.base_url}#{collection.url}",
|
|
10
|
+
'collection' => collection,
|
|
11
|
+
'page_title' => collection.title,
|
|
12
|
+
'template' => 'collection'
|
|
13
|
+
}
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def collection
|
|
19
|
+
@collection ||= if params[:id] == 'all'
|
|
20
|
+
Spree::Taxon.find_or_create_collections_all
|
|
21
|
+
else
|
|
22
|
+
Spree::Taxon.find(params[:id])
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Solidify
|
|
2
|
+
class CustomersController < LiquidController
|
|
3
|
+
def show
|
|
4
|
+
render controller_action_to_liquid_file_path(customer)
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def set_liquid_assigns
|
|
8
|
+
@liquid_assigns = {
|
|
9
|
+
'canonical_url' => "#{request.base_url}/account",
|
|
10
|
+
'customer' => customer,
|
|
11
|
+
'page_title' => 'customer.title',
|
|
12
|
+
'template' => 'customer'
|
|
13
|
+
}
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|