doc-server 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-version +1 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +30 -0
- data/Rakefile +3 -0
- data/bin/doc-server +26 -0
- data/doc-server.gemspec +31 -0
- data/lib/doc-server.rb +0 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ac93e957d56ac323cb0e4d4ce7257ddc0b8b4c6f75a194f1bffefea97bd25cc4
|
4
|
+
data.tar.gz: 7b989ee4a5b4627c94f06fd2903908c3543b524ecfd13b5759fa24c3479ae9d5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ed294656bf719e0f5f9f0cbf0ee69c169bde681dabacc32c0bc5a9b5335bc39b9899f19580cf84406c0fc8c99e91a1cf114c16631a5884bfd79fde43a538b314
|
7
|
+
data.tar.gz: a24cf13e68d9cb42f7e1b4d83e5609e9414fe35779050103241f76cc150451f31a73a5d466baff0521519cfeb05223b60068cc966dbaadb52a953e8c5d8df43e
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.1.2
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2021 Daniel Heath
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# doc-server
|
2
|
+
|
3
|
+
doc-server provides gem rdoc, filtered to only the gems installed by your gemfile.
|
4
|
+
|
5
|
+
It's inspired by https://github.com/rubygems/rubygems-server and the now-defunct `godoc -http`.
|
6
|
+
|
7
|
+
## Installation & usage
|
8
|
+
|
9
|
+
```
|
10
|
+
echo "gem 'doc-server'" >> Gemfile
|
11
|
+
bundle
|
12
|
+
bundle exec doc-server
|
13
|
+
```
|
14
|
+
|
15
|
+
This will create a directory (default='rdoc') to store the per-bundle documentation.
|
16
|
+
|
17
|
+
Whenever you install or update gems, delete this directory, and restart doc-server.
|
18
|
+
|
19
|
+
## Configuration
|
20
|
+
|
21
|
+
DOCSERVER_OUTPUT_PATH: Where to store the per-bundle documentation. Default is "rdoc".
|
22
|
+
DOCSERVER_PORT: Which port to listen on. Default is 8088.
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
|
26
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/danielheath/doc-server.
|
27
|
+
|
28
|
+
## License
|
29
|
+
|
30
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/doc-server
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'rdoc/rdoc'
|
5
|
+
|
6
|
+
outpath = ENV.fetch('DOCSERVER_OUTPUT_PATH', 'rdoc')
|
7
|
+
port = ENV.fetch("DOCSERVER_PORT", "8088").to_i
|
8
|
+
port = 8088 if port <= 0
|
9
|
+
|
10
|
+
if ! Dir.exist?(outpath)
|
11
|
+
Dir.mkdir(outpath)
|
12
|
+
File.write("#{outpath}/created.rid", '')
|
13
|
+
options = RDoc::Options.new
|
14
|
+
options.setup_generator "darkfish"
|
15
|
+
options.op_dir = outpath
|
16
|
+
|
17
|
+
options.files = $LOAD_PATH.map {|p| Dir.glob("#{p}/**/*.rb")}.flatten
|
18
|
+
rdoc = RDoc::RDoc.new
|
19
|
+
rdoc.document options
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'webrick'
|
23
|
+
|
24
|
+
s = WEBrick::HTTPServer.new(:Port => port, :DocumentRoot => outpath)
|
25
|
+
trap('INT') { s.shutdown }
|
26
|
+
s.start
|
data/doc-server.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "doc-server"
|
5
|
+
spec.version = "0.0.1"
|
6
|
+
spec.authors = ["Daniel Heath"]
|
7
|
+
spec.email = ["daniel@heath.cc"]
|
8
|
+
|
9
|
+
spec.summary = "Serves documentation for installed gems locally on HTTP, with full text search"
|
10
|
+
spec.description = spec.summary
|
11
|
+
spec.homepage = "https://github.com/danielheath/doc-server"
|
12
|
+
spec.license = "MIT"
|
13
|
+
spec.required_ruby_version = ">= 3.1.0"
|
14
|
+
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
16
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
17
|
+
|
18
|
+
# Specify which files should be added to the gem when it is released.
|
19
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
20
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
21
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
22
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
23
|
+
end
|
24
|
+
end
|
25
|
+
spec.bindir = "bin"
|
26
|
+
spec.require_paths = ["lib"]
|
27
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
28
|
+
spec.add_dependency "webrick"
|
29
|
+
spec.add_dependency "rack"
|
30
|
+
spec.add_dependency "parser"
|
31
|
+
end
|
data/lib/doc-server.rb
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: doc-server
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Heath
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-03-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: webrick
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: parser
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Serves documentation for installed gems locally on HTTP, with full text
|
56
|
+
search
|
57
|
+
email:
|
58
|
+
- daniel@heath.cc
|
59
|
+
executables:
|
60
|
+
- doc-server
|
61
|
+
extensions: []
|
62
|
+
extra_rdoc_files: []
|
63
|
+
files:
|
64
|
+
- ".ruby-version"
|
65
|
+
- Gemfile
|
66
|
+
- LICENSE.txt
|
67
|
+
- README.md
|
68
|
+
- Rakefile
|
69
|
+
- bin/doc-server
|
70
|
+
- doc-server.gemspec
|
71
|
+
- lib/doc-server.rb
|
72
|
+
homepage: https://github.com/danielheath/doc-server
|
73
|
+
licenses:
|
74
|
+
- MIT
|
75
|
+
metadata:
|
76
|
+
homepage_uri: https://github.com/danielheath/doc-server
|
77
|
+
source_code_uri: https://github.com/danielheath/doc-server
|
78
|
+
post_install_message:
|
79
|
+
rdoc_options: []
|
80
|
+
require_paths:
|
81
|
+
- lib
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 3.1.0
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
requirements: []
|
93
|
+
rubygems_version: 3.3.7
|
94
|
+
signing_key:
|
95
|
+
specification_version: 4
|
96
|
+
summary: Serves documentation for installed gems locally on HTTP, with full text search
|
97
|
+
test_files: []
|