dynarex-usersblog 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dynarex-usersblog.rb +7 -9
- metadata +1 -1
data/lib/dynarex-usersblog.rb
CHANGED
@@ -7,21 +7,19 @@ require 'fileutils'
|
|
7
7
|
|
8
8
|
class DynarexUsersBlog
|
9
9
|
|
10
|
-
def initialize(file_path='
|
10
|
+
def initialize(file_path='.', user='')
|
11
11
|
|
12
12
|
unless user.empty? then
|
13
|
-
@current_user = user
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
user_file_path = file_path + @current_user
|
18
|
-
FileUtils.mkdir_p user_file_path
|
13
|
+
@current_user = user
|
14
|
+
@file_path = file_path
|
15
|
+
user_file_path = "%s/users/%s" % [@file_path, @current_user]
|
19
16
|
|
17
|
+
FileUtils.mkdir_p user_file_path
|
20
18
|
@user_blog = DynarexBlog.new user_file_path
|
21
19
|
@current_blog = @user_blog
|
22
20
|
end
|
23
21
|
|
24
|
-
@master_blog = DynarexBlog.new
|
22
|
+
@master_blog = DynarexBlog.new file_path
|
25
23
|
|
26
24
|
super()
|
27
25
|
end
|
@@ -47,7 +45,7 @@ class DynarexUsersBlog
|
|
47
45
|
end
|
48
46
|
|
49
47
|
def user(user_name)
|
50
|
-
user_file_path =
|
48
|
+
user_file_path = "%s/users/%s" % [@file_path, @current_user]
|
51
49
|
DynarexBlog.new(user_file_path)
|
52
50
|
end
|
53
51
|
|