junebug-wiki 0.0.20 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ = 0.0.21 2006-11-26
2
+
3
+ * *EXISTING USERS PLEASE READ THE RELEASE NOTES*
4
+ * INT and TERM signals handling -- Thanks zimbatm!
5
+ * Support for databases other than sqlite3 -- Thanks Robert Gogolok
6
+
1
7
  = 0.0.20 2006-11-23
2
8
 
3
9
  * Rake task to update local documentation (rake update:help)
@@ -1,3 +1,16 @@
1
+ = 0.0.21 2006-11-26
2
+
3
+ The database configuration in config.yml has been changed to allow easy support for databases other than sqlite3. Existing junebug installations will need to make the following changes:
4
+
5
+ In config.yml, add the following lines:
6
+
7
+ dbconnection:
8
+ adapter: sqlite3
9
+ database: junebug.db
10
+
11
+ And be sure to use spaces to indent!
12
+
13
+
1
14
  = 0.0.19 2006-11-22
2
15
 
3
16
  Existing junebug installations will need to make the following changes:
@@ -8,6 +8,27 @@ port: 3301
8
8
  # if you want to have the wiki root running on something other than /
9
9
  sitepath: /
10
10
 
11
+ # database configuration
12
+ dbconnection:
13
+ #
14
+ # sqlite3 configuration
15
+ adapter: sqlite3
16
+ database: junebug.db
17
+ #
18
+ ## postgresql configuration
19
+ # adapter: postgresql
20
+ # database: junebug
21
+ # username:
22
+ # password:
23
+ # socket: /tmp
24
+ #
25
+ ## mysql configuration
26
+ # adapter: mysql
27
+ # database: junebug
28
+ # username:
29
+ # password:
30
+ # host: localhost
31
+
11
32
  # configuring rss
12
33
  feedtitle: 'Wiki Updates'
13
34
  url: http://localhost:3301
@@ -25,7 +25,7 @@ module Junebug
25
25
  end
26
26
 
27
27
  def self.connect
28
- Junebug::Models::Base.establish_connection :adapter => 'sqlite3', :database => 'junebug.db'
28
+ Junebug::Models::Base.establish_connection(Junebug.config['dbconnection'])
29
29
  Junebug::Models::Base.logger = Logger.new('junebug.log')
30
30
  Junebug::Models::Base.threaded_connections=false
31
31
  end
@@ -51,5 +51,15 @@ if __FILE__ == $0 || ENV['DAEMONS_ARGV']
51
51
 
52
52
  puts "** Junebug is running at http://#{Junebug.config['host']}:#{Junebug.config['port']}#{Junebug.config['sitepath']}"
53
53
 
54
- server.run.join
54
+ thread = server.run
55
+
56
+ stop_method = lambda do
57
+ puts "** Junebug is stopping"
58
+ thread.kill
59
+ end
60
+
61
+ trap "INT", &stop_method
62
+ trap "TERM", &stop_method
63
+
64
+ thread.join
55
65
  end
@@ -99,7 +99,7 @@ module Junebug::Controllers
99
99
  class Recent < R '/all/recent'
100
100
  def get
101
101
  @page_title = "Recent Changes"
102
- @pages = Page.find(:all, :order => 'updated_at DESC', :conditions => "julianday('now')-julianday(updated_at) < 30.0")
102
+ @pages = Page.find(:all, :order => 'updated_at DESC', :conditions => "updated_at > '#{30.days.ago.strftime("%Y-%m-%d %H:%M:%S")}'")
103
103
  render :recent
104
104
  end
105
105
  end
@@ -184,4 +184,4 @@ module Junebug::Controllers
184
184
  input.return_to.blank? ? redirect(Junebug.startpage) : redirect(Junebug.config['url'] + input.return_to)
185
185
  end
186
186
  end
187
- end
187
+ end
@@ -32,7 +32,7 @@ namespace :update do
32
32
  page_data['user_id'] = 1
33
33
  page = Junebug::Models::Page.find_by_title(page_data['title'])
34
34
  if page
35
- page.update_attributes(page_data)
35
+ page.update_attributes(page_data) unless page.body == page_data['body']
36
36
  else
37
37
  Junebug::Models::Page.create(page_data)
38
38
  end
@@ -2,7 +2,7 @@ module Junebug #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 20
5
+ TINY = 21
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: junebug-wiki
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.20
7
- date: 2006-11-23 00:00:00 -08:00
6
+ version: 0.0.21
7
+ date: 2006-11-26 00:00:00 -08:00
8
8
  summary: Junebug is a minimalist ruby wiki running on Camping.
9
9
  require_paths:
10
10
  - lib