solidus_support 0.1.0 → 0.1.1

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: ac2edc88ce702146d0b74ccb5146a5a87d012d29
4
- data.tar.gz: 1a4a77c281140d3d35fb05188dc33dcbf301b98e
3
+ metadata.gz: '08a24113b51dfa61dbc62e42286c191fead054d1'
4
+ data.tar.gz: f3739aac234b7a50fce339209f08e39b8758d46a
5
5
  SHA512:
6
- metadata.gz: 21ee387ead991f0582ac1c654744eaaff6746ca3c20fd5c04fec19bd7145cde7e81c27fa1bd129af2fcfbec775dd1de173e59acdc3f41da4f67cabf2e4441950
7
- data.tar.gz: 960f89678e214579fae7d3f2d6465f860f65bbf0497ddfa5c84f6393b33d5bb2ea5acd894b8215287db78a8a9142c9c8c0cf617ec7a4fc054aae10ba001f510e
6
+ metadata.gz: ba46c533f2f24fe0439723dfc8c3d8b2dfdd591fb2a2b0de1f7be32015330766b913627664177e95295566028d3eb7c62634add2a7d00a325c5d8dfcee7ff5c4
7
+ data.tar.gz: cd81549301b792bb47459b092709284f8d506535777033e0f9c1c4c578df6374636408513fba6200b9771023da80394aaf9bd8dc29c4b01a9ff9f3c44e4450b1
data/Gemfile CHANGED
@@ -1,4 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
4
+ gem 'solidus', github: 'solidusio/solidus', branch: branch
5
+
3
6
  # Specify your gem's dependencies in solidus_support.gemspec
4
7
  gemspec
data/README.md CHANGED
@@ -1,28 +1,28 @@
1
1
  # SolidusSupport
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/solidus_support`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ This gem holds some common functionality for Solidus Extensions.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ It has some utilities to make it easier to support multiple versions of Solidus.
6
6
 
7
- ## Installation
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
- $ bundle
9
+ ### `SolidusSupport::Migration`
18
10
 
19
- Or install it yourself as:
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
- $ gem install solidus_support
15
+ ``` ruby
16
+ # On Rails 4.2
17
+ SolidusSupport::Migration[4.2] # returns `ActiveRecord::Migration`
18
+ SolidusSupport::Migration[5.0] # errors
22
19
 
23
- ## Usage
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
- TODO: Write usage instructions here
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/jhawthorn/solidus_support.
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/solidusio/solidus_support.
36
36
 
@@ -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
- # Your code goes here...
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
@@ -1,3 +1,3 @@
1
1
  module SolidusSupport
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  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.0
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-21 00:00:00.000000000 Z
11
+ date: 2017-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler