spawngebob 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ -- 0.1.5
2
+ * creating for required dirs now happens only in configure
3
+ * error color red will not span anymore after the error message
4
+ * changed color in nginx script to call tput setaf rather than escape codes
5
+
1
6
  -- 0.1.4
2
7
 
3
8
  * thor for CLI
data/README.md ADDED
@@ -0,0 +1,4 @@
1
+ # Spawngebob
2
+ ## nginx config generator
3
+ ## self-contained, user level nginx web service
4
+
@@ -2,6 +2,8 @@ require 'thor'
2
2
 
3
3
  module Spawngebob
4
4
  class CLI < Thor
5
+ include Constants
6
+
5
7
  desc "start", "start nginx"
6
8
  def start
7
9
  Runner.boot(options)
@@ -29,6 +31,17 @@ module Spawngebob
29
31
 
30
32
  desc "configure", "generate conf files"
31
33
  def configure
34
+ # create necessary directories if not exist
35
+ NGINX_DIRS.each do |d|
36
+ full_path = File.join(NGINX_PATH, d)
37
+
38
+ if !File.exists? full_path
39
+ Utils.say_with_time "Directory #{full_path} does not exist, creating..." do
40
+ FileUtils.mkdir_p(full_path)
41
+ end
42
+ end
43
+ end
44
+
32
45
  Runner.boot(options)
33
46
  end
34
47
  end
@@ -12,17 +12,6 @@ module Spawngebob
12
12
  end
13
13
 
14
14
  def self.has_requirements?
15
- # create necessary directories if not exist
16
- NGINX_DIRS.each do |d|
17
- full_path = File.join(NGINX_PATH, d)
18
-
19
- if !File.exists? full_path
20
- Utils.say_with_time "Directory #{full_path} does not exist, creating..." do
21
- FileUtils.mkdir_p(full_path)
22
- end
23
- end
24
- end
25
-
26
15
  # check if nginx is installed
27
16
  if !Constants.const_defined?("NGINX_BIN")
28
17
  Utils.error "Nginx is not installed!"
@@ -18,7 +18,7 @@ module Spawngebob
18
18
  end
19
19
 
20
20
  def self.error(message, code=-1)
21
- say("\033[0;31merror: #{message}")
21
+ say("\033[31merror: #{message}")
22
22
  exit(code)
23
23
  end
24
24
  end
@@ -1,3 +1,3 @@
1
1
  module Spawngebob
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
data/script/nginx CHANGED
@@ -1,14 +1,15 @@
1
1
  #!/usr/bin/env sh
2
+
2
3
  nginx=`which nginx`
3
4
  nginx_path=$HOME/.spawngebob/nginx/
4
5
  pid_file="${nginx_path}run/nginx.pid"
5
6
  prog=$(basename $nginx)
6
7
 
7
8
  # colors
8
- green="\033[0;32m"
9
- yellow="\033[0;33m"
10
- red="\033[0;31m"
11
- clear="\033[0;0m"
9
+ green=$(tput setaf 2)
10
+ yellow=$(tput setaf 3)
11
+ red=$(tput setaf 1)
12
+ clear=$(tput setaf 7)
12
13
  nginx_conf_file="$HOME/.spawngebob/nginx/conf/nginx.conf"
13
14
 
14
15
  lockfile=$HOME/.spawngebob/nginx/tmp/nginx.lock
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spawngebob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-10 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70360117758740 !ruby/object:Gem::Requirement
16
+ requirement: &70293146924520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70360117758740
24
+ version_requirements: *70293146924520
25
25
  description: ''
26
26
  email:
27
27
  - poymode@gmail.com
@@ -33,6 +33,7 @@ files:
33
33
  - .gitignore
34
34
  - CHANGELOG
35
35
  - Gemfile
36
+ - README.md
36
37
  - Rakefile
37
38
  - bin/spawn
38
39
  - lib/spawngebob.rb