cocoapods-aomi-bin 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +22 -0
  3. data/README.md +11 -0
  4. data/lib/cocoapods-lhj-bin.rb +2 -0
  5. data/lib/cocoapods-lhj-bin/command.rb +1 -0
  6. data/lib/cocoapods-lhj-bin/command/bin.rb +58 -0
  7. data/lib/cocoapods-lhj-bin/command/bin/archive.rb +233 -0
  8. data/lib/cocoapods-lhj-bin/command/bin/auto.rb +200 -0
  9. data/lib/cocoapods-lhj-bin/command/bin/code.rb +232 -0
  10. data/lib/cocoapods-lhj-bin/command/bin/dup.rb +78 -0
  11. data/lib/cocoapods-lhj-bin/command/bin/import.rb +130 -0
  12. data/lib/cocoapods-lhj-bin/command/bin/init.rb +69 -0
  13. data/lib/cocoapods-lhj-bin/command/bin/initHotKey.rb +70 -0
  14. data/lib/cocoapods-lhj-bin/command/bin/install.rb +44 -0
  15. data/lib/cocoapods-lhj-bin/command/bin/lhj.rb +46 -0
  16. data/lib/cocoapods-lhj-bin/command/bin/lib/lint.rb +69 -0
  17. data/lib/cocoapods-lhj-bin/command/bin/repo/update.rb +43 -0
  18. data/lib/cocoapods-lhj-bin/command/bin/spec/create.rb +73 -0
  19. data/lib/cocoapods-lhj-bin/command/bin/spec/push.rb +115 -0
  20. data/lib/cocoapods-lhj-bin/command/bin/update.rb +153 -0
  21. data/lib/cocoapods-lhj-bin/config/config.rb +147 -0
  22. data/lib/cocoapods-lhj-bin/config/config_asker.rb +57 -0
  23. data/lib/cocoapods-lhj-bin/config/config_builder.rb +216 -0
  24. data/lib/cocoapods-lhj-bin/config/config_hot_key.rb +103 -0
  25. data/lib/cocoapods-lhj-bin/config/config_hot_key_asker.rb +57 -0
  26. data/lib/cocoapods-lhj-bin/gem_version.rb +9 -0
  27. data/lib/cocoapods-lhj-bin/helpers.rb +5 -0
  28. data/lib/cocoapods-lhj-bin/helpers/Info.plist +0 -0
  29. data/lib/cocoapods-lhj-bin/helpers/build_helper.rb +158 -0
  30. data/lib/cocoapods-lhj-bin/helpers/build_utils.rb +93 -0
  31. data/lib/cocoapods-lhj-bin/helpers/framework.rb +85 -0
  32. data/lib/cocoapods-lhj-bin/helpers/framework_builder.rb +444 -0
  33. data/lib/cocoapods-lhj-bin/helpers/library.rb +54 -0
  34. data/lib/cocoapods-lhj-bin/helpers/library_builder.rb +90 -0
  35. data/lib/cocoapods-lhj-bin/helpers/sources_helper.rb +34 -0
  36. data/lib/cocoapods-lhj-bin/helpers/spec_creator.rb +168 -0
  37. data/lib/cocoapods-lhj-bin/helpers/spec_files_helper.rb +75 -0
  38. data/lib/cocoapods-lhj-bin/helpers/spec_source_creator.rb +220 -0
  39. data/lib/cocoapods-lhj-bin/helpers/upload_helper.rb +105 -0
  40. data/lib/cocoapods-lhj-bin/native.rb +19 -0
  41. data/lib/cocoapods-lhj-bin/native/acknowledgements.rb +27 -0
  42. data/lib/cocoapods-lhj-bin/native/analyzer.rb +55 -0
  43. data/lib/cocoapods-lhj-bin/native/file_accessor.rb +28 -0
  44. data/lib/cocoapods-lhj-bin/native/installation_options.rb +25 -0
  45. data/lib/cocoapods-lhj-bin/native/installer.rb +135 -0
  46. data/lib/cocoapods-lhj-bin/native/linter.rb +26 -0
  47. data/lib/cocoapods-lhj-bin/native/path_source.rb +33 -0
  48. data/lib/cocoapods-lhj-bin/native/pod_source_installer.rb +19 -0
  49. data/lib/cocoapods-lhj-bin/native/pod_target_installer.rb +94 -0
  50. data/lib/cocoapods-lhj-bin/native/podfile.rb +91 -0
  51. data/lib/cocoapods-lhj-bin/native/podfile_env.rb +37 -0
  52. data/lib/cocoapods-lhj-bin/native/podfile_generator.rb +199 -0
  53. data/lib/cocoapods-lhj-bin/native/podspec_finder.rb +25 -0
  54. data/lib/cocoapods-lhj-bin/native/resolver.rb +230 -0
  55. data/lib/cocoapods-lhj-bin/native/sandbox_analyzer.rb +34 -0
  56. data/lib/cocoapods-lhj-bin/native/source.rb +35 -0
  57. data/lib/cocoapods-lhj-bin/native/sources_manager.rb +20 -0
  58. data/lib/cocoapods-lhj-bin/native/specification.rb +31 -0
  59. data/lib/cocoapods-lhj-bin/native/target_validator.rb +41 -0
  60. data/lib/cocoapods-lhj-bin/native/validator.rb +40 -0
  61. data/lib/cocoapods-lhj-bin/source_provider_hook.rb +66 -0
  62. data/lib/cocoapods_plugin.rb +2 -0
  63. data/spec/command/bin_spec.rb +12 -0
  64. data/spec/spec_helper.rb +50 -0
  65. metadata +178 -0
@@ -0,0 +1,444 @@
1
+ # copy from https://github.com/CocoaPods/cocoapods-packager
2
+
3
+ require 'cocoapods-lhj-bin/helpers/framework'
4
+ require 'cocoapods-lhj-bin/helpers/build_utils'
5
+ require 'English'
6
+ require 'cocoapods-lhj-bin/config/config_builder'
7
+ require 'shellwords'
8
+
9
+ module CBin
10
+ class Framework
11
+ class Builder
12
+ include Pod
13
+ #Debug下还待完成
14
+ def initialize(spec, file_accessor, platform, source_dir, isRootSpec = true, build_model="Debug")
15
+ @spec = spec
16
+ @source_dir = source_dir
17
+ @file_accessor = file_accessor
18
+ @platform = platform
19
+ @build_model = build_model
20
+ @isRootSpec = isRootSpec
21
+ #vendored_static_frameworks 只有 xx.framework 需要拼接为 xx.framework/xx by slj
22
+ vendored_static_frameworks = file_accessor.vendored_static_frameworks.map do |framework|
23
+ path = framework
24
+ extn = File.extname path
25
+ if extn.downcase == '.framework'
26
+ path = File.join(path,File.basename(path, extn))
27
+ end
28
+ path
29
+ end
30
+
31
+ @vendored_libraries = (vendored_static_frameworks + file_accessor.vendored_static_libraries).map(&:to_s)
32
+ end
33
+
34
+ def build
35
+ defines = compile
36
+ build_sim_libraries(defines)
37
+
38
+ defines
39
+ end
40
+
41
+ def lipo_build(defines)
42
+
43
+ # if CBin::Build::Utils.is_swift_module(@spec) || !CBin::Build::Utils.uses_frameworks?
44
+ # UI.section("Building static Library #{@spec}") do
45
+ # # defines = compile
46
+ #
47
+ # # build_sim_libraries(defines)
48
+ # output = framework.versions_path + Pathname.new(@spec.name)
49
+ #
50
+ # build_static_library_for_ios(output)
51
+ #
52
+ # copy_headers
53
+ # copy_license
54
+ # copy_resources
55
+ #
56
+ # cp_to_source_dir
57
+ # end
58
+ # else
59
+ # begin
60
+ UI.section("Building framework #{@spec}") do
61
+ # defines = compile
62
+
63
+ # build_sim_libraries(defines)
64
+ output = framework.fwk_path + Pathname.new(@spec.name)
65
+
66
+ copy_static_framework_dir_for_ios
67
+
68
+ build_static_framework_machO_for_ios(output)
69
+
70
+ # copy_license
71
+ copy_framework_resources
72
+
73
+ #cp_to_source_dir#
74
+
75
+ # rescue Object => exception
76
+ # UI.puts exception
77
+ # end
78
+ end
79
+ # end
80
+
81
+ framework
82
+ end
83
+
84
+ private
85
+
86
+ def cp_to_source_dir
87
+ # 删除Versions 软链接
88
+ framework.remove_current_version if CBin::Build::Utils.is_swift_module(@spec)
89
+
90
+ framework_name = "#{@spec.name}.framework"
91
+ target_dir = File.join(CBin::Config::Builder.instance.zip_dir,framework_name)
92
+ FileUtils.rm_rf(target_dir) if File.exist?(target_dir)
93
+
94
+ zip_dir = CBin::Config::Builder.instance.zip_dir
95
+ FileUtils.mkdir_p(zip_dir) unless File.exist?(zip_dir)
96
+
97
+ `cp -fa #{@platform}/#{framework_name} #{target_dir}`
98
+ end
99
+
100
+ #模拟器,目前只支持 debug x86-64
101
+ def build_sim_libraries(defines)
102
+ UI.message 'Building simulator libraries'
103
+
104
+ # archs = %w[i386 x86_64]
105
+ archs = ios_architectures_sim
106
+ archs.map do |arch|
107
+ xcodebuild(defines, "-sdk iphonesimulator ARCHS=\'#{arch}\' ", "build-#{arch}",@build_model)
108
+ end
109
+
110
+ end
111
+
112
+
113
+ def static_libs_in_sandbox(build_dir = 'build')
114
+ file = Dir.glob("#{build_dir}/lib#{target_name}.a")
115
+ unless file
116
+ UI.warn "file no find = #{build_dir}/lib#{target_name}.a"
117
+ end
118
+ file
119
+ end
120
+
121
+ def build_static_library_for_ios(output)
122
+ UI.message "Building ios libraries with archs #{ios_architectures}"
123
+ static_libs = static_libs_in_sandbox('build') + static_libs_in_sandbox('build-simulator') + @vendored_libraries
124
+
125
+ ios_architectures.map do |arch|
126
+ static_libs += static_libs_in_sandbox("build-#{arch}") + @vendored_libraries
127
+ end
128
+ ios_architectures_sim do |arch|
129
+ static_libs += static_libs_in_sandbox("build-#{arch}") + @vendored_libraries
130
+ end
131
+
132
+ build_path = Pathname("build")
133
+ build_path.mkpath unless build_path.exist?
134
+
135
+ libs = (ios_architectures + ios_architectures_sim) .map do |arch|
136
+ library = "build-#{arch}/lib#{@spec.name}.a"
137
+ library
138
+ end
139
+
140
+ UI.message "lipo -create -output #{output} #{libs.join(' ')}"
141
+ `lipo -create -output #{output} #{libs.join(' ')}`
142
+ end
143
+
144
+ def ios_build_options
145
+ "ARCHS=\'#{ios_architectures.join(' ')}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'"
146
+ end
147
+
148
+ def ios_architectures
149
+ # >armv7
150
+ # iPhone4
151
+ # iPhone4S
152
+ # >armv7s 去掉
153
+ # iPhone5
154
+ # iPhone5C
155
+ # >arm64
156
+ # iPhone5S(以上)
157
+ # >i386
158
+ # iphone5,iphone5s以下的模拟器
159
+ # >x86_64
160
+ # iphone6以上的模拟器
161
+ archs = %w[arm64 armv7]
162
+ # archs = %w[x86_64 arm64 armv7s i386]
163
+ # @vendored_libraries.each do |library|
164
+ # archs = `lipo -info #{library}`.split & archs
165
+ # end
166
+ archs
167
+ end
168
+
169
+ def ios_architectures_sim
170
+
171
+ archs = %w[x86_64]
172
+ # TODO 处理是否需要 i386
173
+ archs
174
+ end
175
+
176
+ def compile
177
+ defines = "GCC_PREPROCESSOR_DEFINITIONS='$(inherited)'"
178
+ defines += ' '
179
+ defines += @spec.consumer(@platform).compiler_flags.join(' ')
180
+
181
+ options = ios_build_options
182
+ # if is_debug_model
183
+ archs = ios_architectures
184
+ # archs = %w[arm64 armv7 armv7s]
185
+ archs.map do |arch|
186
+ xcodebuild(defines, "ARCHS=\'#{arch}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'","build-#{arch}",@build_model)
187
+ end
188
+ # else
189
+ # xcodebuild(defines,options)
190
+ # end
191
+
192
+ defines
193
+ end
194
+
195
+ def is_debug_model
196
+ @build_model == "Debug"
197
+ end
198
+
199
+ def target_name
200
+ #区分多平台,如配置了多平台,会带上平台的名字
201
+ # 如libwebp-iOS
202
+ if @spec.available_platforms.count > 1
203
+ "#{@spec.name}-#{Platform.string_name(@spec.consumer(@platform).platform_name)}"
204
+ else
205
+ @spec.name
206
+ end
207
+ end
208
+
209
+ def xcodebuild(defines = '', args = '', build_dir = 'build', build_model = 'Debug')
210
+
211
+ unless File.exist?("Pods.xcodeproj") #cocoapods-generate v2.0.0
212
+ command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{File.join(File.expand_path("..", build_dir), File.basename(build_dir))} clean build -configuration #{build_model} -target #{target_name} -project ./Pods/Pods.xcodeproj 2>&1"
213
+ else
214
+ command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{build_dir} clean build -configuration #{build_model} -target #{target_name} -project ./Pods.xcodeproj 2>&1"
215
+ end
216
+
217
+ UI.message "command = #{command}"
218
+ output = `#{command}`.lines.to_a
219
+
220
+ if $CHILD_STATUS.exitstatus != 0
221
+ raise <<~EOF
222
+ Build command failed: #{command}
223
+ Output:
224
+ #{output.map { |line| " #{line}" }.join}
225
+ EOF
226
+
227
+ Process.exit
228
+ end
229
+ end
230
+
231
+ def copy_headers
232
+ #走 podsepc中的public_headers
233
+ public_headers = Array.new
234
+
235
+ #by slj 如果没有头文件,去 "Headers/Public"拿
236
+ # if public_headers.empty?
237
+ spec_header_dir = "./Headers/Public/#{@spec.name}"
238
+ unless File.exist?(spec_header_dir)
239
+ spec_header_dir = "./Pods/Headers/Public/#{@spec.name}"
240
+ end
241
+ raise "copy_headers #{spec_header_dir} no exist " unless File.exist?(spec_header_dir)
242
+ Dir.chdir(spec_header_dir) do
243
+ headers = Dir.glob('*.h')
244
+ headers.each do |h|
245
+ public_headers << Pathname.new(File.join(Dir.pwd,h))
246
+ end
247
+ end
248
+ # end
249
+
250
+ # UI.message "Copying public headers #{public_headers.map(&:basename).map(&:to_s)}"
251
+
252
+ public_headers.each do |h|
253
+ `ditto #{h} #{framework.headers_path}/#{h.basename}`
254
+ end
255
+
256
+ # If custom 'module_map' is specified add it to the framework distribution
257
+ # otherwise check if a header exists that is equal to 'spec.name', if so
258
+ # create a default 'module_map' one using it.
259
+ if !@spec.module_map.nil?
260
+ module_map_file = @file_accessor.module_map
261
+ if Pathname(module_map_file).exist?
262
+ module_map = File.read(module_map_file)
263
+ end
264
+ elsif public_headers.map(&:basename).map(&:to_s).include?("#{@spec.name}-umbrella.h")
265
+ module_map = <<-MAP
266
+ framework module #{@spec.name} {
267
+ umbrella header "#{@spec.name}-umbrella.h"
268
+
269
+ export *
270
+ module * { export * }
271
+ }
272
+ MAP
273
+ end
274
+
275
+ unless module_map.nil?
276
+ UI.message "Writing module map #{module_map}"
277
+ unless framework.module_map_path.exist?
278
+ framework.module_map_path.mkpath
279
+ end
280
+ File.write("#{framework.module_map_path}/module.modulemap", module_map)
281
+
282
+ # unless framework.swift_module_path.exist?
283
+ # framework.swift_module_path.mkpath
284
+ # end
285
+ # todo 所有架构的swiftModule拷贝到 framework.swift_module_path
286
+ archs = ios_architectures + ios_architectures_sim
287
+ archs.map do |arch|
288
+ swift_module = "build-#{arch}/#{@spec.name}.swiftmodule"
289
+ if File.directory?(swift_module)
290
+ FileUtils.cp_r("#{swift_module}/.", framework.swift_module_path)
291
+ end
292
+ end
293
+ swift_Compatibility_Header = "build-#{archs.first}/Swift\ Compatibility\ Header/#{@spec.name}-Swift.h"
294
+ FileUtils.cp(swift_Compatibility_Header,framework.headers_path) if File.exist?(swift_Compatibility_Header)
295
+ info_plist_file = File.join(File.dirname(__FILE__),"info.plist")
296
+ FileUtils.cp(info_plist_file,framework.fwk_path)
297
+ end
298
+ end
299
+
300
+ def copy_swift_header
301
+
302
+ end
303
+
304
+ def copy_license
305
+ UI.message 'Copying license'
306
+ license_file = @spec.license[:file] || 'LICENSE'
307
+ `cp "#{license_file}" .` if Pathname(license_file).exist?
308
+ end
309
+
310
+ def copy_resources
311
+ resource_dir = './build/*.bundle'
312
+ resource_dir = './build-armv7/*.bundle' if File.exist?('./build-armv7')
313
+ resource_dir = './build-arm64/*.bundle' if File.exist?('./build-arm64')
314
+
315
+ bundles = Dir.glob(resource_dir)
316
+
317
+ bundle_names = [@spec, *@spec.recursive_subspecs].flat_map do |spec|
318
+ consumer = spec.consumer(@platform)
319
+ consumer.resource_bundles.keys +
320
+ consumer.resources.map do |r|
321
+ File.basename(r, '.bundle') if File.extname(r) == 'bundle'
322
+ end
323
+ end.compact.uniq
324
+
325
+ bundles.select! do |bundle|
326
+ bundle_name = File.basename(bundle, '.bundle')
327
+ bundle_names.include?(bundle_name)
328
+ end
329
+
330
+ if bundles.count > 0
331
+ UI.message "Copying bundle files #{bundles}"
332
+ bundle_files = bundles.join(' ')
333
+ `cp -rp #{bundle_files} #{framework.resources_path} 2>&1`
334
+ end
335
+
336
+ real_source_dir = @source_dir
337
+ unless @isRootSpec
338
+ spec_source_dir = File.join(Dir.pwd,"#{@spec.name}")
339
+ unless File.exist?(spec_source_dir)
340
+ spec_source_dir = File.join(Dir.pwd,"Pods/#{@spec.name}")
341
+ end
342
+ raise "copy_resources #{spec_source_dir} no exist " unless File.exist?(spec_source_dir)
343
+
344
+ spec_source_dir = File.join(Dir.pwd,"#{@spec.name}")
345
+ real_source_dir = spec_source_dir
346
+ end
347
+
348
+ resources = [@spec, *@spec.recursive_subspecs].flat_map do |spec|
349
+ expand_paths(real_source_dir, spec.consumer(@platform).resources)
350
+ end.compact.uniq
351
+
352
+ if resources.count == 0 && bundles.count == 0
353
+ framework.delete_resources
354
+ return
355
+ end
356
+
357
+ if resources.count > 0
358
+ #把 路径转义。 避免空格情况下拷贝失败
359
+ escape_resource = []
360
+ resources.each do |source|
361
+ escape_resource << Shellwords.join(source)
362
+ end
363
+ UI.message "Copying resources #{escape_resource}"
364
+ `cp -rp #{escape_resource.join(' ')} #{framework.resources_path}`
365
+ end
366
+ end
367
+
368
+ def expand_paths(source_dir, path_specs)
369
+ path_specs.map do |path_spec|
370
+ Dir.glob(File.join(source_dir, path_spec))
371
+ end
372
+ end
373
+
374
+ #---------------------------------swift--------------------------------------#
375
+ # lipo -create .a
376
+ def build_static_framework_machO_for_ios(output)
377
+ UI.message "Building ios framework with archs #{ios_architectures}"
378
+
379
+ static_libs = static_libs_in_sandbox('build') + @vendored_libraries
380
+ ios_architectures.map do |arch|
381
+ static_libs += static_libs_in_sandbox("build-#{arch}") + @vendored_libraries
382
+ end
383
+
384
+ ios_architectures_sim do |arch|
385
+ static_libs += static_libs_in_sandbox("build-#{arch}") + @vendored_libraries
386
+ end
387
+
388
+ build_path = Pathname("build")
389
+ build_path.mkpath unless build_path.exist?
390
+
391
+ libs = (ios_architectures + ios_architectures_sim) .map do |arch|
392
+ library = "build-#{arch}/#{@spec.name}.framework/#{@spec.name}"
393
+ library
394
+ end
395
+
396
+ UI.message "lipo -create -output #{output} #{libs.join(' ')}"
397
+ `lipo -create -output #{output} #{libs.join(' ')}`
398
+ end
399
+
400
+ def copy_static_framework_dir_for_ios
401
+
402
+ archs = ios_architectures + ios_architectures_sim
403
+ framework_dir = "build-#{ios_architectures_sim.first}/#{@spec.name}.framework"
404
+ framework_dir = "build-#{ios_architectures.first}/#{@spec.name}.framework" unless File.exist?(framework_dir)
405
+ unless File.exist?(framework_dir)
406
+ raise "#{framework_dir} path no exist"
407
+ end
408
+ File.join(Dir.pwd, "build-#{ios_architectures_sim.first}/#{@spec.name}.framework")
409
+ FileUtils.cp_r(framework_dir, framework.root_path)
410
+
411
+ # todo 所有架构的swiftModule拷贝到 framework.swift_module_path
412
+ archs.map do |arch|
413
+ swift_module = "build-#{arch}/#{@spec.name}.framework/Modules/#{@spec.name}.swiftmodule"
414
+ if File.directory?(swift_module)
415
+ FileUtils.cp_r("#{swift_module}/.", framework.swift_module_path)
416
+ end
417
+ end
418
+
419
+ # 删除Versions 软链接
420
+ framework.remove_current_version
421
+ end
422
+
423
+ def copy_framework_resources
424
+ resources = Dir.glob("#{framework.fwk_path + Pathname.new('Resources')}/*")
425
+ if resources.count == 0
426
+ framework.delete_resources
427
+ end
428
+ end
429
+
430
+
431
+ #---------------------------------getter and setter--------------------------------------#
432
+
433
+ def framework
434
+ @framework ||= begin
435
+ framework = Framework.new(@spec.name, @platform.name.to_s)
436
+ framework.make
437
+ framework
438
+ end
439
+ end
440
+
441
+
442
+ end
443
+ end
444
+ end
@@ -0,0 +1,54 @@
1
+ # copy from https://github.com/CocoaPods/cocoapods-packager
2
+
3
+ module CBin
4
+ class Library
5
+ attr_reader :headers_path
6
+ attr_reader :resources_path
7
+ attr_reader :root_path
8
+ attr_reader :versions_path
9
+ attr_reader :name_path
10
+
11
+ def initialize(name, platform, version)
12
+ @name = name
13
+ @platform = platform
14
+ @version = version
15
+ end
16
+
17
+ def make
18
+ make_root
19
+ make_library
20
+ make_headers
21
+ make_resources
22
+ end
23
+
24
+ def delete_resources
25
+ Pathname.new(@resources_path).rmtree
26
+ (Pathname.new(@fwk_path) + Pathname.new('Resources')).delete
27
+ end
28
+
29
+ private
30
+
31
+ def make_library
32
+ @name_path = CBin::Config::Builder.instance.library_name_version(@name,@version)
33
+ @fwk_path = @root_path + Pathname.new(@name_path)
34
+ @fwk_path.mkdir unless @fwk_path.exist?
35
+
36
+ @versions_path = @fwk_path
37
+ end
38
+
39
+ def make_headers
40
+ @headers_path = @versions_path + Pathname.new('Headers')
41
+ @headers_path.mkpath unless @headers_path.exist?
42
+ end
43
+
44
+ def make_resources
45
+ @resources_path = @versions_path + Pathname.new('Resources')
46
+ @resources_path.mkpath unless @resources_path.exist?
47
+ end
48
+
49
+ def make_root
50
+ @root_path = Pathname.new(@platform)
51
+ @root_path.mkpath unless @root_path.exist?
52
+ end
53
+ end
54
+ end