phper 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -6
- data/VERSION +1 -1
- data/lib/phper/commands.rb +40 -12
- data/phper.gemspec +2 -2
- metadata +5 -5
data/README.md
CHANGED
@@ -3,7 +3,7 @@ phper
|
|
3
3
|
|
4
4
|
A CLI utility for PHPer.jp.
|
5
5
|
|
6
|
-
PHPer.jp is a Platform
|
6
|
+
PHPer.jp is a Platform as a Service of PHP.
|
7
7
|
|
8
8
|
Requirements
|
9
9
|
------------
|
@@ -21,10 +21,10 @@ Install
|
|
21
21
|
Usage
|
22
22
|
-----
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
phper [options] <commands> [<command options>] args...
|
25
|
+
--version show version
|
26
|
+
--help show this message
|
27
|
+
--debug debug mode
|
28
28
|
|
29
29
|
### Commands:
|
30
30
|
|
@@ -43,7 +43,7 @@ Usage
|
|
43
43
|
* servers:add
|
44
44
|
* servers:remove
|
45
45
|
* open
|
46
|
-
*
|
46
|
+
* db:init
|
47
47
|
* deploy
|
48
48
|
|
49
49
|
Contributing to phper
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/lib/phper/commands.rb
CHANGED
@@ -73,6 +73,27 @@ class Phper::Commands < CommandLineUtils::Commands
|
|
73
73
|
}
|
74
74
|
end
|
75
75
|
|
76
|
+
def info
|
77
|
+
project = nil
|
78
|
+
OptionParser.new { |opt|
|
79
|
+
project = extract_project(opt)
|
80
|
+
@summery = "show project info"
|
81
|
+
return opt if @help
|
82
|
+
}
|
83
|
+
raise "project is not specified." unless project
|
84
|
+
start
|
85
|
+
project = @agent.projects(project)
|
86
|
+
puts "%s" % project["project"]["id"]
|
87
|
+
puts "--> %s" % project["project"]["git"]
|
88
|
+
puts "--> mysql://%s:%s@%s/%s" % [project["project"]["dbuser"],
|
89
|
+
project["project"]["dbpassword"],
|
90
|
+
"db.phper.jp",
|
91
|
+
project["project"]["dbname"]]
|
92
|
+
@agent.servers(project["project"]["id"]).each { |server|
|
93
|
+
puts "%s\thttp://%s" % [server["server"]["name"],server["server"]["fqdn"]]
|
94
|
+
}
|
95
|
+
end
|
96
|
+
|
76
97
|
def create
|
77
98
|
OptionParser.new { |opt|
|
78
99
|
opt.parse!(@command_options)
|
@@ -100,6 +121,8 @@ class Phper::Commands < CommandLineUtils::Commands
|
|
100
121
|
end
|
101
122
|
end
|
102
123
|
|
124
|
+
|
125
|
+
|
103
126
|
def destroy
|
104
127
|
project = nil
|
105
128
|
yes = false
|
@@ -193,17 +216,6 @@ class Phper::Commands < CommandLineUtils::Commands
|
|
193
216
|
puts "%i key(s) removed" % [count]
|
194
217
|
end
|
195
218
|
|
196
|
-
def extract_project opt
|
197
|
-
@banner = [@banner,"[--project=<project>]"].join(" ")
|
198
|
-
project = nil
|
199
|
-
opt.on('--project=PROJECT', 'project') { |v|
|
200
|
-
project = full_project_name(v)
|
201
|
-
}
|
202
|
-
opt.parse!(@command_options)
|
203
|
-
return project if project
|
204
|
-
git_remote(Dir.pwd)
|
205
|
-
end
|
206
|
-
|
207
219
|
def servers
|
208
220
|
project = nil
|
209
221
|
OptionParser.new { |opt|
|
@@ -326,13 +338,29 @@ class Phper::Commands < CommandLineUtils::Commands
|
|
326
338
|
raise "project is not specified." unless project
|
327
339
|
start
|
328
340
|
@agent.projects_init_db(project)
|
329
|
-
|
341
|
+
project = @agent.projects(project)
|
342
|
+
puts "Initialize Database %s" % project["project"]["id"]
|
343
|
+
puts "--> mysql://%s:%s@%s/%s" % [project["project"]["dbuser"],
|
344
|
+
project["project"]["dbpassword"],
|
345
|
+
"db.phper.jp",
|
346
|
+
project["project"]["dbname"]]
|
330
347
|
end
|
331
348
|
|
332
349
|
|
333
350
|
|
334
351
|
private
|
335
352
|
|
353
|
+
def extract_project opt
|
354
|
+
@banner = [@banner,"[--project=<project>]"].join(" ")
|
355
|
+
project = nil
|
356
|
+
opt.on('--project=PROJECT', 'project') { |v|
|
357
|
+
project = full_project_name(v)
|
358
|
+
}
|
359
|
+
opt.parse!(@command_options)
|
360
|
+
return project if project
|
361
|
+
git_remote(Dir.pwd)
|
362
|
+
end
|
363
|
+
|
336
364
|
def user
|
337
365
|
Keystorage.list("phper.jp").shift
|
338
366
|
end
|
data/phper.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{phper}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Yoshihiro TAKAHARA"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-23}
|
13
13
|
s.default_executable = %q{phper}
|
14
14
|
s.description = %q{phper}
|
15
15
|
s.email = %q{y.takahara@gmail.com}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 4
|
9
|
+
- 0
|
10
|
+
version: 0.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Yoshihiro TAKAHARA
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-23 00:00:00 +09:00
|
19
19
|
default_executable: phper
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|