dynarex-usersblog 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. data/lib/dynarex-usersblog.rb +25 -5
  2. metadata +2 -2
@@ -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
- user_file_path = 'users/' + @current_user
14
- FileUtils.mkdir_p user_file_path
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.0
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-23 00:00:00 +01:00
12
+ date: 2010-06-24 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15