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.
Files changed (42) hide show
  1. data/History.txt +21 -0
  2. data/Rakefile +8 -5
  3. data/bin/ruby-station +14 -11
  4. data/config.rb +10 -5
  5. data/controller/applications.rb +18 -25
  6. data/model/application.rb +35 -1
  7. data/model/init.rb +1 -1
  8. data/ruby-station.gemspec +39 -25
  9. data/runtime/VERSION +1 -1
  10. data/runtime/lib/ruby-station.rb +0 -2
  11. data/runtime/ruby-station-runtime-0.0.5.gem +0 -0
  12. data/runtime/ruby-station-runtime.gemspec +26 -0
  13. data/sample.config.yaml +3 -1
  14. data/tests/README +10 -7
  15. data/tests/Rakefile +11 -0
  16. data/tests/console.rb +11 -0
  17. data/tests/data/conf_dir/config.yaml +4 -2
  18. data/tests/data/hello/hello-ruby-station.gemspec +34 -0
  19. data/tests/data/hello/main.rb +15 -0
  20. data/tests/data/hello/pkg/hello-ruby-station-0.3.1.gem +0 -0
  21. data/tests/data/hello/pkg/hello-ruby-station-0.3.2.gem +0 -0
  22. data/tests/development/config.yaml +9 -0
  23. data/tests/features/install_file.feature +3 -3
  24. data/tests/features/list.feature +5 -6
  25. data/tests/features/reinstall.feature +10 -0
  26. data/tests/features/step_definitions/application_steps.rb +56 -9
  27. data/tests/features/step_definitions/{curelity_steps.rb → culerity_steps.rb} +8 -2
  28. data/tests/features/support/env.rb +1 -1
  29. data/tests/features/uninstall.feature +6 -7
  30. data/tests/features/upgrade.feature +8 -6
  31. data/tests/spec/application.rb +51 -0
  32. data/tests/spec/gem_manager.rb +22 -10
  33. data/tests/spec/servant.rb +33 -0
  34. data/tests/test_helper.rb +7 -11
  35. data/util/gem_manager.rb +63 -24
  36. data/view/applications/uninstall.xhtml +1 -1
  37. data/view/index.xhtml +1 -1
  38. metadata +54 -16
  39. data/ChangeLog +0 -3
  40. data/runtime/lib/ruby-station/helper/rails.rb +0 -64
  41. data/runtime/lib/ruby-station/helper.rb +0 -5
  42. 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
@@ -1,5 +0,0 @@
1
- module RubyStation
2
- module Helper
3
- autoload :Rails, "ruby-station/helper/rails.rb"
4
- end
5
- end
Binary file