magellan-cli 0.6.3 → 0.6.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: 6cba09c2e05c47bef0f93009f6f11e19003f1506
4
- data.tar.gz: 2d5d4c20884ac93e1b6d110b17b1d927b5cf49a7
3
+ metadata.gz: 8d6704f43cf56d986b9ff84182bc449ff4cab94b
4
+ data.tar.gz: 7288afebe3ad3db21870424d976e52d9467a4bfc
5
5
  SHA512:
6
- metadata.gz: 938a8d116ac1452cac229553283ec3e4f6b00f097b7beccaf36baaa77052361251a2d1287e2fb095ea16c9e813e85dddb0992bd7f6024deb8b71b8a021aff3fb
7
- data.tar.gz: 8198e8b595765180b9d02204056ae7afde7e1ef12029bc4f15508f201ccec45cf8da80e41d01fb5862b576e7c82a47bba1a4146afd8875bb39bbd01ede9673c6
6
+ metadata.gz: 1c84ff3dce8dd50cd767f14ba1cb8bcb503acd0fe81cebbec878a1e0e7fbc51ab5cddb0007915a9248478694bec73997bca4d3337094797ea55329e9f292ca8d
7
+ data.tar.gz: 954f8c14b5bbf532fab82cc1f02aa1ef89396eaa88d89b25b89c07a759f82d6adbcbfbea667f61fe70d8f182faf51e37d9dd166a5a621075e2d15a9e5f8025a4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- magellan-cli (0.6.3)
4
+ magellan-cli (0.6.4)
5
5
  activesupport (~> 4.1.4)
6
6
  groovenauts-thor
7
7
  httpclient (~> 2.5)
@@ -96,9 +96,9 @@ module Magellan
96
96
  # @param [String] rel_path http.base_url からの相対パス
97
97
  # @param [Hash] params クエリ文字列
98
98
  # @return [Object] レスポンスのBODYをJSONとしてパースした結果オブジェクト
99
- def get_json(rel_path, params = {})
99
+ def get_json(rel_path, params = {}, &block)
100
100
  http_access do |api|
101
- api.get_json(rel_path, params)
101
+ api.get_json(rel_path, params, &block)
102
102
  end
103
103
  end
104
104
 
@@ -106,9 +106,9 @@ module Magellan
106
106
  # @param [String] rel_path http.base_url からの相対パス
107
107
  # @param [Hash] params POSTで渡されるパラメータ
108
108
  # @return nil
109
- def post(rel_path, params)
109
+ def post(rel_path, params, &block)
110
110
  http_access do |api|
111
- api.post(rel_path, params)
111
+ api.post(rel_path, params, &block)
112
112
  end
113
113
  end
114
114
 
@@ -116,9 +116,9 @@ module Magellan
116
116
  # @param [String] rel_path http.base_url からの相対パス
117
117
  # @param [Hash] params POSTで渡されるパラメータ
118
118
  # @return nil
119
- def post_json(rel_path, params)
119
+ def post_json(rel_path, params, &block)
120
120
  http_access do |api|
121
- api.post_json(rel_path, params)
121
+ api.post_json(rel_path, params, &block)
122
122
  end
123
123
  end
124
124
 
@@ -126,9 +126,9 @@ module Magellan
126
126
  # @param [String] rel_path http.base_url からの相対パス
127
127
  # @param [Hash] params PUTで渡されるパラメータ
128
128
  # @return nil
129
- def put(rel_path, params)
129
+ def put(rel_path, params, &block)
130
130
  http_access do |api|
131
- api.put(rel_path, params)
131
+ api.put(rel_path, params, &block)
132
132
  end
133
133
  end
134
134
 
@@ -136,18 +136,18 @@ module Magellan
136
136
  # @param [String] rel_path http.base_url からの相対パス
137
137
  # @param [Hash] params PUTで渡されるパラメータ
138
138
  # @return nil
139
- def put_json(rel_path, params)
139
+ def put_json(rel_path, params, &block)
140
140
  http_access do |api|
141
- api.put_json(rel_path, params)
141
+ api.put_json(rel_path, params, &block)
142
142
  end
143
143
  end
144
144
 
145
145
  # ログインしてDELETEします
146
146
  # @param [String] rel_path http.base_url からの相対パス
147
147
  # @return nil
148
- def delete(rel_path)
148
+ def delete(rel_path, &block)
149
149
  http_access do |api|
150
- api.delete(rel_path)
150
+ api.delete(rel_path, &block)
151
151
  end
152
152
  end
153
153
 
@@ -1,5 +1,5 @@
1
1
  module Magellan
2
2
  module Cli
3
- VERSION = "0.6.3"
3
+ VERSION = "0.6.4"
4
4
  end
5
5
  end
@@ -2,6 +2,7 @@
2
2
  require 'spec_helper'
3
3
 
4
4
  describe Magellan::Cli::Resources::Project do
5
+ before{ FileUtils.cp(File.expand_path("../../../../.magellan-cli.original", __FILE__), ENV["MAGELLAN_CLI_CONFIG_FILE"]) }
5
6
 
6
7
  let(:base_url){ "https://localhost:3000" }
7
8
  before{ allow(Magellan::Cli::Http).to receive(:base_url).and_return(base_url) }
@@ -18,7 +19,8 @@ describe Magellan::Cli::Resources::Project do
18
19
 
19
20
  describe :list do
20
21
  it do
21
- expect(httpclient).to receive(:get).with(%{#{base_url}/admin/project.json}).and_return(res)
22
+ url = "#{base_url}/admin/project.json?%s=%s&%s=%s" % [CGI.escape("f[organization][6][o]"), "is", CGI.escape("f[organization][6][v]"), 1]
23
+ expect(httpclient).to receive(:get).with(url).and_return(res)
22
24
  expect($stdout).to receive(:puts)
23
25
  cmd.list
24
26
  end
@@ -31,7 +33,8 @@ describe Magellan::Cli::Resources::Project do
31
33
  buf = StringIO.new
32
34
  $stdout, backup = buf, $stdout
33
35
  begin
34
- expect(httpclient).to receive(:get).with(%{#{base_url}/admin/project.json}).and_return(list_res)
36
+ url = "#{base_url}/admin/project.json?%s=%s&%s=%s" % [CGI.escape("f[organization][7][o]"), "is", CGI.escape("f[organization][7][v]"), 1]
37
+ expect(httpclient).to receive(:get).with(url).and_return(list_res)
35
38
  expect(httpclient).to receive(:get).with(%{#{base_url}/admin/magellan~auth~organization.json?compact=true}).and_return(org_res)
36
39
  cmd.list
37
40
  buf.rewind
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.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - akm2000