rack-blogengine 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +39 -0
- data/lib/rack/blogengine/command_line_interface.rb +6 -1
- data/lib/rack/blogengine/operator.rb +2 -2
- data/lib/rack/blogengine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f05845205ddd44ebec04fa3b4ad3f3bc106329aa
|
4
|
+
data.tar.gz: 69fc39f78bef44e58c3ee80982dfc59bbbeb5984
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96d036674dcaaf52a184a52c12ca5ceceb8c4c6f4c06b8e5ddbc07630daf63cbe40f2136fc6c6e2b71a890c10f1b1a73806c72fb6aeb2db8c2c9b7141f762163
|
7
|
+
data.tar.gz: 5c918a4fe907f797b7fc7becbbb2161d18a62c01a98074716381c19a508e583fba41fd2fd6ea6ff9333ad271c4835f5c20b95a2be35e4a8065760d55b49bc393
|
data/README.md
CHANGED
@@ -59,6 +59,45 @@ The Content files (.content) includes your content
|
|
59
59
|
### Hint
|
60
60
|
For a root document (http://pathtoapp.tld/) path should be empty ([path]:[/path])
|
61
61
|
|
62
|
+
### Operators
|
63
|
+
|
64
|
+
In version 0.1.2 operator handling is included.
|
65
|
+
To use this new feature you have to create a operator directory in your rackblog folder.
|
66
|
+
In this directory create your operators (.rb files) with following skeleton
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
module UserOperator
|
70
|
+
end
|
71
|
+
```
|
72
|
+
|
73
|
+
Your operators are normal ruby methods defined in this module.
|
74
|
+
Available params are documents & html
|
75
|
+
|
76
|
+
Param documents:
|
77
|
+
An Array with document objects.
|
78
|
+
This Document objects has following attributes: path, title, html
|
79
|
+
|
80
|
+
Param html:
|
81
|
+
The content of the file where the operator was included
|
82
|
+
|
83
|
+
#### Example
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
module UserOperator
|
87
|
+
def show_nav
|
88
|
+
end
|
89
|
+
end
|
90
|
+
```
|
91
|
+
|
92
|
+
In your layout.html then
|
93
|
+
|
94
|
+
```html
|
95
|
+
<div class="nav">
|
96
|
+
{% show_nav %}
|
97
|
+
</div>
|
98
|
+
```
|
99
|
+
|
100
|
+
|
62
101
|
## Contributing
|
63
102
|
|
64
103
|
1. Fork it
|
@@ -16,7 +16,12 @@ module Rack
|
|
16
16
|
# Method to run the cli command
|
17
17
|
# @param [String] target
|
18
18
|
def run(target)
|
19
|
-
unless target.empty?
|
19
|
+
unless target.empty?
|
20
|
+
if target.include?("/")
|
21
|
+
target = target.dup
|
22
|
+
target["/"] = ""
|
23
|
+
end
|
24
|
+
puts target
|
20
25
|
system("cd #{target}")
|
21
26
|
$targetfolder = "#{Dir.pwd}/#{target}"
|
22
27
|
app = Rack::Builder.new do
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class Operator
|
2
2
|
def initialize(target)
|
3
|
-
Dir.foreach("#{target}operator/") do |item|
|
3
|
+
Dir.foreach("#{target}/operator/") do |item|
|
4
4
|
extension = item.split(".")[1]
|
5
5
|
next if item == '.' or item == '..' or extension != "rb"
|
6
|
-
require "#{target}operator/#{item}"
|
6
|
+
require "#{target}/operator/#{item}"
|
7
7
|
end
|
8
8
|
|
9
9
|
extend UserOperator # load user operators
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-blogengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benny1992
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.0.14
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: Blogengine based on rack applications
|