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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a270f22fca1571061fbd56d18bee90137b71079
4
- data.tar.gz: f26fc82905faa27d613319546897dd86e43a8f05
3
+ metadata.gz: d699fc1843d9a86a7df8b1108885d1e57043ff14
4
+ data.tar.gz: bcabcf644fd935f5f39cc94fcfaa0257b9173bf0
5
5
  SHA512:
6
- metadata.gz: 289a527a728ffcd79d01d60b0cd79be7eef05a8689290258b1d781b9b491268b53fbcb2952a230418f2fedc6c88c19a2f93778486690a3bb67c872331a567ee7
7
- data.tar.gz: 4a17f2594a97f701f841d48acf8d3804984f3668711c42da6f0cfd1f169f9945fa59851e2b063b59dfa0bd9244da0fe7f5e15861456c7254895bacd7655ef433
6
+ metadata.gz: c8916b6447f535462798dfae59c2bfae177816d39e06b72b01d873225b5fcf6dcca57b8509f5b74f4d2b2442faa461ecdb300d1cad6fa4800cd806942aa50a6c
7
+ data.tar.gz: bae70afe3cd8681a4447ebf05545927ab54b74d77157a20bbfbdc695082013a1ee44d82060d9a7e744b9d62ca4f02e80290aecd05e7979a3b59dac9f90c9ee16
@@ -1,6 +1,10 @@
1
1
  # Change Log
2
2
  ## Unreleased
3
3
 
4
+ ## v1.5.0
5
+ ### Added
6
+ * Multiple Organization ID fetch
7
+
4
8
  ## v1.4.0
5
9
  ### Added
6
10
  * Contentful Space URL after creation
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Contentful
2
2
  module Bootstrap
3
- VERSION = "1.4.0"
3
+ VERSION = "1.5.0"
4
4
  end
5
5
  end
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.0
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: