content_directory 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWQyZDYxMDlmMjI1ODg3YjgzM2UyNmRlYjBlY2U5Y2YxYTE0YzZlNw==
4
+ MDk3NjU5M2Y5NzA5ZWQwMzE3MmViMjE4N2Y2YjhlODc0ZmY4Y2U4OQ==
5
5
  data.tar.gz: !binary |-
6
- ZWNmZjYxOWJjMTUwNGQxYzM1MWVmN2ZkYzA4YjAzOTE5ZmI2Yzc3ZA==
6
+ YWNhZjk0YWFjMTRlNmU0YjMxMDExY2E4NzgyNmYzZjYzYjM3MTA0OA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MWUxYzM2MjBmNGEyZDRhYWFiZGU0ZjMzNmRmNzc2ZmU3MzllODU4NmE0ZmQz
10
- NDNmZWYxNWE4NWQwODM4YmNhMzY1MDExNGZiMDIwYWI4Yjg2MDk4NWQ2Zjkw
11
- MTY0YzBhOGQ5NGYwM2Q0MmZjY2Y3N2VhODMzYTBmZDJkNDI0YTI=
9
+ YjYwZjM4MWNlMGMyZjJlOGM0ZDUxYzA4OGJkMjdlY2Y1YWY5MzY4NzgxYzNm
10
+ ZWIwYjU4ZTc3NmI3ZDhlOGYzOGQ4YTJkYjA5NDhlYjNhNjBhZjUwYjc4MTlh
11
+ ZTgxNzVmNjc1Yjk3ZWU3MmFlNmQyYmQ4Y2UxYTE3Yjk2OTI1ZDM=
12
12
  data.tar.gz: !binary |-
13
- YWExNGRkZGRjM2U1NWQ3MzdjY2E1MGI4MDJjN2Q5MTA3NjEwZjM2Y2M3ZTEy
14
- OTMwZmQ1ODE5ZThlMDQ3NTZmMTk3ZjFjMTk2NmZkMTFhN2FiNGI1NTc1ZmYz
15
- NjEwN2FlYTUxODY2M2M1YWVkODRkZTZiY2ZjY2EzYzAxOTVjNDM=
13
+ ZDY0MjI4YzU3YWFkZmZhNmVjMzQyMjdjNjM3M2NhNmM5YjRlODI2MzliMWRk
14
+ YWQxNTJmM2ZjM2Y2MmRiYWFhNjcxYjBjYmYwMzA4YzA1ZDZiMmJlNDJhMThi
15
+ MmRmM2FhZmJjOGNlOGI4NTFlNGZiYjViZjgwMTcwMDUyNmI3MWI=
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2
4
+
5
+ - Support more entry extensions (.md, .markdown, .txt, .text)
6
+
3
7
  ## 0.1.1
4
8
 
5
9
  - An entry file, which only contains metadata, now returns `text` and `html` as nil
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
@@ -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.include?(".md")
31
+ entry[0] == "." || entry.include?(".") && !entry.match(valid_entry_extensions_regex)
29
32
  end
30
33
 
31
34
  entries.each do |entry|
@@ -1,3 +1,3 @@
1
1
  module ContentDirectory
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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 00:00:00.000000000 Z
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.2
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