dynarex-usersblog 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dynarex-usersblog.rb +25 -5
- metadata +2 -2
data/lib/dynarex-usersblog.rb
CHANGED
@@ -7,13 +7,18 @@ require 'fileutils'
|
|
7
7
|
|
8
8
|
class DynarexUsersBlog
|
9
9
|
|
10
|
-
def initialize(user)
|
11
|
-
@current_user = user
|
10
|
+
def initialize(user='')
|
12
11
|
|
13
|
-
|
14
|
-
|
12
|
+
unless user.empty? then
|
13
|
+
@current_user = user
|
14
|
+
|
15
|
+
user_file_path = 'users/' + @current_user
|
16
|
+
FileUtils.mkdir_p user_file_path
|
17
|
+
|
18
|
+
@user_blog = DynarexBlog.new user_file_path
|
19
|
+
@current_blog = @user_blog
|
20
|
+
end
|
15
21
|
|
16
|
-
@user_blog = DynarexBlog.new user_file_path
|
17
22
|
@master_blog = DynarexBlog.new
|
18
23
|
|
19
24
|
super()
|
@@ -30,4 +35,19 @@ class DynarexUsersBlog
|
|
30
35
|
@user_blog.delete id
|
31
36
|
@master_blog.delete id
|
32
37
|
end
|
38
|
+
|
39
|
+
def page(n)
|
40
|
+
@master_blog.page(n)
|
41
|
+
end
|
42
|
+
|
43
|
+
def tag(tag_name)
|
44
|
+
@master_blog.tag(tag_name)
|
45
|
+
end
|
46
|
+
|
47
|
+
def user(user_name)
|
48
|
+
user_file_path = 'users/' + user_name
|
49
|
+
DynarexBlog.new(user_file_path)
|
50
|
+
end
|
51
|
+
|
33
52
|
end
|
53
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynarex-usersblog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors: []
|
7
7
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-06-
|
12
|
+
date: 2010-06-24 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|