From 3385a09b660018497547cc1f62af31df02af44cb Mon Sep 17 00:00:00 2001 From: Smit Shah Date: Sun, 17 Nov 2013 17:57:54 +0530 Subject: [PATCH 1/5] Changed spin to support padrino with new default --- lib/spin.rb | 3 ++- lib/spin/cli.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/spin.rb b/lib/spin.rb index 23955c0..ccd497a 100644 --- a/lib/spin.rb +++ b/lib/spin.rb @@ -22,7 +22,8 @@ module Spin class << self def serve(options) - ENV['RAILS_ENV'] = 'test' unless ENV['RAILS_ENV'] + ENV['PADRINO_ENV'] = 'test' unless ENV['PADRINO_ENV'] + ENV['NO_AUTH'] = 'y' unless ENV['NO_AUTH'] if root_path = rails_root(options[:preload]) Dir.chdir(root_path) diff --git a/lib/spin/cli.rb b/lib/spin/cli.rb index 0822655..2d69b7e 100644 --- a/lib/spin/cli.rb +++ b/lib/spin/cli.rb @@ -6,7 +6,7 @@ module CLI class << self def run(argv) options = { - :preload => "config/application.rb" + :preload => "config/boot.rb" } parser = OptionParser.new do |opts| From 1123d0cf3bbc5f3829dc5e0c2ed6f8fd060c739f Mon Sep 17 00:00:00 2001 From: Smit Shah Date: Sun, 17 Nov 2013 19:40:07 +0530 Subject: [PATCH 2/5] Added proper Padrino support by default --- lib/spin.rb | 2 +- lib/spin/cli.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/spin.rb b/lib/spin.rb index ccd497a..0c390ab 100644 --- a/lib/spin.rb +++ b/lib/spin.rb @@ -22,8 +22,8 @@ module Spin class << self def serve(options) + ENV['RAILS_ENV'] = 'test' unless ENV['RAILS_ENV'] ENV['PADRINO_ENV'] = 'test' unless ENV['PADRINO_ENV'] - ENV['NO_AUTH'] = 'y' unless ENV['NO_AUTH'] if root_path = rails_root(options[:preload]) Dir.chdir(root_path) diff --git a/lib/spin/cli.rb b/lib/spin/cli.rb index 2d69b7e..740d4bd 100644 --- a/lib/spin/cli.rb +++ b/lib/spin/cli.rb @@ -9,6 +9,8 @@ def run(argv) :preload => "config/boot.rb" } + options[:preload] = "config/boot.rb" if ENV['PADRINO_ENV'] + parser = OptionParser.new do |opts| opts.banner = usage opts.separator "" From 763d8c709b4db8315005910790c9309e0ad81f6e Mon Sep 17 00:00:00 2001 From: Smit Shah Date: Sun, 17 Nov 2013 20:01:27 +0530 Subject: [PATCH 3/5] Changed the README and bumped of the version --- CHANGELOG.md | 4 ++++ README.md | 10 +++++----- lib/spin/version.rb | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94e6d97..4713e1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Master branch +## Version 0.7.2 (Nov 17, 2013) + +* Added Padrino support + ## Version 0.7.1 (Aug 19, 2013) * fixed capability with MRI 2.0 [Todd Mazierski and Jonathan del Strother] diff --git a/README.md b/README.md index 373afba..3078406 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ Spin [![Build Status](https://travis-ci.org/jstorimer/spin.png)](https://travis-ci.org/jstorimer/spin) -Spin speeds up your Rails testing workflow. +Spin speeds up your Rails/Padrino testing workflow. -By preloading your Rails environment in one process and then using fork(2) for each test run you don't load the same code over and over and over... +By preloading your Rails/Padrino environment in one process and then using fork(2) for each test run you don't load the same code over and over and over... Spin works with an autotest(ish) workflow. Installation @@ -17,7 +17,7 @@ Spin is available as a rubygem. gem i spin ``` -Spin is a tool for Rails 3 apps. It is compatible with the following testing libraries: +Spin is a tool for Rails 3/Padrino apps. It is compatible with the following testing libraries: * any version of test/unit or MiniTest * RSpec 2.x @@ -25,7 +25,7 @@ Spin is a tool for Rails 3 apps. It is compatible with the following testing lib Usage ===== -There are two components to Spin, a server and client. The server has to be running for anything interesting to happen. You can start the Spin server from your `Rails.root` with the following command: +There are two components to Spin, a server and client. The server has to be running for anything interesting to happen. You can start the Spin server from your root dir with the following command: ``` bash spin serve @@ -108,7 +108,7 @@ There's another project ([spork](https://github.com/sporkrb/spork)) that aims to 2. It's simple. - Spin should work out of the box with any Rails app. No custom configuration required. + Spin should work out of the box with any Rails/Padrino app. No custom configuration required. 3. It doesn't do any [crazy monkey patching](https://github.com/sporkrb/spork-rails/blob/master/lib/spork/app_framework/rails.rb#L43-80). diff --git a/lib/spin/version.rb b/lib/spin/version.rb index f8835ce..0e1adea 100644 --- a/lib/spin/version.rb +++ b/lib/spin/version.rb @@ -1,3 +1,3 @@ module Spin - VERSION = "0.7.1" + VERSION = "0.7.2" end From bdd9edfe35cbb5acf1be6aeb65d7a21f8ca2809f Mon Sep 17 00:00:00 2001 From: Smit Shah Date: Sun, 17 Nov 2013 20:09:56 +0530 Subject: [PATCH 4/5] Revert the preload path to config/application.rb --- lib/spin/cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/spin/cli.rb b/lib/spin/cli.rb index 740d4bd..c0da9ea 100644 --- a/lib/spin/cli.rb +++ b/lib/spin/cli.rb @@ -6,7 +6,7 @@ module CLI class << self def run(argv) options = { - :preload => "config/boot.rb" + :preload => "config/application.rb" } options[:preload] = "config/boot.rb" if ENV['PADRINO_ENV'] From 8f1aa040e93f68ef7413eb6b8d986f2781d06a6a Mon Sep 17 00:00:00 2001 From: Smit Shah Date: Sun, 17 Nov 2013 20:20:14 +0530 Subject: [PATCH 5/5] Reverted the version change --- CHANGELOG.md | 5 +---- lib/spin/version.rb | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4713e1f..7ff43a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,9 @@ ## Master branch -## Version 0.7.2 (Nov 17, 2013) - -* Added Padrino support - ## Version 0.7.1 (Aug 19, 2013) * fixed capability with MRI 2.0 [Todd Mazierski and Jonathan del Strother] +* Added Padrino support ## Version 0.7.0 (Jul 23, 2013) diff --git a/lib/spin/version.rb b/lib/spin/version.rb index 0e1adea..f8835ce 100644 --- a/lib/spin/version.rb +++ b/lib/spin/version.rb @@ -1,3 +1,3 @@ module Spin - VERSION = "0.7.2" + VERSION = "0.7.1" end