peony 0.1.9 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/bin/peony +2 -2
  3. data/lib/peony/actions.rb +66 -20
  4. data/lib/peony/{utils.rb → configure.rb} +13 -40
  5. data/lib/peony/default.rb +9 -2
  6. data/lib/peony/rake.rb +1 -1
  7. data/lib/peony/scope.rb +82 -0
  8. data/lib/peony/settings.rb +24 -23
  9. data/lib/peony/shell/basic.rb +19 -17
  10. data/lib/peony/shell.rb +3 -4
  11. data/lib/peony/version.rb +1 -1
  12. data/lib/peony.rb +6 -3
  13. data/recipes/db/mongo.rake +26 -26
  14. data/recipes/db/mysql.rake +46 -28
  15. data/recipes/db/pg.rake +20 -17
  16. data/recipes/db/redis.rake +22 -20
  17. data/recipes/elasticsearch.rake +14 -12
  18. data/recipes/httpd.rake +20 -18
  19. data/recipes/nginx/www.rake +8 -6
  20. data/recipes/nginx.rake +25 -23
  21. data/recipes/php.rake +10 -5
  22. data/spec/peony_spec.rb +3 -0
  23. data/spec/scope_spec.rb +48 -0
  24. data/spec/settings_in_rake_spec.rb +61 -1
  25. data/spec/settings_spec.rb +2 -2
  26. data/spec/spec_helper.rb +1 -3
  27. data/templates/elasticsearch/config.yml.erb +48 -34
  28. data/templates/elasticsearch/logging.yml.erb +3 -1
  29. data/templates/httpd/extra/httpd-autoindex.conf.erb +2 -2
  30. data/templates/httpd/extra/httpd-dav.conf.erb +4 -4
  31. data/templates/httpd/extra/httpd-mpm.conf.erb +1 -1
  32. data/templates/httpd/extra/httpd-multilang-errordoc.conf.erb +2 -2
  33. data/templates/httpd/httpd.conf.erb +8 -8
  34. data/templates/mongo/master.conf.erb +8 -8
  35. data/templates/mongo/slave.conf.erb +9 -9
  36. data/templates/mysql/my.cnf.erb +48 -34
  37. data/templates/nginx/sites-enabled/php.conf.erb +7 -7
  38. data/templates/nginx/sites-enabled/static.conf.erb +4 -4
  39. data/templates/nginx/www.conf.erb +77 -77
  40. data/templates/redis.conf.erb +13 -13
  41. metadata +6 -3
@@ -1,91 +1,91 @@
1
1
  #user usergroup
2
- user <%= user %> <%= group %>;
2
+ user <%= user %> <%= group %>;
3
3
 
4
- worker_processes <%= worker_processes %>;
4
+ worker_processes <%= nginx.worker_processes %>;
5
5
 
6
6
  #[debug, info, notice, warn, error, crit]
7
- error_log www_error.log debug;
8
- pid <%= nginx_run_dir %>/www.pid;
7
+ error_log www_error.log debug;
8
+ pid <%= nginx.run_dir %>/www.pid;
9
9
 
10
- worker_rlimit_nofile 8192;
10
+ worker_rlimit_nofile 8192;
11
11
 
12
12
  #async IO event model.
13
13
  events {
14
- worker_connections 8192;
14
+ worker_connections 8192;
15
15
  }
16
16
 
17
17
  http {
18
- include conf/mime.types;
19
- default_type application/octet-stream;
20
-
21
- log_format main '$remote_addr – $remote_user [$time_local] $status '
22
- '"$request" $body_bytes_sent "$http_referer" '
23
- '"$http_user_agent" "$http_x_forwarded_for"';
24
-
25
- access_log www_access.log main;
26
-
27
- server_names_hash_bucket_size 128;
28
- client_header_buffer_size 32k;
29
- large_client_header_buffers 4 128k;
30
- client_max_body_size 32m;
31
- client_body_buffer_size 512k;
32
-
33
- sendfile on;
34
- tcp_nopush on;
35
- tcp_nodelay on;
36
-
37
- keepalive_timeout 60;
38
-
39
- fastcgi_connect_timeout 300;
40
- fastcgi_send_timeout 300;
41
- fastcgi_read_timeout 300;
42
- fastcgi_buffer_size 64k;
43
- fastcgi_buffers 4 64k;
44
- fastcgi_busy_buffers_size 128k;
45
- fastcgi_temp_file_write_size 128k;
46
-
47
- gzip on;
48
- gzip_min_length 1k;
49
- gzip_buffers 4 16k;
50
- gzip_http_version 1.1;
51
- gzip_comp_level 2;
52
- gzip_types text/plain application/x-javascript text/css application/xml;
53
- gzip_vary on;
54
-
55
-
56
- <%- upstreams.each do|up| -%>
57
- upstream <%= up[:name] %> {
58
- <%- up[:servers].each do|config| -%>
59
- server <%= config %>;
18
+ include conf/mime.types;
19
+ default_type application/octet-stream;
20
+
21
+ log_format main '$remote_addr – $remote_user [$time_local] $status '
22
+ '"$request" $body_bytes_sent "$http_referer" '
23
+ '"$http_user_agent" "$http_x_forwarded_for"';
24
+
25
+ access_log www_access.log main;
26
+
27
+ server_names_hash_bucket_size 128;
28
+ client_header_buffer_size 32k;
29
+ large_client_header_buffers 4 128k;
30
+ client_max_body_size 32m;
31
+ client_body_buffer_size 512k;
32
+
33
+ sendfile on;
34
+ tcp_nopush on;
35
+ tcp_nodelay on;
36
+
37
+ keepalive_timeout 60;
38
+
39
+ fastcgi_connect_timeout 300;
40
+ fastcgi_send_timeout 300;
41
+ fastcgi_read_timeout 300;
42
+ fastcgi_buffer_size 64k;
43
+ fastcgi_buffers 4 64k;
44
+ fastcgi_busy_buffers_size 128k;
45
+ fastcgi_temp_file_write_size 128k;
46
+
47
+ gzip on;
48
+ gzip_min_length 1k;
49
+ gzip_buffers 4 16k;
50
+ gzip_http_version 1.1;
51
+ gzip_comp_level 2;
52
+ gzip_types text/plain application/x-javascript text/css application/xml;
53
+ gzip_vary on;
54
+
55
+
56
+ <%- nginx.upstreams.each do|up| -%>
57
+ upstream <%= up[:name] %> {
58
+ <%- up[:servers].each do|config| -%>
59
+ server <%= config %>;
60
+ <%- end -%>
61
+ }
62
+ <%- end -%>
63
+
64
+ server {
65
+ listen <%= nginx.www_http_port %>;
66
+ server_name <%= nginx.server_name || "localhost" %>;
67
+ access_log http.access.log main;
68
+
69
+ index index.html index.htm index.php;
70
+
71
+ include sites-enabled/*.http.conf;
72
+ }
73
+
74
+ <%- if nginx.use_ssl -%>
75
+ server {
76
+ listen <%= nginx.www_https_port %>;
77
+ server_name <%= nginx.server_name || "localhost" %>;
78
+ access_log https.access.log main;
79
+ ssl on;
80
+ ssl_certificate <%= nginx.ssl_certificate %>;
81
+ ssl_certificate_key <%= nginx.ssl_certificate_key %>;
82
+ ssl_session_timeout 5m;
83
+ ssl_protocols SSLv2 SSLv3 TLSv1;
84
+ ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
85
+ ssl_prefer_server_ciphers on;
86
+
87
+ include sites-enabled/*.https.conf;
88
+ }
60
89
  <%- end -%>
61
- }
62
- <%- end -%>
63
-
64
- server {
65
- listen <%= www_http_port %>;
66
- server_name <%= server_name || "localhost" %>;
67
- access_log http.access.log main;
68
-
69
- index index.html index.htm index.php;
70
-
71
- include sites-enabled/*.http.conf;
72
- }
73
-
74
- <%- if use_ssl -%>
75
- server {
76
- listen <%= www_https_port %>;
77
- server_name <%= server_name || "localhost" %>;
78
- access_log https.access.log main;
79
- ssl on;
80
- ssl_certificate <%= ssl_certificate %>;
81
- ssl_certificate_key <%= ssl_certificate_key %>;
82
- ssl_session_timeout 5m;
83
- ssl_protocols SSLv2 SSLv3 TLSv1;
84
- ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
85
- ssl_prefer_server_ciphers on;
86
-
87
- include sites-enabled/*.https.conf;
88
- }
89
- <%- end -%>
90
90
  }
91
91
 
@@ -14,15 +14,15 @@
14
14
 
15
15
  # By default Redis does not run as a daemon. Use 'yes' if you need it.
16
16
  # Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
17
- daemonize <%= redis_daemonize %>
17
+ daemonize <%= redis.daemonize %>
18
18
 
19
19
  # When running daemonized, Redis writes a pid file in /var/run/redis.pid by
20
20
  # default. You can specify a custom pid file location here.
21
- pidfile <%= redis_pid %>
21
+ pidfile <%= redis.pid_file %>
22
22
 
23
23
  # Accept connections on the specified port, default is 6379.
24
24
  # If port 0 is specified Redis will not listen on a TCP socket.
25
- port <%= redis_port %>
25
+ port <%= redis.port %>
26
26
 
27
27
  # If you want you can bind a single interface, if the bind option is not
28
28
  # specified all the interfaces will listen for incoming connections.
@@ -37,7 +37,7 @@ port <%= redis_port %>
37
37
  # unixsocketperm 755
38
38
 
39
39
  # Close the connection after a client is idle for N seconds (0 to disable)
40
- timeout <%= redis_timeout %>
40
+ timeout <%= redis.timeout %>
41
41
 
42
42
  # Set server verbosity to 'debug'
43
43
  # it can be one of:
@@ -45,12 +45,12 @@ timeout <%= redis_timeout %>
45
45
  # verbose (many rarely useful info, but not a mess like the debug level)
46
46
  # notice (moderately verbose, what you want in production probably)
47
47
  # warning (only very important / critical messages are logged)
48
- loglevel <%= redis_loglevel %>
48
+ loglevel <%= redis.loglevel %>
49
49
 
50
50
  # Specify the log file name. Also 'stdout' can be used to force
51
51
  # Redis to log on the standard output. Note that if you use standard
52
52
  # output for logging but daemonize, logs will be sent to /dev/null
53
- logfile <%= redis_logfile %>
53
+ logfile <%= redis.logfile %>
54
54
 
55
55
  # To enable logging to the system logger, just set 'syslog-enabled' to yes,
56
56
  # and optionally update the other syslog parameters to suit your needs.
@@ -65,7 +65,7 @@ logfile <%= redis_logfile %>
65
65
  # Set the number of databases. The default database is DB 0, you can select
66
66
  # a different one on a per-connection basis using SELECT <dbid> where
67
67
  # dbid is a number between 0 and 'databases'-1
68
- databases <%= redis_databases %>
68
+ databases <%= redis.databases %>
69
69
 
70
70
  ################################ SNAPSHOTTING #################################
71
71
  #
@@ -112,7 +112,7 @@ stop-writes-on-bgsave-error yes
112
112
  # For default that's set to 'yes' as it's almost always a win.
113
113
  # If you want to save some CPU in the saving child set it to 'no' but
114
114
  # the dataset will likely be bigger if you have compressible values or keys.
115
- rdbcompression <%= rdbcompression %>
115
+ rdbcompression <%= redis.rdbcompression %>
116
116
 
117
117
  # Since verison 5 of RDB a CRC64 checksum is placed at the end of the file.
118
118
  # This makes the format more resistant to corruption but there is a performance
@@ -121,10 +121,10 @@ rdbcompression <%= rdbcompression %>
121
121
  #
122
122
  # RDB files created with checksum disabled have a checksum of zero that will
123
123
  # tell the loading code to skip the check.
124
- rdbchecksum <%= rdbchecksum %>
124
+ rdbchecksum <%= redis.rdbchecksum %>
125
125
 
126
126
  # The filename where to dump the DB
127
- dbfilename <%= redis_dbfilename %>
127
+ dbfilename <%= redis.dbfilename %>
128
128
 
129
129
  # The working directory.
130
130
  #
@@ -135,7 +135,7 @@ dbfilename <%= redis_dbfilename %>
135
135
  #
136
136
  # Note that you must specify a directory here, not a file name.
137
137
  #dir ./
138
- dir <%= redis_dir %>
138
+ dir <%= redis.data_dir %>
139
139
 
140
140
  ################################# REPLICATION #################################
141
141
 
@@ -333,7 +333,7 @@ slave-priority 100
333
333
  # Please check http://redis.io/topics/persistence for more information.
334
334
 
335
335
  #appendonly no
336
- appendonly <%= redis_appendonly %>
336
+ appendonly <%= redis.appendonly %>
337
337
 
338
338
  # The name of the append only file (default: "appendonly.aof")
339
339
  appendfilename appendonly.aof
@@ -557,7 +557,7 @@ zset-max-ziplist-value 64
557
557
  #
558
558
  # use "activerehashing yes" if you don't have such hard requirements but
559
559
  # want to free memory asap when possible.
560
- activerehashing <%= redis_activerehashing %>
560
+ activerehashing <%= redis.activerehashing %>
561
561
 
562
562
  # The client output buffer limits can be used to force disconnection of clients
563
563
  # that are not reading data from the server fast enough for some reason (a
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peony
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Zhan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-22 00:00:00.000000000 Z
11
+ date: 2014-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -70,18 +70,19 @@ files:
70
70
  - lib/peony.rb
71
71
  - lib/peony/actions.rb
72
72
  - lib/peony/application.rb
73
+ - lib/peony/configure.rb
73
74
  - lib/peony/default.rb
74
75
  - lib/peony/line_editor.rb
75
76
  - lib/peony/line_editor/basic.rb
76
77
  - lib/peony/line_editor/readline.rb
77
78
  - lib/peony/parse_arguments.rb
78
79
  - lib/peony/rake.rb
80
+ - lib/peony/scope.rb
79
81
  - lib/peony/settings.rb
80
82
  - lib/peony/shell.rb
81
83
  - lib/peony/shell/basic.rb
82
84
  - lib/peony/shell/color.rb
83
85
  - lib/peony/shell/html.rb
84
- - lib/peony/utils.rb
85
86
  - lib/peony/version.rb
86
87
  - peony.gemspec
87
88
  - recipes/db/mongo.rake
@@ -94,6 +95,7 @@ files:
94
95
  - recipes/nginx/www.rake
95
96
  - recipes/php.rake
96
97
  - spec/peony_spec.rb
98
+ - spec/scope_spec.rb
97
99
  - spec/settings_in_rake_spec.rb
98
100
  - spec/settings_spec.rb
99
101
  - spec/spec_helper.rb
@@ -156,6 +158,7 @@ specification_version: 4
156
158
  summary: Local Script Management System Using Rake.
157
159
  test_files:
158
160
  - spec/peony_spec.rb
161
+ - spec/scope_spec.rb
159
162
  - spec/settings_in_rake_spec.rb
160
163
  - spec/settings_spec.rb
161
164
  - spec/spec_helper.rb