switchery-rails 0.8.1 → 0.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6423f1816de36ccda13d246f04d04b8c52c50f62
4
- data.tar.gz: 819af681da5b276484ae86d28429c9f5e5e19055
3
+ metadata.gz: f5df15ce0ffaf963cbec9d15bdb94716658865ed
4
+ data.tar.gz: eec5643334ffafda3bfb21b0bd9fb2ae0e72b19a
5
5
  SHA512:
6
- metadata.gz: 03f4f03799e83fc5704fd081ee8cb7f6e8d174f6200072deba3c509ca3748c7da618ad3c5a05054fdad798ada2019356e5157fbe4e493f87d6c79f38144d808b
7
- data.tar.gz: 4d6ddab8557b248f3ff5fcc80afc95b1da7c2afb66c3512ddb98eafeb824917b93a81a6d0263aa05a5f566d960ab3d0b0455c00cb20a6d31f955c842b4675c50
6
+ metadata.gz: 1b78cadbc734cdb6cdf603b7fa1f35b14a7d2d90d0cf80d897061de3e333fc1912ee121cd2affa28d8022894c93c2c02e6ba481948278dc0661b095e2220623e
7
+ data.tar.gz: f88a64c1fc1a95997a045f7e4c181b9160992acb2ca4b8764399e3f234349e4f6f81d946255bd69b2622ce0650cc4af2e706041b3788d8efeaa37ece963cc2fe
data/Dockerfile CHANGED
@@ -7,31 +7,34 @@
7
7
 
8
8
  # ~~~~ Image base ~~~~
9
9
  # Base image with the latest Ruby only
10
- FROM litaio/ruby:2.2.2
10
+ FROM ruby:2.3.0-slim
11
11
  MAINTAINER Guillaume Hain zedtux@zedroot.org
12
12
 
13
13
 
14
14
  # ~~~~ Set up the environment ~~~~
15
15
  ENV DEBIAN_FRONTEND noninteractive
16
16
 
17
- # ~~~~ OS Maintenance ~~~~
18
- RUN apt-get update && apt-get install -y git
17
+ RUN mkdir -p /gem/
18
+ WORKDIR /gem/
19
+ ADD . /gem/
19
20
 
20
- # ~~~~ Rails Preparation ~~~~
21
+ # ~~~~ OS Maintenance & Rails Preparation ~~~~
21
22
  # Rubygems and Bundler
22
- RUN touch ~/.gemrc && \
23
+ RUN apt-get update && \
24
+ apt-get install -y git build-essential && \
25
+ touch ~/.gemrc && \
23
26
  echo "gem: --no-ri --no-rdoc" >> ~/.gemrc && \
24
27
  gem install rubygems-update && \
25
28
  update_rubygems && \
26
29
  gem install bundler && \
27
- mkdir -p /gem/
28
-
29
- WORKDIR /gem/
30
- ADD . /gem/
31
- RUN bundle install
30
+ bundle install && \
31
+ apt-get remove --purge -y build-essential && \
32
+ apt-get autoclean -y && \
33
+ apt-get clean
32
34
 
33
35
  # Import the gem source code
34
36
  VOLUME .:/gem/
35
37
 
38
+
36
39
  ENTRYPOINT ["bundle", "exec"]
37
40
  CMD ["rake", "-T"]
data/README.md CHANGED
@@ -32,7 +32,7 @@ Then follow the instructions as described on the Switchery documentation.
32
32
 
33
33
  ## Contributing
34
34
 
35
- 1. Fork it ( https://github.com/zedtux/switchery-rails/fork )
35
+ 1. Fork it ( https://github.com/YourCursus/switchery-rails/fork )
36
36
  2. Create your feature branch (`git checkout -b my-new-feature`)
37
37
  3. Commit your changes (`git commit -am 'Add some feature'`)
38
38
  4. Push to the branch (`git push origin my-new-feature`)
data/Rakefile CHANGED
@@ -2,7 +2,11 @@ require 'bundler/gem_tasks'
2
2
  require 'fileutils'
3
3
 
4
4
  desc 'Update the Switchery Javascript and CSS files'
5
- task :update_switchery do
5
+ task :update do
6
+ def remove_extra_version(version)
7
+ version.scan(/(\d\.\d\.\d)/).flatten.first
8
+ end
9
+
6
10
  def download_switchery(version)
7
11
  base_url = 'https://raw.githubusercontent.com/abpetkov/switchery'
8
12
  puts "Downlading Switchery #{version} ..."
@@ -14,6 +18,6 @@ task :update_switchery do
14
18
 
15
19
  FileUtils.mkdir_p('vendor/assets/javascripts')
16
20
  FileUtils.mkdir_p('vendor/assets/stylesheets')
17
- download_switchery(Switchery::Rails::VERSION)
21
+ download_switchery(remove_extra_version(Switchery::Rails::VERSION))
18
22
  puts "\e[32mDone!\e[0m"
19
23
  end
@@ -1,5 +1,5 @@
1
1
  module Switchery
2
2
  module Rails
3
- VERSION = '0.8.1'
3
+ VERSION = '0.8.1.1'
4
4
  end
5
5
  end
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bash
2
+
3
+ DOCKER_IMAGE_NAME="$USER/switchery-rails"
4
+ LIBRARY_NEW_VERSION=`cat lib/switchery/rails/version.rb | grep VERSION | awk '{ print $3 }' | tr -d "'"`
5
+
6
+ LIBRARY_UPDATED=`git status --porcelain | grep -v "lib/switchery/rails/version.rb"`
7
+ if [[ -n "$LIBRARY_UPDATED" ]]; then
8
+ echo "Your repository is not clean !"
9
+ exit 1
10
+ fi
11
+
12
+ echo "Ensuring Docker image $DOCKER_IMAGE_NAME exists ..."
13
+ EXISTING_DOCKER_IMAGE=`docker images | grep "$DOCKER_IMAGE_NAME"`
14
+ if [[ -z "$EXISTING_DOCKER_IMAGE" ]]; then
15
+ echo "Building the Docker image ..."
16
+ docker build -t "$DOCKER_IMAGE_NAME" .
17
+ fi
18
+
19
+ echo "Updating library code to version $LIBRARY_NEW_VERSION ..."
20
+ docker run --rm -v `pwd`:/gem/ "$DOCKER_IMAGE_NAME" rake update
21
+
22
+ LIBRARY_UPDATED=`git status --porcelain | grep -v make_new_release.sh`
23
+ if [[ -z "$LIBRARY_UPDATED" ]]; then
24
+ echo "No update found, stopping release creation."
25
+ exit 1
26
+ elif [[ "$LIBRARY_UPDATED" == " M lib/switchery/rails/version.rb" ]]; then
27
+ echo "None of the JS or CSS files have been updated."
28
+ exit 1
29
+ fi
30
+
31
+ echo "Committing new version ..."
32
+ git commit -am "Import version $LIBRARY_NEW_VERSION"
33
+
34
+ echo "Releasing gem ..."
35
+ docker run --rm -v ~/.gitconfig:/root/.gitconfig \
36
+ -v ~/.ssh/:/root/.ssh/ \
37
+ -v ~/.gem/:/root/.gem/ \
38
+ -v `pwd`:/gem/ "$DOCKER_IMAGE_NAME" rake release
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.add_dependency 'railties', '~> 4'
22
+ spec.add_dependency 'railties', '>= 3.2', '< 6.0'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.7'
25
25
  spec.add_development_dependency 'rake', '~> 10.0'
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchery-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Hain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-26 00:00:00.000000000 Z
11
+ date: 2016-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.2'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '4'
22
+ version: '6.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '3.2'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '4'
32
+ version: '6.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: bundler
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -60,9 +66,6 @@ extensions: []
60
66
  extra_rdoc_files: []
61
67
  files:
62
68
  - ".gitignore"
63
- - ".ruby-gemset"
64
- - ".ruby-version"
65
- - CHANGELOG.md
66
69
  - Dockerfile
67
70
  - Gemfile
68
71
  - LICENSE
@@ -72,6 +75,7 @@ files:
72
75
  - lib/switchery/rails.rb
73
76
  - lib/switchery/rails/engine.rb
74
77
  - lib/switchery/rails/version.rb
78
+ - make_new_release.sh
75
79
  - switchery-rails.gemspec
76
80
  - vendor/assets/javascripts/switchery.js
77
81
  - vendor/assets/stylesheets/switchery.css
@@ -95,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
99
  version: '0'
96
100
  requirements: []
97
101
  rubyforge_project:
98
- rubygems_version: 2.4.7
102
+ rubygems_version: 2.6.6
99
103
  signing_key:
100
104
  specification_version: 4
101
105
  summary: Use Switchery for Rails
@@ -1 +0,0 @@
1
- switchery-rails
@@ -1 +0,0 @@
1
- 2.2.0
@@ -1,3 +0,0 @@
1
- ## 0.1.0
2
-
3
- - Initial import