spork 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/mkrf_conf.rb +2 -1
- data/lib/spork/app_framework.rb +3 -0
- data/lib/spork/app_framework/padrino.rb +22 -0
- data/lib/spork/diagnoser.rb +2 -0
- metadata +4 -3
data/ext/mkrf_conf.rb
CHANGED
@@ -15,7 +15,8 @@ if RUBY_PLATFORM =~ /mswin|mingw/ and RUBY_VERSION < '1.9.1'
|
|
15
15
|
STDERR.puts "installing windows dependencies"
|
16
16
|
begin
|
17
17
|
inst.install "win32-process", "~> 0.6.1"
|
18
|
-
rescue
|
18
|
+
rescue => e
|
19
|
+
STDERR.puts "Failed to install necessary dependency gem win32-process: #{e}"
|
19
20
|
exit(1)
|
20
21
|
end
|
21
22
|
end
|
data/lib/spork/app_framework.rb
CHANGED
@@ -5,6 +5,9 @@ class Spork::AppFramework
|
|
5
5
|
#
|
6
6
|
# This is used to reduce the amount of code needed to be loaded - only the detected application framework's support code is loaded.
|
7
7
|
SUPPORTED_FRAMEWORKS = {
|
8
|
+
:Padrino => lambda {
|
9
|
+
File.exist?("config/boot.rb") && File.read("config/boot.rb").include?('PADRINO')
|
10
|
+
},
|
8
11
|
:Rails => lambda {
|
9
12
|
File.exist?("config/environment.rb") && File.read("config/environment.rb").include?('RAILS_GEM_VERSION')
|
10
13
|
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class Spork::AppFramework::Padrino < Spork::AppFramework
|
2
|
+
|
3
|
+
def preload(&block)
|
4
|
+
STDERR.puts "Preloading Padrino environment"
|
5
|
+
STDERR.flush
|
6
|
+
ENV["PADRINO_ENV"] ||= "test"
|
7
|
+
require boot_file
|
8
|
+
# Make it so that we don't have to restart Spork if we change, say, a model or routes
|
9
|
+
Spork.each_run { ::Padrino.reload! }
|
10
|
+
yield
|
11
|
+
end
|
12
|
+
|
13
|
+
def entry_point
|
14
|
+
@entry_point ||= File.expand_path("config/boot.rb", Dir.pwd)
|
15
|
+
end
|
16
|
+
alias :boot_file :entry_point
|
17
|
+
|
18
|
+
def boot_contents
|
19
|
+
@boot_contents ||= File.read(boot_file)
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
data/lib/spork/diagnoser.rb
CHANGED
@@ -30,11 +30,13 @@ class Spork::Diagnoser
|
|
30
30
|
::Spork::Diagnoser.add_included_file(string, caller)
|
31
31
|
require_without_diagnoser(string)
|
32
32
|
end
|
33
|
+
private :require
|
33
34
|
|
34
35
|
def load(string)
|
35
36
|
::Spork::Diagnoser.add_included_file(string, caller)
|
36
37
|
load_without_diagnoser(string)
|
37
38
|
end
|
39
|
+
private :load
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 8
|
8
|
-
-
|
9
|
-
version: 0.8.
|
8
|
+
- 4
|
9
|
+
version: 0.8.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Tim Harper
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-06-11 00:00:00 -06:00
|
19
19
|
default_executable: spork
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -33,6 +33,7 @@ files:
|
|
33
33
|
- geminstaller.yml
|
34
34
|
- README.rdoc
|
35
35
|
- MIT-LICENSE
|
36
|
+
- lib/spork/app_framework/padrino.rb
|
36
37
|
- lib/spork/app_framework/rails.rb
|
37
38
|
- lib/spork/app_framework/rails_stub_files/application.rb
|
38
39
|
- lib/spork/app_framework/rails_stub_files/application_controller.rb
|