Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 1211 Bytes
1 | module ActionController |
2 | module UploadedFile |
3 | def self.included(base) |
4 | base.class_eval do |
5 | attr_accessor :original_path, :content_type |
6 | alias_method :local_path, :path if method_defined?(:path) |
7 | end |
8 | end |
9 | |
10 | def self.extended(object) |
11 | object.class_eval do |
12 | attr_accessor :original_path, :content_type |
13 | alias_method :local_path, :path if method_defined?(:path) |
14 | end |
15 | end |
16 | |
17 | # Take the basename of the upload's original filename. |
18 | # This handles the full Windows paths given by Internet Explorer |
19 | # (and perhaps other broken user agents) without affecting |
20 | # those which give the lone filename. |
21 | # The Windows regexp is adapted from Perl's File::Basename. |
22 | def original_filename |
23 | unless defined? @original_filename |
24 | @original_filename = |
25 | unless original_path.blank? |
26 | if original_path =~ /^(?:.*[:\\\/])?(.*)/m |
27 | $1 |
28 | else |
29 | File.basename original_path |
30 | end |
31 | end |
32 | end |
33 | @original_filename |
34 | end |
35 | end |
36 | |
37 | class UploadedStringIO < StringIO |
38 | include UploadedFile |
39 | end |
40 | |
41 | class UploadedTempfile < Tempfile |
42 | include UploadedFile |
43 | end |
44 | end |