alchemy_spree 0.2.0 → 0.3.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 +4 -4
- data/Gemfile +0 -6
- data/LICENSE +20 -18
- data/README.md +74 -28
- data/Versionfile +5 -3
- data/alchemy_spree.gemspec +4 -4
- data/app/controllers/alchemy/admin/spree_controller.rb +1 -0
- data/app/models/alchemy/essence_spree_product.rb +1 -3
- data/app/models/alchemy/essence_spree_taxon.rb +1 -3
- data/config/initializers/alchemy.rb +1 -1
- data/config/routes.rb +1 -1
- data/lib/alchemy/spree/ability.rb +14 -0
- data/lib/alchemy/spree/engine.rb +3 -1
- data/lib/alchemy/spree/version.rb +1 -1
- data/lib/spree/authentication_helpers.rb +1 -0
- metadata +24 -17
- data/config/authorization_rules.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 953d2bd54c42ee048850217613a981122584dfc8
|
4
|
+
data.tar.gz: a5e80e786905bf2798eb05b204e0bc07ea78ffac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2e878aa1e0ea152da467326b319d7f8de8d7dab31b1fbdbf32936a90dd6ddf7653e16a81890e421fde2ebcd68dbd83dc4f4f4b83a11c0696109d4a63f1d9bec
|
7
|
+
data.tar.gz: 3fe19a7605050fa4ac334a256fc7306506e9660784121b80ace70b419368cd6ea5053a507a39989cc2dd3dcc1fdc10dda48ba17c3f744ea655ad5aff83e9f040
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
@@ -1,22 +1,24 @@
|
|
1
|
-
Copyright (c) 2012 magic labs*
|
1
|
+
Copyright (c) 2012-14, magic labs*
|
2
|
+
All rights reserved.
|
2
3
|
|
3
|
-
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
are permitted provided that the following conditions are met:
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
12
9
|
|
13
|
-
|
14
|
-
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
this list of conditions and the following disclaimer in the documentation and/or
|
12
|
+
other materials provided with the distribution.
|
15
13
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
14
|
+
* Neither the name of magic labs* nor the names of its contributors may be used to
|
15
|
+
endorse or promote products derived from this software without specific prior written permission.
|
16
|
+
|
17
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
18
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
|
20
|
+
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
21
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
22
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
23
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
24
|
+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
CHANGED
@@ -10,64 +10,110 @@ This gem is a [Alchemy CMS](https://github.com/magiclabs/alchemy_cms) and [Spree
|
|
10
10
|
2. It gives you new Essences for Alchemy called EssenceSpreeProduct and EssenceSpreeTaxon that you can use to place a Spree product and Taxon on your pages.
|
11
11
|
3. Shares admin session between Alchemy and Spree.
|
12
12
|
|
13
|
+
### Compatibility
|
14
|
+
|
15
|
+
## Spree
|
16
|
+
|
17
|
+
This version runs with Spreecommerce 2.1 and above.
|
18
|
+
|
19
|
+
## Alchemy
|
20
|
+
|
21
|
+
This version runs with Alchemy 3.0
|
22
|
+
|
13
23
|
## Installation
|
14
24
|
|
15
25
|
Add this line to your application's Gemfile:
|
16
26
|
|
17
|
-
|
27
|
+
```ruby
|
28
|
+
gem 'alchemy_spree', github: 'magiclabs/alchemy_spree', branch: 'master'
|
29
|
+
```
|
18
30
|
|
19
31
|
And then execute:
|
20
32
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
$ gem install alchemy_spree
|
33
|
+
```sh
|
34
|
+
$ bundle
|
35
|
+
```
|
26
36
|
|
27
37
|
Install the migrations:
|
28
38
|
|
29
|
-
|
39
|
+
```sh
|
40
|
+
$ rake alchemy_spree:install:migrations
|
41
|
+
```
|
30
42
|
|
31
43
|
Migrate the database:
|
32
44
|
|
33
|
-
|
45
|
+
```sh
|
46
|
+
$ rake db:migrate
|
47
|
+
```
|
48
|
+
|
49
|
+
### Authentication system installation
|
50
|
+
|
51
|
+
Since Alchemy 3.0 has dropped the authentication from its core, you will need to choose one authentication system. The easiest choice is to use the [alchemy-devise gem](https://github.com/magiclabs/alchemy-devise).
|
52
|
+
|
53
|
+
To install alchemy-devise:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
# Gemfile
|
57
|
+
gem 'alchemy-devise', '~> 2.0'
|
58
|
+
```
|
59
|
+
|
60
|
+
And then execute:
|
61
|
+
|
62
|
+
```sh
|
63
|
+
$ bundle
|
64
|
+
```
|
65
|
+
|
66
|
+
Finally, you'll need to instruct Spree accordingly:
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
# config/initializers/spree.rb
|
70
|
+
Spree.user_class = "Alchemy::User"
|
71
|
+
```
|
34
72
|
|
35
73
|
## Usage
|
36
74
|
|
37
75
|
### Create a new Element for Alchemy
|
38
76
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
77
|
+
```yaml
|
78
|
+
# config/alchemy/elements.yml
|
79
|
+
- name: product
|
80
|
+
contents:
|
81
|
+
- name: spree_product
|
82
|
+
type: EssenceSpreeProduct
|
44
83
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
84
|
+
- name: product_category
|
85
|
+
contents:
|
86
|
+
- name: spree_taxon
|
87
|
+
type: EssenceSpreeTaxon
|
88
|
+
```
|
49
89
|
|
50
90
|
### Generate the views
|
51
91
|
|
52
|
-
|
92
|
+
```sh
|
93
|
+
$ rails g alchemy:elements --skip
|
94
|
+
```
|
53
95
|
|
54
96
|
### Place this element on a page layout
|
55
97
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
98
|
+
```yaml
|
99
|
+
# config/alchemy/page_layouts.yml
|
100
|
+
- name: product
|
101
|
+
elements: [product]
|
102
|
+
- name: products
|
103
|
+
elements: [product_category]
|
104
|
+
```
|
61
105
|
|
62
106
|
### You can haz Spree product and taxons!
|
63
107
|
|
64
|
-
|
65
|
-
|
108
|
+
```erb
|
109
|
+
# app/views/alchemy/elements/_product_view.html.erb
|
110
|
+
<%= element.ingredient('spree_product') %>
|
66
111
|
|
67
|
-
|
68
|
-
|
112
|
+
# app/views/alchemy/elements/_product_category_view.html.erb
|
113
|
+
<%= element.ingredient('spree_taxon') %>
|
114
|
+
```
|
69
115
|
|
70
|
-
Alchemy
|
116
|
+
Alchemy :heart: Spree!
|
71
117
|
|
72
118
|
## Contributing
|
73
119
|
|
data/Versionfile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
"2.4.x" => { :branch => "master" }
|
2
|
+
"2.3.x" => { :branch => "master" }
|
3
|
+
"2.2.x" => { :branch => "0.3-stable" }
|
4
|
+
"2.1.x" => { :branch => "0.3-stable" }
|
5
|
+
"2.0.x" => { :branch => "0.2-stable" }
|
data/alchemy_spree.gemspec
CHANGED
@@ -6,8 +6,8 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.email = ["tvd@magiclabs.de"]
|
7
7
|
gem.description = %q{A Alchemy CMS and Spree connector}
|
8
8
|
gem.summary = %q{The World's Most Flexible E-Commerce Platform meets The World's Most Flexible Content Management System!}
|
9
|
-
gem.homepage = "https://github.com/
|
10
|
-
|
9
|
+
gem.homepage = "https://github.com/AlchemyCMS/alchemy_spree"
|
10
|
+
gem.license = 'BSD New'
|
11
11
|
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
12
|
gem.files = `git ls-files`.split("\n")
|
13
13
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -15,6 +15,6 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Alchemy::Spree::VERSION
|
17
17
|
|
18
|
-
gem.add_dependency('alchemy_cms', ['~>
|
19
|
-
gem.add_dependency('spree', ['
|
18
|
+
gem.add_dependency('alchemy_cms', ['~> 3.0.0'])
|
19
|
+
gem.add_dependency('spree', ['>= 2.1', '< 2.3'])
|
20
20
|
end
|
@@ -1,14 +1,12 @@
|
|
1
1
|
module Alchemy
|
2
2
|
class EssenceSpreeProduct < ActiveRecord::Base
|
3
|
-
belongs_to :product, class_name: "Spree::Product", foreign_key: 'spree_product_id'
|
3
|
+
belongs_to :product, class_name: "Spree::Product", foreign_key: 'spree_product_id'
|
4
4
|
|
5
5
|
acts_as_essence(
|
6
6
|
ingredient_column: 'spree_product_id',
|
7
7
|
preview_text_method: 'name'
|
8
8
|
)
|
9
9
|
|
10
|
-
attr_accessible :spree_product_id
|
11
|
-
|
12
10
|
def ingredient
|
13
11
|
product
|
14
12
|
end
|
@@ -1,14 +1,12 @@
|
|
1
1
|
module Alchemy
|
2
2
|
class EssenceSpreeTaxon < ActiveRecord::Base
|
3
|
-
belongs_to :taxon, class_name: "Spree::Taxon", foreign_key: 'taxon_id'
|
3
|
+
belongs_to :taxon, class_name: "Spree::Taxon", foreign_key: 'taxon_id'
|
4
4
|
|
5
5
|
acts_as_essence(
|
6
6
|
ingredient_column: 'taxon_id',
|
7
7
|
preview_text_method: 'name'
|
8
8
|
)
|
9
9
|
|
10
|
-
attr_accessible :taxon_id
|
11
|
-
|
12
10
|
def ingredient
|
13
11
|
taxon
|
14
12
|
end
|
data/config/routes.rb
CHANGED
data/lib/alchemy/spree/engine.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
+
require 'alchemy/spree/ability'
|
1
2
|
require 'alchemy/spree/alchemy_language_store'
|
3
|
+
require 'spree'
|
2
4
|
|
3
5
|
module Alchemy
|
4
6
|
module Spree
|
@@ -14,7 +16,7 @@ module Alchemy
|
|
14
16
|
Dir.glob(File.join(File.dirname(__FILE__), "../../../app/**/*_decorator*.rb")) do |c|
|
15
17
|
Rails.configuration.cache_classes ? require(c) : load(c)
|
16
18
|
end
|
17
|
-
Alchemy::
|
19
|
+
Alchemy.register_ability(Alchemy::Spree::Ability)
|
18
20
|
end
|
19
21
|
|
20
22
|
config.to_prepare &method(:activate).to_proc
|
metadata
CHANGED
@@ -1,43 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy_spree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alchemy_cms
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.0.0
|
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:
|
26
|
+
version: 3.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spree
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: '2.1'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '2.3'
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
|
-
- -
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '2.1'
|
44
|
+
- - "<"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
46
|
+
version: '2.3'
|
41
47
|
description: A Alchemy CMS and Spree connector
|
42
48
|
email:
|
43
49
|
- tvd@magiclabs.de
|
@@ -45,7 +51,7 @@ executables: []
|
|
45
51
|
extensions: []
|
46
52
|
extra_rdoc_files: []
|
47
53
|
files:
|
48
|
-
- .gitignore
|
54
|
+
- ".gitignore"
|
49
55
|
- Gemfile
|
50
56
|
- LICENSE
|
51
57
|
- README.md
|
@@ -64,12 +70,12 @@ files:
|
|
64
70
|
- app/views/alchemy/essences/_essence_spree_product_view.html.erb
|
65
71
|
- app/views/alchemy/essences/_essence_spree_taxon_editor.html.erb
|
66
72
|
- app/views/alchemy/essences/_essence_spree_taxon_view.html.erb
|
67
|
-
- config/authorization_rules.rb
|
68
73
|
- config/initializers/alchemy.rb
|
69
74
|
- config/routes.rb
|
70
75
|
- db/migrate/20120229160509_create_alchemy_essence_spree_products.rb
|
71
76
|
- db/migrate/20131029215548_add_spree_fields_to_custom_user_table.rb
|
72
77
|
- db/migrate/20131030140218_create_alchemy_essence_spree_taxons.rb
|
78
|
+
- lib/alchemy/spree/ability.rb
|
73
79
|
- lib/alchemy/spree/alchemy_language_store.rb
|
74
80
|
- lib/alchemy/spree/engine.rb
|
75
81
|
- lib/alchemy/spree/version.rb
|
@@ -110,8 +116,9 @@ files:
|
|
110
116
|
- test/dummy/script/rails
|
111
117
|
- test/integration/navigation_test.rb
|
112
118
|
- test/test_helper.rb
|
113
|
-
homepage: https://github.com/
|
114
|
-
licenses:
|
119
|
+
homepage: https://github.com/AlchemyCMS/alchemy_spree
|
120
|
+
licenses:
|
121
|
+
- BSD New
|
115
122
|
metadata: {}
|
116
123
|
post_install_message:
|
117
124
|
rdoc_options: []
|
@@ -119,17 +126,17 @@ require_paths:
|
|
119
126
|
- lib
|
120
127
|
required_ruby_version: !ruby/object:Gem::Requirement
|
121
128
|
requirements:
|
122
|
-
- -
|
129
|
+
- - ">="
|
123
130
|
- !ruby/object:Gem::Version
|
124
131
|
version: '0'
|
125
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
133
|
requirements:
|
127
|
-
- -
|
134
|
+
- - ">="
|
128
135
|
- !ruby/object:Gem::Version
|
129
136
|
version: '0'
|
130
137
|
requirements: []
|
131
138
|
rubyforge_project:
|
132
|
-
rubygems_version: 2.
|
139
|
+
rubygems_version: 2.4.3
|
133
140
|
signing_key:
|
134
141
|
specification_version: 4
|
135
142
|
summary: The World's Most Flexible E-Commerce Platform meets The World's Most Flexible
|