contentful_bootstrap 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/contentful/bootstrap/commands.rb +11 -1
- data/lib/contentful/bootstrap/version.rb +1 -1
- metadata +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d699fc1843d9a86a7df8b1108885d1e57043ff14
|
4
|
+
data.tar.gz: bcabcf644fd935f5f39cc94fcfaa0257b9173bf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8916b6447f535462798dfae59c2bfae177816d39e06b72b01d873225b5fcf6dcca57b8509f5b74f4d2b2442faa461ecdb300d1cad6fa4800cd806942aa50a6c
|
7
|
+
data.tar.gz: bae70afe3cd8681a4447ebf05545927ab54b74d77157a20bbfbdc695082013a1ee44d82060d9a7e744b9d62ca4f02e80290aecd05e7979a3b59dac9f90c9ee16
|
data/CHANGELOG.md
CHANGED
@@ -31,7 +31,8 @@ module Contentful
|
|
31
31
|
begin
|
32
32
|
space = Contentful::Management::Space.create(name: space_name)
|
33
33
|
rescue Contentful::Management::NotFound
|
34
|
-
puts "Your account has multiple organizations"
|
34
|
+
puts "Your account has multiple organizations:"
|
35
|
+
puts get_organizations.join("\n")
|
35
36
|
print "Please insert the Organization ID you'd want to create the spaces for: "
|
36
37
|
organization_id = gets.chomp
|
37
38
|
space = Contentful::Management::Space.create(name: space_name, organization_id: organization_id)
|
@@ -126,6 +127,15 @@ module Contentful
|
|
126
127
|
Contentful::Management::Client.new(Token.read, raise_errors: true)
|
127
128
|
end
|
128
129
|
|
130
|
+
def get_organizations
|
131
|
+
client = management_client_init
|
132
|
+
url = client.base_url.sub('spaces', 'token')
|
133
|
+
response = Contentful::Management::Client.get_http(url, nil, client.request_headers)
|
134
|
+
JSON.load(response.body.to_s)["includes"]["Organization"].map { |org|
|
135
|
+
"%-20s #{org["sys"]["id"]}" % org["name"]
|
136
|
+
}.sort
|
137
|
+
end
|
138
|
+
|
129
139
|
def get_token
|
130
140
|
silence_stderr do # Don't show any WEBrick related stuff
|
131
141
|
server = Server.new
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentful_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Litvak Bruno
|
@@ -140,4 +140,3 @@ signing_key:
|
|
140
140
|
specification_version: 4
|
141
141
|
summary: Contentful CLI tool for getting started with Contentful
|
142
142
|
test_files: []
|
143
|
-
has_rdoc:
|