servedown 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 476bf02f71ad703e66102bd1125760f615cef813
4
- data.tar.gz: 9cf1a01b6cdbdd462c21bf5190020e708a4b9db5
3
+ metadata.gz: 0ab82abe49509b16f51ad4a4120324c82aff9d3f
4
+ data.tar.gz: 8ad996a408be548f290f08392e9c8b812970597c
5
5
  SHA512:
6
- metadata.gz: 881aa2177e292028f3353faf0e126641bc7df0852789650c9ccc338385abedd8dd788480b4e79a07d622df651107bc771e910cc86bd69f437df71db3d90e2ec3
7
- data.tar.gz: 15c775ed33b5aa13b624d7adcccefd5018d3be043ca55ef56dd7150f49c49c67b13ea6d27d683915c19ee04112e1df13984d7bd46e4a62819c76b0b6e6480ad5
6
+ metadata.gz: 8468c275ddd68bb1f6a8c6d046ec49e93261e01f023e2d3065afe12203e3d7c786bc4ad3b93247cb2143df3f968cb9cf34cdca0f6adf569538dbe15c0c866bc2
7
+ data.tar.gz: cfffd8b6ed80047647a364b22f4da19964f0114cc981da948512c5e0ec4945b30fa1d7346193f19137f32dee1f954effe0429f6c769c6e1de3a1542f5f013c4e
data/README.md CHANGED
@@ -1,24 +1,20 @@
1
1
  # Servedown
2
2
 
3
- TODO: Write a gem description
3
+ Generates a website for each .md file in the current directory
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
8
-
9
- gem 'servedown'
10
-
11
- And then execute:
12
-
13
- $ bundle
14
-
15
7
  Or install it yourself as:
16
8
 
17
9
  $ gem install servedown
18
10
 
19
11
  ## Usage
20
12
 
21
- TODO: Write usage instructions here
13
+ Start the server
14
+
15
+ $ servedown
16
+
17
+ and open <localhost:4567> in your browser
22
18
 
23
19
  ## Contributing
24
20
 
@@ -10,9 +10,13 @@ module Servedown
10
10
 
11
11
  get '/view' do
12
12
  file = params['file']
13
- text = File.open(file).read
14
- @html = Kramdown::Document.new(text).to_html
15
- haml :view
13
+ if Dir['./**/*.md'].include? file
14
+ text = File.open(file).read
15
+ @html = Kramdown::Document.new(text).to_html
16
+ haml :view
17
+ else
18
+ 404
19
+ end
16
20
  end
17
21
  end
18
22
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'servedown'
7
- spec.version = '0.0.2'
7
+ spec.version = '0.0.3'
8
8
  spec.authors = ['Leon Rische']
9
9
  spec.email = ['hello@l3kn.de']
10
10
  spec.summary = 'Serve a directory of markdown files'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: servedown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leon Rische