This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from takkii/develop
Update.
- Loading branch information
Showing
4 changed files
with
87 additions
and
120 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,17 +6,48 @@ | |
# Installer runner. | ||
class InstallerRunner | ||
|
||
def self.run | ||
def self.install | ||
encoding_style | ||
nyasocom_custom_name | ||
end | ||
|
||
|
||
def self.download | ||
encoding_style | ||
nyasocom_command | ||
end | ||
|
||
def self.database | ||
encoding_style | ||
two = ARGV[1] | ||
|
||
pt = /\Apostgresql\z/ | ||
pg = /\A--pg\z/ | ||
|
||
if two.nil? | ||
puts <<-EOF | ||
nyasocom_pg project, clone command. | ||
heat db postgresql | ||
heat db --pg | ||
EOF | ||
elsif two.match?(pt) | ||
postgresql | ||
elsif two.match?(pg) | ||
postgresql | ||
else | ||
puts 'No such option is found, please refer to the documentation.' | ||
end | ||
end | ||
|
||
private | ||
def self.encoding_style | ||
Encoding.default_internal = 'UTF-8' | ||
Encoding.default_external = 'UTF-8' | ||
end | ||
|
||
def self.nyasocom_custom_name | ||
one = ARGV[1] | ||
FileUtils.mkdir_p("./#{one}") | ||
|
@@ -33,14 +64,36 @@ def self.nyasocom_custom_name | |
EOF | ||
end | ||
end | ||
|
||
begin | ||
InstallerRunner.run | ||
rescue LoadError => e | ||
puts e.backtrace | ||
ensure | ||
GC.compact | ||
def self.nyasocom_command | ||
if system('git clone [email protected]:takkii/nyasocom_oss.git', exception: true) | ||
else | ||
system('git clone https://github.com:takkii/nyasocom_oss.git') | ||
end | ||
FileUtils.cd("./nyasocom_oss") | ||
FileUtils.rm_rf("./.git") | ||
FileUtils.rm_rf("./.github") | ||
puts <<-EOF | ||
Cloned nyasocom_oss with nyasocom_frame. | ||
EOF | ||
end | ||
|
||
def self.postgresql | ||
if system('git clone [email protected]:takkii/nyasocom_pg.git', exception: true) | ||
else | ||
system('git clone https://github.com:takkii/nyasocom_pg.git') | ||
end | ||
FileUtils.cd("./nyasocom_pg") | ||
FileUtils.rm_rf("./.git") | ||
FileUtils.rm_rf("./.github") | ||
puts <<-EOF | ||
Cloned nyasocom_pg with nyasocom_frame. | ||
EOF | ||
end | ||
end | ||
|
||
__END__ |