soracom 1.0.4 → 1.0.5

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: bcc64ce15c72baf0c6b8e6620cfa288effdb07d0
4
- data.tar.gz: e8c54a32d7977f5a07a7dd4c0c6fc801b59d27be
3
+ metadata.gz: 8d301639544eb36f5b10969c2c061dfb459760a9
4
+ data.tar.gz: 3775b3d6d72f3212e1e5228ec805d2976fe9706e
5
5
  SHA512:
6
- metadata.gz: 117a1cdcfc02a180ee439fde5e2b395acd0b8fc167819866d767e22b6df74f4a16d37a22e39aaf40712674f206f5923c0bcd30143bdbb8fbe6ff0a41fcb5bf39
7
- data.tar.gz: ab583fbb498058772b5156a4f81cffcfd99730af2ecc17361c57c196da15f21bc8439e87eb9a952fd3e5e6e6f025d3b0a6afd2d766fe6c895ffd4956b83a13b2
6
+ metadata.gz: a07922a1663e258d5277f86f4f7cfd14e3ef0a630ddd6a5969fcbc648f31b2d5248d138e80079e5d2046fcb46233154859df52bd3066bd067056a699f9d8bcee
7
+ data.tar.gz: 137dfe990265ee945f5200138254a45767e888a63e77cbce18a8b03a8455be6f47bfa219e29fb827d95c492be853c37b80ade8f7183904bbbdf6c085d194be4c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soracom (1.0.4)
4
+ soracom (1.0.5)
5
5
  io-console
6
6
  thor
7
7
 
@@ -1,5 +1,6 @@
1
1
  require 'net/http'
2
2
  require 'uri'
3
+ require 'cgi'
3
4
  require 'json'
4
5
  require 'base64'
5
6
  require 'ostruct'
@@ -61,6 +62,7 @@ module Soracom
61
62
 
62
63
  # SIMの利用開始(再開)
63
64
  def activate_subscriber(imsis)
65
+ imsis = [imsis] if imsis.class != Array
64
66
  threads = [], result = []
65
67
  imsis.map do |imsi|
66
68
  threads << Thread.new do
@@ -73,6 +75,7 @@ module Soracom
73
75
 
74
76
  # SIMの利用休止
75
77
  def deactivate_subscriber(imsis)
78
+ imsis = [imsis] if imsis.class != Array
76
79
  threads = [], result = []
77
80
  imsis.map do |imsi|
78
81
  threads << Thread.new do
@@ -85,6 +88,7 @@ module Soracom
85
88
 
86
89
  # SIMの解約
87
90
  def terminate_subscriber(imsis)
91
+ imsis = [imsis] if imsis.class != Array
88
92
  threads = [], result = []
89
93
  imsis.map do |imsi|
90
94
  threads << Thread.new do
@@ -97,6 +101,7 @@ module Soracom
97
101
 
98
102
  # 指定されたSubscriberをTerminate可能に設定する
99
103
  def enable_termination(imsis)
104
+ imsis = [imsis] if imsis.class != Array
100
105
  threads = [], result = []
101
106
  imsis.map do |imsi|
102
107
  threads << Thread.new do
@@ -109,6 +114,7 @@ module Soracom
109
114
 
110
115
  # 指定されたSubscriberをTerminate不可能に設定する
111
116
  def disable_termination(imsis)
117
+ imsis = [imsis] if imsis.class != Array
112
118
  threads = [], result = []
113
119
  imsis.map do |imsi|
114
120
  threads << Thread.new do
@@ -121,6 +127,7 @@ module Soracom
121
127
 
122
128
  # タグの更新
123
129
  def update_subscriber_tags(imsis, tags)
130
+ imsis = [imsis] if imsis.class != Array
124
131
  threads = [], result = []
125
132
  imsis.map do |imsi|
126
133
  threads << Thread.new do
@@ -133,10 +140,11 @@ module Soracom
133
140
 
134
141
  # 指定タグの削除
135
142
  def delete_subscriber_tag(imsis, tag_name)
143
+ imsis = [imsis] if imsis.class != Array
136
144
  threads = [], result = []
137
145
  imsis.map do |imsi|
138
146
  threads << Thread.new do
139
- result << { 'imsi' => imsi }.merge(@api.delete(path: "/subscribers/#{imsi}/tags/#{tag_name}"))
147
+ result << { 'imsi' => imsi }.merge(@api.delete(path: "/subscribers/#{imsi}/tags/#{CGI.escape(tag_name)}"))
140
148
  end
141
149
  end
142
150
  threads.each(&:join)
@@ -145,7 +153,7 @@ module Soracom
145
153
 
146
154
  # SIMのプラン変更
147
155
  def update_subscriber_speed_class(imsis, speed_class)
148
- imsis = [imsis] if imsis.class == String
156
+ imsis = [imsis] if imsis.class != Array
149
157
  threads = [], result = []
150
158
  imsis.map do |imsi|
151
159
  threads << Thread.new do
@@ -158,6 +166,7 @@ module Soracom
158
166
 
159
167
  # SIMの有効期限設定
160
168
  def set_expiry_time(imsis, expiry_time)
169
+ imsis = [imsis] if imsis.class != Array
161
170
  threads = [], result = []
162
171
  imsis.map do |imsi|
163
172
  threads << Thread.new do
@@ -170,6 +179,7 @@ module Soracom
170
179
 
171
180
  # SIMの有効期限設定を解除
172
181
  def unset_expiry_time(imsis)
182
+ imsis = [imsis] if imsis.class != Array
173
183
  threads = [], result = []
174
184
  imsis.map do |imsi|
175
185
  threads << Thread.new do
@@ -1,4 +1,4 @@
1
1
  # version info
2
2
  module Soracom
3
- VERSION = '1.0.4'
3
+ VERSION = '1.0.5'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soracom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - MATSUI, Motokatsu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-13 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler