hoof 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile CHANGED
@@ -4,6 +4,7 @@ gem 'daemons'
4
4
  gem 'eventmachine'
5
5
  gem 'unicorn'
6
6
  gem 'http_parser'
7
+ gem 'thor'
7
8
 
8
9
  group :development do
9
10
  gem "shoulda", ">= 0"
data/Gemfile.lock CHANGED
@@ -14,6 +14,7 @@ GEM
14
14
  rake (0.8.7)
15
15
  rcov (0.9.9)
16
16
  shoulda (2.11.3)
17
+ thor (0.14.6)
17
18
  unicorn (3.6.2)
18
19
  kgio (~> 2.3)
19
20
  rack
@@ -29,4 +30,5 @@ DEPENDENCIES
29
30
  jeweler (~> 1.6.0)
30
31
  rcov
31
32
  shoulda
33
+ thor
32
34
  unicorn
data/README.rdoc CHANGED
@@ -1,28 +1,47 @@
1
- = hoof
1
+ = Hoof
2
2
 
3
3
  Linux version of https://github.com/37signals/pow/
4
4
 
5
- Now we have a simple resolver.
5
+ == Installation
6
6
 
7
- Compile:
7
+ === Gem
8
8
 
9
- make
9
+ At first - install gem
10
10
 
11
- To install just symlink libnss_hoof.so.2 to /lib/libnss_hoof.so.2
11
+ <tt>gem install hoof</tt>
12
12
 
13
- cd /lib; sudo ln -s /path/to/hoof/libnss_hoof.so.2 libnss_hoof.so.2
13
+ === NSS extension
14
+
15
+ Second step - you should compile and install libnss_hoof.so.
16
+
17
+ Compile: cd /to/your/gems/installation/path/gems/hoof-x.x.x/ext and +make+
18
+
19
+ Install: just symlink maked libnss_hoof.so.2 to /lib/libnss_hoof.so.2. Like this:
20
+
21
+ <tt>cd /lib; sudo ln -sf /to/your/gems/installation/path/gems/hoof-x.x.x/ext/libnss_hoof.so.2</tt>
14
22
 
15
23
  Then change your /etc/nsswitch.conf like this:
16
24
 
17
- hosts: hoof files mdns4_minimal [NOTFOUND=return] dns mdns4
25
+ <tt>hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 hoof</tt>
26
+
27
+ === Application
28
+
29
+ Next step - initialize hoof for application:
30
+
31
+ <tt>mkdir ~/.hoof && ln -s /path/to/app ~/.hoof/app</tt>
32
+
33
+ Then add unicorn to your app Gembile and bundle it.
34
+
35
+
36
+
37
+ == Daemon
18
38
 
19
- Next step - mkdir ~/.hoof
39
+ Hoof has basic cli for controlling.
20
40
 
21
- Then at ~/.hoof create symlink anywhere. Like this:
41
+ Use <tt>hoof</tt> executable to start daemon. Read <tt>hoof help</tt>
22
42
 
23
- cd ~/.hoof; ln -s ~/work/my_project cool_project
43
+ Start your browser and go to http://app.dev:3001
24
44
 
25
- ping cool_project.dev - Wuola!
26
45
 
27
46
 
28
47
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
data/bin/hoof CHANGED
@@ -1,10 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # -*- encoding: utf-8 -*-
3
3
 
4
- require 'daemons'
5
- require 'hoof'
4
+ require 'hoof/cli'
6
5
 
7
- Daemons.run_proc 'hoof', :dir_mode => :normal, :dir => '/tmp', :log_output => true do
8
- Hoof.start
9
- end
6
+ Hoof::Cli.start
10
7
 
data/hoof.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{hoof}
8
- s.version = "0.0.0"
8
+ s.version = "0.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["pyromaniac"]
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
34
34
  "lib/hoof.rb",
35
35
  "lib/hoof/application.rb",
36
36
  "lib/hoof/application_pool.rb",
37
+ "lib/hoof/cli.rb",
37
38
  "lib/hoof/http_server.rb",
38
39
  "lib/hoof/unicorn_config.rb",
39
40
  "test/helper.rb",
@@ -54,6 +55,7 @@ Gem::Specification.new do |s|
54
55
  s.add_runtime_dependency(%q<eventmachine>, [">= 0"])
55
56
  s.add_runtime_dependency(%q<unicorn>, [">= 0"])
56
57
  s.add_runtime_dependency(%q<http_parser>, [">= 0"])
58
+ s.add_runtime_dependency(%q<thor>, [">= 0"])
57
59
  s.add_development_dependency(%q<shoulda>, [">= 0"])
58
60
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
59
61
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.0"])
@@ -63,6 +65,7 @@ Gem::Specification.new do |s|
63
65
  s.add_dependency(%q<eventmachine>, [">= 0"])
64
66
  s.add_dependency(%q<unicorn>, [">= 0"])
65
67
  s.add_dependency(%q<http_parser>, [">= 0"])
68
+ s.add_dependency(%q<thor>, [">= 0"])
66
69
  s.add_dependency(%q<shoulda>, [">= 0"])
67
70
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
68
71
  s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
@@ -73,6 +76,7 @@ Gem::Specification.new do |s|
73
76
  s.add_dependency(%q<eventmachine>, [">= 0"])
74
77
  s.add_dependency(%q<unicorn>, [">= 0"])
75
78
  s.add_dependency(%q<http_parser>, [">= 0"])
79
+ s.add_dependency(%q<thor>, [">= 0"])
76
80
  s.add_dependency(%q<shoulda>, [">= 0"])
77
81
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
78
82
  s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
@@ -5,6 +5,10 @@ module Hoof
5
5
  self[name] ||= Hoof::Application.new name
6
6
  end
7
7
 
8
+ def list
9
+ keys
10
+ end
11
+
8
12
  def stop
9
13
  each do |(name, app)|
10
14
  app.stop
data/lib/hoof/cli.rb ADDED
@@ -0,0 +1,33 @@
1
+ require "thor"
2
+ require 'daemons'
3
+ require "hoof"
4
+
5
+ module Hoof
6
+ class Cli < Thor
7
+
8
+ default_task :start
9
+
10
+ desc "start", "Starts hoof daemon"
11
+ def start
12
+ daemon 'start'
13
+ end
14
+
15
+ desc "stop", "Stops hoof daemon"
16
+ def stop
17
+ daemon 'stop'
18
+ end
19
+
20
+ #desc "list", "Lists started applications"
21
+ #def list
22
+ #end
23
+
24
+ private
25
+
26
+ def daemon *argv
27
+ Daemons.run_proc 'hoof', :dir_mode => :normal, :dir => '/tmp', :log_output => true, :ARGV => argv.flatten do
28
+ Hoof.start
29
+ end
30
+ end
31
+
32
+ end
33
+ end
@@ -16,7 +16,7 @@ module Hoof
16
16
  name = host.gsub(/.dev$/, '')
17
17
  application = Hoof.application name
18
18
 
19
- if application.static? parser.path.split('?', 2)[0]
19
+ if application && application.static?(parser.path.split('?', 2)[0])
20
20
  p "serve static #{host}#{parser.path}"
21
21
  send_data application.serve_static parser.path.split('?', 2)[0]
22
22
  close_connection_after_writing
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoof
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 0
10
- version: 0.0.0
9
+ - 1
10
+ version: 0.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - pyromaniac
@@ -86,10 +86,24 @@ dependencies:
86
86
  version: "0"
87
87
  requirement: *id005
88
88
  prerelease: false
89
+ type: :runtime
90
+ name: thor
91
+ - !ruby/object:Gem::Dependency
92
+ version_requirements: &id006 !ruby/object:Gem::Requirement
93
+ none: false
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ hash: 3
98
+ segments:
99
+ - 0
100
+ version: "0"
101
+ requirement: *id006
102
+ prerelease: false
89
103
  type: :development
90
104
  name: shoulda
91
105
  - !ruby/object:Gem::Dependency
92
- version_requirements: &id006 !ruby/object:Gem::Requirement
106
+ version_requirements: &id007 !ruby/object:Gem::Requirement
93
107
  none: false
94
108
  requirements:
95
109
  - - ~>
@@ -100,12 +114,12 @@ dependencies:
100
114
  - 0
101
115
  - 0
102
116
  version: 1.0.0
103
- requirement: *id006
117
+ requirement: *id007
104
118
  prerelease: false
105
119
  type: :development
106
120
  name: bundler
107
121
  - !ruby/object:Gem::Dependency
108
- version_requirements: &id007 !ruby/object:Gem::Requirement
122
+ version_requirements: &id008 !ruby/object:Gem::Requirement
109
123
  none: false
110
124
  requirements:
111
125
  - - ~>
@@ -116,12 +130,12 @@ dependencies:
116
130
  - 6
117
131
  - 0
118
132
  version: 1.6.0
119
- requirement: *id007
133
+ requirement: *id008
120
134
  prerelease: false
121
135
  type: :development
122
136
  name: jeweler
123
137
  - !ruby/object:Gem::Dependency
124
- version_requirements: &id008 !ruby/object:Gem::Requirement
138
+ version_requirements: &id009 !ruby/object:Gem::Requirement
125
139
  none: false
126
140
  requirements:
127
141
  - - ">="
@@ -130,7 +144,7 @@ dependencies:
130
144
  segments:
131
145
  - 0
132
146
  version: "0"
133
- requirement: *id008
147
+ requirement: *id009
134
148
  prerelease: false
135
149
  type: :development
136
150
  name: rcov
@@ -159,6 +173,7 @@ files:
159
173
  - lib/hoof.rb
160
174
  - lib/hoof/application.rb
161
175
  - lib/hoof/application_pool.rb
176
+ - lib/hoof/cli.rb
162
177
  - lib/hoof/http_server.rb
163
178
  - lib/hoof/unicorn_config.rb
164
179
  - test/helper.rb