iijmio-cli 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6aecd27916a6b6e0af8bcd67e70d4256bf4c214f
4
- data.tar.gz: 0b104c228d0976992bbf4db769146c24d7f0a04c
3
+ metadata.gz: dde6cc67d425bf443ace003f1f68854fd2866029
4
+ data.tar.gz: ef2d482be99d6fbe84a2821941352f0473ed9778
5
5
  SHA512:
6
- metadata.gz: 280a763b7574bc168e7a38e1f840bf7361c9bf64428b2b5d6dc48bb8ea2d30ffbafab39388c20c2c37d5d65473cee4c57908dd2b35555464d42a7220ee5957c3
7
- data.tar.gz: f942a6f5b591340d069f41820fe1427216da23b13992a251057cb37aaddc99ed339667afebf82b7c22251dc8952c002f1e2e3c4e898611974e24ceadbc0db9a4
6
+ metadata.gz: f02a43e0cad5704b1d6033a94672788a1efca66d287438bc4df9de5400ae2eb7375741bb6d90cf9fe4270e79cc6aeffd26a3958f2a250eb7dd83d9231d8cbab2
7
+ data.tar.gz: f5c1ab745a3159cda0898a485bf1b02bb949388b5788bb927144f62e82068115a0fc74180b713ef4e552f4b57fa8ab0dbd53a7f615a06b4efe8fe86d4062e0a6
@@ -138,6 +138,8 @@ module ::Iijmio
138
138
  =end
139
139
  desc %{logs}, %{No description.}
140
140
  def logs *args
141
+ days = args[ 0 ] || 3
142
+
141
143
  response =
142
144
  ::Iijmio::CLI.get_iijmio_rest_api(%{/mobile/d/v1/log/packet/})
143
145
 
@@ -180,18 +182,20 @@ module ::Iijmio
180
182
  puts %{ + ID: #{ hdo_service_code }}
181
183
 
182
184
  packet_logs.reverse.each_with_index do | packet_log, index |
183
- date = packet_log[ %{date} ]
184
- with_coupon = packet_log[ %{withCoupon} ]
185
- without_coupon = packet_log[ %{withoutCoupon} ]
186
-
187
- logs[ hdd_service_code ][ hdo_service_code ][ date ] = {
188
- withCoupon: with_coupon,
189
- withoutCoupon: without_coupon
190
- }
191
-
192
- puts %{ date | LTE | 200Kbps } if index == 0
193
- puts %{ ----------------------------------} if index == 0
194
- puts %{ - #{ date } | #{ sprintf("%4d", with_coupon) } [MB] | #{ sprintf("%4d", without_coupon) } [MB]}
185
+ if index < days.to_i
186
+ date = packet_log[ %{date} ]
187
+ with_coupon = packet_log[ %{withCoupon} ]
188
+ without_coupon = packet_log[ %{withoutCoupon} ]
189
+
190
+ logs[ hdd_service_code ][ hdo_service_code ][ date ] = {
191
+ withCoupon: with_coupon,
192
+ withoutCoupon: without_coupon
193
+ }
194
+
195
+ puts %{ date | LTE | 200Kbps } if index == 0
196
+ puts %{ ----------------------------------} if index == 0
197
+ puts %{ - #{ date } | #{ sprintf("%4d", with_coupon) } [MB] | #{ sprintf("%4d", without_coupon) } [MB]}
198
+ end
195
199
  end
196
200
  end
197
201
  end
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module ::Iijmio
3
3
  module CLI
4
- VERSION = %{0.0.3}
4
+ VERSION = %{0.0.4}
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iijmio-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takahiro INOUE
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-14 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday