gitpusshuten 0.0.3 → 0.0.4
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.
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/gitpusshuten/command.rb +2 -2
- data/lib/gitpusshuten/commands/initialize.rb +5 -5
- data/lib/gitpusshuten/commands/user.rb +17 -24
- data/lib/gitpusshuten/commands/version.rb +2 -2
- data/lib/gitpusshuten/helpers/environment/user.rb +2 -2
- data/lib/gitpusshuten/version.rb +1 -1
- metadata +12 -3
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/gitpusshuten/command.rb
CHANGED
@@ -108,7 +108,7 @@ module GitPusshuTen
|
|
108
108
|
##
|
109
109
|
# Displays a list of available commands in the CLI
|
110
110
|
def display_commands
|
111
|
-
puts "\nGit Pusshu Ten\n\s\s\s\s
|
111
|
+
puts "\nGit Pusshu Ten\n\s\s\s\sプッシュ天\n\n"
|
112
112
|
puts "[Aliases]\n\n"
|
113
113
|
puts "\s\s#{y('gitpusshuten')}, #{y('heavenly')}, #{y('ten')}\n\n"
|
114
114
|
puts "[Commands]\n\n"
|
@@ -122,7 +122,7 @@ module GitPusshuTen
|
|
122
122
|
##
|
123
123
|
# Displays command specific details in the CLI
|
124
124
|
def display_usage(command)
|
125
|
-
puts "\nGit Pusshu Ten\n\s\s\s\s
|
125
|
+
puts "\nGit Pusshu Ten\n\s\s\s\sプッシュ天\n\n"
|
126
126
|
puts "[Command]\n\n\s\s#{y(command)}\n\n"
|
127
127
|
puts "[Description]\n\n\s\s#{get_constant_for(command).description}\n\n"
|
128
128
|
puts "[Usage]\n\n\s\s#{y get_constant_for(command).usage}\n\n"
|
@@ -2,9 +2,9 @@
|
|
2
2
|
module GitPusshuTen
|
3
3
|
module Commands
|
4
4
|
class Initialize < GitPusshuTen::Commands::Base
|
5
|
-
description "Initializes Git Pusshu Ten (
|
5
|
+
description "Initializes Git Pusshu Ten (プッシュ天) with the working directory."
|
6
6
|
usage "initialize"
|
7
|
-
example "heavenly initialize # Initializes Git Pusshu Ten (
|
7
|
+
example "heavenly initialize # Initializes Git Pusshu Ten (プッシュ天) with the working directory."
|
8
8
|
|
9
9
|
##
|
10
10
|
# Initialize specific attributes/arguments
|
@@ -24,7 +24,7 @@ module GitPusshuTen
|
|
24
24
|
##
|
25
25
|
# Performs the Initialize command
|
26
26
|
def perform!
|
27
|
-
message "Would you like to initialize Git Pusshu Ten (
|
27
|
+
message "Would you like to initialize Git Pusshu Ten (プッシュ天) with #{working_directory}?"
|
28
28
|
if yes?
|
29
29
|
copy_templates!
|
30
30
|
if not git.initialized?
|
@@ -41,7 +41,7 @@ module GitPusshuTen
|
|
41
41
|
# to the .gitpusshuten inside the working directory
|
42
42
|
def copy_templates!
|
43
43
|
if File.directory?(File.join(working_directory, '.gitpusshuten'))
|
44
|
-
warning "Git Pusshu Ten (
|
44
|
+
warning "Git Pusshu Ten (プッシュ天) is already initialized in #{y(working_directory)}."
|
45
45
|
warning "Re-initializing it will cause it to overwrite the current #{y("config.rb")} and #{y("hooks.rb")} files."
|
46
46
|
warning "Are you sure you wish to continue?"
|
47
47
|
@confirm_perform = yes?
|
@@ -52,7 +52,7 @@ module GitPusshuTen
|
|
52
52
|
Dir[File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'templates', '*.rb'))].each do |template|
|
53
53
|
local.execute("cp '#{template}' '#{working_directory}/.gitpusshuten/#{template.split('/').last}'")
|
54
54
|
end
|
55
|
-
message "Git Pusshu Ten (
|
55
|
+
message "Git Pusshu Ten (プッシュ天) initialized in: #{y(working_directory)}!"
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -25,9 +25,6 @@ module GitPusshuTen
|
|
25
25
|
# Sets up a new UNIX user and configures it based on the .gitpusshuten/config.rb
|
26
26
|
def perform_add!
|
27
27
|
if not e.user_exists? # prompts root
|
28
|
-
ensure_git_installed!
|
29
|
-
ensure_common_dependencies_are_installed!
|
30
|
-
|
31
28
|
message "It looks like #{y(c.user)} does not yet exist."
|
32
29
|
message "Would you like to add #{y(c.user)} to #{y(c.application)} (#{y(c.ip)})?"
|
33
30
|
if yes?
|
@@ -49,6 +46,20 @@ module GitPusshuTen
|
|
49
46
|
exit
|
50
47
|
end
|
51
48
|
|
49
|
+
##
|
50
|
+
# Install Git if it isn't installed yet
|
51
|
+
Spinner.return :message => "Ensuring #{y('Git')} is installed.." do
|
52
|
+
ensure_git_installed!
|
53
|
+
g('Done!')
|
54
|
+
end
|
55
|
+
|
56
|
+
##
|
57
|
+
# Install common application dependencies like xmllib and imagemagick
|
58
|
+
Spinner.return :message => "Ensuring #{y('common applictation dependencies')} are installed.." do
|
59
|
+
ensure_common_dependencies_are_installed!
|
60
|
+
g('Done!')
|
61
|
+
end
|
62
|
+
|
52
63
|
##
|
53
64
|
# Configures the user
|
54
65
|
configure_user!
|
@@ -123,7 +134,7 @@ module GitPusshuTen
|
|
123
134
|
end
|
124
135
|
|
125
136
|
unless e.ssh_key_installed? # prompts root
|
126
|
-
Spinner.return :message => "Installing SSH Key.." do
|
137
|
+
Spinner.return :message => "Installing #{"SSH Key".color(:yellow)}.." do
|
127
138
|
e.install_ssh_key!
|
128
139
|
g("Done!")
|
129
140
|
end
|
@@ -142,7 +153,7 @@ module GitPusshuTen
|
|
142
153
|
end
|
143
154
|
|
144
155
|
unless e.root_ssh_key_installed? # prompts root
|
145
|
-
Spinner.return :message => "Installing SSH Key.." do
|
156
|
+
Spinner.return :message => "Installing #{"SSH Key".color(:yellow)}.." do
|
146
157
|
e.install_root_ssh_key!
|
147
158
|
g("Done!")
|
148
159
|
end
|
@@ -154,25 +165,7 @@ module GitPusshuTen
|
|
154
165
|
##
|
155
166
|
# Ensures that Git is installed on the remote server
|
156
167
|
def ensure_git_installed!
|
157
|
-
|
158
|
-
warning "It is required that you have #{y('Git')} installed at #{y(c.ip)}."
|
159
|
-
warning "Could not find #{y('Git')}, would you like to install it?"
|
160
|
-
|
161
|
-
if yes?
|
162
|
-
Spinner.return :message => "Installing #{y('Git')}.." do
|
163
|
-
e.install!('git-core')
|
164
|
-
@git_installed = e.installed?('git')
|
165
|
-
if @git_installed
|
166
|
-
g("Done!")
|
167
|
-
else
|
168
|
-
r("Unable to install Git.")
|
169
|
-
end
|
170
|
-
end
|
171
|
-
exit unless @git_installed
|
172
|
-
else
|
173
|
-
exit
|
174
|
-
end
|
175
|
-
end
|
168
|
+
e.install!('git-core')
|
176
169
|
end
|
177
170
|
|
178
171
|
##
|
@@ -2,7 +2,7 @@
|
|
2
2
|
module GitPusshuTen
|
3
3
|
module Commands
|
4
4
|
class Version < GitPusshuTen::Commands::Base
|
5
|
-
description "Displays the current version of Git Pusshu Ten (
|
5
|
+
description "Displays the current version of Git Pusshu Ten (プッシュ天)."
|
6
6
|
|
7
7
|
##
|
8
8
|
# Initializes the Version command
|
@@ -13,7 +13,7 @@ module GitPusshuTen
|
|
13
13
|
##
|
14
14
|
# Performs the Version command
|
15
15
|
def perform!
|
16
|
-
standard "Git Pusshu Ten (
|
16
|
+
standard "Git Pusshu Ten (プッシュ天) version #{GitPusshuTen::VERSION}"
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
@@ -15,7 +15,7 @@ module GitPusshuTen
|
|
15
15
|
##
|
16
16
|
# Adds the user to the sudoers file
|
17
17
|
def add_user_to_sudoers!
|
18
|
-
execute_as_root("echo '#{c.user} ALL=(ALL) ALL' >> /etc/sudoers")
|
18
|
+
execute_as_root("echo '#{c.user} ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers")
|
19
19
|
end
|
20
20
|
|
21
21
|
##
|
@@ -28,7 +28,7 @@ module GitPusshuTen
|
|
28
28
|
##
|
29
29
|
# Checks to see if the user is already in the sudoers file or not
|
30
30
|
def user_in_sudoers?
|
31
|
-
return true if execute_as_root("cat /etc/sudoers").include?("#{c.user} ALL=(ALL) ALL")
|
31
|
+
return true if execute_as_root("cat /etc/sudoers").include?("#{c.user} ALL=(ALL) NOPASSWD: ALL")
|
32
32
|
false
|
33
33
|
end
|
34
34
|
|
data/lib/gitpusshuten/version.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitpusshuten
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Michael van Rooijen
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-23 00:00:00 +01:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
@@ -25,6 +26,7 @@ dependencies:
|
|
25
26
|
requirements:
|
26
27
|
- - ~>
|
27
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 19
|
28
30
|
segments:
|
29
31
|
- 1
|
30
32
|
- 1
|
@@ -40,6 +42,7 @@ dependencies:
|
|
40
42
|
requirements:
|
41
43
|
- - ~>
|
42
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 15
|
43
46
|
segments:
|
44
47
|
- 1
|
45
48
|
- 6
|
@@ -55,6 +58,7 @@ dependencies:
|
|
55
58
|
requirements:
|
56
59
|
- - ~>
|
57
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 15
|
58
62
|
segments:
|
59
63
|
- 2
|
60
64
|
- 0
|
@@ -70,6 +74,7 @@ dependencies:
|
|
70
74
|
requirements:
|
71
75
|
- - ~>
|
72
76
|
- !ruby/object:Gem::Version
|
77
|
+
hash: 23
|
73
78
|
segments:
|
74
79
|
- 1
|
75
80
|
- 0
|
@@ -85,6 +90,7 @@ dependencies:
|
|
85
90
|
requirements:
|
86
91
|
- - ~>
|
87
92
|
- !ruby/object:Gem::Version
|
93
|
+
hash: 7
|
88
94
|
segments:
|
89
95
|
- 3
|
90
96
|
- 0
|
@@ -100,6 +106,7 @@ dependencies:
|
|
100
106
|
requirements:
|
101
107
|
- - ~>
|
102
108
|
- !ruby/object:Gem::Version
|
109
|
+
hash: 7
|
103
110
|
segments:
|
104
111
|
- 1
|
105
112
|
- 4
|
@@ -200,6 +207,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
200
207
|
requirements:
|
201
208
|
- - ">="
|
202
209
|
- !ruby/object:Gem::Version
|
210
|
+
hash: 3
|
203
211
|
segments:
|
204
212
|
- 0
|
205
213
|
version: "0"
|
@@ -208,6 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
216
|
requirements:
|
209
217
|
- - ">="
|
210
218
|
- !ruby/object:Gem::Version
|
219
|
+
hash: 3
|
211
220
|
segments:
|
212
221
|
- 0
|
213
222
|
version: "0"
|