ykxutils 0.1.7 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +106 -55
- data/Gemfile +11 -7
- data/Gemfile.lock +55 -35
- data/Rakefile +25 -8
- data/SECURITY.md +21 -0
- data/a.northern-cross.net.conf +86 -0
- data/lib/ykxutils/erubyx.rb +50 -0
- data/lib/ykxutils/gridlist.rb +46 -0
- data/lib/ykxutils/nginxconfig.rb +40 -0
- data/lib/ykxutils/nginxconfigfiles.rb +32 -0
- data/lib/ykxutils/pstorex.rb +1 -1
- data/lib/ykxutils/version.rb +1 -1
- data/lib/ykxutils/yamlx.rb +31 -48
- data/lib/ykxutils.rb +5 -0
- data/test_data/4servers.erb +7 -0
- data/test_data/v103-3-189-127/4servers.erb +0 -0
- data/test_data/v103-3-189-127/a.northern-cross.net/base.yml +28 -0
- data/test_data/v103-3-189-127/a.northern-cross.net/value_host.yml +1 -0
- data/test_data/v103-3-189-127/b.northern-cross.net/base.yml +28 -0
- data/test_data/v103-3-189-127/b.northern-cross.net/value_host.yml +1 -0
- data/test_data/v103-3-189-127/c.northern-cross.net/base.yml +28 -0
- data/test_data/v103-3-189-127/c.northern-cross.net/value_host.yml +1 -0
- data/test_data/v103-3-189-127/d.northern-cross.info/base.yml +28 -0
- data/test_data/v103-3-189-127/d.northern-cross.info/value_host.yml +1 -0
- data/test_data/v103-3-189-127/d.northern-cross.net/base.yml +28 -0
- data/test_data/v103-3-189-127/d.northern-cross.net/value_host.yml +1 -0
- data/test_data/v103-3-189-127/e.northern-cross.info/base.yml +28 -0
- data/test_data/v103-3-189-127/e.northern-cross.info/value_host.yml +1 -0
- data/test_data/v103-3-189-127/e.northern-cross.net/base.yml +28 -0
- data/test_data/v103-3-189-127/e.northern-cross.net/value_host.yml +1 -0
- data/test_data/v103-3-189-127/f.northern-cross.info/base.yml +28 -0
- data/test_data/v103-3-189-127/f.northern-cross.info/value_host.yml +1 -0
- data/test_data/v103-3-189-127/f.northern-cross.net/base.yml +28 -0
- data/test_data/v103-3-189-127/f.northern-cross.net/value_host.yml +1 -0
- data/test_data/v103-3-189-127/t_server_1.erb +7 -0
- data/test_data/v103-3-189-127/template.erb +21 -0
- data/test_data/v103-3-189-127/template_ssl.erb +22 -0
- data/test_data/v103-3-189-127/template_ssl_www.erb +12 -0
- data/test_data/v103-3-189-127/template_www.erb +24 -0
- data/test_data/v103-3-189-127/value.yml +3 -0
- data/test_data/v103-3-189-127/value_ssl.yml +5 -0
- data/ykxutils.gemspec +25 -18
- metadata +88 -17
- data/.github/workflows/main.yml +0 -16
- data/.gitignore +0 -14
- data/bin/console +0 -15
- data/bin/setup +0 -8
@@ -0,0 +1,32 @@
|
|
1
|
+
require "find"
|
2
|
+
require_relative "nginxconfig"
|
3
|
+
|
4
|
+
module Ykxutils
|
5
|
+
class Nginxconfigfiles
|
6
|
+
def get_file_list(start_dir, rex)
|
7
|
+
@file_list = []
|
8
|
+
|
9
|
+
Find.find(start_dir) do |x|
|
10
|
+
if x =~ rex
|
11
|
+
@file_list << x
|
12
|
+
Find.prune
|
13
|
+
end
|
14
|
+
end
|
15
|
+
@file_list
|
16
|
+
end
|
17
|
+
|
18
|
+
def output(file_list)
|
19
|
+
file_list.map do |fname|
|
20
|
+
parent_dir_pn = Pathname.new(fname).cleanpath.parent
|
21
|
+
vdomain = parent_dir_pn.basename
|
22
|
+
output_fname = "#{vdomain}.conf"
|
23
|
+
cli = ::Ykxutils::Nginxconfig.new(fname)
|
24
|
+
scope = nil
|
25
|
+
File.open(output_fname, "w") do |f|
|
26
|
+
x = cli.extract(scope)
|
27
|
+
f.write(x)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/ykxutils/pstorex.rb
CHANGED
data/lib/ykxutils/version.rb
CHANGED
data/lib/ykxutils/yamlx.rb
CHANGED
@@ -1,68 +1,51 @@
|
|
1
1
|
require "yaml"
|
2
2
|
|
3
3
|
module Ykxutils
|
4
|
+
SUCCESS = 0
|
5
|
+
ARGUMENT_ERROR = 1
|
6
|
+
STANDARD_ERROR = 2
|
7
|
+
|
4
8
|
module_function
|
5
9
|
|
6
|
-
def
|
7
|
-
|
8
|
-
valid = false
|
10
|
+
def yaml_load_file_aliases(yaml_file_path, use_aliases: true)
|
11
|
+
converted = nil
|
9
12
|
begin
|
10
|
-
|
11
|
-
|
13
|
+
converted = use_aliases ? YAML.load_file(yaml_file_path, aliases: true) : YAML.load_file(yaml_file_path)
|
14
|
+
value = SUCCESS
|
12
15
|
rescue ArgumentError
|
13
|
-
#
|
14
|
-
|
15
|
-
# p ex.inspect
|
16
|
-
# p ex.message
|
17
|
-
# p ex.backtrace
|
18
|
-
# exit#
|
16
|
+
# puts e.message
|
17
|
+
value = ARGUMENT_ERROR
|
19
18
|
rescue StandardError
|
20
|
-
#
|
21
|
-
|
22
|
-
# p ex.inspect
|
23
|
-
# p ex.message
|
24
|
-
# p ex.backtrace
|
19
|
+
# puts e.message8
|
20
|
+
value = STANDARD_ERROR
|
25
21
|
end
|
22
|
+
[converted, value]
|
23
|
+
end
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
# valid = true
|
31
|
-
rescue ArgumentError
|
32
|
-
# p "yaml_load_file_compat 2"
|
33
|
-
# p ex.class
|
34
|
-
# p ex.inspect
|
35
|
-
# p ex.message
|
36
|
-
# p ex.backtrace
|
37
|
-
#
|
38
|
-
rescue StandardError
|
39
|
-
# p "yaml_load_file_compat 2-2"
|
40
|
-
# p ex.class
|
41
|
-
# p ex.inspect
|
42
|
-
# p ex.message
|
43
|
-
# p ex.backtrace
|
44
|
-
end
|
45
|
-
end
|
25
|
+
def yaml_load_file_compati(yaml_file_path)
|
26
|
+
setting = yaml_load_file_aliases(yaml_file_path, use_aliases: true)
|
27
|
+
setting = yaml_load_file_aliases(yaml_file_path, use_aliases: false) if setting.nil?
|
46
28
|
setting
|
47
29
|
end
|
48
30
|
|
49
|
-
def
|
50
|
-
|
51
|
-
valid = false
|
31
|
+
def yaml_load_aliases(content, use_aliases: true)
|
32
|
+
converted = nil
|
52
33
|
begin
|
53
|
-
|
54
|
-
|
34
|
+
converted = use_aliases ? YAML.safe_load(content, use_aliases) : YAML.safe_load(content)
|
35
|
+
result = SUCCESS
|
55
36
|
rescue ArgumentError
|
37
|
+
# puts e.message
|
38
|
+
result = ARGUMENT_ERROR
|
56
39
|
rescue StandardError
|
40
|
+
# puts e.message
|
41
|
+
result = STANDARD_ERROR
|
57
42
|
end
|
43
|
+
[converted, result]
|
44
|
+
end
|
58
45
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
rescue StandardError
|
64
|
-
end
|
65
|
-
end
|
66
|
-
setting
|
46
|
+
def yaml_load_compati(content)
|
47
|
+
ret_array = yaml_load_aliases(content, use_aliases: true)
|
48
|
+
ret_array = yaml_load_aliases(content, use_aliases: false) if ret_array[1] != 0
|
49
|
+
ret_array[0]
|
67
50
|
end
|
68
51
|
end
|
data/lib/ykxutils.rb
CHANGED
@@ -2,10 +2,15 @@
|
|
2
2
|
|
3
3
|
require_relative "ykxutils/version"
|
4
4
|
require_relative "ykxutils/yamlx"
|
5
|
+
require_relative "ykxutils/erubyx"
|
5
6
|
require_relative "ykxutils/pstorex"
|
6
7
|
require_relative "ykxutils/gitcmd"
|
8
|
+
require_relative "ykxutils/nginxconfig"
|
9
|
+
require_relative "ykxutils/nginxconfigfiles"
|
10
|
+
require_relative "ykxutils/gridlist"
|
7
11
|
|
8
12
|
module Ykxutils
|
9
13
|
class Error < StandardError; end
|
14
|
+
|
10
15
|
# Your code goes here...
|
11
16
|
end
|
File without changes
|
@@ -0,0 +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
|
@@ -0,0 +1 @@
|
|
1
|
+
host: a.northern-cross.net
|
@@ -0,0 +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
|
@@ -0,0 +1 @@
|
|
1
|
+
host: b.northern-cross.net
|
@@ -0,0 +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
|
@@ -0,0 +1 @@
|
|
1
|
+
host: c.northern-cross.net
|
@@ -0,0 +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
|
@@ -0,0 +1 @@
|
|
1
|
+
host: d.northern-cross.info
|
@@ -0,0 +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
|
@@ -0,0 +1 @@
|
|
1
|
+
host: d.northern-cross.net
|
@@ -0,0 +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
|
@@ -0,0 +1 @@
|
|
1
|
+
host: e.northern-cross.info
|
@@ -0,0 +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
|
@@ -0,0 +1 @@
|
|
1
|
+
host: e.northern-cross.net
|
@@ -0,0 +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
|
@@ -0,0 +1 @@
|
|
1
|
+
host: f.northern-cross.info
|
@@ -0,0 +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
|
@@ -0,0 +1 @@
|
|
1
|
+
host: f.northern-cross.net
|
@@ -0,0 +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
|
+
}
|
@@ -0,0 +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
|
+
}
|
@@ -0,0 +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
|
+
}
|
@@ -0,0 +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
|
+
}
|
data/ykxutils.gemspec
CHANGED
@@ -3,18 +3,18 @@
|
|
3
3
|
require_relative "lib/ykxutils/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name
|
7
|
-
spec.version
|
8
|
-
spec.authors
|
9
|
-
spec.email
|
6
|
+
spec.name = "ykxutils"
|
7
|
+
spec.version = Ykxutils::VERSION
|
8
|
+
spec.authors = ["ykominami"]
|
9
|
+
spec.email = ["ykominami@gmail.com"]
|
10
10
|
|
11
|
-
spec.summary
|
12
|
-
spec.description
|
13
|
-
spec.homepage
|
14
|
-
spec.license
|
15
|
-
spec.required_ruby_version =
|
11
|
+
spec.summary = "New version of utilty function created by yk."
|
12
|
+
spec.description = "New version of utilty function created by yk."
|
13
|
+
spec.homepage = "https://ykominami.github.io/ykxutils"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 2.7"
|
16
16
|
|
17
|
-
# spec.metadata["allowed_push_host"] = "TODO: Set to '
|
17
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
18
18
|
|
19
19
|
spec.metadata["homepage_uri"] = spec.homepage
|
20
20
|
spec.metadata["source_code_uri"] = "https://github.com/ykominami/ykxutils"
|
@@ -23,25 +23,32 @@ Gem::Specification.new do |spec|
|
|
23
23
|
# Specify which files should be added to the gem when it is released.
|
24
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
25
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
26
|
-
`git ls-files -z`.split("\x0").reject
|
26
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
28
|
+
end
|
27
29
|
end
|
28
|
-
spec.bindir
|
29
|
-
spec.executables
|
30
|
+
spec.bindir = "exe"
|
31
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
32
|
spec.require_paths = ["lib"]
|
31
33
|
|
32
|
-
spec.
|
33
|
-
spec.
|
34
|
-
spec.
|
34
|
+
spec.add_runtime_dependency "bundler"
|
35
|
+
# spec.add_runtime_dependency 'debug'
|
36
|
+
spec.add_runtime_dependency "erubi"
|
37
|
+
spec.add_runtime_dependency "rake", "~> 13.0"
|
38
|
+
spec.add_runtime_dependency "tilt"
|
35
39
|
|
36
|
-
spec.add_development_dependency "
|
40
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
41
|
+
spec.add_development_dependency "rubocop"
|
42
|
+
spec.add_development_dependency "rubocop-performance"
|
37
43
|
spec.add_development_dependency "rubocop-rake"
|
38
44
|
spec.add_development_dependency "rubocop-rspec"
|
39
45
|
|
40
46
|
spec.add_development_dependency "yard"
|
47
|
+
|
41
48
|
# Uncomment to register a new dependency of your gem
|
42
49
|
# spec.add_dependency "example-gem", "~> 1.0"
|
43
50
|
|
44
|
-
# For more information and examples about making a new gem,
|
51
|
+
# For more information and examples about making a new gem, check out our
|
45
52
|
# guide at: https://bundler.io/guides/creating_gem.html
|
46
53
|
spec.metadata["rubygems_mfa_required"] = "true"
|
47
54
|
end
|