phper 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/Gemfile +1 -1
  2. data/README.md +5 -2
  3. data/VERSION +1 -1
  4. data/lib/phper/commands.rb +24 -23
  5. data/phper.gemspec +12 -12
  6. metadata +30 -30
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ gem 'command-line-utils' , '>= 0.0.1'
9
9
  gem 'launchy'
10
10
  gem 'json'
11
11
  gem 'rdoc'
12
-
12
+
13
13
  # Add dependencies to develop your gem here.
14
14
  # Include everything needed to run rake, tests, features, etc.
15
15
  group :development do
data/README.md CHANGED
@@ -50,7 +50,8 @@ Usage
50
50
  * files:get
51
51
  * files:modified
52
52
  * files:modified:get
53
-
53
+ * logs
54
+ * logs:tail
54
55
  Contributing to phper
55
56
  ---------------------
56
57
 
@@ -65,5 +66,7 @@ Contributing to phper
65
66
  Copyright
66
67
  ---------
67
68
 
68
- Copyright (c) 2011 Yoshihiro TAKAHARA. See LICENSE.txt for further details.
69
+ Copyright (c) 2011-2012 Yoshihiro TAKAHARA. See LICENSE.txt for further details.
70
+
71
+ [![endorse](http://api.coderwall.com/tumf/endorsecount.png)](http://coderwall.com/tumf)
69
72
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1
1
+ 0.7.0
@@ -594,11 +594,8 @@ EOF
594
594
 
595
595
  def logs
596
596
  project = nil
597
- server = nil
597
+ # server = nil
598
598
  OptionParser.new { |opt|
599
- opt.on('-s SERVER','--server=SERVER', 'server') { |v|
600
- server = v
601
- }
602
599
  @summery = "list logs"
603
600
  @banner = ""
604
601
  project = extract_project(opt)
@@ -610,28 +607,26 @@ EOF
610
607
  servers = @agent.servers(project)
611
608
  raise "project #{project} has no servers." if servers.length == 0
612
609
 
613
- if server
614
- servers.find { |s| s["server"]["name"] =~ /^#{server}/ }
615
- else
616
- server = servers.first if servers.length == 1
617
- end
618
- raise "server is not specified." unless server
619
-
620
- puts "-----> #{server['server']['name']}"
621
- @agent.logs(project,server).each { |log|
622
- puts log
610
+ servers.each { |server|
611
+ puts "-----> #{server['server']['name']}"
612
+ @agent.logs(project,server).each { |log|
613
+ puts log
614
+ }
623
615
  }
624
616
  end
625
617
 
626
618
  def logs_tail
627
619
  project = nil
628
620
  server = nil
621
+ name = nil
629
622
  OptionParser.new { |opt|
630
623
  opt.on('-s SERVER','--server=SERVER', 'server') { |v|
631
624
  server = v
632
625
  }
626
+ opt.on('-n NAME','--name=NAME', 'log name') { |v|
627
+ name = v
628
+ }
633
629
  @summery = "list logs"
634
- @banner = ""
635
630
  project = extract_project(opt)
636
631
  return opt if @help
637
632
  }
@@ -642,16 +637,22 @@ EOF
642
637
  raise "project #{project} has no servers." if servers.length == 0
643
638
 
644
639
  if server
645
- servers.find { |s| s["server"]["name"] =~ /^#{server}/ }
646
- else
647
- server = servers.first if servers.length == 1
640
+ server = servers.find { |s| s["server"]["name"] =~ /^#{server}/ }
641
+ raise "server is not specified." unless server
648
642
  end
649
- raise "server is not specified." unless server
650
- name = @command_options.shift
651
- name ||= "access"
652
643
 
653
- puts "-----> #{server['server']['name']}"
654
- puts @agent.logs_tail(project,server,name)["log"]
644
+ servers = [server] if server
645
+ servers.each { |server|
646
+ names = @agent.logs(project,server)
647
+ if name
648
+ raise "#{server["server"]["name"]} has no log:#{name}." unless names.include?(name)
649
+ names = [name]
650
+ end
651
+ names.each { |name|
652
+ puts "-----> log:#{name} #{server["server"]["name"]}"
653
+ puts @agent.logs_tail(project,server,name)["log"]
654
+ }
655
+ }
655
656
  end
656
657
 
657
658
  end
data/phper.gemspec CHANGED
@@ -4,15 +4,15 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{phper}
8
- s.version = "0.6.1"
7
+ s.name = "phper"
8
+ s.version = "0.7.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{Yoshihiro TAKAHARA}]
12
- s.date = %q{2011-10-16}
13
- s.description = %q{phper}
14
- s.email = %q{y.takahara@gmail.com}
15
- s.executables = [%q{phper}]
11
+ s.authors = ["Yoshihiro TAKAHARA"]
12
+ s.date = "2012-03-17"
13
+ s.description = "phper"
14
+ s.email = "y.takahara@gmail.com"
15
+ s.executables = ["phper"]
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE.txt",
18
18
  "README.md"
@@ -33,11 +33,11 @@ Gem::Specification.new do |s|
33
33
  "test/helper.rb",
34
34
  "test/test_phper.rb"
35
35
  ]
36
- s.homepage = %q{http://github.com/tumf/phper}
37
- s.licenses = [%q{MIT}]
38
- s.require_paths = [%q{lib}]
39
- s.rubygems_version = %q{1.8.6}
40
- s.summary = %q{phper}
36
+ s.homepage = "http://github.com/tumf/phper"
37
+ s.licenses = ["MIT"]
38
+ s.require_paths = ["lib"]
39
+ s.rubygems_version = "1.8.12"
40
+ s.summary = "phper"
41
41
  s.test_files = [
42
42
  "test/helper.rb",
43
43
  "test/test_phper.rb"
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: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 6
9
- - 1
10
- version: 0.6.1
8
+ - 7
9
+ - 0
10
+ version: 0.7.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Yoshihiro TAKAHARA
@@ -15,10 +15,9 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-16 00:00:00 Z
18
+ date: 2012-03-17 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- type: :runtime
22
21
  requirement: &id001 !ruby/object:Gem::Requirement
23
22
  none: false
24
23
  requirements:
@@ -28,11 +27,11 @@ dependencies:
28
27
  segments:
29
28
  - 0
30
29
  version: "0"
31
- version_requirements: *id001
30
+ type: :runtime
32
31
  name: rest-client
33
32
  prerelease: false
33
+ version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency
35
- type: :runtime
36
35
  requirement: &id002 !ruby/object:Gem::Requirement
37
36
  none: false
38
37
  requirements:
@@ -43,11 +42,11 @@ dependencies:
43
42
  - 0
44
43
  - 1
45
44
  version: "0.1"
46
- version_requirements: *id002
45
+ type: :runtime
47
46
  name: keystorage
48
47
  prerelease: false
48
+ version_requirements: *id002
49
49
  - !ruby/object:Gem::Dependency
50
- type: :runtime
51
50
  requirement: &id003 !ruby/object:Gem::Requirement
52
51
  none: false
53
52
  requirements:
@@ -58,11 +57,11 @@ dependencies:
58
57
  - 1
59
58
  - 6
60
59
  version: "1.6"
61
- version_requirements: *id003
60
+ type: :runtime
62
61
  name: highline
63
62
  prerelease: false
63
+ version_requirements: *id003
64
64
  - !ruby/object:Gem::Dependency
65
- type: :runtime
66
65
  requirement: &id004 !ruby/object:Gem::Requirement
67
66
  none: false
68
67
  requirements:
@@ -74,11 +73,11 @@ dependencies:
74
73
  - 0
75
74
  - 1
76
75
  version: 0.0.1
77
- version_requirements: *id004
76
+ type: :runtime
78
77
  name: command-line-utils
79
78
  prerelease: false
79
+ version_requirements: *id004
80
80
  - !ruby/object:Gem::Dependency
81
- type: :runtime
82
81
  requirement: &id005 !ruby/object:Gem::Requirement
83
82
  none: false
84
83
  requirements:
@@ -88,11 +87,11 @@ dependencies:
88
87
  segments:
89
88
  - 0
90
89
  version: "0"
91
- version_requirements: *id005
90
+ type: :runtime
92
91
  name: launchy
93
92
  prerelease: false
93
+ version_requirements: *id005
94
94
  - !ruby/object:Gem::Dependency
95
- type: :runtime
96
95
  requirement: &id006 !ruby/object:Gem::Requirement
97
96
  none: false
98
97
  requirements:
@@ -102,11 +101,11 @@ dependencies:
102
101
  segments:
103
102
  - 0
104
103
  version: "0"
105
- version_requirements: *id006
104
+ type: :runtime
106
105
  name: json
107
106
  prerelease: false
107
+ version_requirements: *id006
108
108
  - !ruby/object:Gem::Dependency
109
- type: :runtime
110
109
  requirement: &id007 !ruby/object:Gem::Requirement
111
110
  none: false
112
111
  requirements:
@@ -116,11 +115,11 @@ dependencies:
116
115
  segments:
117
116
  - 0
118
117
  version: "0"
119
- version_requirements: *id007
118
+ type: :runtime
120
119
  name: rdoc
121
120
  prerelease: false
121
+ version_requirements: *id007
122
122
  - !ruby/object:Gem::Dependency
123
- type: :development
124
123
  requirement: &id008 !ruby/object:Gem::Requirement
125
124
  none: false
126
125
  requirements:
@@ -130,11 +129,11 @@ dependencies:
130
129
  segments:
131
130
  - 0
132
131
  version: "0"
133
- version_requirements: *id008
132
+ type: :development
134
133
  name: shoulda
135
134
  prerelease: false
135
+ version_requirements: *id008
136
136
  - !ruby/object:Gem::Dependency
137
- type: :development
138
137
  requirement: &id009 !ruby/object:Gem::Requirement
139
138
  none: false
140
139
  requirements:
@@ -146,11 +145,11 @@ dependencies:
146
145
  - 0
147
146
  - 0
148
147
  version: 1.0.0
149
- version_requirements: *id009
148
+ type: :development
150
149
  name: bundler
151
150
  prerelease: false
151
+ version_requirements: *id009
152
152
  - !ruby/object:Gem::Dependency
153
- type: :development
154
153
  requirement: &id010 !ruby/object:Gem::Requirement
155
154
  none: false
156
155
  requirements:
@@ -162,11 +161,11 @@ dependencies:
162
161
  - 5
163
162
  - 2
164
163
  version: 1.5.2
165
- version_requirements: *id010
164
+ type: :development
166
165
  name: jeweler
167
166
  prerelease: false
167
+ version_requirements: *id010
168
168
  - !ruby/object:Gem::Dependency
169
- type: :development
170
169
  requirement: &id011 !ruby/object:Gem::Requirement
171
170
  none: false
172
171
  requirements:
@@ -176,11 +175,11 @@ dependencies:
176
175
  segments:
177
176
  - 0
178
177
  version: "0"
179
- version_requirements: *id011
178
+ type: :development
180
179
  name: rcov
181
180
  prerelease: false
181
+ version_requirements: *id011
182
182
  - !ruby/object:Gem::Dependency
183
- type: :development
184
183
  requirement: &id012 !ruby/object:Gem::Requirement
185
184
  none: false
186
185
  requirements:
@@ -190,9 +189,10 @@ dependencies:
190
189
  segments:
191
190
  - 0
192
191
  version: "0"
193
- version_requirements: *id012
192
+ type: :development
194
193
  name: mocha
195
194
  prerelease: false
195
+ version_requirements: *id012
196
196
  description: phper
197
197
  email: y.takahara@gmail.com
198
198
  executables:
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  requirements: []
247
247
 
248
248
  rubyforge_project:
249
- rubygems_version: 1.8.6
249
+ rubygems_version: 1.8.12
250
250
  signing_key:
251
251
  specification_version: 3
252
252
  summary: phper