nox 0.1.0 → 0.1.1

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: 90a28ff6f4202bdbc4f5091178935967e34be7f0
4
- data.tar.gz: c7e97abf0d35e1a8d8542afd38b2a59a2a532925
3
+ metadata.gz: af07666101673559110a74604b04b9f70919bc6b
4
+ data.tar.gz: 6aef87a76c13ec2ac98d2880abf9fdd189570cfd
5
5
  SHA512:
6
- metadata.gz: 3ea4b279edbba9c69bf86ce51ab0fd8e3a7455712b40983e84fb5027ef941cba818572607f79735d2e9ebbd15437c25eded5bf6068d74da7ded09c97ab41d736
7
- data.tar.gz: 71e1c3fe5715753e68194b449ca1cbf359753f8984eb85561a89017297ca9aecabcfc89e327c732578b34c01a820cd88b3fe31382e1d375709c35e83b42c1804
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 Thor) for doing things:
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Nox
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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.0
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-05 00:00:00.000000000 Z
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