ykutils 0.1.4 → 0.1.6

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -1
  3. data/.rubocop.yml +2 -1
  4. data/.rubocop_todo.yml +181 -85
  5. data/Gemfile +11 -11
  6. data/Gemfile.lock +17 -12
  7. data/bin/erubix +1 -1
  8. data/bin/makegrid +4 -4
  9. data/lib/ykutils/erubyx.rb +30 -19
  10. data/lib/ykutils/fileoputils.rb +2 -2
  11. data/lib/ykutils/gridlist.rb +49 -49
  12. data/lib/ykutils/lines.rb +143 -143
  13. data/lib/ykutils/lsutils.rb +71 -71
  14. data/lib/ykutils/nginxconfig.rb +40 -41
  15. data/lib/ykutils/nginxconfigfiles.rb +31 -31
  16. data/lib/ykutils/nkfutil.rb +148 -147
  17. data/lib/ykutils/nkfutil19.rb +9 -11
  18. data/lib/ykutils/osutil.rb +16 -16
  19. data/lib/ykutils/retcodex.rb +1 -3
  20. data/lib/ykutils/stext.rb +427 -425
  21. data/lib/ykutils/stextx.rb +32 -32
  22. data/lib/ykutils/stringutils.rb +111 -111
  23. data/lib/ykutils/treemanager.rb +33 -33
  24. data/lib/ykutils/treemanagera.rb +21 -21
  25. data/lib/ykutils/version.rb +1 -1
  26. data/lib/ykutils/xlines.rb +8 -8
  27. data/lib/ykutils/yamlop.rb +227 -227
  28. data/lib/ykutils/yamlxop.rb +35 -35
  29. data/test_data/4servers.erb +7 -7
  30. data/test_data/a.bat +5 -5
  31. data/test_data/a_ncn.bat +12 -12
  32. data/test_data/v103-3-189-127/a.northern-cross.net/base.yml +28 -28
  33. data/test_data/v103-3-189-127/a.northern-cross.net/value_host.yml +1 -1
  34. data/test_data/v103-3-189-127/b.northern-cross.net/base.yml +28 -28
  35. data/test_data/v103-3-189-127/b.northern-cross.net/value_host.yml +1 -1
  36. data/test_data/v103-3-189-127/c.northern-cross.net/base.yml +28 -28
  37. data/test_data/v103-3-189-127/c.northern-cross.net/value_host.yml +1 -1
  38. data/test_data/v103-3-189-127/d.northern-cross.info/base.yml +28 -28
  39. data/test_data/v103-3-189-127/d.northern-cross.info/value_host.yml +1 -1
  40. data/test_data/v103-3-189-127/d.northern-cross.net/base.yml +28 -28
  41. data/test_data/v103-3-189-127/d.northern-cross.net/value_host.yml +1 -1
  42. data/test_data/v103-3-189-127/e.northern-cross.info/base.yml +28 -28
  43. data/test_data/v103-3-189-127/e.northern-cross.info/value_host.yml +1 -1
  44. data/test_data/v103-3-189-127/e.northern-cross.net/base.yml +28 -28
  45. data/test_data/v103-3-189-127/e.northern-cross.net/value_host.yml +1 -1
  46. data/test_data/v103-3-189-127/f.northern-cross.info/base.yml +28 -28
  47. data/test_data/v103-3-189-127/f.northern-cross.info/value_host.yml +1 -1
  48. data/test_data/v103-3-189-127/f.northern-cross.net/base.yml +28 -28
  49. data/test_data/v103-3-189-127/f.northern-cross.net/value_host.yml +1 -1
  50. data/test_data/v103-3-189-127/t_server_1.erb +7 -7
  51. data/test_data/v103-3-189-127/template.erb +21 -21
  52. data/test_data/v103-3-189-127/template_ssl.erb +22 -22
  53. data/test_data/v103-3-189-127/template_ssl_www.erb +12 -12
  54. data/test_data/v103-3-189-127/template_www.erb +24 -24
  55. data/test_data/v103-3-189-127/value.yml +3 -3
  56. data/test_data/v103-3-189-127/value_ssl.yml +5 -5
  57. data/ykutils.gemspec +45 -43
  58. metadata +8 -9
  59. data/_config.yml +0 -1
@@ -1,28 +1,28 @@
1
- _root:
2
- template: 4servers.erb
3
- server1:
4
- protocol: ssl
5
- template: template_ssl.erb
6
- value:
7
- - value_host.yml
8
- - ../value_ssl.yml
9
- server2:
10
- protocol: ssl
11
- domain: www
12
- template: template_ssl_www.erb
13
- value:
14
- - value_host.yml
15
- - ../value_ssl.yml
16
- server3:
17
- protocol:
18
- template: template.erb
19
- value:
20
- - value_host.yml
21
- - ../value.yml
22
- server4:
23
- protocol:
24
- domain: www
25
- template: template_www.erb
26
- value:
27
- - value_host.yml
28
- - ../value.yml
1
+ _root:
2
+ template: 4servers.erb
3
+ server1:
4
+ protocol: ssl
5
+ template: template_ssl.erb
6
+ value:
7
+ - value_host.yml
8
+ - ../value_ssl.yml
9
+ server2:
10
+ protocol: ssl
11
+ domain: www
12
+ template: template_ssl_www.erb
13
+ value:
14
+ - value_host.yml
15
+ - ../value_ssl.yml
16
+ server3:
17
+ protocol:
18
+ template: template.erb
19
+ value:
20
+ - value_host.yml
21
+ - ../value.yml
22
+ server4:
23
+ protocol:
24
+ domain: www
25
+ template: template_www.erb
26
+ value:
27
+ - value_host.yml
28
+ - ../value.yml
@@ -1 +1 @@
1
- host: b.northern-cross.net
1
+ host: b.northern-cross.net
@@ -1,28 +1,28 @@
1
- _root:
2
- template: 4servers.erb
3
- server1:
4
- protocol: ssl
5
- template: template_ssl.erb
6
- value:
7
- - value_host.yml
8
- - ../value_ssl.yml
9
- server2:
10
- protocol: ssl
11
- domain: www
12
- template: template_ssl_www.erb
13
- value:
14
- - value_host.yml
15
- - ../value_ssl.yml
16
- server3:
17
- protocol:
18
- template: template.erb
19
- value:
20
- - value_host.yml
21
- - ../value.yml
22
- server4:
23
- protocol:
24
- domain: www
25
- template: template_www.erb
26
- value:
27
- - value_host.yml
28
- - ../value.yml
1
+ _root:
2
+ template: 4servers.erb
3
+ server1:
4
+ protocol: ssl
5
+ template: template_ssl.erb
6
+ value:
7
+ - value_host.yml
8
+ - ../value_ssl.yml
9
+ server2:
10
+ protocol: ssl
11
+ domain: www
12
+ template: template_ssl_www.erb
13
+ value:
14
+ - value_host.yml
15
+ - ../value_ssl.yml
16
+ server3:
17
+ protocol:
18
+ template: template.erb
19
+ value:
20
+ - value_host.yml
21
+ - ../value.yml
22
+ server4:
23
+ protocol:
24
+ domain: www
25
+ template: template_www.erb
26
+ value:
27
+ - value_host.yml
28
+ - ../value.yml
@@ -1 +1 @@
1
- host: c.northern-cross.net
1
+ host: c.northern-cross.net
@@ -1,28 +1,28 @@
1
- _root:
2
- template: 4servers.erb
3
- server1:
4
- protocol: ssl
5
- template: template_ssl.erb
6
- value:
7
- - value_host.yml
8
- - ../value_ssl.yml
9
- server2:
10
- protocol: ssl
11
- domain: www
12
- template: template_ssl_www.erb
13
- value:
14
- - value_host.yml
15
- - ../value_ssl.yml
16
- server3:
17
- protocol:
18
- template: template.erb
19
- value:
20
- - value_host.yml
21
- - ../value.yml
22
- server4:
23
- protocol:
24
- domain: www
25
- template: template_www.erb
26
- value:
27
- - value_host.yml
28
- - ../value.yml
1
+ _root:
2
+ template: 4servers.erb
3
+ server1:
4
+ protocol: ssl
5
+ template: template_ssl.erb
6
+ value:
7
+ - value_host.yml
8
+ - ../value_ssl.yml
9
+ server2:
10
+ protocol: ssl
11
+ domain: www
12
+ template: template_ssl_www.erb
13
+ value:
14
+ - value_host.yml
15
+ - ../value_ssl.yml
16
+ server3:
17
+ protocol:
18
+ template: template.erb
19
+ value:
20
+ - value_host.yml
21
+ - ../value.yml
22
+ server4:
23
+ protocol:
24
+ domain: www
25
+ template: template_www.erb
26
+ value:
27
+ - value_host.yml
28
+ - ../value.yml
@@ -1 +1 @@
1
- host: d.northern-cross.info
1
+ host: d.northern-cross.info
@@ -1,28 +1,28 @@
1
- _root:
2
- template: 4servers.erb
3
- server1:
4
- protocol: ssl
5
- template: template_ssl.erb
6
- value:
7
- - value_host.yml
8
- - ../value_ssl.yml
9
- server2:
10
- protocol: ssl
11
- domain: www
12
- template: template_ssl_www.erb
13
- value:
14
- - value_host.yml
15
- - ../value_ssl.yml
16
- server3:
17
- protocol:
18
- template: template.erb
19
- value:
20
- - value_host.yml
21
- - ../value.yml
22
- server4:
23
- protocol:
24
- domain: www
25
- template: template_www.erb
26
- value:
27
- - value_host.yml
28
- - ../value.yml
1
+ _root:
2
+ template: 4servers.erb
3
+ server1:
4
+ protocol: ssl
5
+ template: template_ssl.erb
6
+ value:
7
+ - value_host.yml
8
+ - ../value_ssl.yml
9
+ server2:
10
+ protocol: ssl
11
+ domain: www
12
+ template: template_ssl_www.erb
13
+ value:
14
+ - value_host.yml
15
+ - ../value_ssl.yml
16
+ server3:
17
+ protocol:
18
+ template: template.erb
19
+ value:
20
+ - value_host.yml
21
+ - ../value.yml
22
+ server4:
23
+ protocol:
24
+ domain: www
25
+ template: template_www.erb
26
+ value:
27
+ - value_host.yml
28
+ - ../value.yml
@@ -1 +1 @@
1
- host: d.northern-cross.net
1
+ host: d.northern-cross.net
@@ -1,28 +1,28 @@
1
- _root:
2
- template: 4servers.erb
3
- server1:
4
- protocol: ssl
5
- template: template_ssl.erb
6
- value:
7
- - value_host.yml
8
- - ../value_ssl.yml
9
- server2:
10
- protocol: ssl
11
- domain: www
12
- template: template_ssl_www.erb
13
- value:
14
- - value_host.yml
15
- - ../value_ssl.yml
16
- server3:
17
- protocol:
18
- template: template.erb
19
- value:
20
- - value_host.yml
21
- - ../value.yml
22
- server4:
23
- protocol:
24
- domain: www
25
- template: template_www.erb
26
- value:
27
- - value_host.yml
28
- - ../value.yml
1
+ _root:
2
+ template: 4servers.erb
3
+ server1:
4
+ protocol: ssl
5
+ template: template_ssl.erb
6
+ value:
7
+ - value_host.yml
8
+ - ../value_ssl.yml
9
+ server2:
10
+ protocol: ssl
11
+ domain: www
12
+ template: template_ssl_www.erb
13
+ value:
14
+ - value_host.yml
15
+ - ../value_ssl.yml
16
+ server3:
17
+ protocol:
18
+ template: template.erb
19
+ value:
20
+ - value_host.yml
21
+ - ../value.yml
22
+ server4:
23
+ protocol:
24
+ domain: www
25
+ template: template_www.erb
26
+ value:
27
+ - value_host.yml
28
+ - ../value.yml
@@ -1 +1 @@
1
- host: e.northern-cross.info
1
+ host: e.northern-cross.info
@@ -1,28 +1,28 @@
1
- _root:
2
- template: 4servers.erb
3
- server1:
4
- protocol: ssl
5
- template: template_ssl.erb
6
- value:
7
- - value_host.yml
8
- - ../value_ssl.yml
9
- server2:
10
- protocol: ssl
11
- domain: www
12
- template: template_ssl_www.erb
13
- value:
14
- - value_host.yml
15
- - ../value_ssl.yml
16
- server3:
17
- protocol:
18
- template: template.erb
19
- value:
20
- - value_host.yml
21
- - ../value.yml
22
- server4:
23
- protocol:
24
- domain: www
25
- template: template_www.erb
26
- value:
27
- - value_host.yml
28
- - ../value.yml
1
+ _root:
2
+ template: 4servers.erb
3
+ server1:
4
+ protocol: ssl
5
+ template: template_ssl.erb
6
+ value:
7
+ - value_host.yml
8
+ - ../value_ssl.yml
9
+ server2:
10
+ protocol: ssl
11
+ domain: www
12
+ template: template_ssl_www.erb
13
+ value:
14
+ - value_host.yml
15
+ - ../value_ssl.yml
16
+ server3:
17
+ protocol:
18
+ template: template.erb
19
+ value:
20
+ - value_host.yml
21
+ - ../value.yml
22
+ server4:
23
+ protocol:
24
+ domain: www
25
+ template: template_www.erb
26
+ value:
27
+ - value_host.yml
28
+ - ../value.yml
@@ -1 +1 @@
1
- host: e.northern-cross.net
1
+ host: e.northern-cross.net
@@ -1,28 +1,28 @@
1
- _root:
2
- template: 4servers.erb
3
- server1:
4
- protocol: ssl
5
- template: template_ssl.erb
6
- value:
7
- - value_host.yml
8
- - ../value_ssl.yml
9
- server2:
10
- protocol: ssl
11
- domain: www
12
- template: template_ssl_www.erb
13
- value:
14
- - value_host.yml
15
- - ../value_ssl.yml
16
- server3:
17
- protocol:
18
- template: template.erb
19
- value:
20
- - value_host.yml
21
- - ../value.yml
22
- server4:
23
- protocol:
24
- domain: www
25
- template: template_www.erb
26
- value:
27
- - value_host.yml
28
- - ../value.yml
1
+ _root:
2
+ template: 4servers.erb
3
+ server1:
4
+ protocol: ssl
5
+ template: template_ssl.erb
6
+ value:
7
+ - value_host.yml
8
+ - ../value_ssl.yml
9
+ server2:
10
+ protocol: ssl
11
+ domain: www
12
+ template: template_ssl_www.erb
13
+ value:
14
+ - value_host.yml
15
+ - ../value_ssl.yml
16
+ server3:
17
+ protocol:
18
+ template: template.erb
19
+ value:
20
+ - value_host.yml
21
+ - ../value.yml
22
+ server4:
23
+ protocol:
24
+ domain: www
25
+ template: template_www.erb
26
+ value:
27
+ - value_host.yml
28
+ - ../value.yml
@@ -1 +1 @@
1
- host: f.northern-cross.info
1
+ host: f.northern-cross.info
@@ -1,28 +1,28 @@
1
- _root:
2
- template: 4servers.erb
3
- server1:
4
- protocol: ssl
5
- template: template_ssl.erb
6
- value:
7
- - value_host.yml
8
- - ../value_ssl.yml
9
- server2:
10
- protocol: ssl
11
- domain: www
12
- template: template_ssl_www.erb
13
- value:
14
- - value_host.yml
15
- - ../value_ssl.yml
16
- server3:
17
- protocol:
18
- template: template.erb
19
- value:
20
- - value_host.yml
21
- - ../value.yml
22
- server4:
23
- protocol:
24
- domain: www
25
- template: template_www.erb
26
- value:
27
- - value_host.yml
28
- - ../value.yml
1
+ _root:
2
+ template: 4servers.erb
3
+ server1:
4
+ protocol: ssl
5
+ template: template_ssl.erb
6
+ value:
7
+ - value_host.yml
8
+ - ../value_ssl.yml
9
+ server2:
10
+ protocol: ssl
11
+ domain: www
12
+ template: template_ssl_www.erb
13
+ value:
14
+ - value_host.yml
15
+ - ../value_ssl.yml
16
+ server3:
17
+ protocol:
18
+ template: template.erb
19
+ value:
20
+ - value_host.yml
21
+ - ../value.yml
22
+ server4:
23
+ protocol:
24
+ domain: www
25
+ template: template_www.erb
26
+ value:
27
+ - value_host.yml
28
+ - ../value.yml
@@ -1 +1 @@
1
- host: f.northern-cross.net
1
+ host: f.northern-cross.net
@@ -1,7 +1,7 @@
1
- <%= server_ssl %>
2
-
3
- <%= server_ssl_www %>
4
-
5
- <%= server %>
6
-
7
- <%= server_www %>
1
+ <%= server_ssl %>
2
+
3
+ <%= server_ssl_www %>
4
+
5
+ <%= server %>
6
+
7
+ <%= server_www %>
@@ -1,21 +1,21 @@
1
- server {
2
- if ($host = <%= host %>) {
3
- return 301 https://$host$request_uri;
4
- }
5
-
6
- listen 80;
7
- server_name <%= host %>;
8
-
9
- error_log /var/www/vhosts/<%= host %>/statistics/logs/<%= error_log %>;
10
- access_log /var/www/vhosts/<%= host %>/statistics/logs/<%= access_log %>;
11
-
12
- root /var/www/vhosts/<%= host %>/httpdocs;
13
- location / {
14
- index index.html;
15
- }
16
- error_page 500 502 503 504 /50x.html;
17
- location = /50x.html {
18
- root /usr/share/nginx/html/;
19
- index 50x.html;
20
- }
21
- }
1
+ server {
2
+ if ($host = <%= host %>) {
3
+ return 301 https://$host$request_uri;
4
+ }
5
+
6
+ listen 80;
7
+ server_name <%= host %>;
8
+
9
+ error_log /var/www/vhosts/<%= host %>/statistics/logs/<%= error_log %>;
10
+ access_log /var/www/vhosts/<%= host %>/statistics/logs/<%= access_log %>;
11
+
12
+ root /var/www/vhosts/<%= host %>/httpdocs;
13
+ location / {
14
+ index index.html;
15
+ }
16
+ error_page 500 502 503 504 /50x.html;
17
+ location = /50x.html {
18
+ root /usr/share/nginx/html/;
19
+ index 50x.html;
20
+ }
21
+ }
@@ -1,22 +1,22 @@
1
- server {
2
- listen <%= ssl_port %>;
3
- ssl_certificate <%= ssl_certificate %>;
4
- ssl_certificate_key <%= ssl_certificate_key %>;
5
- server_name <%= host %>;
6
-
7
- error_log /var/www/vhosts/<%= host %>/statistics/logs/<%= error_log %>;
8
- access_log /var/www/vhosts/<%= host %>/statistics/logs/<%= access_log %>;
9
-
10
- # rewrite_log on;
11
-
12
- root /var/www/vhosts/<%= host %>/httpdocs;
13
- location / {
14
- index index.html;
15
- }
16
- error_page 500 502 503 504 /50x.html;
17
- #error_page 500 /50x.html;
18
- location = /50x.html {
19
- root /usr/share/nginx/html/;
20
- index 50x.html;
21
- }
22
- }
1
+ server {
2
+ listen <%= ssl_port %>;
3
+ ssl_certificate <%= ssl_certificate %>;
4
+ ssl_certificate_key <%= ssl_certificate_key %>;
5
+ server_name <%= host %>;
6
+
7
+ error_log /var/www/vhosts/<%= host %>/statistics/logs/<%= error_log %>;
8
+ access_log /var/www/vhosts/<%= host %>/statistics/logs/<%= access_log %>;
9
+
10
+ # rewrite_log on;
11
+
12
+ root /var/www/vhosts/<%= host %>/httpdocs;
13
+ location / {
14
+ index index.html;
15
+ }
16
+ error_page 500 502 503 504 /50x.html;
17
+ #error_page 500 /50x.html;
18
+ location = /50x.html {
19
+ root /usr/share/nginx/html/;
20
+ index 50x.html;
21
+ }
22
+ }
@@ -1,12 +1,12 @@
1
- server {
2
- listen <%= ssl_port %>;
3
- server_name www.<%= host %>;
4
- #
5
- return 301 https://<%= host %>;
6
-
7
- ssl_certificate <%= ssl_certificate %>;
8
- ssl_certificate_key <%= ssl_certificate_key %>;
9
- include /etc/letsencrypt/options-ssl-nginx.conf;
10
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
11
-
12
- }
1
+ server {
2
+ listen <%= ssl_port %>;
3
+ server_name www.<%= host %>;
4
+ #
5
+ return 301 https://<%= host %>;
6
+
7
+ ssl_certificate <%= ssl_certificate %>;
8
+ ssl_certificate_key <%= ssl_certificate_key %>;
9
+ include /etc/letsencrypt/options-ssl-nginx.conf;
10
+ ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
11
+
12
+ }
@@ -1,24 +1,24 @@
1
- server {
2
- if ($host = northern-cross.net) {
3
- return 301 https://$host$request_uri;
4
- }
5
-
6
-
7
- listen <%= port %>;
8
- server_name <%= host %>;
9
-
10
- error_log /var/www/vhosts/<%= host %>/statistics/logs/<%= error_log %>;
11
- access_log /var/www/vhosts/<%= host %>/statistics/logs/<%= access_log %>;
12
-
13
- rewrite_log on;
14
-
15
- root /var/www/vhosts/<%= host %>/httpdocs;
16
- location / {
17
- index index.html;
18
- }
19
- error_page 500 502 503 504 /50x.html;
20
- location = /50x.html {
21
- root /usr/share/nginx/html/;
22
- index 50x.html;
23
- }
24
- }
1
+ server {
2
+ if ($host = northern-cross.net) {
3
+ return 301 https://$host$request_uri;
4
+ }
5
+
6
+
7
+ listen <%= port %>;
8
+ server_name <%= host %>;
9
+
10
+ error_log /var/www/vhosts/<%= host %>/statistics/logs/<%= error_log %>;
11
+ access_log /var/www/vhosts/<%= host %>/statistics/logs/<%= access_log %>;
12
+
13
+ rewrite_log on;
14
+
15
+ root /var/www/vhosts/<%= host %>/httpdocs;
16
+ location / {
17
+ index index.html;
18
+ }
19
+ error_page 500 502 503 504 /50x.html;
20
+ location = /50x.html {
21
+ root /usr/share/nginx/html/;
22
+ index 50x.html;
23
+ }
24
+ }