dynarex-usersblog 0.1.3 → 0.1.4

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 +7 -9
  2. metadata +1 -1
@@ -7,21 +7,19 @@ require 'fileutils'
7
7
 
8
8
  class DynarexUsersBlog
9
9
 
10
- def initialize(file_path='users/', user='')
10
+ def initialize(file_path='.', user='')
11
11
 
12
12
  unless user.empty? then
13
- @current_user = user
14
-
15
- file_path + '/' unless file_path[/\/$/]
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 = 'users/' + user_name
48
+ user_file_path = "%s/users/%s" % [@file_path, @current_user]
51
49
  DynarexBlog.new(user_file_path)
52
50
  end
53
51
 
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors: []
7
7