phper 0.2.4 → 0.3.0

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.3.0
data/lib/phper/agent.rb CHANGED
@@ -49,6 +49,15 @@ class Phper::Agent
49
49
  get("/keys")
50
50
  end
51
51
 
52
+
53
+ def projects_deploy project
54
+ get("/projects/%s/deploy" % project)
55
+ end
56
+
57
+ def projects_init_db project
58
+ get("/projects/%s/db/initialize" % project)
59
+ end
60
+
52
61
  def keys_create key
53
62
  param = {}
54
63
  param[:public_key] = key if key
@@ -99,10 +108,6 @@ class Phper::Agent
99
108
  end
100
109
 
101
110
 
102
-
103
-
104
-
105
-
106
111
  def post(url,data = {},format=:json)
107
112
  call(:post,url,data,format)
108
113
  end
@@ -9,7 +9,7 @@ class Phper::Commands < CommandLineUtils::Commands
9
9
  @commands += ["login","logout","list","create","destroy","info"]
10
10
  @commands += ["keys","keys:add","keys:remove","keys:clear"]
11
11
  @commands += ["servers","servers:add","servers:remove"]
12
- @commands += ["open","mysql:init","deploy"]
12
+ @commands += ["open","db:init","deploy"]
13
13
 
14
14
  @agent = Agent.new
15
15
  # @cache_file = homedir + "/.phper.cache"
@@ -89,7 +89,7 @@ class Phper::Commands < CommandLineUtils::Commands
89
89
  puts "--> %s" % project["project"]["git"]
90
90
  puts "--> mysql://%s:%s@%s/%s" % [project["project"]["dbuser"],
91
91
  project["project"]["dbpassword"],
92
- project["project"]["dbhost"],
92
+ "db.phper.jp",
93
93
  project["project"]["dbname"]]
94
94
  # if here
95
95
  if in_git? and project["project"]["id"] != git_remote(Dir.pwd)
@@ -294,8 +294,33 @@ class Phper::Commands < CommandLineUtils::Commands
294
294
  Launchy.open url
295
295
  end
296
296
 
297
+ def deploy
298
+ project = nil
299
+ OptionParser.new { |opt|
300
+ project = extract_project(opt)
301
+ @banner = ""
302
+ @summery = "Deploy project"
303
+ return opt if @help
304
+ }
305
+ raise "project is not specified." unless project
306
+ start
307
+ @agent.projects_deploy(project)
308
+ puts "Deploy #{project}"
309
+ end
297
310
 
298
-
311
+ def db_init
312
+ project = nil
313
+ OptionParser.new { |opt|
314
+ project = extract_project(opt)
315
+ @banner = ""
316
+ @summery = "Initialize project database."
317
+ return opt if @help
318
+ }
319
+ raise "project is not specified." unless project
320
+ start
321
+ @agent.projects_init_db(project)
322
+ puts "Initialize Database #{project}"
323
+ end
299
324
 
300
325
 
301
326
 
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.2.4"
8
+ s.version = "0.3.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-21}
12
+ s.date = %q{2011-02-22}
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: 31
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 4
10
- version: 0.2.4
8
+ - 3
9
+ - 0
10
+ version: 0.3.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-21 00:00:00 +09:00
18
+ date: 2011-02-22 00:00:00 +09:00
19
19
  default_executable: phper
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency