dynarex-usersblog 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/dynarex-usersblog.rb +6 -4
  2. metadata +2 -2
@@ -2,7 +2,8 @@
2
2
 
3
3
  # file: dynarex-usersblog.rb
4
4
 
5
- require 'dynarex-blog'
5
+ #require 'dynarex-blog'
6
+ require '/home/james/learning/ruby/dynarex-blog'
6
7
  require 'fileutils'
7
8
  require 'hashcache'
8
9
 
@@ -33,8 +34,8 @@ class DynarexUsersBlog
33
34
  super()
34
35
  end
35
36
 
36
- def create_entry(blog_params={}, user='')
37
- switch_user user unless user.empty? or @current_user == user
37
+ def create_entry(blog_params={}, user=nil)
38
+ switch_user user unless user.nil? or user.empty? or @current_user == user
38
39
  blog_params.merge!({user: @current_user})
39
40
  @user_blog.create_entry blog_params
40
41
  @master_blog.id = @user_blog.id.to_i - 1
@@ -56,6 +57,7 @@ class DynarexUsersBlog
56
57
 
57
58
  def user(username)
58
59
  (@current_user == username ? @current_user : switch_user(username))
60
+ self
59
61
  end
60
62
 
61
63
  def entry(id)
@@ -66,7 +68,7 @@ class DynarexUsersBlog
66
68
  @master_blog.tags
67
69
  end
68
70
 
69
- def update_user(user, id=0, h={})
71
+ def update_entry(user, id=0, h={})
70
72
  switch_user user unless @current_user == user
71
73
  @user_blog.update(id, h)
72
74
  @master_blog.update(id, h)
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.2.5
4
+ version: 0.2.6
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: 2011-01-14 00:00:00 +00:00
12
+ date: 2011-02-07 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency