content_directory 0.1.1 → 0.1.2
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.
- checksums.yaml +8 -8
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/content_directory.rb +4 -1
- data/lib/content_directory/version.rb +1 -1
- data/test/support/content/home/invalid.jpg +0 -0
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
MDk3NjU5M2Y5NzA5ZWQwMzE3MmViMjE4N2Y2YjhlODc0ZmY4Y2U4OQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
YWNhZjk0YWFjMTRlNmU0YjMxMDExY2E4NzgyNmYzZjYzYjM3MTA0OA==
|
|
7
7
|
!binary "U0hBNTEy":
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
YjYwZjM4MWNlMGMyZjJlOGM0ZDUxYzA4OGJkMjdlY2Y1YWY5MzY4NzgxYzNm
|
|
10
|
+
ZWIwYjU4ZTc3NmI3ZDhlOGYzOGQ4YTJkYjA5NDhlYjNhNjBhZjUwYjc4MTlh
|
|
11
|
+
ZTgxNzVmNjc1Yjk3ZWU3MmFlNmQyYmQ4Y2UxYTE3Yjk2OTI1ZDM=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
ZDY0MjI4YzU3YWFkZmZhNmVjMzQyMjdjNjM3M2NhNmM5YjRlODI2MzliMWRk
|
|
14
|
+
YWQxNTJmM2ZjM2Y2MmRiYWFhNjcxYjBjYmYwMzA4YzA1ZDZiMmJlNDJhMThi
|
|
15
|
+
MmRmM2FhZmJjOGNlOGI4NTFlNGZiYjViZjgwMTcwMDUyNmI3MWI=
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Content Directory is a lightweight replacement of Content Management System. It
|
|
|
4
4
|
|
|
5
5
|
## Structure
|
|
6
6
|
|
|
7
|
-
Content Directory does not require a database. Instead, it uses file system. An entry is a file written in Markdown syntax. You can group related entries in a folder.
|
|
7
|
+
Content Directory does not require a database. Instead, it uses file system. An entry is a file written in Markdown syntax (with one of the following extensions: .md, .markdown, .txt, .text). You can group related entries in a folder.
|
|
8
8
|
|
|
9
9
|
- content
|
|
10
10
|
- home
|
data/lib/content_directory.rb
CHANGED
|
@@ -18,6 +18,9 @@ module ContentDirectory
|
|
|
18
18
|
|
|
19
19
|
def self.find(path=nil)
|
|
20
20
|
result = {}
|
|
21
|
+
valid_entry_extensions = %w(.md .markdown .txt .text)
|
|
22
|
+
valid_entry_extensions_regex = /.*(#{valid_entry_extensions.join('|\\').prepend('\\')})$/i
|
|
23
|
+
|
|
21
24
|
begin
|
|
22
25
|
entries = Dir.entries "#{root}/#{path}"
|
|
23
26
|
rescue Exception => e
|
|
@@ -25,7 +28,7 @@ module ContentDirectory
|
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
entries.reject! do |entry|
|
|
28
|
-
entry[0] == "." || entry.include?(".") && !entry.
|
|
31
|
+
entry[0] == "." || entry.include?(".") && !entry.match(valid_entry_extensions_regex)
|
|
29
32
|
end
|
|
30
33
|
|
|
31
34
|
entries.each do |entry|
|
|
File without changes
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: content_directory
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Steve Randy Tantra
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-03-
|
|
11
|
+
date: 2013-03-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: redcarpet
|
|
@@ -88,6 +88,7 @@ files:
|
|
|
88
88
|
- test/support/content/home/empty.md
|
|
89
89
|
- test/support/content/home/features/collaboration.md
|
|
90
90
|
- test/support/content/home/features/manage.md
|
|
91
|
+
- test/support/content/home/invalid.jpg
|
|
91
92
|
- test/support/content/home/main.md
|
|
92
93
|
- test/support/content/posts/a-new-blog.md
|
|
93
94
|
- test/support/content/posts/sortable-stars.md
|
|
@@ -114,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
114
115
|
version: '0'
|
|
115
116
|
requirements: []
|
|
116
117
|
rubyforge_project:
|
|
117
|
-
rubygems_version: 2.0.
|
|
118
|
+
rubygems_version: 2.0.3
|
|
118
119
|
signing_key:
|
|
119
120
|
specification_version: 4
|
|
120
121
|
summary: Lightweight replacement of Content Management System
|
|
@@ -122,6 +123,7 @@ test_files:
|
|
|
122
123
|
- test/support/content/home/empty.md
|
|
123
124
|
- test/support/content/home/features/collaboration.md
|
|
124
125
|
- test/support/content/home/features/manage.md
|
|
126
|
+
- test/support/content/home/invalid.jpg
|
|
125
127
|
- test/support/content/home/main.md
|
|
126
128
|
- test/support/content/posts/a-new-blog.md
|
|
127
129
|
- test/support/content/posts/sortable-stars.md
|