solidus_multi_domain 1.1.2 → 1.1.3

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: dc79c8c6d9ed544b44283fe022948098973b838c
4
- data.tar.gz: 0f50104cabfc247f3db4dc0d539ebc702a5db618
3
+ metadata.gz: 1b9c1fa3385d3591e2108d27bf82b62191b0de5b
4
+ data.tar.gz: 87f182e7c3081372437abd54cca46068b9bc77eb
5
5
  SHA512:
6
- metadata.gz: 40a54ce0b981f3825561180b91f9aa335b877861f172f62bb0d71e83bf1e7d3f214b5eb5055d1d01a2e859370a188ec23ad7757511d67e11642eb2fbc90659a8
7
- data.tar.gz: e5d9ab6db83f1f38e70d7e8e42a6a64ec976194bbd47abe8b7a3fa692979839564eae8c8fe46129c0fb22325f4b39bc8d762314f3576e8f76d0c70d9fe0573d1
6
+ metadata.gz: 22245c44898f38230eca433a29d6e8605db1987ac25e7a0513acb5a1fc93c0c3fecfa12bd29e2e84061c428f525780d57859f3901bba585b673d1ad86427c02f
7
+ data.tar.gz: 8785ecb9d2d1fc91146b2374c9ef7d717fa355b7be15e4aed53ac0649a0a5d7933796c0782975612b423d3460909ecc921c958da27e8e5eff8494dbf206a6367
data/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.1.8
5
+ env:
6
+ matrix:
7
+ - SOLIDUS_BRANCH=v1.1 DB=postgres
8
+ - SOLIDUS_BRANCH=v1.2 DB=postgres
9
+ - SOLIDUS_BRANCH=master DB=postgres
10
+ - SOLIDUS_BRANCH=v1.1 DB=mysql
11
+ - SOLIDUS_BRANCH=v1.2 DB=mysql
12
+ - SOLIDUS_BRANCH=master DB=mysql
data/Gemfile CHANGED
@@ -1,6 +1,10 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "solidus", github: "solidusio/solidus"
3
+ branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
4
+ gem "solidus", github: "solidusio/solidus", branch: branch
5
+
6
+ gem 'pg'
7
+ gem 'mysql2'
4
8
 
5
9
  group :development, :test do
6
10
  gem "pry-rails"
data/LICENSE.md ADDED
@@ -0,0 +1,27 @@
1
+ Copyright (c) 2016, Solidus
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ * Neither the name of solidus_multi_domain nor the names of its
15
+ contributors may be used to endorse or promote products derived from
16
+ this software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -5,6 +5,8 @@ This extension allows a single Solidus instance to have several customer facing
5
5
  stores, with a single shared backend administration system (i.e. multi-store,
6
6
  single-vendor).
7
7
 
8
+ [![Build Status](https://travis-ci.org/solidusio/solidus_multi_domain.svg?branch=master)](https://travis-ci.org/solidusio/solidus_multi_domain)
9
+
8
10
  Current features:
9
11
  ------------------
10
12
 
@@ -56,6 +58,15 @@ rails g solidus_multi_domain:install
56
58
 
57
59
  You should see 'Stores & Domains' in Configuration tab of Spree Admin.
58
60
 
61
+ Development
62
+ -------
63
+
64
+ To see if your stores indeed do point to the correct and unique domains, start your server with
65
+ ```shell
66
+ rails s -p 3000 -b lvh.me
67
+ ```
68
+ and give a store a domain like http://store1.lvh.me:3000/.
69
+
59
70
  Authorization
60
71
  -------------
61
72
 
@@ -11,8 +11,8 @@ Spree::Store.class_eval do
11
11
  has_attached_file :logo,
12
12
  styles: { mini: '48x48>', small: '100x100>', medium: '250x250>' },
13
13
  default_style: :medium,
14
- url: 'stores/:id/:style/:basename.:extension',
15
- path: 'stores/:id/:style/:basename.:extension',
14
+ url: '/spree/stores/:id/:style/:basename.:extension',
15
+ path: ':rails_root/public/spree/stores/:id/:style/:basename.:extension',
16
16
  convert_options: { all: '-strip -auto-orient' }
17
17
 
18
18
  validates_attachment_file_name :logo, matches: [/png\Z/i, /jpe?g\Z/i],
@@ -2,7 +2,7 @@ Deface::Override.new(
2
2
  :virtual_path => "spree/admin/trackers/index",
3
3
  :name => "multi_domain_admin_trackers_index_headers",
4
4
  :insert_before => "[data-hook='admin_trackers_index_headers'] th:last",
5
- :text => "<th><%= I18n.t(:store) %></th>",
5
+ :text => "<th><%= Spree.t(:store) %></th>",
6
6
  :disabled => false)
7
7
 
8
8
  Deface::Override.new(
@@ -19,8 +19,8 @@
19
19
  <%= f.field_container :default do %>
20
20
  <%= f.label :default, Spree.t(:default) %>
21
21
  <ul>
22
- <li><%= f.radio_button :default, "true", :class => 'fullwidth' %> <%= Spree.t(:yes) %></li>
23
- <li><%= f.radio_button :default, "false", :class => 'fullwidth' %> <%= Spree.t(:no) %></li>
22
+ <li><%= f.radio_button :default, "true", :class => 'fullwidth' %> <%= Spree.t(:say_yes) %></li>
23
+ <li><%= f.radio_button :default, "false", :class => 'fullwidth' %> <%= Spree.t(:say_no) %></li>
24
24
  </ul>
25
25
  <%= error_message_on :store, :default %>
26
26
  <% end %>
@@ -6,7 +6,7 @@
6
6
 
7
7
  <% content_for :page_actions do %>
8
8
  <li>
9
- <%= button_link_to Spree.t(:back_to_stores_list), spree.admin_stores_path, :icon => 'icon-arrow-left' %>
9
+ <%= button_link_to Spree.t(:back_to_store_list), spree.admin_stores_path, :icon => 'icon-arrow-left' %>
10
10
  </li>
11
11
  <% end %>
12
12
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  <% content_for :page_actions do %>
8
8
  <li>
9
- <%= button_link_to Spree.t(:back_to_stores_list), spree.admin_stores_path, :icon => 'icon-arrow-left' %>
9
+ <%= button_link_to Spree.t(:back_to_store_list), spree.admin_stores_path, :icon => 'icon-arrow-left' %>
10
10
  </li>
11
11
  <% end %>
12
12
 
@@ -1,12 +1,17 @@
1
1
  module SpreeMultiDomain
2
2
  module MultiDomainHelpers
3
- def self.included(receiver)
4
- receiver.send :helper, 'spree/products'
5
- receiver.send :helper, 'spree/taxons'
3
+ extend ActiveSupport::Concern
6
4
 
7
- receiver.send :before_filter, :add_current_store_id_to_params
8
- receiver.send :helper_method, :current_store
9
- receiver.send :helper_method, :current_tracker
5
+ include Spree::Core::ControllerHelpers::Common #layout :get_layout
6
+ include Spree::Core::ControllerHelpers::Store #current_store
7
+
8
+ included do
9
+ helper 'spree/products'
10
+ helper 'spree/taxons'
11
+
12
+ before_filter :add_current_store_id_to_params
13
+ helper_method :current_store
14
+ helper_method :current_tracker
10
15
  end
11
16
 
12
17
  def current_tracker
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |s|
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.name = "solidus_multi_domain"
6
- s.version = "1.1.2"
6
+ s.version = "1.1.3"
7
7
  s.summary = "Adds multiple site support to Solidus"
8
8
  s.description = "Multiple Solidus stores on different domains - single unified backed for processing orders."
9
9
  s.required_ruby_version = ">= 2.1"
@@ -9,17 +9,36 @@ describe "Template renderer with dynamic layouts" do
9
9
  )]
10
10
  end
11
11
 
12
- it "should render the layout corresponding to the current store" do
13
- store = FactoryGirl.create :store, code: "my_store"
12
+ let(:store) { FactoryGirl.create :store, code: "my_store" }
14
13
 
14
+ it "should render the layout corresponding to the current store" do
15
15
  get "http://#{store.url}"
16
16
  expect(response.body).to eql("Store layout hello")
17
17
  end
18
18
 
19
19
  it "should fall back to the default layout if none are found for the current store" do
20
- allow(ApplicationController).to receive(:current_store).and_return(nil)
21
-
22
20
  get "http://www.example.com"
23
21
  expect(response.body).to eql("Default layout hello")
24
22
  end
23
+
24
+ context "for a controller inheriting from ApplicationController" do
25
+ NormalController = Class.new(ApplicationController)
26
+
27
+ before do
28
+ ApplicationController.view_paths += [ActionView::FixtureResolver.new(
29
+ "normal/index.html.erb" => "just normal"
30
+ )]
31
+ Rails.application.routes.draw do
32
+ get 'normal', to: 'normal#index'
33
+ end
34
+ end
35
+ it "should fall back to the default layout for unmatched store" do
36
+ get "http://www.example.com/normal"
37
+ expect(response.body).to eq("Default layout just normal")
38
+ end
39
+ it "should render the layout for the current store" do
40
+ get "http://#{store.url}/normal"
41
+ expect(response.body).to eq("Store layout just normal")
42
+ end
43
+ end
25
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_multi_domain
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-13 00:00:00.000000000 Z
11
+ date: 2016-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus
@@ -145,7 +145,9 @@ extra_rdoc_files: []
145
145
  files:
146
146
  - ".gitignore"
147
147
  - ".rspec"
148
+ - ".travis.yml"
148
149
  - Gemfile
150
+ - LICENSE.md
149
151
  - README.md
150
152
  - Rakefile
151
153
  - app/controllers/concerns/spree_multi_domain/create_line_item_support.rb
@@ -261,8 +263,28 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
263
  requirements:
262
264
  - none
263
265
  rubyforge_project:
264
- rubygems_version: 2.5.1
266
+ rubygems_version: 2.4.5.1
265
267
  signing_key:
266
268
  specification_version: 4
267
269
  summary: Adds multiple site support to Solidus
268
- test_files: []
270
+ test_files:
271
+ - spec/controllers/spree/admin/products_controller_spec.rb
272
+ - spec/controllers/spree/admin/stores_controller_spec.rb
273
+ - spec/controllers/spree/api/line_items_controller_spec.rb
274
+ - spec/controllers/spree/api/products_controller_spec.rb
275
+ - spec/controllers/spree/api/shipments_controller_spec.rb
276
+ - spec/controllers/spree/products_controller_spec.rb
277
+ - spec/helpers/products_helper_decorator_spec.rb
278
+ - spec/models/spree/line_item_spec.rb
279
+ - spec/models/spree/order_spec.rb
280
+ - spec/models/spree/permission_sets/store_display_spec.rb
281
+ - spec/models/spree/permission_sets/store_management_spec.rb
282
+ - spec/models/spree/product_spec.rb
283
+ - spec/models/spree/shipping_method_decorator_spec.rb
284
+ - spec/models/spree/store_spec.rb
285
+ - spec/models/spree/taxon_decorator_spec.rb
286
+ - spec/models/spree/tracker_spec.rb
287
+ - spec/requests/global_controller_helpers_spec.rb
288
+ - spec/requests/template_renderer_spec.rb
289
+ - spec/spec_helper.rb
290
+ - spec/support/factory_overrides.rb