zeus 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,14 +1,10 @@
1
1
  # Zeus
2
2
 
3
- ## What?
3
+ ## What is Zeus?
4
4
 
5
- Zeus preloads your app so that your normal development tasks such as `console`, `server`, `generate`, and tests are faster.
5
+ Zeus preloads your app so that your normal development tasks such as `console`, `server`, `generate`, and tests take **ONE second**.
6
6
 
7
- [Mediocre screencast](http://burke.libbey.me/zeus.mov). Better one coming soon.
8
-
9
- ## Why?
10
-
11
- Because waiting 25 seconds sucks, but waiting 0.4 seconds doesn't.
7
+ ### [Watch the screencast!](http://vimeo.com/burkelibbey/zeus)
12
8
 
13
9
  ## Requirements
14
10
 
@@ -26,10 +22,6 @@ Install the gem.
26
22
 
27
23
  gem install zeus
28
24
 
29
- Run the project initializer.
30
-
31
- zeus init
32
-
33
25
  ## Usage
34
26
 
35
27
  Start the server:
@@ -46,31 +38,15 @@ Run some commands:
46
38
  zeus runner omg.rb
47
39
 
48
40
 
49
- ## TODO (roughly prioritized)
50
-
51
- * Make sure that when a command process's connection is dropped, it is killed
52
- * less leaky handling of at_exit pid killing
53
- * Instead of exiting when requesting an as-yet-unbooted acceptor, wait until it's available then run.
54
- * Refactor, refactor, refactor...
55
- * Make sure client connection requests are handled immediately (Chunk the select loop)
56
- * Don't fork to handshake client to acceptor
57
- * Eliminate the client-side exit lag for zeus commands.
58
- * Support other frameworks?
59
- * Figure out how to run full test suites without multiple env loads
60
-
61
- ## Ideas (not quite TODOs)
62
-
63
- * (maybe) Start the preloader as a daemon transparently when any command is run, then wait for it to finish
64
- * Support inotify on linux
65
-
66
41
  ## Contributing
67
42
 
68
43
  Fork, Branch, Pull Request.
69
44
 
70
45
  ## Thanks...
71
46
 
72
- * To [Jesse Storimer](http://github.com/jstorimer) for spin, part of the inspiration for this project
47
+ * To [Stefan Penner](http://github.com/stefanpenner) for discussion and various contributions.
73
48
  * To [Samuel Kadolph](http://github.com/samuelkadolph) for doing most of the cross-process pseudoterminal legwork.
49
+ * To [Jesse Storimer](http://github.com/jstorimer) for spin, part of the inspiration for this project
74
50
  * To [Shopify](http://github.com/Shopify) for letting me spend (some of) my days working on this.
75
51
 
76
52
  ## Doesn't work for you?
data/TODO.md ADDED
@@ -0,0 +1,18 @@
1
+ ## TODO (roughly prioritized)
2
+
3
+ * Make sure that when a command process's connection is dropped, it is killed
4
+ * less leaky handling of at_exit pid killing
5
+ * Instead of exiting when requesting an as-yet-unbooted acceptor, wait until it's available then run.
6
+ * Refactor, refactor, refactor...
7
+ * Make sure client connection requests are handled immediately (Chunk the select loop)
8
+ * Don't fork to handshake client to acceptor
9
+ * Eliminate the client-side exit lag for zeus commands.
10
+ * Support other frameworks?
11
+ * Figure out how to run full test suites without multiple env loads
12
+
13
+ ## Ideas (not quite TODOs)
14
+
15
+ * (maybe) Start the preloader as a daemon transparently when any command is run, then wait for it to finish
16
+ * Support inotify on linux
17
+
18
+
data/lib/thrud.rb CHANGED
@@ -55,7 +55,7 @@ BANNER
55
55
  else
56
56
  # this is super non-generic. problem for future-burke.
57
57
  project_tasks = self.class.instance_variable_get("@tasks").
58
- reject{|k,_|['initialize', 'version', 'init', 'start', 'help'].include?(k)}.values.uniq
58
+ reject{|k,v|['definition_file', 'initialize', 'version', 'init', 'start', 'help'].include?(v.method_name.to_s)}.values.uniq
59
59
 
60
60
  tasks = project_tasks.map { |task|
61
61
  " zeus %-14s # %s" % [task.method_name, task.desc]
@@ -67,6 +67,7 @@ Global Commands:
67
67
  zeus help [COMMAND] # show help for a specific command
68
68
  zeus init # #{task_for_name(:init).desc}
69
69
  zeus start # #{task_for_name(:start).desc}
70
+ zeus version # #{task_for_name(:version).desc}
70
71
 
71
72
  Project-local Commands:
72
73
  #{tasks.join("\n")}
data/lib/zeus/cli.rb CHANGED
@@ -34,10 +34,10 @@ module Zeus
34
34
  D
35
35
  def start
36
36
  begin
37
- require './.zeus.rb'
37
+ require self.class.definition_file
38
38
  rescue LoadError
39
- Zeus.ui.error("Your project is missing a config file (.zeus.rb), or you are not\n"\
40
- "in the project root. You can run `zeus init` to generate a config file.")
39
+ Zeus.ui.error("Your project is missing a config file (.zeus.rb), and it doesn't appear\n"\
40
+ "to be a rails project. You can run `zeus init` to generate a config file.")
41
41
  exit 1
42
42
  end
43
43
  Zeus::Server.new.run
@@ -53,8 +53,16 @@ module Zeus
53
53
  end
54
54
  map %w(-v --version) => :version
55
55
 
56
+ def self.definition_file
57
+ if !File.exists?('.zeus.rb') && File.exists?('script/rails')
58
+ File.expand_path("../templates/rails.rb", __FILE__)
59
+ else
60
+ '.zeus.rb'
61
+ end
62
+ end
63
+
56
64
  begin
57
- require './.zeus.rb'
65
+ require definition_file
58
66
  Zeus::Server.acceptors.each do |acc|
59
67
  desc acc.name, (acc.description || "#{acc.name} task defined in .zeus.rb")
60
68
  define_method(acc.name) { |*args|
@@ -65,5 +73,6 @@ module Zeus
65
73
  rescue LoadError
66
74
  end
67
75
 
76
+
68
77
  end
69
78
  end
@@ -4,10 +4,10 @@ Zeus::Server.define! do
4
4
  stage :boot do
5
5
 
6
6
  action do
7
- ENV_PATH = File.expand_path('../config/environment', __FILE__)
8
- BOOT_PATH = File.expand_path('../config/boot', __FILE__)
9
- APP_PATH = File.expand_path('../config/application', __FILE__)
10
- ROOT_PATH = File.expand_path('..', __FILE__)
7
+ ROOT_PATH = File.expand_path(Dir.pwd)
8
+ ENV_PATH = File.expand_path('config/environment', ROOT_PATH)
9
+ BOOT_PATH = File.expand_path('config/boot', ROOT_PATH)
10
+ APP_PATH = File.expand_path('config/application', ROOT_PATH)
11
11
 
12
12
  require BOOT_PATH
13
13
  require 'rails/all'
@@ -57,21 +57,21 @@ Zeus::Server.define! do
57
57
  end
58
58
  end
59
59
 
60
- # stage :test do
61
- # action do
62
- # Rails.env = ENV['RAILS_ENV'] = "test"
63
- # Bundler.require(:test)
64
- # require APP_PATH
65
- # Rails.application.require_environment!
66
- # end
67
-
68
- # command :testrb do
69
- # (r = Test::Unit::AutoRunner.new(true)).process_args(ARGV) or
70
- # abort r.options.banner + " tests..."
71
- # exit r.run
72
- # end
73
-
74
- # end
60
+ stage :test do
61
+ action do
62
+ Rails.env = ENV['RAILS_ENV'] = "test"
63
+ Bundler.require(:test)
64
+ require APP_PATH
65
+ Rails.application.require_environment!
66
+ end
67
+
68
+ command :testrb do
69
+ (r = Test::Unit::AutoRunner.new(true)).process_args(ARGV) or
70
+ abort r.options.banner + " tests..."
71
+ exit r.run
72
+ end
73
+
74
+ end
75
75
 
76
76
  end
77
77
  end
data/lib/zeus/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Zeus
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zeus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -24,6 +24,7 @@ files:
24
24
  - LICENSE
25
25
  - README.md
26
26
  - Rakefile
27
+ - TODO.md
27
28
  - bin/zeus
28
29
  - ext/fsevents-wrapper/fsevents-wrapper
29
30
  - ext/fsevents-wrapper/main.m