Permalink
Browse files

merge johnmhul

  • Loading branch information...
2 parents 3a6724f + 07c9939 commit b5d5a446387687748682272deb90822ba491a535 @saturnflyer saturnflyer committed Apr 29, 2010
Showing with 203 additions and 112 deletions.
  1. +3 −2 .gitignore
  2. +20 −0 LICENSE
  3. +40 −110 Rakefile
  4. +1 −0 VERSION
  5. 0 lib/radiant-page_attachments-extension.rb
  6. +139 −0 radiant-page_attachments-extension.gemspec
View
@@ -1,4 +1,5 @@
.svn
-*/**/.DS_Store
.DS_Store
-app/.DS_STORE
+coverage
+rdoc
+pkg
View
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2010 Sean Cribbs
+
+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.
View
150 Rakefile
@@ -1,127 +1,57 @@
-# I think this is the one that should be moved to the extension Rakefile template
-
-# In rails 1.2, plugins aren't available in the path until they're loaded.
-# Check to see if the rspec plugin is installed first and require
-# it if it is. If not, use the gem version.
+require 'rubygems'
+require 'rake'
-# Determine where the RSpec plugin is by loading the boot
-unless defined? RADIANT_ROOT
- ENV["RAILS_ENV"] = "test"
- case
- when ENV["RADIANT_ENV_FILE"]
- require File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot"
- when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
- require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
- else
- require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "radiant-page_attachments-extension"
+ gem.summary = %Q{Adds page-attachment-style asset management.}
+ gem.description = %Q{Page Attachments adds support for file uploads realized as attachments to individual pages. Attachments can have an order via acts_as_list, a title, a description and various metadata fields as provided by AttachmentFu.}
+ gem.email = "radiant@radiantcms.org"
+ gem.homepage = "http://github.com/radiant/radiant-page-attachments-extension"
+ gem.authors = ["Sean Cribbs"]
+ gem.add_development_dependency "rspec"
+ gem.add_development_dependency "cucumber"
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
-require 'rake'
-require 'rake/rdoctask'
-require 'rake/testtask'
-
-rspec_base = File.expand_path(RADIANT_ROOT + '/vendor/plugins/rspec/lib')
-$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
require 'spec/rake/spectask'
-# require 'spec/translator'
-
-$:.unshift(RAILS_ROOT + '/vendor/plugins/cucumber/lib')
-require 'cucumber/rake/task'
-
-# Cleanup the RADIANT_ROOT constant so specs will load the environment
-Object.send(:remove_const, :RADIANT_ROOT)
-
-extension_root = File.expand_path(File.dirname(__FILE__))
-
-task :default => [:features, :spec]
-task :stats => "spec:statsetup"
-
-desc "Run all specs in spec directory"
-Spec::Rake::SpecTask.new(:spec) do |t|
- t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
- t.spec_files = FileList['spec/**/*_spec.rb']
+Spec::Rake::SpecTask.new(:spec) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.spec_files = FileList['spec/**/*_spec.rb']
end
-Cucumber::Rake::Task.new(:features) do |t|
- t.cucumber_opts = "--format progress"
+Spec::Rake::SpecTask.new(:rcov) do |spec|
+ spec.libs << 'lib' << 'spec'
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.rcov = true
end
-namespace :spec do
- desc "Run all specs in spec directory with RCov"
- Spec::Rake::SpecTask.new(:rcov) do |t|
- t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
- t.spec_files = FileList['spec/**/*_spec.rb']
- t.rcov = true
- t.rcov_opts = ['--exclude', 'spec', '--rails']
- end
-
- desc "Print Specdoc for all specs"
- Spec::Rake::SpecTask.new(:doc) do |t|
- t.spec_opts = ["--format", "specdoc", "--dry-run"]
- t.spec_files = FileList['spec/**/*_spec.rb']
- end
+task :spec => :check_dependencies
- [:models, :controllers, :views, :helpers].each do |sub|
- desc "Run the specs under spec/#{sub}"
- Spec::Rake::SpecTask.new(sub) do |t|
- t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
- t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
- end
- end
-
- # Hopefully no one has written their extensions in pre-0.9 style
- # desc "Translate specs from pre-0.9 to 0.9 style"
- # task :translate do
- # translator = ::Spec::Translator.new
- # dir = RAILS_ROOT + '/spec'
- # translator.translate(dir, dir)
- # end
+begin
+ require 'cucumber/rake/task'
+ Cucumber::Rake::Task.new(:features)
- # Setup specs for stats
- task :statsetup do
- require 'code_statistics'
- ::STATS_DIRECTORIES << %w(Model\ specs spec/models)
- ::STATS_DIRECTORIES << %w(View\ specs spec/views)
- ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers)
- ::STATS_DIRECTORIES << %w(Helper\ specs spec/views)
- ::CodeStatistics::TEST_TYPES << "Model specs"
- ::CodeStatistics::TEST_TYPES << "View specs"
- ::CodeStatistics::TEST_TYPES << "Controller specs"
- ::CodeStatistics::TEST_TYPES << "Helper specs"
- ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
- end
-
- namespace :db do
- namespace :fixtures do
- desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
- task :load => :environment do
- require 'active_record/fixtures'
- ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
- (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
- Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
- end
- end
- end
+ task :features => :check_dependencies
+rescue LoadError
+ task :features do
+ abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
end
end
-desc 'Generate documentation for the page_attachments extension.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
+task :default => :spec
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
+
rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'PageAttachmentsExtension'
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('README')
+ rdoc.title = "radiant-page_attachments-extension #{version}"
+ rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
-
-# For extensions that are in transition
-desc 'Test the page_attachments extension.'
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = true
-end
-
-# Load any custom rakefiles for extension
-Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f }
View
@@ -0,0 +1 @@
+1.0.0
No changes.
@@ -0,0 +1,139 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{radiant-page_attachments-extension}
+ s.version = "1.0.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Sean Cribbs"]
+ s.date = %q{2010-04-29}
+ s.description = %q{Page Attachments adds support for file uploads realized as attachments to individual pages. Attachments can have an order via acts_as_list, a title, a description and various metadata fields as provided by AttachmentFu.}
+ s.email = %q{radiant@radiantcms.org}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.md"
+ ]
+ s.files = [
+ ".gitignore",
+ "LICENSE",
+ "README.md",
+ "Rakefile",
+ "VERSION",
+ "app/models/observe_page_attachments.rb",
+ "app/models/page_attachment.rb",
+ "app/models/page_attachment_associations.rb",
+ "app/models/page_attachment_tags.rb",
+ "app/models/page_attachments_interface.rb",
+ "app/views/admin/pages/_attachment.html.haml",
+ "app/views/admin/pages/_attachments_box.html.haml",
+ "db/migrate/001_create_page_attachments_extension_schema.rb",
+ "db/migrate/002_add_page_attachments_fields.rb",
+ "features/attachments.feature",
+ "features/step_definitions/attachment_steps.rb",
+ "features/support/env.rb",
+ "features/support/paths.rb",
+ "lib/difference_test_helper.rb",
+ "lib/radiant-page_attachments-extension.rb",
+ "lib/tasks/page_attachments_extension_tasks.rake",
+ "page_attachments_extension.rb",
+ "public/images/admin/drag_order.png",
+ "public/javascripts/admin/page_attachments.js",
+ "public/stylesheets/admin/page_attachments.css",
+ "radiant-page_attachments-extension.gemspec",
+ "spec/controllers/pages_controller_spec.rb",
+ "spec/datasets/page_attachments_dataset.rb",
+ "spec/fixtures/foo.txt",
+ "spec/fixtures/rails.png",
+ "spec/models/observe_page_attachments_spec.rb",
+ "spec/models/page_attachment_spec.rb",
+ "spec/models/page_attachment_tags_spec.rb",
+ "spec/models/page_spec.rb",
+ "spec/spec.opts",
+ "spec/spec_helper.rb",
+ "vendor/plugins/acts_as_list/README",
+ "vendor/plugins/acts_as_list/init.rb",
+ "vendor/plugins/acts_as_list/lib/active_record/acts/list.rb",
+ "vendor/plugins/acts_as_list/test/list_test.rb",
+ "vendor/plugins/attachment_fu/CHANGELOG",
+ "vendor/plugins/attachment_fu/LICENSE",
+ "vendor/plugins/attachment_fu/README",
+ "vendor/plugins/attachment_fu/Rakefile",
+ "vendor/plugins/attachment_fu/amazon_s3.yml.tpl",
+ "vendor/plugins/attachment_fu/init.rb",
+ "vendor/plugins/attachment_fu/install.rb",
+ "vendor/plugins/attachment_fu/lib/geometry.rb",
+ "vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb",
+ "vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/cloud_file_backend.rb",
+ "vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/db_file_backend.rb",
+ "vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/file_system_backend.rb",
+ "vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/s3_backend.rb",
+ "vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/core_image_processor.rb",
+ "vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/gd2_processor.rb",
+ "vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/image_science_processor.rb",
+ "vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/mini_magick_processor.rb",
+ "vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/rmagick_processor.rb",
+ "vendor/plugins/attachment_fu/rackspace_cloudfiles.yml.tpl",
+ "vendor/plugins/attachment_fu/test/backends/db_file_test.rb",
+ "vendor/plugins/attachment_fu/test/backends/file_system_test.rb",
+ "vendor/plugins/attachment_fu/test/backends/remote/cloudfiles_test.rb",
+ "vendor/plugins/attachment_fu/test/backends/remote/s3_test.rb",
+ "vendor/plugins/attachment_fu/test/base_attachment_tests.rb",
+ "vendor/plugins/attachment_fu/test/basic_test.rb",
+ "vendor/plugins/attachment_fu/test/database.yml",
+ "vendor/plugins/attachment_fu/test/extra_attachment_test.rb",
+ "vendor/plugins/attachment_fu/test/fixtures/attachment.rb",
+ "vendor/plugins/attachment_fu/test/fixtures/files/fake/rails.png",
+ "vendor/plugins/attachment_fu/test/fixtures/files/foo.txt",
+ "vendor/plugins/attachment_fu/test/fixtures/files/rails.png",
+ "vendor/plugins/attachment_fu/test/geometry_test.rb",
+ "vendor/plugins/attachment_fu/test/processors/core_image_test.rb",
+ "vendor/plugins/attachment_fu/test/processors/gd2_test.rb",
+ "vendor/plugins/attachment_fu/test/processors/image_science_test.rb",
+ "vendor/plugins/attachment_fu/test/processors/mini_magick_test.rb",
+ "vendor/plugins/attachment_fu/test/processors/rmagick_test.rb",
+ "vendor/plugins/attachment_fu/test/schema.rb",
+ "vendor/plugins/attachment_fu/test/test_helper.rb",
+ "vendor/plugins/attachment_fu/test/validation_test.rb",
+ "vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/color.rb",
+ "vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/effects.rb",
+ "vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/perspective.rb",
+ "vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/quality.rb",
+ "vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/scale.rb",
+ "vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/watermark.rb",
+ "vendor/plugins/attachment_fu/vendor/red_artisan/core_image/processor.rb"
+ ]
+ s.homepage = %q{http://github.com/radiant/radiant-page-attachments-extension}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.6}
+ s.summary = %q{Adds page-attachment-style asset management.}
+ s.test_files = [
+ "spec/controllers/pages_controller_spec.rb",
+ "spec/datasets/page_attachments_dataset.rb",
+ "spec/models/observe_page_attachments_spec.rb",
+ "spec/models/page_attachment_spec.rb",
+ "spec/models/page_attachment_tags_spec.rb",
+ "spec/models/page_spec.rb",
+ "spec/spec_helper.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_development_dependency(%q<rspec>, [">= 0"])
+ s.add_development_dependency(%q<cucumber>, [">= 0"])
+ else
+ s.add_dependency(%q<rspec>, [">= 0"])
+ s.add_dependency(%q<cucumber>, [">= 0"])
+ end
+ else
+ s.add_dependency(%q<rspec>, [">= 0"])
+ s.add_dependency(%q<cucumber>, [">= 0"])
+ end
+end
+

0 comments on commit b5d5a44

Please sign in to comment.