EliteJournal 1.9.403 → 1.9.480
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.
- data/app/controllers/application.rb +6 -4
- data/app/controllers/atom_controller.rb +10 -17
- data/app/controllers/post_controller.rb +67 -36
- data/app/controllers/rss_controller.rb +12 -17
- data/app/controllers/tags_controller.rb +2 -2
- data/app/controllers/users_controller.rb +9 -3
- data/app/helpers/application_helper.rb +13 -23
- data/app/helpers/pagination_helper.rb +487 -0
- data/app/helpers/tags_helper.rb +1 -1
- data/app/models/post.rb +2 -0
- data/app/models/user.rb +4 -4
- data/app/views/account/info.rhtml +4 -0
- data/app/views/atom/feed.rxml +2 -2
- data/app/views/css/edit.rhtml +1 -1
- data/app/views/layouts/application.rhtml +5 -5
- data/app/views/{journal → post}/_comment.rhtml +1 -1
- data/app/views/{journal → post}/_post.rhtml +3 -3
- data/app/views/{journal → post}/_trackback.rhtml +0 -0
- data/app/views/{journal → post}/error.rhtml +0 -0
- data/app/views/post/index.rhtml +5 -0
- data/app/views/post/reply.rhtml +21 -12
- data/app/views/post/replyxml.rxml +2 -2
- data/app/views/{journal → post}/view.rhtml +0 -0
- data/app/views/rss/{index.rxml → feed.rxml} +1 -1
- data/app/views/users/index.rhtml +1 -1
- data/config/environment.rb +22 -9
- data/config/routes.rb +36 -0
- data/db/db-mysql.sql +2 -0
- data/db/db-postgresql.sql +2 -0
- data/db/db-sqlite.sql +2 -0
- data/db/development_structure.sql +67 -65
- data/elitejournal +3 -40
- data/public/dispatch.rb +2 -2
- metadata +12 -22
- data/app/controllers/journal_controller.rb +0 -53
- data/app/helpers/journal_helper.rb +0 -2
- data/app/views/journal/index.rhtml +0 -1
    
        data/elitejournal
    CHANGED
    
    | @@ -12,8 +12,8 @@ end | |
| 12 12 |  | 
| 13 13 | 
             
            OPTIONS = {
         | 
| 14 14 | 
             
              :port        => 3000,
         | 
| 15 | 
            -
              :ip          => " | 
| 16 | 
            -
              :environment => " | 
| 15 | 
            +
              :ip          => "0.0.0.0",
         | 
| 16 | 
            +
              :environment => "production",
         | 
| 17 17 | 
             
              :server_root => File.expand_path(File.dirname(__FILE__) + "/public/"),
         | 
| 18 18 | 
             
              :server_type => fork_available ? WEBrick::Daemon : WEBrick::SimpleServer,
         | 
| 19 19 | 
             
            }
         | 
| @@ -89,44 +89,7 @@ ENV["RAILS_ENV"] = 'geminstall' | |
| 89 89 | 
             
            require File.dirname(__FILE__) + "/config/environment"
         | 
| 90 90 | 
             
            require 'webrick_server'
         | 
| 91 91 |  | 
| 92 | 
            -
             | 
| 93 | 
            -
            class DispatchServlet
         | 
| 94 | 
            -
              alias :orig_do_GET :do_GET
         | 
| 95 | 
            -
             | 
| 96 | 
            -
              def do_GET(req, res)
         | 
| 97 | 
            -
                if /\/(\d{4})\/(\d{1,2})\/(\d{1,2})\/?/ =~ req.request_uri.path
         | 
| 98 | 
            -
                  req.request_uri.path = "/dispatch.rb"
         | 
| 99 | 
            -
                  req.request_uri.query = "controller=journal&action=range&year=#{$1}&month=#{$2}&day=#{$3}"
         | 
| 100 | 
            -
                  handle_dispatch(req, res)
         | 
| 101 | 
            -
                  return
         | 
| 102 | 
            -
                end
         | 
| 103 | 
            -
                if /\/(\d{4})\/(\d{1,2})\/?/ =~ req.request_uri.path
         | 
| 104 | 
            -
                  req.request_uri.path = "/dispatch.rb"
         | 
| 105 | 
            -
                  req.request_uri.query = "controller=journal&action=range&year=#{$1}&month=#{$2}"
         | 
| 106 | 
            -
                  handle_dispatch(req, res)
         | 
| 107 | 
            -
                  return
         | 
| 108 | 
            -
                end
         | 
| 109 | 
            -
                if /\/(\d{4})\/?/ =~ req.request_uri.path
         | 
| 110 | 
            -
                  req.request_uri.path = "/dispatch.rb"
         | 
| 111 | 
            -
                  req.request_uri.query = "controller=journal&action=range&year=#{$1}"
         | 
| 112 | 
            -
                  handle_dispatch(req, res)
         | 
| 113 | 
            -
                  return
         | 
| 114 | 
            -
                end
         | 
| 115 | 
            -
                if /\/view\/(\d+)\/?/ =~ req.request_uri.path
         | 
| 116 | 
            -
                  req.request_uri.path = "/dispatch.rb"
         | 
| 117 | 
            -
                  req.request_uri.query = "controller=journal&action=view&id=#{$1}"
         | 
| 118 | 
            -
                  handle_dispatch(req, res)
         | 
| 119 | 
            -
                  return
         | 
| 120 | 
            -
                end
         | 
| 121 | 
            -
             | 
| 122 | 
            -
                orig_do_GET(req, res)
         | 
| 123 | 
            -
              end
         | 
| 124 | 
            -
            end
         | 
| 125 | 
            -
             | 
| 126 | 
            -
             | 
| 127 | 
            -
             | 
| 128 | 
            -
             | 
| 129 | 
            -
            OPTIONS[:index_controller] = "journal"
         | 
| 92 | 
            +
            OPTIONS['working_directory'] = File.expand_path(RAILS_ROOT)
         | 
| 130 93 |  | 
| 131 94 | 
             
            puts "=> Elite Journal started on http://#{OPTIONS[:ip]}:#{OPTIONS[:port]}"
         | 
| 132 95 | 
             
            DispatchServlet.dispatch(OPTIONS)
         | 
    
        data/public/dispatch.rb
    CHANGED
    
    | @@ -6,5 +6,5 @@ require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ | |
| 6 6 | 
             
            # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
         | 
| 7 7 | 
             
            require "dispatcher"
         | 
| 8 8 |  | 
| 9 | 
            -
            ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) }
         | 
| 10 | 
            -
            Dispatcher.dispatch
         | 
| 9 | 
            +
            ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
         | 
| 10 | 
            +
            Dispatcher.dispatch
         | 
    
        metadata
    CHANGED
    
    | @@ -1,10 +1,10 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 | 
            -
            rubygems_version: 0.8. | 
| 2 | 
            +
            rubygems_version: 0.8.6
         | 
| 3 3 | 
             
            specification_version: 1
         | 
| 4 4 | 
             
            name: EliteJournal
         | 
| 5 5 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 6 | 
            -
              version: 1.9. | 
| 7 | 
            -
            date: 2005- | 
| 6 | 
            +
              version: 1.9.480
         | 
| 7 | 
            +
            date: 2005-03-04
         | 
| 8 8 | 
             
            summary: "Easy to install, multi-user blog software"
         | 
| 9 9 | 
             
            require_paths: 
         | 
| 10 10 | 
             
              - lib
         | 
| @@ -39,7 +39,6 @@ files: | |
| 39 39 | 
             
              - app/controllers/css_controller.rb
         | 
| 40 40 | 
             
              - app/controllers/draft_controller.rb
         | 
| 41 41 | 
             
              - app/controllers/image_controller.rb
         | 
| 42 | 
            -
              - app/controllers/journal_controller.rb
         | 
| 43 42 | 
             
              - app/controllers/link_controller.rb
         | 
| 44 43 | 
             
              - app/controllers/ping_controller.rb
         | 
| 45 44 | 
             
              - app/controllers/post_controller.rb
         | 
| @@ -55,8 +54,8 @@ files: | |
| 55 54 | 
             
              - app/helpers/css_helper.rb
         | 
| 56 55 | 
             
              - app/helpers/draft_helper.rb
         | 
| 57 56 | 
             
              - app/helpers/image_helper.rb
         | 
| 58 | 
            -
              - app/helpers/journal_helper.rb
         | 
| 59 57 | 
             
              - app/helpers/link_helper.rb
         | 
| 58 | 
            +
              - app/helpers/pagination_helper.rb
         | 
| 60 59 | 
             
              - app/helpers/ping_helper.rb
         | 
| 61 60 | 
             
              - app/helpers/post_helper.rb
         | 
| 62 61 | 
             
              - app/helpers/rss_helper.rb
         | 
| @@ -84,19 +83,19 @@ files: | |
| 84 83 | 
             
              - app/views/draft/edit.rhtml
         | 
| 85 84 | 
             
              - app/views/draft/list.rhtml
         | 
| 86 85 | 
             
              - app/views/draft/new.rhtml
         | 
| 87 | 
            -
              - app/views/journal/_comment.rhtml
         | 
| 88 | 
            -
              - app/views/journal/_post.rhtml
         | 
| 89 | 
            -
              - app/views/journal/_trackback.rhtml
         | 
| 90 | 
            -
              - app/views/journal/error.rhtml
         | 
| 91 | 
            -
              - app/views/journal/index.rhtml
         | 
| 92 | 
            -
              - app/views/journal/view.rhtml
         | 
| 93 86 | 
             
              - app/views/layouts/application.rhtml
         | 
| 94 87 | 
             
              - app/views/link/list.rhtml
         | 
| 95 88 | 
             
              - app/views/link/new.rhtml
         | 
| 89 | 
            +
              - app/views/post/_comment.rhtml
         | 
| 90 | 
            +
              - app/views/post/_post.rhtml
         | 
| 96 91 | 
             
              - app/views/post/_reply.rhtml
         | 
| 92 | 
            +
              - app/views/post/_trackback.rhtml
         | 
| 97 93 | 
             
              - app/views/post/edit.rhtml
         | 
| 94 | 
            +
              - app/views/post/error.rhtml
         | 
| 95 | 
            +
              - app/views/post/index.rhtml
         | 
| 98 96 | 
             
              - app/views/post/new.rhtml
         | 
| 99 97 | 
             
              - app/views/post/reply.rhtml
         | 
| 98 | 
            +
              - app/views/post/view.rhtml
         | 
| 100 99 | 
             
              - app/views/tags/index.rhtml
         | 
| 101 100 | 
             
              - app/views/tags/no_completions.rhtml
         | 
| 102 101 | 
             
              - app/views/tags/search.rhtml
         | 
| @@ -110,8 +109,9 @@ files: | |
| 110 109 | 
             
              - app/views/post/postxml.rxml
         | 
| 111 110 | 
             
              - app/views/post/replyxml.rxml
         | 
| 112 111 | 
             
              - app/views/post/toggle_commentingxml.rxml
         | 
| 113 | 
            -
              - app/views/rss/ | 
| 112 | 
            +
              - app/views/rss/feed.rxml
         | 
| 114 113 | 
             
              - app/views/tags/addxml.rxml
         | 
| 114 | 
            +
              - config/routes.rb
         | 
| 115 115 | 
             
              - config/app.yml
         | 
| 116 116 | 
             
              - config/database.yml
         | 
| 117 117 | 
             
              - config/environment.rb
         | 
| @@ -160,16 +160,6 @@ dependencies: | |
| 160 160 | 
             
                      - !ruby/object:Gem::Version 
         | 
| 161 161 | 
             
                        version: 2.0.11
         | 
| 162 162 | 
             
                  version: 
         | 
| 163 | 
            -
              - !ruby/object:Gem::Dependency 
         | 
| 164 | 
            -
                name: rails
         | 
| 165 | 
            -
                version_requirement: 
         | 
| 166 | 
            -
                version_requirements: !ruby/object:Gem::Version::Requirement 
         | 
| 167 | 
            -
                  requirements: 
         | 
| 168 | 
            -
                    - 
         | 
| 169 | 
            -
                      - ">="
         | 
| 170 | 
            -
                      - !ruby/object:Gem::Version 
         | 
| 171 | 
            -
                        version: 0.9.5
         | 
| 172 | 
            -
                  version: 
         | 
| 173 163 | 
             
              - !ruby/object:Gem::Dependency 
         | 
| 174 164 | 
             
                name: sqlite-ruby
         | 
| 175 165 | 
             
                version_requirement: 
         | 
| @@ -1,53 +0,0 @@ | |
| 1 | 
            -
            class JournalController < ApplicationController
         | 
| 2 | 
            -
              def index
         | 
| 3 | 
            -
                @posts = Post.find_all(nil, 'created_at desc', @app_config['main']['num_posts'])
         | 
| 4 | 
            -
              end
         | 
| 5 | 
            -
             | 
| 6 | 
            -
              # View one specific post, using the post partial, and its comments using the comment
         | 
| 7 | 
            -
              # partial.
         | 
| 8 | 
            -
              def view
         | 
| 9 | 
            -
                begin
         | 
| 10 | 
            -
                  @post     = Post.find(@params['id'])
         | 
| 11 | 
            -
                  @user     = @post.user
         | 
| 12 | 
            -
                  @comments = @post.find_all_in_comments("comment_id=0")
         | 
| 13 | 
            -
                rescue
         | 
| 14 | 
            -
                  redirect_to_main
         | 
| 15 | 
            -
                end
         | 
| 16 | 
            -
              end
         | 
| 17 | 
            -
             | 
| 18 | 
            -
              # This is used for fancy URL viewing with URLs of the format /year/month/day.
         | 
| 19 | 
            -
              def range
         | 
| 20 | 
            -
                unless @params['year']
         | 
| 21 | 
            -
                  @error = 'Invalid date.'
         | 
| 22 | 
            -
                  render 'journal/error'
         | 
| 23 | 
            -
                  return
         | 
| 24 | 
            -
                end
         | 
| 25 | 
            -
                if @params['day'] and !@params['month']
         | 
| 26 | 
            -
                   @error = 'Invalid date.'
         | 
| 27 | 
            -
                  render 'journal/error'
         | 
| 28 | 
            -
                  return
         | 
| 29 | 
            -
                end
         | 
| 30 | 
            -
             | 
| 31 | 
            -
                year   = @params['year']
         | 
| 32 | 
            -
                fmonth = @params['month'] || '01'
         | 
| 33 | 
            -
                tmonth = @params['month'] ? fmonth : '12'
         | 
| 34 | 
            -
                fday   = @params['day'] || '01'
         | 
| 35 | 
            -
                tday   = @params['day'] ? fday : '31'
         | 
| 36 | 
            -
                
         | 
| 37 | 
            -
                  
         | 
| 38 | 
            -
                if @params['day']
         | 
| 39 | 
            -
                  tday = fday
         | 
| 40 | 
            -
                else # I don't like this at all.
         | 
| 41 | 
            -
                  if tmonth == '02'
         | 
| 42 | 
            -
                    tday = '28' 
         | 
| 43 | 
            -
                  elsif ['01', '03', '05', '07', '08', '10', '12'].include? tmonth
         | 
| 44 | 
            -
                    tday = '31'
         | 
| 45 | 
            -
                  else
         | 
| 46 | 
            -
                    tday = '30'
         | 
| 47 | 
            -
                  end
         | 
| 48 | 
            -
                end
         | 
| 49 | 
            -
             | 
| 50 | 
            -
                @posts = Post.find_all(["created_at BETWEEN '%s-%s-%s 00:00:00' AND '%s-%s-%s 23:59:59'", year, fmonth, fday, year, tmonth, tday], 'created_at DESC') rescue []
         | 
| 51 | 
            -
                render_action 'index'
         | 
| 52 | 
            -
              end
         | 
| 53 | 
            -
            end
         | 
| @@ -1 +0,0 @@ | |
| 1 | 
            -
            <%= render_collection_of_partials 'journal/post', @posts %>
         |