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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8e83d20847f61ee5f2de8dc0854604045dc93f0
4
- data.tar.gz: 5c003d7a48d262f6cfa84bed2ec1d4d243682302
3
+ metadata.gz: f05845205ddd44ebec04fa3b4ad3f3bc106329aa
4
+ data.tar.gz: 69fc39f78bef44e58c3ee80982dfc59bbbeb5984
5
5
  SHA512:
6
- metadata.gz: 49d1f9f0203dc2ff8f28a566aedbf963d3cac1a4dedbe5241bc44b254208747b54bf76fb1eefd24d37d13ce0674736d5ac448ba08b7045fa85db91636650c041
7
- data.tar.gz: 512e3a2e9b03e02b754ded438656213569ed2b8e430e806a0922019527c93b109149bd9c9eec9b786283c4c642b7410d99070505ac7083e83030ad634ae76aee
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
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module Blogengine
3
- VERSION = "0.1.2".freeze
3
+ VERSION = "0.1.3".freeze
4
4
  end
5
5
  end
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.2
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.1.11
113
+ rubygems_version: 2.0.14
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Blogengine based on rack applications