sakura-cli 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efd5e983753789e52601e9ac4a964b12126a4332
4
- data.tar.gz: 738d21ce3ec8ead5bbc4a299cc2facb31d01c780
3
+ metadata.gz: 8566975c821f240ec7db3c57603592a5e0fbe164
4
+ data.tar.gz: 3c3790ea92f68174cb6e3fd3df38831919129138
5
5
  SHA512:
6
- metadata.gz: 1e0ff298884e5271b0b22a4b30d9500c603fa0597b6db756546a225b77ce0f64d17efd72c58f19d0c59bc95a23b22cc30e021f9b67bb422dbc1dd1cb649a3f4a
7
- data.tar.gz: 7ea1e26078515dc5bffd37667870683d1a9c2380c0a6fa0f6da8b452fbf9a022d3903f6c0fdcf91d65b2e97335675f258c4517101530c49e2986487672bddfad
6
+ metadata.gz: 5773712c8dd30f04f68fe18e9c11ead53a75584788ce42dee5f0453e7ac2ede2d699081723a54786156f5e2149635d3b876f0f37719b429950ee9ab77f64b890
7
+ data.tar.gz: e62355d238a16cf03fe4a80f11cf5fb7ffda1d9a0191577f63803ca8b6a8b9b8411deb3d86d5e73045e7342732f9923482ab29826dff395f99daba04cccdb586
@@ -67,7 +67,7 @@ module Sakura
67
67
  end
68
68
  end
69
69
 
70
- desc 'scan LOCAL_PART [enable|disable]', 'Switch virus scan'
70
+ desc 'scan LOCAL_PART [enable|disable]', 'Switch virus scan configuration of a mail address'
71
71
  def scan(local_part, value=nil)
72
72
  self.class.handle_argument_error if value && value !~ /enable|disable/
73
73
 
@@ -111,7 +111,7 @@ module Sakura
111
111
  end
112
112
  end
113
113
 
114
- desc 'keep LOCAL_PART [enable|disable]', 'Switch keep or flush mails'
114
+ desc 'keep LOCAL_PART [enable|disable]', 'Switch keep or flush configuration of a mail address'
115
115
  def keep(local_part, value=nil)
116
116
  self.class.handle_argument_error if value && value !~ /enable|disable/
117
117
 
@@ -132,6 +132,14 @@ module Sakura
132
132
  end
133
133
  end
134
134
 
135
+ desc 'show LOCAL_PART', 'Display information about a mail address'
136
+ def show(local_part)
137
+ mail = MailAddress.find(local_part)
138
+ abort %(No mail address: "#{local_part}") unless mail
139
+
140
+ puts mail.detail
141
+ end
142
+
135
143
 
136
144
  private
137
145
 
@@ -1,5 +1,5 @@
1
1
  module Sakura
2
2
  module Cli
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -98,9 +98,9 @@ module Sakura
98
98
  virus_scan = false
99
99
  end
100
100
 
101
- def keep
101
+ def keep(page=nil)
102
102
  if @keep.nil?
103
- page = Client.current_session.get(MAIL_URL + @link)
103
+ page ||= Client.current_session.get(MAIL_URL + @link)
104
104
  @keep = page.find('input[name="Save"]:checked').value == '1'
105
105
  end
106
106
 
@@ -124,9 +124,9 @@ module Sakura
124
124
  keep = false
125
125
  end
126
126
 
127
- def forward_list
127
+ def forward_list(page=nil)
128
128
  if @forward_list.nil?
129
- page = Client.current_session.get(MAIL_URL + @link)
129
+ page ||= Client.current_session.get(MAIL_URL + @link)
130
130
  @forward_list = page.all('select[name="DeleteAddress[]"] option').map(&:text)
131
131
  end
132
132
 
@@ -160,5 +160,16 @@ module Sakura
160
160
  def to_s
161
161
  self.class.tabularize(@address, @virus_scan, @usage, @quota)
162
162
  end
163
+
164
+ def detail
165
+ page = Client.current_session.get(MAIL_URL + @link)
166
+
167
+ <<-EOS
168
+ usage / quota: #{usage} / #{quota}
169
+ forward_to: #{forward_list(page).join(' ')}
170
+ keep mail?: #{keep(page)}
171
+ virus_scan?: #{virus_scan}
172
+ EOS
173
+ end
163
174
  end
164
175
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sakura-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shintaro Kojima
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-05-12 00:00:00.000000000 Z
11
+ date: 2015-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: poltergeist