ruby-station 0.1.3 → 0.1.4.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +21 -0
- data/Rakefile +8 -5
- data/bin/ruby-station +14 -11
- data/config.rb +10 -5
- data/controller/applications.rb +18 -25
- data/model/application.rb +35 -1
- data/model/init.rb +1 -1
- data/ruby-station.gemspec +39 -25
- data/runtime/VERSION +1 -1
- data/runtime/lib/ruby-station.rb +0 -2
- data/runtime/ruby-station-runtime-0.0.5.gem +0 -0
- data/runtime/ruby-station-runtime.gemspec +26 -0
- data/sample.config.yaml +3 -1
- data/tests/README +10 -7
- data/tests/Rakefile +11 -0
- data/tests/console.rb +11 -0
- data/tests/data/conf_dir/config.yaml +4 -2
- data/tests/data/hello/hello-ruby-station.gemspec +34 -0
- data/tests/data/hello/main.rb +15 -0
- data/tests/data/hello/pkg/hello-ruby-station-0.3.1.gem +0 -0
- data/tests/data/hello/pkg/hello-ruby-station-0.3.2.gem +0 -0
- data/tests/development/config.yaml +9 -0
- data/tests/features/install_file.feature +3 -3
- data/tests/features/list.feature +5 -6
- data/tests/features/reinstall.feature +10 -0
- data/tests/features/step_definitions/application_steps.rb +56 -9
- data/tests/features/step_definitions/{curelity_steps.rb → culerity_steps.rb} +8 -2
- data/tests/features/support/env.rb +1 -1
- data/tests/features/uninstall.feature +6 -7
- data/tests/features/upgrade.feature +8 -6
- data/tests/spec/application.rb +51 -0
- data/tests/spec/gem_manager.rb +22 -10
- data/tests/spec/servant.rb +33 -0
- data/tests/test_helper.rb +7 -11
- data/util/gem_manager.rb +63 -24
- data/view/applications/uninstall.xhtml +1 -1
- data/view/index.xhtml +1 -1
- metadata +54 -16
- data/ChangeLog +0 -3
- data/runtime/lib/ruby-station/helper/rails.rb +0 -64
- data/runtime/lib/ruby-station/helper.rb +0 -5
- data/runtime/ruby-station-runtime-0.0.4.gem +0 -0
@@ -1,64 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
module RubyStation
|
3
|
-
module Helper
|
4
|
-
|
5
|
-
# This module helps invoking Rails apps.
|
6
|
-
# During execution of the application, Rails writes data to
|
7
|
-
# many directories (db/, log/, tmp/).
|
8
|
-
# So this helper copies all the files into data_dir and
|
9
|
-
# invoke the app within the directory.
|
10
|
-
#
|
11
|
-
# Be sure to run 'rake db:migrate RAILS_ENV=produciton'
|
12
|
-
# before you create the gem of your app.
|
13
|
-
#
|
14
|
-
# @example
|
15
|
-
# RubyStation::Helper::Rails.run
|
16
|
-
#
|
17
|
-
# @api external
|
18
|
-
|
19
|
-
module Rails
|
20
|
-
|
21
|
-
# Copy files (if needed) and start Rails server.
|
22
|
-
#
|
23
|
-
# @api external
|
24
|
-
def self.run
|
25
|
-
caller_path = caller[0][/^(.*):/, 1]
|
26
|
-
self.install(File.dirname(caller_path))
|
27
|
-
|
28
|
-
Dir.chdir(RubyStation.data_dir)
|
29
|
-
self.start_server
|
30
|
-
end
|
31
|
-
|
32
|
-
# Ensure your app is copied to data_dir.
|
33
|
-
# It does nothing if already copied.
|
34
|
-
#
|
35
|
-
# @api internal
|
36
|
-
def self.install(app_dir)
|
37
|
-
# Note: "." is needed, otherwise copied as data_dir/appname/*
|
38
|
-
from = File.join(app_dir, ".")
|
39
|
-
to = RubyStation.data_dir
|
40
|
-
|
41
|
-
unless installed?(from, to)
|
42
|
-
FileUtils.cp_r(from, to)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# Checks if the files are copied
|
47
|
-
#
|
48
|
-
# @api internal
|
49
|
-
def self.installed?(from, to)
|
50
|
-
# Note: Too simple?
|
51
|
-
File.exist?(File.join(to, "main.rb"))
|
52
|
-
end
|
53
|
-
|
54
|
-
# Start Rails with 'script/server'.
|
55
|
-
#
|
56
|
-
# @api internal
|
57
|
-
def self.start_server
|
58
|
-
Dir.chdir(RubyStation.data_dir)
|
59
|
-
# TODO: Support Windows
|
60
|
-
exec "./script/server -p #{RubyStation.port} -e production"
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
Binary file
|