File tree 4 files changed +87
-120
lines changed
4 files changed +87
-120
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -17,14 +17,35 @@ def version
17
17
18
18
def installer
19
19
require 'install'
20
+ begin
21
+ InstallerRunner . install
22
+ rescue LoadError => e
23
+ puts e . backtrace
24
+ ensure
25
+ GC . compact
26
+ end
20
27
end
21
28
22
29
def downloader
23
- require 'download'
30
+ require 'install'
31
+ begin
32
+ InstallerRunner . download
33
+ rescue LoadError => e
34
+ puts e . backtrace
35
+ ensure
36
+ GC . compact
37
+ end
24
38
end
25
-
39
+
26
40
def databases
27
- require 'database'
41
+ require 'install'
42
+ begin
43
+ InstallerRunner . database
44
+ rescue LoadError => e
45
+ puts e . backtrace
46
+ ensure
47
+ GC . compact
48
+ end
28
49
end
29
50
30
51
def default
Original file line number Diff line number Diff line change 6
6
# Installer runner.
7
7
class InstallerRunner
8
8
9
- def self . run
9
+ def self . install
10
10
encoding_style
11
11
nyasocom_custom_name
12
12
end
13
-
13
+
14
+ def self . download
15
+ encoding_style
16
+ nyasocom_command
17
+ end
18
+
19
+ def self . database
20
+ encoding_style
21
+ two = ARGV [ 1 ]
22
+
23
+ pt = /\A postgresql\z /
24
+ pg = /\A --pg\z /
25
+
26
+ if two . nil?
27
+ puts <<-EOF
28
+
29
+ nyasocom_pg project, clone command.
30
+
31
+ heat db postgresql
32
+
33
+ heat db --pg
34
+
35
+ EOF
36
+ elsif two . match? ( pt )
37
+ postgresql
38
+ elsif two . match? ( pg )
39
+ postgresql
40
+ else
41
+ puts 'No such option is found, please refer to the documentation.'
42
+ end
43
+ end
44
+
14
45
private
15
46
def self . encoding_style
16
47
Encoding . default_internal = 'UTF-8'
17
48
Encoding . default_external = 'UTF-8'
18
49
end
19
-
50
+
20
51
def self . nyasocom_custom_name
21
52
one = ARGV [ 1 ]
22
53
FileUtils . mkdir_p ( "./#{ one } " )
@@ -33,14 +64,36 @@ def self.nyasocom_custom_name
33
64
34
65
EOF
35
66
end
36
- end
37
67
38
- begin
39
- InstallerRunner . run
40
- rescue LoadError => e
41
- puts e . backtrace
42
- ensure
43
- GC . compact
68
+ def self . nyasocom_command
69
+ if system ( 'git clone git@github.com:takkii/nyasocom_oss.git' , exception : true )
70
+ else
71
+ system ( 'git clone https://github.com:takkii/nyasocom_oss.git' )
72
+ end
73
+ FileUtils . cd ( "./nyasocom_oss" )
74
+ FileUtils . rm_rf ( "./.git" )
75
+ FileUtils . rm_rf ( "./.github" )
76
+ puts <<-EOF
77
+
78
+ Cloned nyasocom_oss with nyasocom_frame.
79
+
80
+ EOF
81
+ end
82
+
83
+ def self . postgresql
84
+ if system ( 'git clone git@github.com:takkii/nyasocom_pg.git' , exception : true )
85
+ else
86
+ system ( 'git clone https://github.com:takkii/nyasocom_pg.git' )
87
+ end
88
+ FileUtils . cd ( "./nyasocom_pg" )
89
+ FileUtils . rm_rf ( "./.git" )
90
+ FileUtils . rm_rf ( "./.github" )
91
+ puts <<-EOF
92
+
93
+ Cloned nyasocom_pg with nyasocom_frame.
94
+
95
+ EOF
96
+ end
44
97
end
45
98
46
99
__END__
You can’t perform that action at this time.
0 commit comments