nox 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +13 -1
- data/lib/nox.rb +1 -0
- data/lib/nox/ghserver.rb +2 -1
- data/lib/nox/version.rb +1 -1
- data/override.css +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af07666101673559110a74604b04b9f70919bc6b
|
4
|
+
data.tar.gz: 6aef87a76c13ec2ac98d2880abf9fdd189570cfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64190c620a097878c96de60fc549525325da8f4972712131618c515c326c8bf03d88b8892ee5d9c5af544969fbafb3be1e70e98d9c817678d9b6b1b2ff9d8dd7
|
7
|
+
data.tar.gz: 7b3545cd67eb0b9b66c179848fc4d052f6ba77dbb4eb24d63b752daa8777b23068f8bd1e6c24ba17c32f4d08ef3df3ee13b26dc42e7a3bd1f50802fbee87b842
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
[gem]: https://rubygems.org/gems/nox
|
6
6
|
|
7
|
-
Nox is a command line tool (based on
|
7
|
+
Nox is a command line tool (based on Thør) for doing things:
|
8
8
|
|
9
9
|
* Run a micro-webserver to display GitHub markup in pages
|
10
10
|
|
@@ -20,6 +20,18 @@ Install with:
|
|
20
20
|
|
21
21
|
Type: `nox help` to get started
|
22
22
|
|
23
|
+
### Encoding
|
24
|
+
|
25
|
+
Internally all pages are transcoded to UTF-8 and served with content type
|
26
|
+
`text/html;charset=UTF-8`. The input files are assumed to be in the encoding specified by
|
27
|
+
your machine environment LANG variable, for example:
|
28
|
+
|
29
|
+
```bash
|
30
|
+
LANG=en_US.UTF-8
|
31
|
+
```
|
32
|
+
|
33
|
+
Set this prior to executing the server if your input files are in a different encoding.
|
34
|
+
|
23
35
|
## Development
|
24
36
|
|
25
37
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
data/lib/nox.rb
CHANGED
@@ -18,6 +18,7 @@ class Nox::App < Thor
|
|
18
18
|
method_option :port, type: :numeric, aliases: '-p', default: 8019, desc: 'Port'
|
19
19
|
def ghserver(path=Dir.getwd)
|
20
20
|
|
21
|
+
Encoding.default_internal = 'utf-8'
|
21
22
|
WEBrick::HTTPServlet::FileHandler.add_handler('md', ::Nox::GitHubRenderer)
|
22
23
|
WEBrick::HTTPServlet::FileHandler.add_handler('markdown', ::Nox::GitHubRenderer)
|
23
24
|
server = WEBrick::HTTPServer.new DocumentRoot: path, BindAddress: '0.0.0.0', Port: options.port
|
data/lib/nox/ghserver.rb
CHANGED
@@ -28,6 +28,7 @@ module Nox
|
|
28
28
|
render = @pipeline.call File.read(@filename)
|
29
29
|
rsp.body = <<-BODY
|
30
30
|
<html>
|
31
|
+
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
31
32
|
<head>#{styles.join('')}</head>
|
32
33
|
<body>
|
33
34
|
<article class="markdown-body">
|
@@ -49,7 +50,7 @@ module Nox
|
|
49
50
|
begin
|
50
51
|
rsp.status = 200
|
51
52
|
rsp['Content-Type'] = 'text/css'
|
52
|
-
rsp.body = ['normalize', 'github'].map do |style|
|
53
|
+
rsp.body = ['normalize', 'github', 'override'].map do |style|
|
53
54
|
File.read(File.absolute_path("../../#{style}.css", File.dirname(__FILE__)))
|
54
55
|
end.join("\n")
|
55
56
|
end
|
data/lib/nox/version.rb
CHANGED
data/override.css
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pre { background-color: rgb(247,247,247); padding: 16px 16px 16px 16px }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Townsend
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -164,6 +164,7 @@ files:
|
|
164
164
|
- lib/nox/version.rb
|
165
165
|
- normalize.css
|
166
166
|
- nox.gemspec
|
167
|
+
- override.css
|
167
168
|
homepage: https://github.com/townsen/nox
|
168
169
|
licenses:
|
169
170
|
- MIT
|