contentful_bootstrap 1.2.0 → 1.3.0
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/CHANGELOG.md +7 -0
- data/README.md +3 -0
- data/lib/contentful/bootstrap/commands.rb +4 -1
- data/lib/contentful/bootstrap/token.rb +11 -6
- data/lib/contentful/bootstrap/version.rb +1 -1
- 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: abc3293313734c48533d9bfab19a082c56ff2015
|
4
|
+
data.tar.gz: 2f32362597921e36bde671c82e6ebc1ed9370b8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd662d667dbfa2ea5fedc5eba59e21c88a26a2178857b491ebf334232bf67e96bd3aefd7819f3d97d3752a52b4f58edb275292476684a185768aa9a7a3efc13f
|
7
|
+
data.tar.gz: fecb3ebcc95412f4471f9836ac8767168b2f7f68319da4abad64718917809e62af6a1f21b3f16881100aae39b01aa2fddba68a60b0e9447988468e779561c5a7
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -111,6 +111,9 @@ The configuration file will be in `ini` format and looks like the following
|
|
111
111
|
```ini
|
112
112
|
[global]
|
113
113
|
CONTENTFUL_MANAGEMENT_ACCESS_TOKEN = a_management_access_token
|
114
|
+
|
115
|
+
[space_name]
|
116
|
+
SPACE_ID = some_space_id ; Space configurations are not required by this tool, but can be generated by it
|
114
117
|
CONTENTFUL_DELIVERY_ACCESS_TOKEN = a_delivery_acces_token ; Delivery Access Token is not required for this tool, but can be generated by it
|
115
118
|
```
|
116
119
|
|
@@ -95,7 +95,10 @@ module Contentful
|
|
95
95
|
|
96
96
|
puts "Token '#{token_name}' created! - '#{token}'"
|
97
97
|
print "Do you want to write the Delivery Token to your configuration file? (Y/n): "
|
98
|
-
|
98
|
+
unless gets.chomp.downcase == "n"
|
99
|
+
Token.write_access_token(space.name, token)
|
100
|
+
Token.write_space_id(space.name, space.id)
|
101
|
+
end
|
99
102
|
|
100
103
|
token
|
101
104
|
end
|
@@ -6,8 +6,9 @@ module Contentful
|
|
6
6
|
CONFIG_ENV = "CONTENTFUL_ENV".freeze
|
7
7
|
DEFAULT_SECTION = "global".freeze
|
8
8
|
DEFAULT_PATH = ".contentfulrc".freeze
|
9
|
-
MANAGEMENT_TOKEN = "CONTENTFUL_MANAGEMENT_ACCESS_TOKEN"
|
10
|
-
DELIVERY_TOKEN = "CONTENTFUL_DELIVERY_ACCESS_TOKEN"
|
9
|
+
MANAGEMENT_TOKEN = "CONTENTFUL_MANAGEMENT_ACCESS_TOKEN".freeze
|
10
|
+
DELIVERY_TOKEN = "CONTENTFUL_DELIVERY_ACCESS_TOKEN".freeze
|
11
|
+
SPACE_ID = "SPACE_ID".freeze
|
11
12
|
|
12
13
|
def self.set_path!(config_path = "")
|
13
14
|
@@config_path = config_path
|
@@ -26,14 +27,18 @@ module Contentful
|
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
29
|
-
def self.write(
|
30
|
+
def self.write(value, section = nil, key = MANAGEMENT_TOKEN)
|
30
31
|
file = config_file
|
31
|
-
file[config_section][key] =
|
32
|
+
file[section || config_section][key] = value
|
32
33
|
file.save
|
33
34
|
end
|
34
35
|
|
35
|
-
def self.write_access_token(token)
|
36
|
-
write(token, DELIVERY_TOKEN)
|
36
|
+
def self.write_access_token(space_name, token)
|
37
|
+
write(token, space_name, DELIVERY_TOKEN)
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.write_space_id(space_name, space_id)
|
41
|
+
write(space_id, space_name, SPACE_ID)
|
37
42
|
end
|
38
43
|
|
39
44
|
def self.filename
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentful_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Litvak Bruno
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|