rack-blogengine 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rack-blogengine +12 -28
- data/lib/rack/blogengine/command_line_interface.rb +35 -0
- data/lib/rack/blogengine/version.rb +1 -1
- 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: 9db5da82e83eb236a86e369e4e161d853c0934d2
|
4
|
+
data.tar.gz: 11ccce1b61bc92a6b2275407884b1a41ccdee2af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89ec6a8b8508d10078c12a025de15de3fe40175fb5de11d6196d28bb56ae6bf73c5c9fe58c611db55238edd17edf3307ab8778fa400f324c584f52d5cdb992ae
|
7
|
+
data.tar.gz: a09b762e2d637e37bffaeff1171efb08aa2f793ee287d83307fb941b72cd07c13c68be1c976968f39c66aabb63c94726684f385f4ea208650009550d979c82e3
|
data/bin/rack-blogengine
CHANGED
@@ -1,38 +1,22 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require 'rack/blogengine'
|
3
|
-
require 'rack'
|
2
|
+
require 'rack/blogengine/command_line_interface'
|
4
3
|
|
5
4
|
|
6
|
-
command = ARGV[0]
|
5
|
+
command = ARGV[0].to_sym
|
7
6
|
|
8
|
-
if ARGV[1]
|
9
|
-
target = ARGV[1]
|
10
|
-
else
|
11
|
-
target = "";
|
12
|
-
end
|
13
7
|
|
14
|
-
|
15
|
-
|
16
|
-
unless target.empty?
|
17
|
-
$targetfolder = target
|
18
|
-
app = Rack::Builder.new do
|
19
|
-
use Rack::CommonLogger
|
20
|
-
use Rack::ShowExceptions
|
8
|
+
target = ARGV[1]
|
9
|
+
target = "" if !ARGV[1]
|
21
10
|
|
22
|
-
map "/assets" do
|
23
|
-
run Rack::Directory.new("#{$targetfolder}/assets")
|
24
|
-
end
|
25
11
|
|
26
|
-
|
27
|
-
|
28
|
-
end
|
12
|
+
cli = Rack::Blogengine::CommandLineInterface.new
|
13
|
+
methods = Rack::Blogengine::CommandLineInterface.instance_methods(false)
|
29
14
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
puts "
|
15
|
+
begin
|
16
|
+
cli.send(command, target)
|
17
|
+
rescue TypeError
|
18
|
+
puts "Available commands are #{methods}"
|
19
|
+
rescue NoMethodError
|
20
|
+
puts "Available commands are #{methods}"
|
36
21
|
end
|
37
|
-
|
38
22
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'rack'
|
2
|
+
require 'rack/blogengine'
|
3
|
+
|
4
|
+
module Rack
|
5
|
+
module Blogengine
|
6
|
+
class CommandLineInterface
|
7
|
+
# Method to run the cli command
|
8
|
+
# @param [String] target
|
9
|
+
def run(target)
|
10
|
+
unless target.empty?
|
11
|
+
$targetfolder = target
|
12
|
+
app = Rack::Builder.new do
|
13
|
+
use Rack::CommonLogger
|
14
|
+
use Rack::ShowExceptions
|
15
|
+
|
16
|
+
map "/assets" do
|
17
|
+
run Rack::Directory.new("#{$targetfolder}/assets")
|
18
|
+
end
|
19
|
+
|
20
|
+
use Rack::Lint
|
21
|
+
run Rack::Blogengine::Application
|
22
|
+
end
|
23
|
+
|
24
|
+
Rack::Server.start( :app => app, :Port => 3000 )
|
25
|
+
else
|
26
|
+
puts "Specify a targetfolder!"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# TODO write generate method to generate blog skeleton (assets, layout etc)
|
31
|
+
def generate(folder)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-blogengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benny1992
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- lib/rack/blogengine.rb
|
84
84
|
- lib/rack/blogengine/application.rb
|
85
85
|
- lib/rack/blogengine/application_router.rb
|
86
|
+
- lib/rack/blogengine/command_line_interface.rb
|
86
87
|
- lib/rack/blogengine/doc_parser.rb
|
87
88
|
- lib/rack/blogengine/version.rb
|
88
89
|
- rack-blogengine.gemspec
|