health_check 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,6 +1,10 @@
1
1
  = Change Log =
2
2
 
3
3
  * pre_rails4 branch
4
+ *1.7.1
5
+ * Restricted sass version for ruby 1.9.7 compatibility
6
+ * Added Vgrantfile for easier testing
7
+ * removed badges that don't work with branches
4
8
  *1.7.0
5
9
  * Split away from rails2.3 branch
6
10
  * removed rails 2.3 and 4.0 artifacts
data/README.rdoc CHANGED
@@ -178,38 +178,50 @@ See https://github.com/ianheggie/health_check/wiki/Ajax-Example for an Ajax exam
178
178
 
179
179
  == Testing
180
180
 
181
- === Automated testing and other checks
181
+ === Automated testing
182
182
 
183
- * {<img src="https://badge.fury.io/rb/health_check.png" alt="Gem Version" />}[http://badge.fury.io/rb/health_check] - Latest Gem
184
- * {<img src="https://travis-ci.org/ianheggie/health_check.png">}[https://travis-ci.org/ianheggie/health_check] - Travis CI
185
- * {<img src="https://codeclimate.com/github/ianheggie/health_check.png" />}[https://codeclimate.com/github/ianheggie/health_check] - Code quality
186
- * {<img src="https://gemnasium.com/ianheggie/health_check.png">}[https://gemnasium.com/ianheggie/health_check] - Gem dependencies
183
+ * {<img src="https://travis-ci.org/ianheggie/health_check.svg?branch=pre_rails4">}[https://travis-ci.org/ianheggie/health_check.svg?branch=pre_rails4] - Travis CI
187
184
 
188
185
  === Manual testing
189
186
 
190
- The test will package up and install the gem under a temporary path, create a dummy rails app configured for sqlite,
191
- install the gem, and then run up tests against the server.
192
- This will require TCP port 3456 to be free.
187
+ The instructions have been changed to using a vagrant virtual box for consistant results.
193
188
 
194
- Using rbenv or rvm, install and set the version of ruby you wish to test against.
195
- You will need to install the bundler gem if using rbenv.
196
- See the <tt>.travis.yml</tt> file for the list of ruby versions that we test against.
197
-
198
- * rbenv command: <tt>rbenv shell 1.8.7-p371</tt>
199
- * rvm command: <tt>rvm use 1.9.3</tt>
189
+ Install vagrant 1.9.7 or later and virtual_box or other local virtual machine providor.
200
190
 
201
191
  Create a temp directory for throw away testing, and clone the health_check gem into it
202
192
 
203
193
  mkdir -p ~/tmp
204
194
  cd ~/tmp
205
- git clone https://github.com/ianheggie/health_check.git
195
+ git clone https://github.com/ianheggie/health_check.git ~/tmp/health_check
196
+
197
+ The Vagrantfile includes provisioning rules to install chruby (ruby version control),
198
+ ruby-build will also be installed and run to build various rubies under /opt/rubies.
199
+
200
+ Use <tt>vagrant ssh</tt> to connect to the virtual box and run tests.
201
+
202
+ The test script will package up and install the gem under a temporary path, create a dummy rails app configured for sqlite,
203
+ install the gem, and then run up tests against the server.
204
+ This will require TCP port 3456 to be free.
206
205
 
207
206
  Cd to the checked out health_check directory and then run the test as follows:
208
207
 
209
208
  cd ~/tmp/health_check
210
209
 
210
+ vagrant up # this will also run vagrant provision and take some time
211
+ # chruby and various ruby versions will be installed
212
+
213
+ vagrant ssh
214
+
215
+ cd /vagrant # the current directory on your host is mounted here on the virtual machine
216
+
217
+ chruby 1.8.7
218
+ # or
219
+ chruby 1.9.3
220
+
211
221
  test/test_with_railsapp
212
222
 
223
+ exit # from viretual machine when finished
224
+
213
225
  The script will first call `test/setup_railsapp` to setup a rails app with health_check installed and then
214
226
  run up the rails server and perform veraious tests.
215
227
 
@@ -220,7 +232,7 @@ The command `rake test` will also launch these tests, except it cannot install t
220
232
 
221
233
  == Copyright
222
234
 
223
- Copyright (c) 2010-2015 Ian Heggie, released under the MIT license.
235
+ Copyright (c) 2010-2017 Ian Heggie, released under the MIT license.
224
236
  See MIT-LICENSE for details.
225
237
 
226
238
  == Contributors
data/Vagrantfile ADDED
@@ -0,0 +1,20 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ Vagrant.configure("2") do |config|
5
+ # For a complete reference, please see the online documentation at
6
+ # https://docs.vagrantup.com.
7
+
8
+ config.vm.box = "ubuntu/xenial64"
9
+
10
+ # set auto_update to false, if you do NOT want to check the correct
11
+ # additions version when booting this machine
12
+ config.vbguest.auto_update = false
13
+
14
+ # do NOT download the iso file from a webserver
15
+ config.vbguest.no_remote = true
16
+
17
+ # provision with a shell script.
18
+ config.vm.provision "shell", path: "./test/provision_vagrant"
19
+
20
+ end
@@ -1,4 +1,4 @@
1
1
  module HealthCheck
2
- VERSION = "1.7.0"
2
+ VERSION = "1.7.1"
3
3
  end
4
4
 
data/test/init_variables CHANGED
@@ -20,6 +20,8 @@ if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
20
20
  echo "Detected user installed rvm"
21
21
  elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
22
22
  echo "Detected root installed rvm"
23
+ elif [[ -s /usr/local/share/chruby/chruby.sh ]] ; then
24
+ echo "Detected root installed chruby"
23
25
  elif [[ -d "$HOME/.rbenv" ]] ; then
24
26
  echo "Detected rbenv: `rbenv version`"
25
27
  rehash='rbenv rehash'
@@ -0,0 +1,79 @@
1
+ #!/bin/bash
2
+
3
+ case `id` in
4
+ *root*)
5
+ ;;
6
+ *)
7
+ exec echo Must be run as root
8
+ ;;
9
+ esac
10
+
11
+ chruby_version=0.3.9
12
+ chruby=chruby-${chruby_version}
13
+
14
+ set -xe
15
+ id
16
+ pwd
17
+ export DEBIAN_FRONTEND=noninteractive
18
+ find /tmp/got-apt-update -mtime -1 || ( apt-get update && touch /tmp/got-apt-update )
19
+ apt install --yes --force-yes -q ruby ruby-dev sqlite3 libsqlite3-dev nodejs subversion git git-core
20
+ # https://github.com/rbenv/ruby-build/wiki#suggested-build-environment
21
+ # using default gcc-5 since xenial doesn't have gcc-6
22
+ apt install --yes --force-yes -q gcc-5 autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
23
+
24
+ # The following is not required for testing, install if you are doing manual tests with extra gems
25
+ # apt install --yes --force-yes -q mysql-client mysql-server libmysqlclient-dev
26
+ # apt install --yes --force-yes -q libcurl4-openssl-dev libncurses5-dev libxml2-dev libxslt1-dev
27
+ (
28
+ echo Install chruby
29
+ [ -s ${chruby}.tar.gz ] || wget -q -O ${chruby}.tar.gz https://github.com/postmodern/chruby/archive/v${chruby_version}.tar.gz
30
+ [ -d ${chruby} ] || tar -xzf ${chruby}.tar.gz
31
+ cd ${chruby}/
32
+ ./scripts/setup.sh
33
+ cat > /etc/profile.d/chruby.sh <<'EOF'
34
+ if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then
35
+ source /usr/local/share/chruby/chruby.sh
36
+ #source /usr/local/share/chruby/auto
37
+ fi
38
+ EOF
39
+ chmod a+r /etc/profile.d/chruby.sh
40
+ )
41
+
42
+ (
43
+ [ -d ruby-build ] || git clone https://github.com/rbenv/ruby-build.git
44
+ which ruby-build || PREFIX=/usr/local ./ruby-build/install.sh
45
+
46
+ mkdir -p /opt/rubies
47
+ v=1.8.7-p375
48
+ [ -x /opt/rubies/${v}/bin/bundle ] || ( ruby-build ${v} /opt/rubies/${v} && /opt/rubies/${v}/bin/gem update --system 1.8.25 && /opt/rubies/${v}/bin/gem install bundler )
49
+
50
+ v=1.9.3-p551
51
+ [ -x /opt/rubies/${v}/bin/bundle ] || ( ruby-build ${v} /opt/rubies/${v} && /opt/rubies/${v}/bin/gem install bundler )
52
+
53
+ for v in 2.2.0
54
+ do
55
+ [ -x /opt/rubies/${v}/bin/bundle ] || ( ruby-build ${v} /opt/rubies/${v} && /opt/rubies/${v}/bin/gem install bundler )
56
+ done
57
+ )
58
+
59
+ echo Setup system ruby
60
+ which bundle || gem install bundler
61
+ bundle --version
62
+ set +x
63
+ cat <<EOF
64
+
65
+ Now test by running the following commands:
66
+
67
+ vagrant ssh
68
+ cd /vagrant
69
+
70
+ chruby RUBY_VERSION
71
+ or
72
+ chruby system # for system version 2.3.1
73
+
74
+ ./test/test_with_railsapp
75
+
76
+ exit
77
+
78
+ EOF
79
+ exit
@@ -22,6 +22,8 @@ gem 'i18n', '< 0.7' if RUBY_VERSION < '1.9.3' # REQUIRED
22
22
  # rack 2.0 requires ruby 2.2.2
23
23
  gem 'rack', "< 2.0" if RUBY_VERSION < '2.2.2' # REQUIRED
24
24
 
25
+ gem 'sass', '< 3.5' if RUBY_VERSION < '1.9.3' # REQUIRED
26
+
25
27
  # Initial Gemfile has therubyracer commented out
26
28
  gem 'therubyrhino', :platform => :jruby # REQUIRED
27
29
  gem 'therubyracer', :platform => :ruby # REQUIRED
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: health_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-10-04 00:00:00.000000000 Z
12
+ date: 2017-10-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -99,6 +99,7 @@ files:
99
99
  - README.rdoc
100
100
  - Rakefile
101
101
  - VERSION
102
+ - Vagrantfile
102
103
  - config/routes.rb
103
104
  - health_check.gemspec
104
105
  - init.rb
@@ -115,6 +116,7 @@ files:
115
116
  - test/migrate/twelve/011_create_roles.roles.rb
116
117
  - test/migrate/twelve/012_create_users.rb
117
118
  - test/migrate/twelve/9_create_countries.rb
119
+ - test/provision_vagrant
118
120
  - test/rails_3.0.gemfile
119
121
  - test/rails_3.1.gemfile
120
122
  - test/rails_3.2.gemfile
@@ -136,6 +138,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
136
138
  - - ! '>='
137
139
  - !ruby/object:Gem::Version
138
140
  version: '0'
141
+ segments:
142
+ - 0
143
+ hash: 4152709430930612224
139
144
  required_rubygems_version: !ruby/object:Gem::Requirement
140
145
  none: false
141
146
  requirements:
@@ -157,6 +162,7 @@ test_files:
157
162
  - test/migrate/twelve/011_create_roles.roles.rb
158
163
  - test/migrate/twelve/012_create_users.rb
159
164
  - test/migrate/twelve/9_create_countries.rb
165
+ - test/provision_vagrant
160
166
  - test/rails_3.0.gemfile
161
167
  - test/rails_3.1.gemfile
162
168
  - test/rails_3.2.gemfile