-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update gem structure for new sunrise-cms
- Loading branch information
Showing
12 changed files
with
56 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright 2012 Fodojo http://fodojo.com/ | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
Rails.application.routes.draw do | ||
resources :comments, :only => [:new, :create, :edit, :update, :destroy] | ||
|
||
namespace :manage do | ||
resources :comments | ||
end | ||
resources :comments, :only => [:new, :create, :edit, :update, :destroy] | ||
end |
2 changes: 1 addition & 1 deletion
2
...ise/comments/templates/create_comments.rb → db/migrate/20121809170415_create_comments.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,14 @@ | ||
require 'rails/generators' | ||
require 'rails/generators/migration' | ||
|
||
module Sunrise | ||
module Comments | ||
class InstallGenerator < Rails::Generators::Base | ||
include Rails::Generators::Migration | ||
|
||
source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates')) | ||
class_option :migrations, :type => :boolean, :default => true, :description => "Generate migrations files" | ||
desc "Generates comment model" | ||
|
||
desc "Generates comment migration and model" | ||
|
||
def self.current_time | ||
@current_time ||= Time.now | ||
@current_time += 1.minute | ||
end | ||
|
||
def self.next_migration_number(dirname) | ||
current_time.strftime("%Y%m%d%H%M%S") | ||
end | ||
|
||
def create_model | ||
copy_file('comment.rb', 'app/models/comment.rb') | ||
end | ||
|
||
def create_migration | ||
if options.migrations | ||
migration_template "create_comments.rb", File.join('db/migrate', "sunrise_create_comments.rb") | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
lib/sunrise/models/comment.rb → lib/sunrise/comments/commentable.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,10 @@ | ||
require 'rails' | ||
require 'sunrise-cms' | ||
require 'sunrise-comments' | ||
|
||
module Sunrise | ||
module Comments | ||
class Engine < ::Rails::Engine | ||
config.before_initialize do | ||
Sunrise::Plugin.register :comments do |plugin| | ||
plugin.model = 'sunrise/models/comment' | ||
plugin.menu = false | ||
plugin.version = Sunrise::Comments::VERSION.dup | ||
end | ||
|
||
Sunrise::Plugins.activate(:comments) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Sunrise | ||
module Comments | ||
VERSION = "0.1.2".freeze | ||
VERSION = "0.2.0".freeze | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,23 @@ | ||
# Generated by jeweler | ||
# DO NOT EDIT THIS FILE DIRECTLY | ||
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' | ||
# -*- encoding: utf-8 -*- | ||
$:.push File.expand_path("../lib", __FILE__) | ||
require "sunrise/comments/version" | ||
|
||
Gem::Specification.new do |s| | ||
s.name = %q{sunrise-comments} | ||
s.version = "0.1.2" | ||
|
||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | ||
s.name = "sunrise-comments" | ||
s.version = Sunrise::Comments::VERSION.dup | ||
s.platform = Gem::Platform::RUBY | ||
s.summary = "Comments for sunrise-cms" | ||
s.description = "Comments module for sunrise-cms" | ||
s.authors = ["Igor Galeta", "Pavlo Galeta"] | ||
s.date = %q{2011-08-16} | ||
s.description = %q{Sunrise is a Aimbulance CMS} | ||
s.email = %q{galeta.igor@gmail.com} | ||
s.extra_rdoc_files = [ | ||
"README.rdoc" | ||
] | ||
s.files = [ | ||
"README.rdoc", | ||
"Rakefile", | ||
"app/controllers/comments_controller.rb", | ||
"app/sweepers/comment_sweeper.rb", | ||
"app/views/comments/_block.html.erb", | ||
"app/views/comments/_comment.html.erb", | ||
"app/views/comments/_form.html.erb", | ||
"app/views/comments/create.js.erb", | ||
"app/views/comments/destroy.js.erb", | ||
"config/locales/ru.yml", | ||
"config/locales/uk.yml", | ||
"config/routes.rb", | ||
"lib/generators/sunrise/comments/USAGE", | ||
"lib/generators/sunrise/comments/install_generator.rb", | ||
"lib/generators/sunrise/comments/templates/comment.rb", | ||
"lib/generators/sunrise/comments/templates/create_comments.rb", | ||
"lib/sunrise-comments.rb", | ||
"lib/sunrise/comments.rb", | ||
"lib/sunrise/comments/author.rb", | ||
"lib/sunrise/comments/base.rb", | ||
"lib/sunrise/comments/engine.rb", | ||
"lib/sunrise/comments/version.rb", | ||
"lib/sunrise/models/comment.rb" | ||
] | ||
s.homepage = %q{https://github.com/galetahub/sunrise-comments} | ||
s.email = "galeta.igor@gmail.com" | ||
s.rubyforge_project = "sunrise-comments" | ||
s.homepage = "https://github.com/galetahub/sunrise-comments" | ||
|
||
s.files = Dir["{app,lib,config,db,vendor}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] | ||
s.test_files = Dir["{spec}/**/*"] | ||
s.extra_rdoc_files = ["README.rdoc"] | ||
s.require_paths = ["lib"] | ||
s.rubygems_version = %q{1.6.2} | ||
s.summary = %q{Rails CMS} | ||
|
||
if s.respond_to? :specification_version then | ||
s.specification_version = 3 | ||
|
||
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then | ||
s.add_runtime_dependency(%q<sunrise-cms>, [">= 0"]) | ||
else | ||
s.add_dependency(%q<sunrise-cms>, [">= 0"]) | ||
end | ||
else | ||
s.add_dependency(%q<sunrise-cms>, [">= 0"]) | ||
end | ||
end | ||
|
||
|
||
s.add_dependency "sunrise-cms" | ||
s.add_dependency "auto_html" | ||
end |