magellan-cli 0.3.1 → 0.3.2

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: 677c866fdec8cf71b6cc7f80d3565362bee866ed
4
- data.tar.gz: 8bcbdfa44c81412e912f27ebf33367e3fa0c14fe
3
+ metadata.gz: 75c33ee36cf2a036e44f83936430b41069da6652
4
+ data.tar.gz: fff038dcf11eaf7803f3907337830193904d57e1
5
5
  SHA512:
6
- metadata.gz: 4f25ddfdafe4d927d7d56f596ef11cb414cf55538c5d6a9f86dc130cd90cfdbff1d2373e3f1781f525be08b1235938256d7ff0b3c7f2a46429bdbe99a51cf2ae
7
- data.tar.gz: 810aa638fcd93250ed8d1b4ae9f2686ff343a202b2a5a9daaf0f04d67ad178cabc2c53d061814491f8ffcee4a2fe1380ad3937e9837be52f0b109004d3185b94
6
+ metadata.gz: f842ef103745ff900ffb4c6c814192bd33b6d30f65de08a62224e2039f901369da12b36c4e1589b90b4a4209bcc2034e2bd356238398a37fc04fa72242d8c0ab
7
+ data.tar.gz: 9766570f91bca86217cdff7a33a89b948ab24a0351f439f6d29e21d5523293b260cf71a9760bc90228ba6b5eafaee3fe728158b7a6c7c85efd0103482fff7ac1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- magellan-cli (0.3.1)
4
+ magellan-cli (0.3.2)
5
5
  activesupport (~> 4.1.4)
6
6
  groovenauts-thor
7
7
  httpclient (~> 2.5)
@@ -32,7 +32,16 @@ module Magellan
32
32
  def check_response(res)
33
33
  case res.status
34
34
  when 200...400 then
35
- r = JSON.parse(res.body)
35
+ begin
36
+ r = JSON.parse(res.body)
37
+ rescue
38
+ # DELETE で 302 Found を返す時に HTML がレンダリングされることがあるので
39
+ # status code 300 台では JSON パースエラーを無視する
40
+ if res.status >= 300
41
+ return nil
42
+ end
43
+ raise
44
+ end
36
45
  log_verbose(JSON.pretty_generate(r))
37
46
  r
38
47
  else
@@ -1,5 +1,5 @@
1
1
  module Magellan
2
2
  module Cli
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magellan-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - akm2000