rack-webdav 0.4.3 → 0.4.4

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: 9025207ede1c1f829fa216898d173661ac29aa2d
4
- data.tar.gz: e6c001a417788e6a4134493ecb82031467c3ebaa
3
+ metadata.gz: 6ebc645c51bce135644ae41d8a5e81e07a33b2dc
4
+ data.tar.gz: aedfa7f5b1128e2a48c518e9009f0e18cb01a945
5
5
  SHA512:
6
- metadata.gz: 1be317ee0340db32fa1ebf40f663810b58fc50b29a3d08f7c9c745a2912d67849639ac9a4dde236e065119e7f83e90e8fb5b3f69160f90a61e07dd5bb226ac71
7
- data.tar.gz: e01078ed80e0a6fb2ec0dd99c4c89fa4765a6c1a43d001083935031ac6a9191bd0bc179ec101ab320e8d39d67b5d0526e0b7660098c8b3b12807c47bae140e38
6
+ metadata.gz: 87014d0f17fab49c5d1b6b738a192e3bf43a9727ff3174aaf9b1df0b0c898bc1c1a7b768f21173bf5b569bd0f781c175a905b9dbcb061e0d5a6b260f55fcd461
7
+ data.tar.gz: 39d1a57fe8d17fae9494c68a09f45b192a929e67a49b0f5eb58510fedfe2cf831e33297ed3f2555dd55077f5872f492487ee34f4185eb4bccbbfda04b8aea867
data/bin/byebug ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'byebug' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("byebug", "byebug")
data/bin/coderay ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'coderay' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("coderay", "coderay")
data/bin/htmldiff ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'htmldiff' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("diff-lcs", "htmldiff")
data/bin/ldiff ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'ldiff' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("diff-lcs", "ldiff")
data/bin/nokogiri ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'nokogiri' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("nokogiri", "nokogiri")
data/bin/pry ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'pry' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("pry", "pry")
data/bin/puma ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'puma' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("puma", "puma")
data/bin/pumactl ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'pumactl' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("puma", "pumactl")
data/bin/rack-webdav CHANGED
@@ -1,126 +1,40 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'rubygems'
4
- require 'rack-webdav/version'
5
- require 'getoptlong'
3
+ $:.unshift(File.expand_path("../../lib", __FILE__))
6
4
 
7
- def print_help_msg
8
- print_version_info
9
- puts "Usage: rack-webdav [opts]"
10
- puts " --help Print help message"
11
- puts " --version Print version information"
12
- puts " --username name Set username"
13
- puts " --password pass Set password"
14
- puts " --root /share/path Set path to share directory"
15
- puts " --log /path/to/log Set path for logging file"
16
- puts " --verbosity opt Set logging verbosity. (Valid: debug,info,warn,fatal)"
17
- end
18
-
19
- def print_version_info
20
- puts "DAV 4 Rack - Rack based WebDAV Framework - Version: #{RackWebDAV::VERSION}"
21
- end
22
-
23
- opts = GetoptLong.new(
24
- ['--username', '-u', GetoptLong::REQUIRED_ARGUMENT],
25
- ['--password', '-p', GetoptLong::REQUIRED_ARGUMENT],
26
- ['--help', '-h', GetoptLong::NO_ARGUMENT],
27
- ['--version', '-v', GetoptLong::NO_ARGUMENT],
28
- ['--root', '-r', GetoptLong::REQUIRED_ARGUMENT],
29
- ['--log', '-l', GetoptLong::OPTIONAL_ARGUMENT],
30
- ['--verbosity', '-V', GetoptLong::REQUIRED_ARGUMENT],
31
- ['--pretty-xml', '-P', GetoptLong::REQUIRED_ARGUMENT]
32
- )
5
+ require 'rack-webdav'
33
6
 
34
- credentials = {}
7
+ root=ARGV[1] || Dir.pwd
8
+ port = ARGV[0] || 3000
35
9
 
36
- opts.each do |opt,arg|
37
- case opt
38
- when '--help'
39
- print_help_msg
40
- exit(0)
41
- when '--username'
42
- credentials[:username] = arg
43
- when '--password'
44
- credentials[:password] = arg
45
- when '--root'
46
- credentials[:root] = arg
47
- unless(File.exists?(arg) && File.directory?(arg))
48
- puts "ERROR: Path provided is not a valid directory (#{arg})"
49
- exit(-1)
50
- end
51
- when '--pretty-xml'
52
- credentials[:pretty_xml] = true
53
- when '--version'
54
- print_version_info
55
- exit(0)
56
- when '--log'
57
- require 'pathname'
58
- require 'logger'
59
- credentials[:log_to] = [nil, Logger::FATAL] unless credentials[:log_to]
60
- if(arg && !arg.empty?)
61
- dirname = Pathname.new(arg).dirname
62
- if((File.exists?(arg) && File.writable?(arg)) || (File.exists?(dirname) && File.writable?(dirname)))
63
- credentials[:log_to][0] = arg
64
- else
65
- puts "ERROR: Log file is not writable: #{arg}"
66
- exit(-1)
67
- end
68
- else
69
- credentials[:log_to][0] = $stdout
70
- end
71
- when '--verbosity'
72
- require 'logger'
73
- begin
74
- credentials[:log_to] = [] unless credentials[:log_to]
75
- credentials[:log_to][1] = Logger.const_get(arg.upcase)
76
- rescue NameError
77
- puts "ERROR: Unknown verbosity level given: #{arg}"
78
- exit(-1)
79
- end
80
- else
81
- puts "ERROR: Unknown option provided"
82
- exit(-1)
83
- end
84
- end
10
+ require 'rack-timeout'
85
11
 
86
- require 'rack-webdav'
12
+ Rack::Timeout::Logger.device = $stderr
13
+ Rack::Timeout::Logger.level = Logger::INFO
14
+ Rack::Timeout.service_timeout = 50
87
15
 
88
16
  app = Rack::Builder.new do
89
17
  use Rack::ShowExceptions
90
18
  use Rack::CommonLogger
91
19
  use Rack::Reloader
92
20
  use Rack::Lint
21
+ use Rack::Timeout
93
22
 
94
- run RackWebDAV::Handler.new(credentials)
95
-
23
+ run RackWebDAV::Handler.new(:root => root)
96
24
  end.to_app
97
25
 
98
- runners = []
99
- runners << lambda do |x|
100
- print 'Looking for unicorn... '
101
- require 'unicorn'
102
- puts 'OK'
103
- if(Unicorn.respond_to?(:run))
104
- Unicorn.run(x, :listeners => ["0.0.0.0:3000"])
105
- else
106
- Unicorn::HttpServer.new(x, :listeners => ["0.0.0.0:3000"]).start.join
107
- end
108
- end
109
- runners << lambda do |x|
110
- print 'Looking for mongrel... '
111
- require 'mongrel'
112
- puts 'OK'
113
- Rack::Handler::Mongrel.run(x, :Port => 3000)
114
- end
115
- runners << lambda do |x|
116
- puts 'Loading WEBrick'
117
- Rack::Handler::WEBrick.run(x, :Port => 3000)
118
- end
119
-
120
26
  begin
121
- runner = runners.shift
122
- runner.call(app)
123
- rescue LoadError
124
- puts 'FAILED'
125
- retry unless runners.empty?
27
+ require 'rack/handler/puma'
28
+ Rack::Handler::Puma.run(app, Host: '0.0.0.0', Port: port)
29
+ # rescue NameError, LoadError
30
+ # begin
31
+ # require 'unicorn'
32
+ # Unicorn::HttpServer.new(app, :listeners => ["0.0.0.0:3000"]).start.join
33
+ # rescue NameError, LoadError
34
+ # begin
35
+ # Rack::Handler::WEBrick.run(app, Host: '0.0.0.0', Port: port)
36
+ # rescue NameError, LoadError
37
+ # Rack::Handler::Mongrel.run(app, Host: '0.0.0.0', Port: port)
38
+ # end
39
+ # end
126
40
  end
data/bin/rackup ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'rackup' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("rack", "rackup")
data/bin/rake ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'rake' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("rake", "rake")
data/bin/rspec ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'rspec' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("rspec-core", "rspec")
data/bin/rubocop ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'rubocop' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("rubocop", "rubocop")
data/bin/ruby-parse ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'ruby-parse' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("parser", "ruby-parse")
data/bin/ruby-rewrite ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'ruby-rewrite' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("parser", "ruby-rewrite")
data/bin/unicorn ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'unicorn' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("unicorn", "unicorn")
data/bin/unicorn_rails ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'unicorn_rails' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("unicorn", "unicorn_rails")