junebug 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,96 @@
1
+ = 0.0.18 2006-11-21
2
+
3
+ * Changed diff output to compare unformmatted text
4
+ * Converted to using hoe
5
+ * Quicksave option (doesn't increment version)
6
+ * Signup redirect bugfix
7
+ * External lib dir (ext)
8
+
9
+ = 0.0.17 2006-11-19
10
+
11
+ * Quick bugfix for login redirects behind proxy
12
+
13
+ = 0.0.16 2006-11-19
14
+
15
+ * Style tweaks
16
+ * Login/logout redirects you back to the page you were on
17
+
18
+ = 0.0.15 2006-11-17
19
+
20
+ * Loosen up mongrel requirements for windows users -- thanks deejay
21
+ * Bugfix for static file issue #6536. Thanks zimbatm
22
+ * Added css for wrapping pre text
23
+ * Changed wikiword syntax to [[link]]
24
+ * Unit testing improvements
25
+ * Command line help
26
+
27
+ = 0.0.14 2006-11-14
28
+
29
+ * Page title cleanup
30
+ * Rake task reorg
31
+ * Dump task
32
+ * Added error checking to generator
33
+
34
+ = 0.0.13 2006-11-14
35
+
36
+ * Link style improvement/simplification
37
+ * Autolinking urls
38
+ * use user.role to determine admin rights
39
+ * is_admin?, logged_in?
40
+
41
+ = 0.0.12 2006-11-13
42
+
43
+ * content div bugfix
44
+
45
+ = 0.0.11 2006-11-13
46
+
47
+ * Added revert
48
+ * Versioning bugfix
49
+ * Changed delete operation
50
+ * Added 'role' user field
51
+
52
+ = 0.0.10 2006-11-12
53
+
54
+ * Submit bugfix
55
+ * More unit tests
56
+
57
+ = 0.0.9 2006-11-10
58
+
59
+ * Mosquito unit tests
60
+
61
+ = 0.0.8 2006-11-08
62
+
63
+ * Style work
64
+ * Add rss link to head
65
+ * Stylesheet update rake task
66
+
67
+ = 0.0.7 2006-11-07
68
+
69
+ * Redirect bugfix for proxied sites
70
+
71
+ = 0.0.6 2006-11-07
72
+
73
+ * Delete pages
74
+ * More style work
75
+
76
+ = 0.0.5 2006-11-06
77
+
78
+ * Style cleanups
79
+ * Security fix
80
+ * Format test page
81
+
82
+ = 0.0.4 2006-11-05
83
+
84
+ * Readonly pages
85
+ * Start page
86
+ * Bugfixes
87
+
88
+ = 0.0.3 2006-10-30
89
+
90
+ * User accounts
91
+ * Daemonize
92
+ * Default page fixtures
93
+
94
+ = 0.0.2 2006-10-22
95
+
96
+ * Initial release
@@ -0,0 +1,36 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ RELEASE_NOTES.txt
5
+ Rakefile
6
+ bin/junebug
7
+ deploy/Rakefile
8
+ deploy/config.yml
9
+ deploy/console
10
+ deploy/static/images/feed-icon-14x14.png
11
+ deploy/static/style/base.css
12
+ deploy/static/style/yui/fonts.css
13
+ deploy/static/style/yui/grids.css
14
+ deploy/static/style/yui/reset.css
15
+ deploy/wiki
16
+ dump/junebug_pages.yml
17
+ lib/junebug.rb
18
+ lib/junebug/config.rb
19
+ lib/junebug/controllers.rb
20
+ lib/junebug/ext/acts_as_versioned.rb
21
+ lib/junebug/ext/diff.rb
22
+ lib/junebug/ext/mosquito.rb
23
+ lib/junebug/generator.rb
24
+ lib/junebug/helpers.rb
25
+ lib/junebug/models.rb
26
+ lib/junebug/tasks.rb
27
+ lib/junebug/tasks/dump.rake
28
+ lib/junebug/tasks/update.rake
29
+ lib/junebug/version.rb
30
+ lib/junebug/views.rb
31
+ setup.rb
32
+ test/fixtures/junebug_page_versions.yml
33
+ test/fixtures/junebug_pages.yml
34
+ test/fixtures/junebug_users.yml
35
+ test/test_helper.rb
36
+ test/wiki_test.rb
@@ -0,0 +1,87 @@
1
+ = JUNEBUG WIKI
2
+
3
+ * http://www.junebugwiki.com
4
+ * http://rubyforge.org/projects/junebug/
5
+ * tim.myrtle@gmail.com
6
+
7
+
8
+ == DESCRIPTION:
9
+
10
+ Junebug is a minimalist wiki, running on Camping.
11
+
12
+ This is an alpha release. Use at your own risk. Please do not use this for anything important.
13
+
14
+
15
+ == SYNOPSIS:
16
+
17
+ To create your Junebug wiki:
18
+
19
+ % junebug testwiki
20
+
21
+ This creates a directory 'testwiki' with the necessary files.
22
+
23
+ % cd testwiki
24
+ % ruby wiki run
25
+
26
+ View your new wiki at: http://localhost:3301
27
+
28
+ If everything is running fine, you can set the wiki to run in the background. Hit ctrl-C to kill the wiki, and then type
29
+
30
+ % ruby wiki start
31
+
32
+ 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:
33
+
34
+ % ruby wiki restart
35
+
36
+
37
+ == REQUIREMENTS:
38
+
39
+ * Ruby and rubygems
40
+ * Sqlite3
41
+
42
+ _why has set up a page describing how to get sqlite3 set up on ruby for various platforms: http://code.whytheluckystiff.net/camping/wiki/BeAlertWhenOnSqlite3
43
+
44
+ Please follow the instructions _why has provided. In particular, make sure that you have _why's latest sqlite3-ruby gem installed.
45
+
46
+
47
+ == INSTALL:
48
+
49
+ % gem install junebug --include-dependencies
50
+
51
+
52
+ == NOTES:
53
+
54
+ Starting and stopping the wiki:
55
+
56
+ % ruby wiki [start|stop|restart|run]
57
+
58
+
59
+ == CREDITS:
60
+
61
+ Thans to _why for camping http://code.whytheluckystiff.net/camping/wiki and his tepee wiki example which was the starting point for Junebug, and also to Chris Wanstrath for cheat http://cheat.errtheblog.com/ .
62
+
63
+
64
+ == LICENSE:
65
+
66
+ (The MIT License)
67
+
68
+ Copyright (c) 2006 Tim Myrtle
69
+
70
+ Permission is hereby granted, free of charge, to any person obtaining a copy
71
+ of this software and associated documentation files (the "Software"), to
72
+ deal in the Software without restriction, including without limitation the
73
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
74
+ sell copies of the Software, and to permit persons to whom the Software is
75
+ furnished to do so, subject to the following conditions:
76
+
77
+ The above copyright notice and this permission notice shall be included in
78
+ all copies or substantial portions of the Software.
79
+
80
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
81
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
82
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
83
+ THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
84
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
85
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
86
+
87
+
@@ -1,4 +1,4 @@
1
- v0.0.15
1
+ = 0.0.15 2006-11-17
2
2
 
3
3
  The wikiword syntax changed in this release from just straight WikiLink to [[WikiLink]]. Just using camelcase was having trouble coexisting with textile, so I opted instead for the instiki convention which is less problematic.
4
4
 
data/Rakefile CHANGED
@@ -2,70 +2,61 @@ $:.unshift './lib'
2
2
 
3
3
  require 'rubygems'
4
4
  require 'rake'
5
-
6
- require 'rake/gempackagetask'
5
+ require 'rake/clean'
7
6
  require 'rake/testtask'
7
+ require 'rake/packagetask'
8
+ require 'rake/gempackagetask'
8
9
  require 'rake/rdoctask'
9
-
10
- require 'junebug'
11
-
12
- Gem.manage_gems
13
-
14
- gem_spec = Gem::Specification.new do |s|
15
- s.name = 'junebug'
16
- s.version = Junebug::VERSION
17
- s.summary = "Junebug is a minimalist ruby wiki."
18
- s.description = "Junebug is a minimalist ruby wiki running on Camping."
19
- s.author = "Tim Myrtle"
20
- s.email = 'tim.myrtle@gmail.com'
21
- s.homepage = 'http://www.junebugwiki.com/'
10
+ require 'rake/contrib/rubyforgepublisher'
11
+ require 'fileutils'
12
+ require 'hoe'
13
+ include FileUtils
14
+ require File.join(File.dirname(__FILE__), 'lib', 'junebug', 'version')
15
+
16
+ AUTHOR = "Tim Myrtle" # can also be an array of Authors
17
+ EMAIL = "tim.myrtle@gmail.com"
18
+ DESCRIPTION = "Junebug is a minimalist ruby wiki running on Camping."
19
+ GEM_NAME = "junebug" # what ppl will type to install your gem
20
+ RUBYFORGE_PROJECT = "junebug" # The unix name for your project
21
+ HOMEPATH = "http://www.junebugwiki.com"
22
+ RELEASE_TYPES = %w( gem ) # can use: gem, tar, zip
23
+
24
+ NAME = "junebug"
25
+ REV = nil # File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
26
+ VERS = ENV['VERSION'] || (Junebug::VERSION::STRING + (REV ? ".#{REV}" : ""))
27
+ CLEAN.include ['**/.*.sw?', '*.gem', '.config', '**/*.db', '**/*.log', 'config.yml', 'deploy/dump/*']
28
+ TEST = ["test/**/*_test.rb"]
29
+ RDOC_OPTS = ['--quiet', '--title', "junebug documentation",
30
+ "--opname", "index.html", "--line-numbers", "--main", "README", "--inline-source"]
31
+
32
+ # Generate all the Rake tasks
33
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
34
+ hoe = Hoe.new(GEM_NAME, VERS) do |p|
35
+ p.author = AUTHOR
36
+ p.description = DESCRIPTION
37
+ p.email = EMAIL
38
+ p.summary = DESCRIPTION
39
+ p.url = HOMEPATH
40
+ p.rubyforge_name = RUBYFORGE_PROJECT
41
+ p.test_globs = TEST
42
+ p.clean_globs = CLEAN
43
+ p.need_tar = false
44
+ p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
22
45
 
23
- s.require_paths = ['lib']
24
- s.bindir = 'bin'
25
- s.executables = ['junebug']
26
- s.files = FileList['README', 'LICENSE', 'CHANGELOG', 'RELEASE_NOTES', 'Rakefile', 'lib/**/*', 'deploy/**/*', 'dump/**/*']
27
- s.test_files = FileList['test/**/*']
28
-
29
- s.add_dependency('mongrel', '>=0.3.13.3')
30
- s.add_dependency('camping', '>=1.5')
31
- s.add_dependency('RedCloth', '>=3.0.4')
32
- s.add_dependency('daemons', '>=1.0.3')
33
- s.add_dependency('sqlite3-ruby', '>=1.1.0.1')
34
- s.add_dependency('activerecord', '>=1.14.4')
46
+ # == Optional
47
+ #p.changes - A description of the release's latest changes.
48
+ #p.spec_extras - A hash of extra values to set in the gemspec.
49
+ p.extra_deps = [
50
+ ['mongrel', '>=0.3.13.3'],
51
+ ['camping', '>=1.5'],
52
+ ['RedCloth', '>=3.0.4'],
53
+ ['daemons', '>=1.0.3'],
54
+ ['sqlite3-ruby', '>=1.1.0.1'],
55
+ ['activerecord', '>=1.14.4']
56
+ ]
35
57
  end
36
58
 
37
-
38
- Rake::GemPackageTask.new(gem_spec) do |pkg|
39
- pkg.need_zip = false
40
- pkg.need_tar = false
41
- end
42
-
43
-
44
- desc "View tidy html from dev server in editor"
45
- task :tidy do
46
- system("curl http://localhost:3301/#{ENV['PAGE']} | tidy -i -wrap 1000 | #{ENV['VISUAL'] || ENV['EDITOR'] || 'vim' }")
47
- end
48
-
49
-
50
- desc "Clean up directory"
51
- task :clean => :clobber_package do
52
- rm 'deploy/junebug.db', :force => true
53
- rm 'deploy/junebug.log', :force => true
54
- Dir['deploy/dump/*'].each { |ext| rm ext }
55
- rm 'test/test.log', :force => true
56
- rm 'config.yml', :force => true
57
- end
58
-
59
-
60
- desc 'Test the campground.'
61
- Rake::TestTask.new(:test) do |t|
62
- # t.libs << 'lib'
63
- t.pattern = 'test/**/*_test.rb'
64
- t.verbose = true
65
- end
66
-
67
-
68
-
59
+ #rake test RUBY_FLAGS=''
69
60
 
70
61
 
71
62
 
@@ -247,6 +247,7 @@ body {
247
247
  background: #f4f4f4;
248
248
  border: 1px solid #ddd;
249
249
  padding: 8px 20px;
250
+ margin: 15px 0px;
250
251
  }
251
252
 
252
253
  /* http://longren.org/2006/09/27/wrapping-text-inside-pre-tags */
@@ -6,6 +6,7 @@ require 'camping/session'
6
6
 
7
7
  Camping.goes :Junebug
8
8
 
9
+ require 'junebug/version'
9
10
  require 'junebug/helpers'
10
11
  require 'junebug/models'
11
12
  require 'junebug/views'
@@ -17,8 +18,6 @@ require 'fileutils'
17
18
 
18
19
  module Junebug
19
20
  include Camping::Session
20
-
21
- VERSION='0.0.17'
22
21
 
23
22
  def self.create
24
23
  Junebug::Models.create_schema :assume => (Junebug::Models::Page.table_exists? ? 1.0 : 0.0)
@@ -1,4 +1,4 @@
1
- require 'junebug/diff'
1
+ require 'junebug/ext/diff'
2
2
 
3
3
  module Junebug::Controllers
4
4
 
@@ -29,16 +29,25 @@ module Junebug::Controllers
29
29
  render :edit
30
30
  end
31
31
 
32
+ # FIXME: no error checking, also no verify quicksave/readonly rights
32
33
  def post page_name
33
34
  redirect("#{Junebug.config['url']}/login") and return unless logged_in?
34
35
  if input.submit == 'save'
35
- attrs = { :body => input.post_body, :title => input.post_title, :user_id =>@state.user.id }
36
- attrs[:readonly] = input.post_readonly if is_admin?
37
- if Page.find_or_create_by_title(page_name).update_attributes( attrs )
38
- # redirect Show, input.post_title
39
- redirect "#{Junebug.config['url']}/#{input.post_title.gsub(/ /,'+')}"
36
+ if ! input.quicksave
37
+ attrs = { :body => input.post_body, :title => input.post_title, :user_id =>@state.user.id }
38
+ attrs[:readonly] = input.post_readonly if is_admin?
39
+ Page.find_or_create_by_title(page_name).update_attributes(attrs)
40
+ else
41
+ attrs = { :body => input.post_body }
42
+ attrs[:readonly] = input.post_readonly if is_admin?
43
+ page = Page.find_by_title(page_name)
44
+ current_version = page.find_version(page.version)
45
+ current_version.update_attributes(attrs)
46
+ page.without_revision { page.update_attributes(attrs) }
40
47
  end
41
- else
48
+ # redirect Show, input.post_title
49
+ redirect "#{Junebug.config['url']}/#{input.post_title.gsub(/ /,'+')}"
50
+ else # cancel
42
51
  redirect "#{Junebug.config['url']}/#{page_name.gsub(/ /,'+')}"
43
52
  end
44
53
  end
@@ -103,8 +112,10 @@ module Junebug::Controllers
103
112
  @v1 = @page.find_version(v1)
104
113
  @v2 = @page.find_version(v2)
105
114
 
106
- @v1_markup = ( @v1.body ? _markup( @v1.body ) : '' )
107
- @v2_markup = ( @v2.body ? _markup( @v2.body ) : '' )
115
+ #@v1_markup = ( @v1.body ? _markup( @v1.body ) : '' )
116
+ #@v2_markup = ( @v2.body ? _markup( @v2.body ) : '' )
117
+ @v1_markup = @v1.body || ''
118
+ @v2_markup = @v2.body || ''
108
119
 
109
120
  @difftext = diff( @v1_markup , @v2_markup)
110
121
 
@@ -157,7 +168,7 @@ module Junebug::Controllers
157
168
  @user = User.create :username=>input.username, :password=>input.password
158
169
  if @user.errors.empty?
159
170
  @state.user = @user
160
- redirect(Junebug.startpage)
171
+ input.return_to.blank? ? redirect(Junebug.startpage) : redirect(Junebug.config['url'] + input.return_to)
161
172
  return
162
173
  else
163
174
  @notice = @user.errors.full_messages[0]
File without changes
@@ -1,5 +1,5 @@
1
1
  require 'active_record'
2
- require 'junebug/acts_as_versioned'
2
+ require 'junebug/ext/acts_as_versioned'
3
3
 
4
4
  module Junebug::Models
5
5