solidus_support 0.1.0 → 0.1.1
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 +3 -0
- data/README.md +17 -17
- data/lib/solidus_support.rb +14 -1
- data/lib/solidus_support/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08a24113b51dfa61dbc62e42286c191fead054d1'
|
4
|
+
data.tar.gz: f3739aac234b7a50fce339209f08e39b8758d46a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba46c533f2f24fe0439723dfc8c3d8b2dfdd591fb2a2b0de1f7be32015330766b913627664177e95295566028d3eb7c62634add2a7d00a325c5d8dfcee7ff5c4
|
7
|
+
data.tar.gz: cd81549301b792bb47459b092709284f8d506535777033e0f9c1c4c578df6374636408513fba6200b9771023da80394aaf9bd8dc29c4b01a9ff9f3c44e4450b1
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,28 +1,28 @@
|
|
1
1
|
# SolidusSupport
|
2
2
|
|
3
|
-
|
3
|
+
This gem holds some common functionality for Solidus Extensions.
|
4
4
|
|
5
|
-
|
5
|
+
It has some utilities to make it easier to support multiple versions of Solidus.
|
6
6
|
|
7
|
-
##
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'solidus_support'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
7
|
+
## Usage
|
16
8
|
|
17
|
-
|
9
|
+
### `SolidusSupport::Migration`
|
18
10
|
|
19
|
-
|
11
|
+
Rails >= 5 introduced the concept of specifying what rails version your migration was written for, like `ActiveRecord::Migration[5.0]`.
|
12
|
+
Not specifying a version is deprecated in Rails 5.0 and removed in rails 5.1.
|
13
|
+
This wasn't backported to Rails 4.2, but Rails 4.2 _is_ Rails 4.2. So we provide this helper.
|
20
14
|
|
21
|
-
|
15
|
+
``` ruby
|
16
|
+
# On Rails 4.2
|
17
|
+
SolidusSupport::Migration[4.2] # returns `ActiveRecord::Migration`
|
18
|
+
SolidusSupport::Migration[5.0] # errors
|
22
19
|
|
23
|
-
|
20
|
+
# On Rails 5.0
|
21
|
+
SolidusSupport::Migration[4.2] # same as `ActiveRecord::Migration[4.2]`
|
22
|
+
SolidusSupport::Migration[5.0] # same as `ActiveRecord::Migration[5.0]`
|
23
|
+
```
|
24
24
|
|
25
|
-
|
25
|
+
There's no reason to use `SolidusSupport::Migration[5.0]` over `ActiveRecord::Migration[5.0]`, but it is provided.
|
26
26
|
|
27
27
|
## Development
|
28
28
|
|
@@ -32,5 +32,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
32
|
|
33
33
|
## Contributing
|
34
34
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/solidusio/solidus_support.
|
36
36
|
|
data/lib/solidus_support.rb
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
require "solidus_support/version"
|
2
2
|
require "solidus_support/migration"
|
3
|
+
require "solidus_core"
|
3
4
|
|
4
5
|
module SolidusSupport
|
5
|
-
|
6
|
+
class << self
|
7
|
+
def solidus_gem_version
|
8
|
+
if Spree.respond_to?(:solidus_gem_version)
|
9
|
+
Spree.solidus_gem_version
|
10
|
+
elsif Spree.respond_to?(:gem_version)
|
11
|
+
# 1.1 doesn't have solidus_gem_version
|
12
|
+
Gem::Version.new(Spree.solidus_version)
|
13
|
+
else
|
14
|
+
# 1.0 doesn't have gem_version
|
15
|
+
Gem::Specification.detect{|x| x.name == "solidus_core" }.version
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
6
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Hawthorn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03
|
11
|
+
date: 2017-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|