MrMurano 1.12.0 → 1.12.1
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 +4 -4
- data/README.markdown +2 -0
- data/lib/MrMurano/Account.rb +2 -1
- data/lib/MrMurano/Config.rb +1 -1
- data/lib/MrMurano/version.rb +1 -1
- data/spec/Account_spec.rb +25 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8d8d36a38e4e9224fe18419fa46c209b617fb1e
|
4
|
+
data.tar.gz: 1821d92046439a529a13dc4e24bf63ddddc6ad15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 885dd022085c78c25fde01506207f278e7cd38b27dce925c5fe83b636f123783cd6ca9600ea6ba32f413ed2546354048eed13d01bec48548e67fc1a08095791d
|
7
|
+
data.tar.gz: ce90dbb3756e0b8151621db399cdbc38528f0bee94aa15304494cbc9b7686b9b84a3fa7addb72aff72ea3a027cf4fb711842f702b604205720d6d88951d177d6
|
data/README.markdown
CHANGED
@@ -31,6 +31,8 @@ There are a few steps and pieces to getting a solution with a product up and
|
|
31
31
|
running in Murano. Here is the list.
|
32
32
|
|
33
33
|
- Pick a business: `mr account --business`
|
34
|
+
If this is the first time you've run `mr` it will ask for your Murano username
|
35
|
+
and password.
|
34
36
|
- Set it: `mr config business.id ZZZZZZZZZ`
|
35
37
|
- Create a product: `mr product create myawesomeproduct`
|
36
38
|
- Save the result: `mr config product.id YYYYYYYYY`
|
data/lib/MrMurano/Account.rb
CHANGED
@@ -64,7 +64,7 @@ module MrMurano
|
|
64
64
|
def _loginInfo
|
65
65
|
host = $cfg['net.host']
|
66
66
|
user = $cfg['user.name']
|
67
|
-
if user.nil? then
|
67
|
+
if user.nil? or user.empty? then
|
68
68
|
error("No Murano user account found; please login")
|
69
69
|
user = ask("User name: ")
|
70
70
|
$cfg.set('user.name', user, :user)
|
@@ -118,6 +118,7 @@ module MrMurano
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def businesses
|
121
|
+
_loginInfo if $cfg['user.name'].nil?
|
121
122
|
get('user/' + $cfg['user.name'] + '/membership/')
|
122
123
|
end
|
123
124
|
|
data/lib/MrMurano/Config.rb
CHANGED
@@ -80,7 +80,7 @@ module MrMurano
|
|
80
80
|
set('location.cors', 'cors.yaml', :defaults)
|
81
81
|
set('location.specs', 'specs', :defaults)
|
82
82
|
|
83
|
-
set('sync.bydefault', SyncRoot.bydefault.join(' '), :defaults)
|
83
|
+
set('sync.bydefault', SyncRoot.bydefault.join(' '), :defaults) if defined? SyncRoot
|
84
84
|
|
85
85
|
set('files.default_page', 'index.html', :defaults)
|
86
86
|
set('files.searchFor', '**/*', :defaults)
|
data/lib/MrMurano/version.rb
CHANGED
data/spec/Account_spec.rb
CHANGED
@@ -101,7 +101,6 @@ RSpec.describe MrMurano::Account, "token" do
|
|
101
101
|
ret = acc.token
|
102
102
|
expect(ret).to eq("quxx")
|
103
103
|
end
|
104
|
-
|
105
104
|
end
|
106
105
|
end
|
107
106
|
|
@@ -123,15 +122,32 @@ RSpec.describe MrMurano::Account do
|
|
123
122
|
expect(uri.to_s).to eq("https://bizapi.hosted.exosite.io/api:1/")
|
124
123
|
end
|
125
124
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
125
|
+
context "lists business" do
|
126
|
+
it "for user.name" do
|
127
|
+
bizlist = [{"bizid"=>"XXX","role"=>"admin","name"=>"MPS"},
|
128
|
+
{"bizid"=>"YYY","role"=>"admin","name"=>"MAE"}]
|
129
|
+
stub_request(:get, "https://bizapi.hosted.exosite.io/api:1/user/BoB@place.net/membership/").
|
130
|
+
to_return(body: bizlist )
|
131
|
+
|
132
|
+
$cfg['user.name'] = 'BoB@place.net'
|
133
|
+
ret = @acc.businesses
|
134
|
+
expect(ret).to eq(bizlist)
|
135
|
+
end
|
136
|
+
|
137
|
+
it "askes for account when missing" do
|
138
|
+
bizlist = [{"bizid"=>"XXX","role"=>"admin","name"=>"MPS"},
|
139
|
+
{"bizid"=>"YYY","role"=>"admin","name"=>"MAE"}]
|
140
|
+
stub_request(:get, "https://bizapi.hosted.exosite.io/api:1/user/BoB@place.net/membership/").
|
141
|
+
to_return(body: bizlist )
|
131
142
|
|
132
|
-
|
133
|
-
|
134
|
-
|
143
|
+
$cfg['user.name'] = nil
|
144
|
+
expect(@acc).to receive(:_loginInfo) do |arg|
|
145
|
+
$cfg['user.name'] = 'BoB@place.net'
|
146
|
+
end
|
147
|
+
|
148
|
+
ret = @acc.businesses
|
149
|
+
expect(ret).to eq(bizlist)
|
150
|
+
end
|
135
151
|
end
|
136
152
|
|
137
153
|
it "lists products" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: MrMurano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Conrad Tadpol Tilstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|