Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Finishing reorganization

git-svn-id: http://opensvn.csie.org/rails_file_column/plugins/file_column/trunk@10 6a5db2c9-b104-0410-84e5-917aad89f9d9
  • Loading branch information...
commit 880c7a63610118564e905eec3366ae16bf4ea4dc 1 parent d4f351a
kyle authored
Showing with 142 additions and 0 deletions.
  1. +36 −0 CHANGELOG
  2. +54 −0 README
  3. +36 −0 Rakefile
  4. +7 −0 TODO
  5. +9 −0 init.rb
View
36 CHANGELOG
@@ -0,0 +1,36 @@
+0.3
+ * fixed bug where empty file uploads were not recognized with some browsers
+ * fixed bug on windows when "file" utility is not present
+ * added option to disable automatic file extension correction
+ * Only allow one attribute per call to file_column, so that options only
+ apply to one argument
+ * try to detect when people forget to set the form encoding to
+ 'multipart/form-data'
+ * converted to rails plugin
+ * easy integration with RMagick
+
+0.2
+ * complete rewrite using state pattern
+ * fixed sanitize filename [Michael Raidel]
+ * fixed bug when no file was uploaded [Michael Raidel]
+ * try to fix filename extensions [Michael Raidel]
+ * Feed absolute paths through File.expand_path to make them as simple as possible
+ * Make file_column_field helper work with auto-ids (e.g., "event[]")
+
+0.1.3
+ * test cases with more than 1 file_column
+ * fixed bug when file_column was called with several arguments
+ * treat empty ("") file_columns as nil
+ * support for binary files on windows
+
+0.1.2
+ * better rails integration, so that you do not have to include the modules yourself. You
+ just have to "require 'rails_file_column'" in your "config/environment.rb"
+ * Rakefile for testing and packaging
+
+0.1.1 (2005-08-11)
+ * fixed nasty bug in url_for_file_column that made it unusable on Apache
+ * prepared for public release
+
+0.1 (2005-08-10)
+ * initial release
View
54 README
@@ -0,0 +1,54 @@
+FEATURES
+========
+
+Let's assume an model class named Entry, where we want to define the "image" column
+as a "file_upload" column.
+
+class Entry < ActiveRecord::Base
+ file_column :image
+end
+
+* every entry can have one uploaded file, the filename will be stored in the "image" column
+
+* files will be stored in "public/entry/image/<entry.id>/filename.ext"
+
+* Newly uploaded files will be stored in "public/entry/tmp/<random>/filename.ext" so that
+ they can be reused in form redisplays (due to validation etc.)
+
+* in a view, "<%= file_column_field 'entry', 'image' %> will create a file upload field as well
+ as a hidden field to recover files uploaded before in a case of a form redisplay
+
+* in a view, "<%= url_for_file_column 'entry', 'image' %> will create an URL to access the
+ uploaded file. Note that you need an Entry object in the instance variable @entry for this
+ to work.
+
+* easy integration with RMagick to resize images and/or create thumb-nails.
+
+USAGE
+=====
+
+Just drop the whole directory into your application's "vendor/plugins" directory. Starting
+with version 1.0rc of rails, it will be automatically picked for you by rails plugin
+mechanism.
+
+DOCUMENTATION
+=============
+
+Please look at the rdoc-generated documentation in the "doc" directory.
+
+RUNNING UNITTESTS
+=================
+
+There are extensive unittests in the "test" directory. Currently, only MySQL is supported, but
+you should be able to easily fix this by looking at "connection.rb". You have to create a
+database for the tests and put the connection information into "connection.rb". The schema
+for MySQL can be found in "test/fixtures/mysql.sql".
+
+You can run the tests by starting the "*_test.rb" in the directory "test"
+
+BUGS & FEEDBACK
+===============
+
+Bug reports (as well as patches) and feedback are very welcome. Please send it to
+sebastian.kanthak@muehlheim.de
+
View
36 Rakefile
@@ -0,0 +1,36 @@
+task :default => [:test]
+
+PKG_NAME = "file-column"
+PKG_VERSION = "0.3"
+
+PKG_DIR = "release/#{PKG_NAME}-#{PKG_VERSION}"
+
+task :clean do
+ rm_rf "release"
+end
+
+task :setup_directories do
+ mkpath "release"
+end
+
+
+task :checkout_release => :setup_directories do
+ rm_rf PKG_DIR
+ revision = ENV["REVISION"] || "t:#{PKG_NAME}-#{PKG_VERSION}"
+ sh "monotone --db ../rails_file_column.db checkout -r #{revision} #{PKG_DIR}"
+ rm_rf File.join(PKG_DIR, "MT")
+ rm_f File.join(PKG_DIR, ".mt-attrs")
+end
+
+task :release_docs => :checkout_release do
+ sh "cd #{PKG_DIR}; rdoc lib"
+end
+
+task :package => [:checkout_release, :release_docs] do
+ sh "cd release; tar czf #{PKG_NAME}-#{PKG_VERSION}.tar.gz #{PKG_NAME}-#{PKG_VERSION}"
+end
+
+task :test do
+ sh "cd test; ruby file_column_test.rb"
+ sh "cd test; ruby magick_test.rb"
+end
View
7 TODO
@@ -0,0 +1,7 @@
+* document configuration options better
+* support setting of permissions
+* validation methods for file format/size
+* delete stale files from tmp directories
+* move image scaling into views
+* make file_column models serializable
+
View
9 init.rb
@@ -0,0 +1,9 @@
+# plugin init file for rails
+# this file will be picked up by rails automatically and
+# add the file_column extensions to rails
+
+require 'file_column'
+require 'file_column_helper'
+
+ActiveRecord::Base.send(:include, FileColumn)
+ActionView::Base.send(:include, FileColumnHelper)
Please sign in to comment.
Something went wrong with that request. Please try again.