httpit 0.3.2 → 0.3.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.
Files changed (4) hide show
  1. data/README.md +8 -0
  2. data/bin/httpit +6 -5
  3. data/httpit.gemspec +1 -1
  4. metadata +3 -3
data/README.md CHANGED
@@ -9,3 +9,11 @@ Build on sinatra, useful for developing JS applications and doing "psd => xhtml"
9
9
  $ httpit
10
10
  # or you can set port
11
11
  $ httpit <port number>
12
+
13
+ ## Features
14
+
15
+ * Haml support
16
+ * Sass support
17
+ * MarkDown support
18
+
19
+ See example
data/bin/httpit CHANGED
@@ -68,23 +68,24 @@ get %r{.+} do
68
68
 
69
69
  abs_path = File.join(ROOT, @path)
70
70
 
71
- # *.sass.css suport
72
71
  if @path =~ /.+\.sass\.css/
73
72
  content_type :css
74
- sass @path.sub('.sass.css', '').to_sym
73
+ sass @path.chomp('.sass.css').to_sym
75
74
 
76
- elsif !File.file?(abs_path) && !File.directory?(abs_path)
77
- # shows 404 if file not found
75
+ elsif !File.file?(abs_path) && !File.directory?(abs_path)
78
76
  halt 404
79
77
 
80
78
  elsif @path =~ /.+\.md/
81
- # render markdown template
82
79
  content_type :html
83
80
  content = File.open(abs_path) {|f| f.read }
84
81
  return RedCloth.new(content).to_html
85
82
 
83
+ elsif @path =~ /.+\.haml/
84
+ haml @path.chomp('.haml').to_sym
85
+
86
86
  elsif File.file?(abs_path)
87
87
  send_file(abs_path)
88
+
88
89
  else
89
90
  @files = get_content(@path)
90
91
  haml :listing
data/httpit.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "httpit"
3
- s.version = "0.3.2"
3
+ s.version = "0.3.3"
4
4
  s.summary = "Web server for static files"
5
5
  s.description = "Just go to folder and run `httpit`"
6
6
  s.author = "Pavel Evstigneev"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpit
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pavel Evstigneev