first version of the foodsoft_wiki plugin
This commit is contained in:
parent
fde7904c1a
commit
6d0ba985aa
6 changed files with 86 additions and 0 deletions
3
lib/foodsoft_wiki/README.rdoc
Normal file
3
lib/foodsoft_wiki/README.rdoc
Normal file
|
@ -0,0 +1,3 @@
|
|||
= FoodsoftWiki
|
||||
|
||||
This project rocks and uses MIT-LICENSE.
|
40
lib/foodsoft_wiki/Rakefile
Normal file
40
lib/foodsoft_wiki/Rakefile
Normal file
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env rake
|
||||
begin
|
||||
require 'bundler/setup'
|
||||
rescue LoadError
|
||||
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
||||
end
|
||||
begin
|
||||
require 'rdoc/task'
|
||||
rescue LoadError
|
||||
require 'rdoc/rdoc'
|
||||
require 'rake/rdoctask'
|
||||
RDoc::Task = Rake::RDocTask
|
||||
end
|
||||
|
||||
RDoc::Task.new(:rdoc) do |rdoc|
|
||||
rdoc.rdoc_dir = 'rdoc'
|
||||
rdoc.title = 'FoodsoftWiki'
|
||||
rdoc.options << '--line-numbers'
|
||||
rdoc.rdoc_files.include('README.rdoc')
|
||||
rdoc.rdoc_files.include('lib/**/*.rb')
|
||||
end
|
||||
|
||||
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
||||
load 'rails/tasks/engine.rake'
|
||||
|
||||
|
||||
|
||||
Bundler::GemHelper.install_tasks
|
||||
|
||||
require 'rake/testtask'
|
||||
|
||||
Rake::TestTask.new(:test) do |t|
|
||||
t.libs << 'lib'
|
||||
t.libs << 'test'
|
||||
t.pattern = 'test/**/*_test.rb'
|
||||
t.verbose = false
|
||||
end
|
||||
|
||||
|
||||
task :default => :test
|
22
lib/foodsoft_wiki/foodsoft_wiki.gemspec
Normal file
22
lib/foodsoft_wiki/foodsoft_wiki.gemspec
Normal file
|
@ -0,0 +1,22 @@
|
|||
$:.push File.expand_path("../lib", __FILE__)
|
||||
|
||||
# Maintain your gem's version:
|
||||
require "foodsoft_wiki/version"
|
||||
|
||||
# Describe your gem and declare its dependencies:
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "foodsoft_wiki"
|
||||
s.version = FoodsoftWiki::VERSION
|
||||
s.authors = ["wvengen"]
|
||||
s.email = ["dev-foodsoft@willem.engen.nl"]
|
||||
s.homepage = "https://github.com/foodcoops/foodsoft"
|
||||
s.summary = "Wiki plugin for foodsoft."
|
||||
s.description = "Adds a wiki to foodsoft."
|
||||
|
||||
s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "README.rdoc"]
|
||||
s.test_files = Dir["test/**/*"]
|
||||
|
||||
s.add_dependency "rails", "~> 3.2.15"
|
||||
|
||||
s.add_development_dependency "sqlite3"
|
||||
end
|
4
lib/foodsoft_wiki/lib/foodsoft_wiki.rb
Normal file
4
lib/foodsoft_wiki/lib/foodsoft_wiki.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
require "foodsoft_wiki/engine"
|
||||
|
||||
module FoodsoftWiki
|
||||
end
|
14
lib/foodsoft_wiki/lib/foodsoft_wiki/engine.rb
Normal file
14
lib/foodsoft_wiki/lib/foodsoft_wiki/engine.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
module FoodsoftWiki
|
||||
class Engine < ::Rails::Engine
|
||||
def navigation(primary, ctx)
|
||||
primary.item :wiki, I18n.t('navigation.wiki.title'), '#', id: nil do |subnav|
|
||||
subnav.item :wiki_home, I18n.t('navigation.wiki.home'), ctx.wiki_path, id: nil
|
||||
subnav.item :all_pages, I18n.t('navigation.wiki.all_pages'), ctx.all_pages_path, id: nil
|
||||
end
|
||||
# move this last added item to just after the foodcoop menu
|
||||
if i = primary.items.index(primary[:foodcoop])
|
||||
primary.items.insert(i+1, primary.items.delete_at(-1))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
3
lib/foodsoft_wiki/lib/foodsoft_wiki/version.rb
Normal file
3
lib/foodsoft_wiki/lib/foodsoft_wiki/version.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
module FoodsoftWiki
|
||||
VERSION = "0.0.1"
|
||||
end
|
Loading…
Reference in a new issue