GithubHelp home page GithubHelp logo

gollum_rails's Introduction

Gollum for Rails

Build Status Dependency Status Gem Version Coverage Status Code Climate

gollum_rails combines the git-powered wiki software gollum with the extreme popular webframework rails. It improves the lightweight "gollum" experience which is quite awesome.

with gollum_rails you can:

  • Define your own views
  • Use your Rails layouts
  • Embed gollum it without mounting any rack application
  • Use own preprocession e.g. background workers for data procession
  • Use user authentication e.g. Devise or Authlogic

For an Editor to use with gollum_rails I personally like the gollum_editor

It provides nearly the same features as the official editor.

SYSTEM REQUIREMENTS

  • Python 2.5+ (2.7.3 recommended)
  • Ruby 1.9.3+ (2.0.0 recommended)
  • Unix like operating system (OS X, Ubuntu, Debian, and more)
  • Will not work on Windows (see gollum)

DEVELOPER

Very cool. Just fork this repository and send me pull requests.

QUICK START

Clone the repository:

$ git clone git://github.com/nirnanaaa/gollum_rails.git

Run the Bundler:

$ bundle install

TESTING

First use the Quick Start to install all dependencies. All tests are stored under the spec/ directory.

To run tests just use the rspec command:

$ bundle exec rspec

LICENSE

AGPLv3

gollum_rails is licensed under the AGPL license.

Copyright (C) 2013 Florian Kasper

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

gollum_rails's People

Contributors

fkasper avatar katafrakt avatar nirnanaaa avatar shahin70000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gollum_rails's Issues

ArgumentError on setup with Hash

If I initialize GollumRails::Setup with the Hash method:

2.1.5 :001 > GollumRails::Setup.build(repository: "utils/wiki.git")
ArgumentError: When assigning attributes, you must pass a hash as an argument.
        from /home/fkasper/files/gollum_rails/lib/gollum_rails/setup.rb:31:in `build'
        from (irb):1
        from /home/fkasper/.rvm/rubies/ruby-2.1.5/bin/irb:11:in `<main>'

This is probably because of missing activesupport

Install instructions don't work

Moi, nice sounding project, so i thought i let you know that it's impossible to try out with current versions.
I did rails new and then added the gollum_rails gem and bundled:

gollum_rails (>= 0) ruby depends on
  gollum-lib (~> 4.0.1) ruby depends on
    gollum-grit_adapter (>= 0.1.1, ~> 0.1) ruby depends on
      gitlab-grit (>= 2.7.1, ~> 2.7) ruby depends on
        mime-types (~> 1.15) ruby

rails (= 4.2.0) ruby depends on
  actionmailer (= 4.2.0) ruby depends on
    mail (>= 2.5.4, ~> 2.5) ruby depends on
      mime-types (2.4.3)

I tried with 3.2 and got it up (in a new app) and it doesn't have any routes!
I can see that approach, but it should be mentioned. The install instructions make it sound like gem and path and good to go.

So i cloned the repository and stumbled again. It's not an app.

Maybe my confusion comes from the readme, where it says you "can define your own views".
I assumed that means there are views which i can redefine/overwrite.
It looks like it would be better to say "you must define your own views".

btw: i've just written a few engines and this would be a good candidate for an engine. Let me know if you want some help / talk .

Torsten

1.5.9 has breaking changes

Using 1.5.9, I attempted to follow the Usage documentation.

I ended up getting "TypeError (no implicit conversion of nil into Hash):" on a Gollum Page.
Logged into Rails Console, I get this stack trace:

TypeError: no implicit conversion of nil into Hash
    from /Users/juliannadeau/.rvm/gems/ruby-2.0.0-p353/gems/gollum-lib-2.0.0/lib/gollum-lib/wiki.rb:199:in `merge'
    from /Users/juliannadeau/.rvm/gems/ruby-2.0.0-p353/gems/gollum-lib-2.0.0/lib/gollum-lib/wiki.rb:199:in `initialize'
    from /Users/juliannadeau/.rvm/gems/ruby-2.0.0-p353/gems/gollum_rails-1.5.9/lib/gollum_rails/store.rb:24:in `new'
    from /Users/juliannadeau/.rvm/gems/ruby-2.0.0-p353/gems/gollum_rails-1.5.9/lib/gollum_rails/store.rb:24:in `wiki'
    from /Users/juliannadeau/.rvm/gems/ruby-2.0.0-p353/gems/gollum_rails-1.5.9/lib/gollum_rails/finders.rb:61:in `all'
    from (irb):1
    from /Users/juliannadeau/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.3/lib/rails/commands/console.rb:90:in `start'
    from /Users/juliannadeau/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.3/lib/rails/commands/console.rb:9:in `start'
    from /Users/juliannadeau/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.3/lib/rails/commands.rb:62:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

Reverting to 1.5.8 works fine.

Routing with gollum_rails

How can you create routes to your pages in config/routes.rb?

Also is nested routing supported? Ie, if a page is created in a subdirectory (page_directory/category1/page1) can there exist a route like: 'example.com/pages/category1/page1?

Reading module constant

the constants for the modules GollumRails::Adapters::ActiveModel and GollumRails::Adapters::Gollum should use a readable version of constant VERSION

config.startup is ignored

I looked through lib/gollum_rails/setup.rb, and it looks like config.startup is never checked. I worked around it, but it might be nice to fix this someday.

add create (create!) functions

instead of .new and .save you must be able to use .create(data) as a singleton method.

Implement new Page caller ( callable by .new.create /.new.create! / .create / .create!)

Folder not changed when using the `all` method

>> Page.all
=> [#<Page:0x007f92d4bf59c8 @gollum_page=#<Gollum::Page:70134305632560 gollum_redmine (markdown) @wiki="/Users/mosny/Documents/production.git">, @name="gollum_redmine", @content="---\ntitle: GollumRedmine\ndate: 2014-01-30 14:21:00 GMT+02\ndescription: \"What is Gollum for Redmine and how to install this piece of Software\"\nkeywords:\n  - Gollum\n  - redmine\n  - plugin\n  - github\n  - nirnanaaa\n  - gollum_redmine\n  - wiki\n  - commit\n---\n\n### What is GollumRedmine?\n\ngollum_redmine is a plugin for redmine. It includes the following features:  \n\n* Store your meeting protocols in git\n* Display your wiki in redmine\n* Create project descriptions for your projects\n* Commit as your redmine user\n\n\n### How can I get this?\n\nSimply download it from my GitHub page.\n\n```sh\ncd /path/to/your/redmine/folder\ncd plugins\ngit clone https://github.com/nirnanaaa/gollum_redmine.git gollum\n```\n\n### How does it work?\n\nIt uses your existing wiki infrastructure and boosts it to another level. All the above features  \nare stored in this repository. You can configure them under the `Administration > Plugins` tab. \n\nOnce these variables are configured you need to restart your Rails application.\n\nNavigate to \"Wiki\" in the top menu. Now you should see your defined landing page.\n\n\n", @format=:markdown>, #<Page:0x007f92d4bef938 @gollum_page=#<Gollum::Page:70134305631780 installing_nginx_spdy (markdown) @wiki="/Users/mosny/Documents/production.git">, @name="installing_nginx_spdy", @content="---\ntitle: Installieren des SPDY2/3 Modules für NGINX auf Debian\ndate: 2014-02-20 19:14:00 GMT+02\ndescription: \"How to install Nginx with SPDY3 module on Debian 7.0 Wheezy\"\nkeywords:\n  - nginx\n  - spdy\n  - spdy3\n  - spdy-nginx\n  - chrome\n  - opera\n  - firefox\n  - internet\n  - pcre\n---\n\nSPDY ist ein Protokoll, welches von Google eingeführt wurde um die Ladezeiten von Websiten\nenorm zu reduzieren. Es arbeitet Hand in Hand mit HTTPS damit ältere Browser ebenfalls bedient werden können.\n\nSPDY3 benötigt folgende minimalen Browser Anforderungen:\n\n* Firefox 27\n* Google Chrome\n* Opera 12.10\n* Internet Explorer 11 auf Windows 8.1\n\n\nBeim Internet Explorer 11 auf Windows 8.1 kann es vereinzelt auftreten dass beim ersten Laden der Fehler \n\"Seite nicht gefunden\" angezeigt wird. In diesem Falle einfach neu laden dann sollte es funktionieren.\n\n\n### Installation\n\nAls erstes installieren wir das normale Debian-NGINX-Paket wie folgt:\n\n```sh\n# apt-get install nginx\n```\n\n\nAnschließend müssen wir das neue Binary komplieren. Keine Angst bei meinen Installationen verlief dies stets einwandfrei.\n\n\nWir laden uns den Nginx Quellcode von der Offiziellen Seite: [[http://nginx.org/en/download.html]] . Man sollte darauf achten,\ndass man Version `>= 1.5.10` verwendet, da in dieser erst der Standard 3.1 von SPDY eingeführt wurde.\n\n```sh\nwget http://nginx.org/download/nginx-1.5.10.tar.gz\ntar xfvz nginx-1.5.10.tar.gz\ncd nginx-1.5.10.tar.gz\n```\n\nUm die SPDY Funktionalität zu aktivieren benötigt man beim Konfigurieren den Schalter `--with-http_spdy_module`.\n\nEine Liste weiterer Konfigurationsoptionen findet man unter [[http://wiki.nginx.org/InstallOptions]] oder [[http://nginx.org/en/docs/configure.html]]\n\nZum Konfigurieren einfach den `./configure` Command ausführen:\n\n```sh\n./configure --prefix=/ \\\n--sbin-path=/usr/sbin/nginx \\\n--conf-path=/etc/nginx/nginx.conf \\\n--pid-path=/var/run/nginx.pid \\\n--error-log-path=/var/log/nginx/error.log \\\n--http-log-path=/var/log/nginx/access.log \\\n--user=www-data \\\n--group=www-data \\\n--with-http_ssl_module \\\n--with-http_gzip_static_module \\\n--with-http_stub_status_module \\\n--with-pcre \\\n--with-http_realip_module \\\n--with-file-aio \\\n--with-http_spdy_module  \\\n--with-ipv6\n```\n\nHier wird SPDY, SSL, IPv6, PCRE(RegExpressions), Gzip und einige weitere für mich nützliche Optionen aktiviert.\n\nDie `--with-pcre` option erfordert zusätzlich das Paket `libpcre`, welches ganz einfach folgendermaßen installiert wird:\n\n```sh\n# apt-get install libpcre3 libpcre3-dev\n```\n\nNatürlich kann man hier auch selbst Anpassungen nach eigenem Ermessen vornehmen.\nWichtig hierbei ist nur dass das `--with-http_spdy_module` und das `--with-http_ssl_module` notwendig sind um SPDY\nlauffähig zu bekommen.\n\nAnschließend kann man das Ganze bauen:\n\n```sh\nmake\n```\n\nNun muss man das Binary an die Stelle des orginalen NGINX binaries kopieren:\n\n```sh\ncp objs/nginx `which nginx`\nln -s /etc/nginx /var/lib/nginx/conf\nln -s /var/log/nginx /var/lib/nginx/logs\n```\n\nIm Anschluss muss noch die `/etc/nginx/nginx.conf` angepasst werden:\n\n```nginx\npid /var/run/nginx.pid;\nlock_file /var/lock/nginx.lock;\n```\n\nJetzt kann man den Server neustarten. Dies sollte ohne Fehler ablaufen:\n\n```sh\n# service nginx restart\n```\n\n### SPDY testen\n\nUm SPDY zu testen benötigt man ein SSL Zertifikat. Dieses sollte nicht selbssigniert sein, ist aber trotzdem möglich.\n\nWenn man das SSL Zertifikat hat kann man die Konfiguration testen:\n\n```sh\nvi /etc/nginx/sites-enabled/spdytest\nserver {\n    listen 443 ssl spdy;\n    server_name your_domain_name.com;\n    ssl on;\n    ssl_certificate /path-to-your-cert.crt;\n    ssl_certificate_key /path-to-your-key.key;\n    root /tmp/spdy_test;\n}\n```\n\nAnschließend erstellen wir den Document root + Test-Datei:\n\n\n```sh\nmkdir /tmp/spdy_test\necho it works > /tmp/spdy_test/index.html\n```\n\nJetzt kann man per [[http://spdycheck.org/]] die Funktionalität testen.\n\n\n## Wichtig bei NGINX Updates\n\nSollte es ein Update der Distribution geben, so muss das Binary erneut kopiert werden.\n\n\n\n\n\n\n", @format=:markdown>]
>> Page.all(folder: 'articles')
=> [#<Page:0x007f92d4b7db80 @gollum_page=#<Gollum::Page:70134305387120 gollum_redmine (markdown) @wiki="/Users/mosny/Documents/production.git">, @name="gollum_redmine", @content="---\ntitle: GollumRedmine\ndate: 2014-01-30 14:21:00 GMT+02\ndescription: \"What is Gollum for Redmine and how to install this piece of Software\"\nkeywords:\n  - Gollum\n  - redmine\n  - plugin\n  - github\n  - nirnanaaa\n  - gollum_redmine\n  - wiki\n  - commit\n---\n\n### What is GollumRedmine?\n\ngollum_redmine is a plugin for redmine. It includes the following features:  \n\n* Store your meeting protocols in git\n* Display your wiki in redmine\n* Create project descriptions for your projects\n* Commit as your redmine user\n\n\n### How can I get this?\n\nSimply download it from my GitHub page.\n\n```sh\ncd /path/to/your/redmine/folder\ncd plugins\ngit clone https://github.com/nirnanaaa/gollum_redmine.git gollum\n```\n\n### How does it work?\n\nIt uses your existing wiki infrastructure and boosts it to another level. All the above features  \nare stored in this repository. You can configure them under the `Administration > Plugins` tab. \n\nOnce these variables are configured you need to restart your Rails application.\n\nNavigate to \"Wiki\" in the top menu. Now you should see your defined landing page.\n\n\n", @format=:markdown>, #<Page:0x007f92d4b7c1b8 @gollum_page=#<Gollum::Page:70134305386240 installing_nginx_spdy (markdown) @wiki="/Users/mosny/Documents/production.git">, @name="installing_nginx_spdy", @content="---\ntitle: Installieren des SPDY2/3 Modules für NGINX auf Debian\ndate: 2014-02-20 19:14:00 GMT+02\ndescription: \"How to install Nginx with SPDY3 module on Debian 7.0 Wheezy\"\nkeywords:\n  - nginx\n  - spdy\n  - spdy3\n  - spdy-nginx\n  - chrome\n  - opera\n  - firefox\n  - internet\n  - pcre\n---\n\nSPDY ist ein Protokoll, welches von Google eingeführt wurde um die Ladezeiten von Websiten\nenorm zu reduzieren. Es arbeitet Hand in Hand mit HTTPS damit ältere Browser ebenfalls bedient werden können.\n\nSPDY3 benötigt folgende minimalen Browser Anforderungen:\n\n* Firefox 27\n* Google Chrome\n* Opera 12.10\n* Internet Explorer 11 auf Windows 8.1\n\n\nBeim Internet Explorer 11 auf Windows 8.1 kann es vereinzelt auftreten dass beim ersten Laden der Fehler \n\"Seite nicht gefunden\" angezeigt wird. In diesem Falle einfach neu laden dann sollte es funktionieren.\n\n\n### Installation\n\nAls erstes installieren wir das normale Debian-NGINX-Paket wie folgt:\n\n```sh\n# apt-get install nginx\n```\n\n\nAnschließend müssen wir das neue Binary komplieren. Keine Angst bei meinen Installationen verlief dies stets einwandfrei.\n\n\nWir laden uns den Nginx Quellcode von der Offiziellen Seite: [[http://nginx.org/en/download.html]] . Man sollte darauf achten,\ndass man Version `>= 1.5.10` verwendet, da in dieser erst der Standard 3.1 von SPDY eingeführt wurde.\n\n```sh\nwget http://nginx.org/download/nginx-1.5.10.tar.gz\ntar xfvz nginx-1.5.10.tar.gz\ncd nginx-1.5.10.tar.gz\n```\n\nUm die SPDY Funktionalität zu aktivieren benötigt man beim Konfigurieren den Schalter `--with-http_spdy_module`.\n\nEine Liste weiterer Konfigurationsoptionen findet man unter [[http://wiki.nginx.org/InstallOptions]] oder [[http://nginx.org/en/docs/configure.html]]\n\nZum Konfigurieren einfach den `./configure` Command ausführen:\n\n```sh\n./configure --prefix=/ \\\n--sbin-path=/usr/sbin/nginx \\\n--conf-path=/etc/nginx/nginx.conf \\\n--pid-path=/var/run/nginx.pid \\\n--error-log-path=/var/log/nginx/error.log \\\n--http-log-path=/var/log/nginx/access.log \\\n--user=www-data \\\n--group=www-data \\\n--with-http_ssl_module \\\n--with-http_gzip_static_module \\\n--with-http_stub_status_module \\\n--with-pcre \\\n--with-http_realip_module \\\n--with-file-aio \\\n--with-http_spdy_module  \\\n--with-ipv6\n```\n\nHier wird SPDY, SSL, IPv6, PCRE(RegExpressions), Gzip und einige weitere für mich nützliche Optionen aktiviert.\n\nDie `--with-pcre` option erfordert zusätzlich das Paket `libpcre`, welches ganz einfach folgendermaßen installiert wird:\n\n```sh\n# apt-get install libpcre3 libpcre3-dev\n```\n\nNatürlich kann man hier auch selbst Anpassungen nach eigenem Ermessen vornehmen.\nWichtig hierbei ist nur dass das `--with-http_spdy_module` und das `--with-http_ssl_module` notwendig sind um SPDY\nlauffähig zu bekommen.\n\nAnschließend kann man das Ganze bauen:\n\n```sh\nmake\n```\n\nNun muss man das Binary an die Stelle des orginalen NGINX binaries kopieren:\n\n```sh\ncp objs/nginx `which nginx`\nln -s /etc/nginx /var/lib/nginx/conf\nln -s /var/log/nginx /var/lib/nginx/logs\n```\n\nIm Anschluss muss noch die `/etc/nginx/nginx.conf` angepasst werden:\n\n```nginx\npid /var/run/nginx.pid;\nlock_file /var/lock/nginx.lock;\n```\n\nJetzt kann man den Server neustarten. Dies sollte ohne Fehler ablaufen:\n\n```sh\n# service nginx restart\n```\n\n### SPDY testen\n\nUm SPDY zu testen benötigt man ein SSL Zertifikat. Dieses sollte nicht selbssigniert sein, ist aber trotzdem möglich.\n\nWenn man das SSL Zertifikat hat kann man die Konfiguration testen:\n\n```sh\nvi /etc/nginx/sites-enabled/spdytest\nserver {\n    listen 443 ssl spdy;\n    server_name your_domain_name.com;\n    ssl on;\n    ssl_certificate /path-to-your-cert.crt;\n    ssl_certificate_key /path-to-your-key.key;\n    root /tmp/spdy_test;\n}\n```\n\nAnschließend erstellen wir den Document root + Test-Datei:\n\n\n```sh\nmkdir /tmp/spdy_test\necho it works > /tmp/spdy_test/index.html\n```\n\nJetzt kann man per [[http://spdycheck.org/]] die Funktionalität testen.\n\n\n## Wichtig bei NGINX Updates\n\nSollte es ein Update der Distribution geben, so muss das Binary erneut kopiert werden.\n\n\n\n\n\n\n", @format=:markdown>]

It does not change the folder to :articles

Last Changed by Issue

Hi, it looks like your "last_changed_by" method in /lib/gollum_rails/core.rb
gives the first user that changed it.

I think the history array is in descending order so "%s <%s>" % [history.last.author.name, history.last.author.email] should be "%s <%s>" % [history.first.author.name, history.first.author.email]

Thanks.

Unclear folder support status

Firstly thanks for writing a nice gem.

Since usage example contained reference to Page.all(:folder,'articles'), I tried to make gollum_rails work with folders but I feel it's not really a trivial task.

  • Rails assume Page resources are accessible with "pages/:id" combination
    • path helpers messed up
      Overriding helpers in page_helper.rb solved

    • rails routes require customization

  match "pages/:id/edit", id: /.*/, via: :get, to: "pages#edit", as: :edit_page
  match "pages/", id: /.*/, via: :patch, to: "pages#update"
  match "pages/", id: /.*/, via: :get, to: "pages#show", as: :page, anchor: false
  • Once a file is created under a folder, all file creations thereafter happen under that folder.
    Create a file fol/test => url method returns fol/test
    Create a file at_root => url method returns fol/at_root

  • Using folder breaks rails form builders

I don't know much about rails, so I could be doing something wildly wrong.
And I guess I can solve the issues with some effort, but not too easily...
It would be nice if you could leave us some note on how to deal with folder related issues or simple warn that it's not supported.
Thanks for reading.

Edited

Note for myself and for others

  • form builder post address issue in edit form
    Explicitly provide url
<%= form_with(model: @page, url:"/"[email protected],local: true ) do |form| %>
  • Getting stuck at a folder
  include GollumRails::Core::ClassMethods
  def index
    reset_folder
    @pages = Page.all
  end

Using revert_page method

controller

    def revert
     # before_action sets @page prior to revert method call
      r = Page.wiki.revert_page(@page, params[:sha],@page.current_version)
      if r == nil|| r == false
        flash[:danger] = "Failed to revert the page"
      else
        flash[:success] = "Page successfully reverted"
      end
      path = "/"+page_path(@page).to_s
      redirect_to path
    end

model

    class Page < GollumRails::Page
      def url
        "pages/#{super}"
      end
      def path
        Page.wiki.path
      end
      def self.strip_filename(filename)
        ::File.basename(filename, ::File.extname(filename))
      end
      def filename_stripped
        self.class.strip_filename(filename)
      end
    end

erb template example for revert page action

    <head>
    <link rel="stylesheet" type="text/css" href="/dist/diff2html.css">
    <!-- Javascripts -->
    <script type="text/javascript" src="/dist/diff2html.js"></script>
    <script type="text/javascript" src="/dist/diff2html-ui.js"></script>
    </head>
    <% count = 0 %>
    <%= prv_sha = @page.current_version %>
    <% if @page != nil %>
      <% for h in @page.history[[email protected]] do %>
        <h3><%= @page.history[count].author.name %></h3>

        <div style="display:block;">
        <%= button_to 'Revert to this', 
          {controller: "pages",
           action: "revert", 
           sha: "#{h.sha}"
          },
          method: :post,
          style: "width:200px;float:right;margin:10px;", 
          class: "btn btn-primary",
          type: "button"%>
        </div>
        <div id="diff_output<%= count %>" [innerHtml]="outputHtml"></div>
       <script>
        var inputString = "<%= escape_javascript(@page.compare_commits(h.sha,prv_sha)) %>";
        var diff2htmlUi = new Diff2HtmlUI( {diff:  inputString }); 
        diff2htmlUi.draw('div#diff_output<%= count %>', {inputFormat: 'json', showFiles: true, matching: 'lines'});
       </script>
      <% count += 1 %>
      <% prv_sha = h.sha %>
      <% end %>
    <% end %>

I experienced some troubles using @page.history.
@page.history.first.sha contains the sha for the latest commit.
Page.wiki.revert_page(@page, @page.history.first.sha,@page.current_version) throws no such method diff error at repo.diff(sha2, sha1, path).first.diff as repo.diff(sha2, sha1, path) returns an empty [] when sha1 is the sha for the current commit.
The code is in gollum-lib, so not related to gollum_rails though.

Updating dependencies for Rails4?

Hi,

I'm complete newbie when it comes to Rails-development, so bare with me. I was wondering if there is any work going for updating gollum-rails for use with Rails4?

/ Christoffer

PS: Oh, and let me know if there's anything I can do to help...!

After / Before action

must implement actions for:

  • after save
  • before save
  • after create
  • before create
  • after update
  • before update

Post install message

Important:


To use the installer just run the following command:
rails g gollum_rails:install

To generate a new Page model just run:
rails g gollum_rails:model MODEL_NAME

To install an additional parsing language run:
rails g gollum_rails:language LANGUAGE
**************************************"

SHOULD BE:

Important:
To enable gollum_rails run the following command:
rails g gollum_rails:install
To generate a new Gollum::Page Model just run:
rails g gollum_rails:model MODEL_NAME
To install an additional markup language run:
rails g gollum_rails:language LANGUAGE

using existing gollum wiki

Hi,
I feel kind of dense asking this but I already have a gollum wiki running (using rack on ec2). i'd like to have more control and use devise etc to build a rails site around it.

How can I integrate that existing structure ? Is the best way to add routes, or models? It was unclear to me.

Thanks and keep up the good work. It's possible i will help you develop some of this once i'm more familiar with the code base.

Thanks

How to use it.

I create a new rails project and change the Gemfile.

And then run rails g gollum_rails:install and change the initializers file

  config.repository = '/Users/xushanchuan/projects/wiki-test/'
  config.startup = true

and when i run the rails server nothing happend. I cant see a view like gollum do.

What should i do next?

multiple wikis?

Can there be multiple wiki's and can multiple users access each wiki?

Methods not working with Mongoid

Thanks very much for building the great gem.

I am using rails 3.2.15, mongoid 3.1.5 and Gollum 1.0.4.

When I create a page using:

page = Page.create!(name: 'test_page', content: 'content', format: :markdown, commit: { name: 'nirnanaa', email: '[email protected]', message: 'created page page'})
page
=> #<Gollum::Page:70106851999460 test_page (markdown) @pages="/Users/Jeremy/projects/TestWiki/.
page.content
NoMethodError: undefined method `content' for #<Gollum::Page:0x007f860c04fdc8>
from (pry):12:in `__pry__'

The following methods also don't work: content, history, url, last_changed_by, and preview.

However when I create a page in this way, the methods are working:

page = Page.new(name: 'another_page', content: 'content', format: :markdown, commit: { name: 'nirnanaa', email: '[email protected]', message: 'created page page'})
page.save
=> #<Gollum::Page:70106797523340 another_page (markdown) @page="/Users/Jeremy/projects/TestWiki/.git">
wiki.preview
=> "content"

What am I doing wrong?

incompatible character encodings: UTF-8 and ASCII-8BIT

When i create a page, i received this message :

incompatible character encodings: UTF-8 and ASCII-8BIT

  def create
 =>   @page = Page.create page_params
    debugger
    @page.save!
    redirect_to wiki_path(@page.name)
end 

This is my params
Parameters:

{"utf8"=>"✓",
 "authenticity_token"=>"7KpDqaK5oO8XX/Dg/kFtJbrzy4ZTv5Qt92HqKoyirto=",
 "name"=>"sasdfasdfasdf",
 "content"=>"#asdfasdfasdf",
 "commit"=>"asdfas"}

what should do ? can you help me ? thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.