sssmoke 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,30 +1,34 @@
1
1
  # Sssmoke
2
2
 
3
- Slap a Ruby script on a web server in seconds.
3
+ Slap Ruby scripts on a web server in seconds.
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ $ gem install sssmoke
8
8
 
9
- gem 'sssmoke'
9
+ ## Usage
10
10
 
11
- And then execute:
11
+ Put erb templates in a directory (with extension _erb_).
12
12
 
13
- $ bundle
13
+ To put the whole directory on a web server, run:
14
14
 
15
- Or install it yourself as:
15
+ sssmoke
16
16
 
17
- $ gem install sssmoke
17
+ Now open:
18
18
 
19
- ## Usage
19
+ http://localhost:<your web server's default port>/<name of erb script>
20
20
 
21
- Put erb templates in a folder, go to the folder and run:
22
21
 
23
- 'sssmoke'
22
+ ## Pro Usage for Powah Usah
24
23
 
25
- Now open:
24
+ If you want to sssmoke a directory other than the current directory:
25
+
26
+ sssmoke <directory name>
27
+
28
+ To expose a single template at the server's root:
29
+
30
+ sssmoke <file name>
26
31
 
27
- http://localhost:<your web server's default port>/<name of script>
28
32
 
29
33
  ## Contributing
30
34
 
data/bin/sssmoke CHANGED
@@ -1,16 +1,19 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'sinatra/base'
3
+ require 'erb'
4
+ require 'tilt'
3
5
 
4
- class Frontend < Sinatra::Base
5
- set :views, Dir.pwd
6
-
7
- get '/' do
8
- erb :index
6
+ filename = ARGV[0] || "."
7
+ if File.directory? filename
8
+ Class.new(Sinatra::Base) do
9
+ set :views, filename
10
+ get('/') { erb :index }
11
+ get('/:page') {|page| erb page.to_sym }
12
+ run!
9
13
  end
10
-
11
- get '/:page' do |page|
12
- erb page.to_sym
14
+ else
15
+ Class.new(Sinatra::Base) do
16
+ get('/') { Tilt::ERBTemplate.new(filename).render }
17
+ run!
13
18
  end
14
-
15
- run!
16
19
  end
data/lib/sssmoke.rb CHANGED
@@ -1,5 +1 @@
1
- require "sssmoke/version"
2
-
3
- module Sssmoke
4
- # Your code goes here...
5
- end
1
+ require "sssmoke/version"
@@ -1,3 +1,3 @@
1
1
  module Sssmoke
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/sssmoke.gemspec CHANGED
@@ -8,10 +8,9 @@ Gem::Specification.new do |gem|
8
8
  gem.version = Sssmoke::VERSION
9
9
  gem.authors = ["Paolo \"Nusco\" Perrotta"]
10
10
  gem.email = ["paolo.nusco.perrotta@gmail.com"]
11
- gem.description = %q{Slap a Ruby script on a web server in seconds.}
12
- gem.summary = %q{Put erb templates in a folder and run them in a server with the 'rackup' command.}
11
+ gem.description = %q{Slap Rubys script on a web server in seconds.}
12
+ gem.summary = %q{Put erb templates in a folder and run them in a server with the 'sssmoke' command.}
13
13
  gem.homepage = "https://github.com/nusco/sssmoke"
14
-
15
14
  gem.files = `git ls-files`.split($/)
16
15
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
16
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sssmoke
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -43,7 +43,7 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
- description: Slap a Ruby script on a web server in seconds.
46
+ description: Slap Rubys script on a web server in seconds.
47
47
  email:
48
48
  - paolo.nusco.perrotta@gmail.com
49
49
  executables:
@@ -85,6 +85,6 @@ rubyforge_project:
85
85
  rubygems_version: 1.8.24
86
86
  signing_key:
87
87
  specification_version: 3
88
- summary: Put erb templates in a folder and run them in a server with the 'rackup'
88
+ summary: Put erb templates in a folder and run them in a server with the 'sssmoke'
89
89
  command.
90
90
  test_files: []