junebug 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ v0.0.14 2006-11-14
2
+
3
+ * Page title cleanup
4
+ * Rake task reorg
5
+ * Dump task
6
+ * Added error checking to generator
7
+
1
8
  v0.0.13 2006-11-14
2
9
 
3
10
  * Link style improvement/simplification
data/README CHANGED
@@ -32,11 +32,17 @@ To create your Junebug wiki:
32
32
  This creates a directory 'testwiki' with the necessary files.
33
33
 
34
34
  > cd testwiki
35
- > ./wiki start
35
+ > ./wiki run
36
36
 
37
37
  View your new wiki at: http://localhost:3301
38
38
 
39
- You can change default configuration (host, port, startpage, etc.. ) by editing the config.yml file
39
+ Once everything seems to be running fine, you can set the wiki to run in the background. Hit ctrl-C to kill the wiki, and then type
40
+
41
+ > ./wiki start
42
+
43
+ You can change default configuration (host, port, startpage, etc.. ) by editing the config.yml file. For the changes to take effect, just restart the wiki:
44
+
45
+ > ./wiki restart
40
46
 
41
47
 
42
48
  == Notes
data/Rakefile CHANGED
@@ -2,17 +2,16 @@ $:.unshift './lib'
2
2
 
3
3
  require 'rubygems'
4
4
  require 'rake'
5
+
5
6
  require 'rake/gempackagetask'
6
7
  require 'rake/testtask'
7
8
  require 'rake/rdoctask'
8
9
 
9
- require 'active_record'
10
-
11
10
  Gem.manage_gems
12
11
 
13
12
  gem_spec = Gem::Specification.new do |s|
14
13
  s.name = 'junebug'
15
- s.version = '0.0.13'
14
+ s.version = '0.0.14'
16
15
  s.summary = "Junebug is a minimalist ruby wiki."
17
16
  s.description = "Junebug is a minimalist ruby wiki running on Camping."
18
17
  s.author = "Tim Myrtle"
@@ -22,7 +21,7 @@ gem_spec = Gem::Specification.new do |s|
22
21
  s.require_paths = ['lib']
23
22
  s.bindir = 'bin'
24
23
  s.executables = ['junebug']
25
- s.files = FileList['README','LICENSE','CHANGELOG','Rakefile','lib/**/*','deploy/**/*','fixtures/**/*']
24
+ s.files = FileList['README','LICENSE','CHANGELOG','Rakefile','lib/**/*','deploy/**/*','dump/**/*']
26
25
  s.test_files = FileList['test/**/*']
27
26
 
28
27
  s.add_dependency('mongrel', '>=0.3.13.4')
@@ -50,38 +49,11 @@ desc "Clean up directory"
50
49
  task :clean => :clobber_package do
51
50
  rm 'deploy/junebug.db', :force => true
52
51
  rm 'deploy/junebug.log', :force => true
52
+ Dir['deploy/dump/*'].each { |ext| rm ext }
53
53
  rm 'test/test.log', :force => true
54
54
  end
55
55
 
56
56
 
57
- desc 'Dump wiki pages'
58
- task :dump_pages do
59
- fixtures_dir = File.join('.', 'fixtures')
60
-
61
- # clean out fixtures dir
62
- puts "fixtures_dir: #{fixtures_dir}"
63
- Dir[File.join(fixtures_dir, '*')].each { |f| rm_f(f, :verbose => false) }
64
-
65
- # open db connection
66
- ActiveRecord::Base.establish_connection( :adapter => "sqlite3", :database => "./deploy/junebug.db")
67
-
68
- # open fixtures file
69
- File.open(File.join(fixtures_dir, "junebug_pages.yml"), 'w') do |file|
70
-
71
- # grab all pages
72
- pages = Junebug::Models::Page.find(:all)
73
- page_data = []
74
- pages.each do |page|
75
- page_data << page.attributes
76
- end
77
-
78
- file.write page_data.to_yaml
79
- end
80
-
81
- puts "Got pages and put them in #{fixtures_dir}."
82
- end
83
-
84
-
85
57
  desc 'Test the campground.'
86
58
  Rake::TestTask.new(:test) do |t|
87
59
  # t.libs << 'lib'
data/deploy/Rakefile CHANGED
@@ -3,28 +3,8 @@ $:.unshift "../lib"
3
3
  require 'rubygems'
4
4
  require 'rake'
5
5
 
6
- require 'junebug/config'
6
+ require 'junebug/tasks'
7
7
 
8
- namespace :update do
9
-
10
- desc "Update stylesheets"
11
- task :stylesheets do
12
- junebug_root = Junebug::Config.rootdir
13
- cp_r File.join(junebug_root, 'deploy', 'static'), '.'
14
- end
15
-
16
- desc "Update rakefile"
17
- task :rakefile do
18
- junebug_root = Junebug::Config.rootdir
19
- cp File.join(junebug_root, 'deploy', 'Rakefile'), '.'
20
- end
21
-
22
- desc "Update everything"
23
- task :everything => [:stylesheets, :rakefile] do
24
-
25
- end
26
-
27
- end
28
8
 
29
9
 
30
10
 
File without changes
@@ -72,7 +72,7 @@ module Junebug::Controllers
72
72
 
73
73
  class List < R '/all/list'
74
74
  def get
75
- @page_title = "#{Junebug.config['startpage']}: All Pages"
75
+ @page_title = "All Pages"
76
76
  @pages = Page.find :all, :order => 'title'
77
77
  render :list
78
78
  end
@@ -27,7 +27,7 @@ Welcome to Junebug!
27
27
  To start your new wiki, do the following:
28
28
 
29
29
  > cd #{app}
30
- > ./wiki start
30
+ > ./wiki run
31
31
 
32
32
  Open your browser to http://#{Junebug.config['host']}:#{Junebug.config['port']}#{Junebug.config['sitepath']}
33
33
 
@@ -36,6 +36,9 @@ Your admin account is:
36
36
  username: #{user.username}
37
37
  password: #{user.password}
38
38
 
39
+ For more information about running and configuring Junebug,
40
+ go to http://www.junebugwiki.com
41
+
39
42
  Submit bug reports to tim.myrtle@gmail.com
40
43
 
41
44
  EOS
@@ -1,5 +1,5 @@
1
1
  require 'active_record'
2
- require 'acts_as_versioned'
2
+ require 'junebug/acts_as_versioned'
3
3
 
4
4
  module Junebug::Models
5
5
 
@@ -60,20 +60,28 @@ module Junebug::Models
60
60
  Page.reset_column_information
61
61
 
62
62
  # Create admin account
63
+ admin = User.new(:role => User::ROLE_ADMIN)
63
64
  if ENV['INTERACTIVE']
64
- print "Create an initial user account\n"
65
- print "\nEnter your username (3-30 chars, no spaces or punctuation): "
66
- username = STDIN.gets.strip
67
- print "\nEnter your password (5-30 chars, no spaces or punctuation): "
68
- password = STDIN.gets.strip
65
+ loop {
66
+ print "Create an initial user account\n"
67
+ print "\nEnter your username (3-30 chars, no spaces or punctuation): "
68
+ admin.username = STDIN.gets.strip
69
+ print "\nEnter your password (5-30 chars, no spaces or punctuation): "
70
+ admin.password = STDIN.gets.strip
71
+ break if admin.valid?
72
+ puts "\nThe following errors were encountered:"
73
+ admin.errors.full_messages().each {|msg| puts " #{msg}"}
74
+ puts
75
+ }
69
76
  else
70
- username = 'admin'
71
- password = 'password'
77
+ admin.username = 'admin'
78
+ admin.password = 'password'
72
79
  end
73
- admin = User.create :username => username, :password => password, :role => User::ROLE_ADMIN
80
+ admin.save
74
81
 
75
82
  # Install some default pages
76
- pages_file = File.dirname(__FILE__) + "/../../fixtures/junebug_pages.yml"
83
+ pages_file = File.dirname(__FILE__) + "/../../dump/junebug_pages.yml"
84
+ puts pages_file
77
85
  YAML.load_file(pages_file).each {|page_data|Page.create(page_data) } if File.exist?(pages_file)
78
86
  end
79
87
  def self.down
@@ -0,0 +1,4 @@
1
+ $VERBOSE = nil
2
+
3
+ # Load rakefile extensions
4
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].each { |ext| load ext }
@@ -0,0 +1,34 @@
1
+ require 'junebug'
2
+ require 'junebug/models'
3
+ require 'active_record'
4
+
5
+ namespace :dump do
6
+
7
+ desc 'Dump wiki pages'
8
+ task :pages do
9
+ fixtures_dir = File.join('.', 'dump')
10
+
11
+ # clean out fixtures dir
12
+ puts "fixtures_dir: #{fixtures_dir}"
13
+ Dir[File.join(fixtures_dir, '*')].each { |f| rm_f(f, :verbose => false) }
14
+
15
+ # open db connection
16
+ ActiveRecord::Base.establish_connection( :adapter => "sqlite3", :database => "./junebug.db")
17
+
18
+ # open fixtures file
19
+ File.open(File.join(fixtures_dir, "junebug_pages.yml"), 'w') do |file|
20
+
21
+ # grab all pages
22
+ pages = Junebug::Models::Page.find(:all)
23
+ page_data = []
24
+ pages.each do |page|
25
+ page_data << page.attributes
26
+ end
27
+
28
+ file.write page_data.to_yaml
29
+ end
30
+
31
+ puts "Got pages and put them in #{fixtures_dir}."
32
+ end
33
+
34
+ end
@@ -0,0 +1,22 @@
1
+ require 'junebug/config'
2
+
3
+ namespace :update do
4
+
5
+ desc "Update stylesheets"
6
+ task :stylesheets do
7
+ junebug_root = Junebug::Config.rootdir
8
+ cp_r File.join(junebug_root, 'deploy', 'static'), '.'
9
+ end
10
+
11
+ desc "Update rakefile"
12
+ task :rakefile do
13
+ junebug_root = Junebug::Config.rootdir
14
+ cp File.join(junebug_root, 'deploy', 'Rakefile'), '.'
15
+ end
16
+
17
+ desc "Update everything"
18
+ task :everything => [:stylesheets, :rakefile] do
19
+
20
+ end
21
+
22
+ end
data/lib/junebug/views.rb CHANGED
@@ -21,11 +21,11 @@ module Junebug::Views
21
21
  end
22
22
 
23
23
  def show
24
- _header (@version.version == @page.version ? :show : :backlinks), @page.title
24
+ _header (@version.version == @page.version ? :backlinks : :show), @page.title
25
25
  _body {
26
26
  _button 'edit', R(Edit, @page.title, @version.version), {:style=>'float: right; margin: 0 0 5px 5px;'} if logged_in? && (@version.version == @page.version && (! @page.readonly || is_admin?))
27
27
  _markup @version.body
28
- _button 'edit', R(Edit, @page.title, @version.version), {:style=>'float: right; margin: 5px 0 0 5px;'} if logged_in? && (@version.version == @page.version && (! @page.readonly || is_admin?)) && (@version.body && @version.body.size > 100)
28
+ _button 'edit', R(Edit, @page.title, @version.version), {:style=>'float: right; margin: 5px 0 0 5px;'} if logged_in? && (@version.version == @page.version && (! @page.readonly || is_admin?)) && (@version.body && @version.body.size > 200)
29
29
  br :clear=>'all'
30
30
  }
31
31
  _footer {
@@ -56,7 +56,7 @@ module Junebug::Views
56
56
  end
57
57
 
58
58
  def edit
59
- _header :backlinks, @page.title
59
+ _header :show, @page.title
60
60
  _body {
61
61
  div.formbox {
62
62
  form :method => 'post', :action => R(Edit, @page.title) do
@@ -90,7 +90,7 @@ module Junebug::Views
90
90
  end
91
91
 
92
92
  def versions
93
- _header :backlinks, @page.title
93
+ _header :show, @page.title
94
94
  _body {
95
95
  h1 @page_title
96
96
  ul {
@@ -115,7 +115,7 @@ module Junebug::Views
115
115
  end
116
116
 
117
117
  def backlinks
118
- _header :static, @page.title
118
+ _header :show, @page.title
119
119
  _body {
120
120
  h1 "Backlinks to #{@page.title}"
121
121
  ul {
@@ -126,7 +126,7 @@ module Junebug::Views
126
126
  end
127
127
 
128
128
  def list
129
- _header :backlinks, Junebug.config['startpage']
129
+ _header :static, @page_title
130
130
  _body {
131
131
  h1 "All Wiki Pages"
132
132
  ul {
@@ -164,7 +164,7 @@ module Junebug::Views
164
164
  end
165
165
 
166
166
  def diff
167
- _header :backlinks, @page.title
167
+ _header :show, @page.title
168
168
  _body {
169
169
  text 'Comparing '
170
170
  span "version #{@v2.version}", :style=>"background-color: #cfc; padding: 1px 4px;"
@@ -226,7 +226,7 @@ module Junebug::Views
226
226
  end
227
227
  if type == :static
228
228
  h1 page_title
229
- elsif type == :show
229
+ elsif type == :backlinks
230
230
  h1 { a page_title, :href => R(Backlinks, page_title) }
231
231
  else
232
232
  h1 { a page_title, :href => R(Show, page_title) }
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: junebug
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.13
6
+ version: 0.0.14
7
7
  date: 2006-11-14 00:00:00 -08:00
8
8
  summary: Junebug is a minimalist ruby wiki.
9
9
  require_paths:
@@ -33,9 +33,9 @@ files:
33
33
  - LICENSE
34
34
  - CHANGELOG
35
35
  - Rakefile
36
- - lib/acts_as_versioned.rb
37
36
  - lib/junebug
38
37
  - lib/junebug.rb
38
+ - lib/junebug/acts_as_versioned.rb
39
39
  - lib/junebug/config.rb
40
40
  - lib/junebug/controllers.rb
41
41
  - lib/junebug/diff.rb
@@ -43,9 +43,14 @@ files:
43
43
  - lib/junebug/helpers.rb
44
44
  - lib/junebug/models.rb
45
45
  - lib/junebug/mosquito.rb
46
+ - lib/junebug/tasks
47
+ - lib/junebug/tasks.rb
46
48
  - lib/junebug/views.rb
49
+ - lib/junebug/tasks/dump.rake
50
+ - lib/junebug/tasks/update.rake
47
51
  - deploy/config.yml
48
52
  - deploy/console
53
+ - deploy/dump
49
54
  - deploy/Rakefile
50
55
  - deploy/static
51
56
  - deploy/wiki
@@ -57,7 +62,7 @@ files:
57
62
  - deploy/static/style/yui/fonts.css
58
63
  - deploy/static/style/yui/grids.css
59
64
  - deploy/static/style/yui/reset.css
60
- - fixtures/junebug_pages.yml
65
+ - dump/junebug_pages.yml
61
66
  test_files:
62
67
  - test/fixtures
63
68
  - test/wiki_test.rb