contentful_bootstrap 1.6.0 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +26 -0
- data/.rubocop_todo.yml +123 -0
- data/.travis.yml +6 -0
- data/CHANGELOG.md +25 -0
- data/Gemfile +1 -0
- data/Guardfile +5 -0
- data/README.md +40 -14
- data/Rakefile +7 -0
- data/bin/contentful_bootstrap +33 -22
- data/contentful_bootstrap.gemspec +7 -0
- data/lib/contentful/bootstrap.rb +7 -5
- data/lib/contentful/bootstrap/command_runner.rb +45 -0
- data/lib/contentful/bootstrap/commands.rb +3 -168
- data/lib/contentful/bootstrap/commands/base.rb +66 -0
- data/lib/contentful/bootstrap/commands/create_space.rb +111 -0
- data/lib/contentful/bootstrap/commands/generate_json.rb +41 -0
- data/lib/contentful/bootstrap/commands/generate_token.rb +52 -0
- data/lib/contentful/bootstrap/constants.rb +2 -2
- data/lib/contentful/bootstrap/generator.rb +94 -0
- data/lib/contentful/bootstrap/server.rb +25 -17
- data/lib/contentful/bootstrap/support.rb +3 -2
- data/lib/contentful/bootstrap/templates.rb +4 -4
- data/lib/contentful/bootstrap/templates/base.rb +51 -30
- data/lib/contentful/bootstrap/templates/blog.rb +33 -33
- data/lib/contentful/bootstrap/templates/catalogue.rb +103 -103
- data/lib/contentful/bootstrap/templates/gallery.rb +55 -56
- data/lib/contentful/bootstrap/templates/json_template.rb +22 -16
- data/lib/contentful/bootstrap/templates/links.rb +2 -2
- data/lib/contentful/bootstrap/templates/links/asset.rb +2 -2
- data/lib/contentful/bootstrap/templates/links/base.rb +3 -3
- data/lib/contentful/bootstrap/templates/links/entry.rb +2 -2
- data/lib/contentful/bootstrap/token.rb +32 -31
- data/lib/contentful/bootstrap/version.rb +1 -1
- data/spec/contentful/bootstrap/command_runner_spec.rb +111 -0
- data/spec/contentful/bootstrap/commands/base_spec.rb +102 -0
- data/spec/contentful/bootstrap/commands/create_space_spec.rb +72 -0
- data/spec/contentful/bootstrap/commands/generate_json_spec.rb +64 -0
- data/spec/contentful/bootstrap/commands/generate_token_spec.rb +82 -0
- data/spec/contentful/bootstrap/generator_spec.rb +15 -0
- data/spec/contentful/bootstrap/server_spec.rb +154 -0
- data/spec/contentful/bootstrap/support_spec.rb +27 -0
- data/spec/contentful/bootstrap/templates/base_spec.rb +34 -0
- data/spec/contentful/bootstrap/templates/blog_spec.rb +32 -0
- data/spec/contentful/bootstrap/templates/catalogue_spec.rb +40 -0
- data/spec/contentful/bootstrap/templates/gallery_spec.rb +40 -0
- data/spec/contentful/bootstrap/templates/json_template_spec.rb +52 -0
- data/spec/contentful/bootstrap/templates/links/asset_spec.rb +23 -0
- data/spec/contentful/bootstrap/templates/links/base_spec.rb +31 -0
- data/spec/contentful/bootstrap/templates/links/entry_spec.rb +23 -0
- data/spec/contentful/bootstrap/token_spec.rb +143 -0
- data/spec/fixtures/ini_fixtures/contentfulrc.ini +2 -0
- data/spec/fixtures/ini_fixtures/no_global.ini +2 -0
- data/spec/fixtures/ini_fixtures/no_token.ini +1 -0
- data/spec/fixtures/ini_fixtures/sections.ini +5 -0
- data/spec/fixtures/json_fixtures/issue_22.json +77 -0
- data/spec/fixtures/json_fixtures/simple.json +34 -0
- data/spec/fixtures/json_fixtures/wl1z0pal05vy.json +437 -0
- data/spec/fixtures/vcr_fixtures/generate_json.yml +384 -0
- data/spec/fixtures/vcr_fixtures/issue_22.yml +2488 -0
- data/spec/spec_helper.rb +51 -0
- metadata +167 -4
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('lib', __FILE__)
|
2
|
+
|
3
|
+
require 'contentful/bootstrap'
|
4
|
+
require 'vcr'
|
5
|
+
require 'json'
|
6
|
+
|
7
|
+
VCR.configure do |config|
|
8
|
+
config.cassette_library_dir = "spec/fixtures/vcr_fixtures"
|
9
|
+
config.hook_into :webmock
|
10
|
+
end
|
11
|
+
|
12
|
+
def json_fixture(name)
|
13
|
+
json = JSON.load(File.read("spec/fixtures/json_fixtures/#{name}.json"))
|
14
|
+
yield json if block_given?
|
15
|
+
json
|
16
|
+
end
|
17
|
+
|
18
|
+
def vcr(cassette)
|
19
|
+
VCR.use_cassette(cassette) do
|
20
|
+
yield if block_given?
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def ini(ini_file)
|
25
|
+
file = IniFile.load(ini_file)
|
26
|
+
yield file if block_given?
|
27
|
+
file
|
28
|
+
end
|
29
|
+
|
30
|
+
class SpaceDouble
|
31
|
+
def id
|
32
|
+
'foobar'
|
33
|
+
end
|
34
|
+
|
35
|
+
def name
|
36
|
+
'foobar'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
class ServerDouble
|
41
|
+
def [](key)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class RequestDouble
|
46
|
+
attr_accessor :query
|
47
|
+
end
|
48
|
+
|
49
|
+
class ResponseDouble
|
50
|
+
attr_accessor :body, :status, :content_type
|
51
|
+
end
|
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:
|
4
|
+
version: 2.0.2
|
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-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,90 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: vcr
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rr
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: guard
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: guard-rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
41
125
|
- !ruby/object:Gem::Dependency
|
42
126
|
name: launchy
|
43
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +150,20 @@ dependencies:
|
|
66
150
|
- - ">="
|
67
151
|
- !ruby/object:Gem::Version
|
68
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: contentful
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.7'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.7'
|
69
167
|
- !ruby/object:Gem::Dependency
|
70
168
|
name: inifile
|
71
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,9 +187,13 @@ extensions: []
|
|
89
187
|
extra_rdoc_files: []
|
90
188
|
files:
|
91
189
|
- ".gitignore"
|
190
|
+
- ".rubocop.yml"
|
191
|
+
- ".rubocop_todo.yml"
|
192
|
+
- ".travis.yml"
|
92
193
|
- CHANGELOG.md
|
93
194
|
- CONTRIBUTING.md
|
94
195
|
- Gemfile
|
196
|
+
- Guardfile
|
95
197
|
- LICENSE
|
96
198
|
- README.md
|
97
199
|
- Rakefile
|
@@ -99,8 +201,14 @@ files:
|
|
99
201
|
- contentful_bootstrap.gemspec
|
100
202
|
- examples/templates/catalogue.json
|
101
203
|
- lib/contentful/bootstrap.rb
|
204
|
+
- lib/contentful/bootstrap/command_runner.rb
|
102
205
|
- lib/contentful/bootstrap/commands.rb
|
206
|
+
- lib/contentful/bootstrap/commands/base.rb
|
207
|
+
- lib/contentful/bootstrap/commands/create_space.rb
|
208
|
+
- lib/contentful/bootstrap/commands/generate_json.rb
|
209
|
+
- lib/contentful/bootstrap/commands/generate_token.rb
|
103
210
|
- lib/contentful/bootstrap/constants.rb
|
211
|
+
- lib/contentful/bootstrap/generator.rb
|
104
212
|
- lib/contentful/bootstrap/server.rb
|
105
213
|
- lib/contentful/bootstrap/support.rb
|
106
214
|
- lib/contentful/bootstrap/templates.rb
|
@@ -115,6 +223,33 @@ files:
|
|
115
223
|
- lib/contentful/bootstrap/templates/links/entry.rb
|
116
224
|
- lib/contentful/bootstrap/token.rb
|
117
225
|
- lib/contentful/bootstrap/version.rb
|
226
|
+
- spec/contentful/bootstrap/command_runner_spec.rb
|
227
|
+
- spec/contentful/bootstrap/commands/base_spec.rb
|
228
|
+
- spec/contentful/bootstrap/commands/create_space_spec.rb
|
229
|
+
- spec/contentful/bootstrap/commands/generate_json_spec.rb
|
230
|
+
- spec/contentful/bootstrap/commands/generate_token_spec.rb
|
231
|
+
- spec/contentful/bootstrap/generator_spec.rb
|
232
|
+
- spec/contentful/bootstrap/server_spec.rb
|
233
|
+
- spec/contentful/bootstrap/support_spec.rb
|
234
|
+
- spec/contentful/bootstrap/templates/base_spec.rb
|
235
|
+
- spec/contentful/bootstrap/templates/blog_spec.rb
|
236
|
+
- spec/contentful/bootstrap/templates/catalogue_spec.rb
|
237
|
+
- spec/contentful/bootstrap/templates/gallery_spec.rb
|
238
|
+
- spec/contentful/bootstrap/templates/json_template_spec.rb
|
239
|
+
- spec/contentful/bootstrap/templates/links/asset_spec.rb
|
240
|
+
- spec/contentful/bootstrap/templates/links/base_spec.rb
|
241
|
+
- spec/contentful/bootstrap/templates/links/entry_spec.rb
|
242
|
+
- spec/contentful/bootstrap/token_spec.rb
|
243
|
+
- spec/fixtures/ini_fixtures/contentfulrc.ini
|
244
|
+
- spec/fixtures/ini_fixtures/no_global.ini
|
245
|
+
- spec/fixtures/ini_fixtures/no_token.ini
|
246
|
+
- spec/fixtures/ini_fixtures/sections.ini
|
247
|
+
- spec/fixtures/json_fixtures/issue_22.json
|
248
|
+
- spec/fixtures/json_fixtures/simple.json
|
249
|
+
- spec/fixtures/json_fixtures/wl1z0pal05vy.json
|
250
|
+
- spec/fixtures/vcr_fixtures/generate_json.yml
|
251
|
+
- spec/fixtures/vcr_fixtures/issue_22.yml
|
252
|
+
- spec/spec_helper.rb
|
118
253
|
homepage: https://www.contentful.com
|
119
254
|
licenses:
|
120
255
|
- MIT
|
@@ -135,8 +270,36 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
270
|
version: '0'
|
136
271
|
requirements: []
|
137
272
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.
|
273
|
+
rubygems_version: 2.4.5.1
|
139
274
|
signing_key:
|
140
275
|
specification_version: 4
|
141
276
|
summary: Contentful CLI tool for getting started with Contentful
|
142
|
-
test_files:
|
277
|
+
test_files:
|
278
|
+
- spec/contentful/bootstrap/command_runner_spec.rb
|
279
|
+
- spec/contentful/bootstrap/commands/base_spec.rb
|
280
|
+
- spec/contentful/bootstrap/commands/create_space_spec.rb
|
281
|
+
- spec/contentful/bootstrap/commands/generate_json_spec.rb
|
282
|
+
- spec/contentful/bootstrap/commands/generate_token_spec.rb
|
283
|
+
- spec/contentful/bootstrap/generator_spec.rb
|
284
|
+
- spec/contentful/bootstrap/server_spec.rb
|
285
|
+
- spec/contentful/bootstrap/support_spec.rb
|
286
|
+
- spec/contentful/bootstrap/templates/base_spec.rb
|
287
|
+
- spec/contentful/bootstrap/templates/blog_spec.rb
|
288
|
+
- spec/contentful/bootstrap/templates/catalogue_spec.rb
|
289
|
+
- spec/contentful/bootstrap/templates/gallery_spec.rb
|
290
|
+
- spec/contentful/bootstrap/templates/json_template_spec.rb
|
291
|
+
- spec/contentful/bootstrap/templates/links/asset_spec.rb
|
292
|
+
- spec/contentful/bootstrap/templates/links/base_spec.rb
|
293
|
+
- spec/contentful/bootstrap/templates/links/entry_spec.rb
|
294
|
+
- spec/contentful/bootstrap/token_spec.rb
|
295
|
+
- spec/fixtures/ini_fixtures/contentfulrc.ini
|
296
|
+
- spec/fixtures/ini_fixtures/no_global.ini
|
297
|
+
- spec/fixtures/ini_fixtures/no_token.ini
|
298
|
+
- spec/fixtures/ini_fixtures/sections.ini
|
299
|
+
- spec/fixtures/json_fixtures/issue_22.json
|
300
|
+
- spec/fixtures/json_fixtures/simple.json
|
301
|
+
- spec/fixtures/json_fixtures/wl1z0pal05vy.json
|
302
|
+
- spec/fixtures/vcr_fixtures/generate_json.yml
|
303
|
+
- spec/fixtures/vcr_fixtures/issue_22.yml
|
304
|
+
- spec/spec_helper.rb
|
305
|
+
has_rdoc:
|