-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb1b91a
commit 549cbb8
Showing
16 changed files
with
162 additions
and
83 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,5 @@ | ||
lib/**/*.rb | ||
bin/* | ||
- | ||
features/**/*.feature | ||
LICENSE.txt |
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,43 @@ | ||
# rcov generated | ||
coverage | ||
|
||
# rdoc generated | ||
rdoc | ||
|
||
# yard generated | ||
doc | ||
.yardoc | ||
|
||
# bundler | ||
.bundle | ||
|
||
# jeweler generated | ||
pkg | ||
|
||
Gemfile* | ||
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore: | ||
# | ||
# * Create a file at ~/.gitignore | ||
# * Include files you want ignored | ||
# * Run: git config --global core.excludesfile ~/.gitignore | ||
# | ||
# After doing this, these files will be ignored in all your git projects, | ||
# saving you from having to 'pollute' every project you touch with them | ||
# | ||
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line) | ||
# | ||
# For MacOS: | ||
# | ||
#.DS_Store | ||
# | ||
# For TextMate | ||
#*.tmproj | ||
#tmtags | ||
# | ||
# For emacs: | ||
#*~ | ||
#\#* | ||
#.\#* | ||
# | ||
# For vim: | ||
#*.swp |
File renamed without changes.
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,22 +1,56 @@ | ||
require 'rubygems' | ||
require 'bundler' | ||
begin | ||
Bundler.setup(:default, :development) | ||
rescue Bundler::BundlerError => e | ||
$stderr.puts e.message | ||
$stderr.puts "Run `bundle install` to install missing gems" | ||
exit e.status_code | ||
end | ||
require 'rake' | ||
require 'rake/testtask' | ||
require 'rake/rdoctask' | ||
|
||
desc 'Default: run unit tests.' | ||
task :default => :test | ||
require 'jeweler' | ||
require './lib/active_scaffold_sortable/version.rb' | ||
Jeweler::Tasks.new do |gem| | ||
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options | ||
gem.name = "active_scaffold_sortable" | ||
gem.version = ActiveScaffoldSortable::Version::STRING | ||
gem.homepage = "http://github.com/vhochstein/active_scaffold_sortable" | ||
gem.license = "MIT" | ||
gem.summary = %Q{Drag n Drop Sorting for Activescaffold} | ||
gem.description = %Q{Sort Tree or List Structures by Drag n Drop} | ||
gem.email = "activescaffold@googlegroups.com" | ||
gem.authors = ["Volker Hochstein"] | ||
gem.add_runtime_dependency 'active_scaffold', '~> 3.0.6' | ||
# Include your dependencies below. Runtime dependencies are required when using your gem, | ||
# and development dependencies are only needed for development (ie running rake tasks, tests, etc) | ||
# gem.add_runtime_dependency 'jabber4r', '> 0.1' | ||
# gem.add_development_dependency 'rspec', '> 1.2.3' | ||
end | ||
Jeweler::RubygemsDotOrgTasks.new | ||
|
||
desc 'Test the addresses_engine plugin.' | ||
require 'rake/testtask' | ||
desc 'Test plugin.' | ||
Rake::TestTask.new(:test) do |t| | ||
t.libs << 'test' | ||
t.pattern = 'test/**/*_test.rb' | ||
t.verbose = true | ||
end | ||
|
||
desc 'Generate documentation for the addresses_engine plugin.' | ||
require 'rcov/rcovtask' | ||
Rcov::RcovTask.new do |test| | ||
test.libs << 'test' | ||
test.pattern = 'test/**/test_*.rb' | ||
test.verbose = true | ||
end | ||
|
||
task :default => :test | ||
|
||
require 'rake/rdoctask' | ||
desc 'Generate documentation for plugin.' | ||
Rake::RDocTask.new(:rdoc) do |rdoc| | ||
rdoc.rdoc_dir = 'rdoc' | ||
rdoc.title = 'AddressesEngine' | ||
rdoc.options << '--line-numbers' << '--inline-source' | ||
rdoc.rdoc_files.include('README') | ||
rdoc.title = "active_scaffold_sortable #{ActiveScaffoldSortable::Version::STRING}" | ||
rdoc.rdoc_files.include('README*') | ||
rdoc.rdoc_files.include('lib/**/*.rb') | ||
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,11 +1,9 @@ | ||
require 'sortable' | ||
ACTIVE_SCAFFOLD_SORTABLE_PLUGIN = true | ||
|
||
require 'active_scaffold_sortable' | ||
|
||
## | ||
## Run the install assets script, too, just to make sure | ||
## But at least rescue the action in production | ||
## | ||
begin | ||
require File.dirname(__FILE__) + '/install_assets' | ||
ActiveScaffoldAssets.copy_to_public(ActiveScaffoldSortable.root) | ||
rescue | ||
raise $! unless Rails.env == 'production' | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require "#{File.dirname(__FILE__)}/active_scaffold_sortable/config/core.rb" | ||
require "#{File.dirname(__FILE__)}/active_scaffold/config/sortable.rb" | ||
require "#{File.dirname(__FILE__)}/active_scaffold/actions/sortable.rb" | ||
require "#{File.dirname(__FILE__)}/active_scaffold/helpers/sortable_helpers.rb" | ||
|
||
module ActiveScaffoldSortable | ||
def self.root | ||
File.dirname(__FILE__) + "/.." | ||
end | ||
end | ||
|
||
ActiveScaffold::Config::Core.send :include, ActiveScaffoldSortable::Core | ||
ActiveScaffold::Helpers::ViewHelpers.send :include, ActiveScaffoldSortable::ViewHelpers | ||
|
||
## | ||
## Run the install assets script, too, just to make sure | ||
## But at least rescue the action in production | ||
## | ||
Rails::Application.initializer("active_scaffold_sortable.install_assets") do | ||
begin | ||
ActiveScaffoldAssets.copy_to_public(ActiveScaffoldSortable.root) | ||
rescue | ||
raise $! unless Rails.env == 'production' | ||
end | ||
end unless defined?(ACTIVE_SCAFFOLD_SORTABLE_PLUGIN) && ACTIVE_SCAFFOLD_SORTABLE_PLUGIN == true |
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,4 @@ | ||
# Need to open the AS module carefully due to Rails 2.3 lazy loading | ||
ActiveScaffold::Config::Core.class_eval do | ||
ActionDispatch::Routing::ACTIVE_SCAFFOLD_CORE_ROUTING[:collection][:reorder] = :post | ||
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module ActiveScaffoldSortable | ||
module Core | ||
def self.included(base) | ||
base.alias_method_chain :initialize, :sortable | ||
end | ||
|
||
def initialize_with_sortable(model_id) | ||
initialize_without_sortable(model_id) | ||
# seems some rubies are returning strings in instance_methods and other symbols... | ||
self.actions << :sortable if !(model.instance_methods & ['acts_as_list_class', :acts_as_list_class, 'nested_set_scope', :nested_set_scope]).empty? | ||
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module ActiveScaffoldSortable | ||
module Version | ||
MAJOR = 3 | ||
MINOR = 0 | ||
PATCH = 0 | ||
|
||
STRING = [MAJOR, MINOR, PATCH].compact.join('.') | ||
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module ActiveScaffoldSortable | ||
module ViewHelpers | ||
def self.included(base) | ||
base.alias_method_chain :active_scaffold_stylesheets, :sortable | ||
end | ||
|
||
def active_scaffold_stylesheets_with_sortable(frontend = :default) | ||
active_scaffold_stylesheets_without_sortable(frontend) + [ActiveScaffold::Config::Core.asset_path('sortable.css', frontend)] | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.