Sha256: b1a78704c088a88a437b900881d090e49971f8546633b4a206868fa35e5610dd
Contents?: true
Size: 805 Bytes
Versions: 16
Compression:
Stored size: 805 Bytes
Contents
module ZendeskAppsTools module Directory def app_dir @app_dir ||= Pathname.new(destination_root) end def tmp_dir @tmp_dir ||= Pathname.new(File.join(app_dir, "tmp")).tap do |dir| FileUtils.mkdir_p(dir) end end def get_new_app_directory prompt = "Enter a directory name to save the new app (will create the dir if it does not exist, default to current dir):\n" opts = { :valid_regex => /^(\w|\/|\\)*$/, :allow_empty => true } while @app_dir = get_value_from_stdin(prompt, opts) do @app_dir = './' and break if @app_dir.empty? if !File.exists?(@app_dir) break elsif !File.directory?(@app_dir) puts "Invalid dir, try again:" else break end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems