filemanager 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/Rakefile +1 -1
- data/lib/filemanager.rb +5 -54
- metadata +3 -4
- data/README +0 -32
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
data/lib/filemanager.rb
CHANGED
@@ -6,70 +6,21 @@
|
|
6
6
|
license terms as Ruby.
|
7
7
|
=end
|
8
8
|
require 'uri'
|
9
|
-
begin
|
10
|
-
require 'action_controller/polymorphic_routes'
|
11
|
-
require 'action_controller/routing/optimisations'
|
12
|
-
require 'action_controller/routing/routing_ext'
|
13
|
-
require 'action_controller/routing/route'
|
14
|
-
require 'action_controller/routing/segments'
|
15
|
-
require 'action_controller/routing/builder'
|
16
|
-
require 'action_controller/routing/route_set'
|
17
|
-
require 'action_controller/routing/recognition_optimisation'
|
18
|
-
rescue
|
19
|
-
require 'action_controller/routing'
|
20
|
-
end
|
21
9
|
require 'fileutils'
|
22
10
|
FM_ID = 'filemanager'
|
23
|
-
FM_ROOT = File.join(RAILS_ROOT, 'vendor', FM_ID)
|
24
|
-
FM_PATH_CONTROLLER = File.join(FM_ROOT, 'app', 'controllers')
|
25
|
-
FM_PATH_VIEW = File.join(FM_ROOT, 'app', 'views')
|
11
|
+
FM_ROOT = File.join(RAILS_ROOT, 'vendor', 'plugins', FM_ID)
|
26
12
|
FM_PATH_PUBLIC = File.join(FM_ROOT, 'public')
|
27
13
|
|
28
14
|
if $FM_OVERWRITE || ! File.exist?(FM_ROOT)
|
29
15
|
fm_rails_path = File.dirname(File.dirname(__FILE__)) + "/#{FM_ID}"
|
30
|
-
FileUtils.cp_r(fm_rails_path, File.join(RAILS_ROOT, 'vendor'))
|
16
|
+
FileUtils.cp_r(fm_rails_path, File.join(RAILS_ROOT, 'vendor', 'plugins'))
|
31
17
|
FileUtils.cp_r(FM_PATH_PUBLIC, RAILS_ROOT)
|
32
18
|
FileUtils.rm_rf(FM_PATH_PUBLIC)
|
33
19
|
end
|
34
20
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
fm_old_load_routes!
|
39
|
-
map = ActionController::Routing::RouteSet::Mapper.new(self)
|
40
|
-
map.namespace :fm do |f|
|
41
|
-
f.resources :filemanager
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
alias_method :fm_old_load_routes!, :load_routes!
|
46
|
-
alias_method :load_routes!, :fm_load_routes!
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
Rails::Initializer.class_eval do
|
51
|
-
|
52
|
-
def fm_set_load_path
|
53
|
-
configuration.load_paths << FM_PATH_CONTROLLER
|
54
|
-
fm_old_set_load_path
|
55
|
-
end
|
56
|
-
|
57
|
-
def fm_initialize_framework_views
|
58
|
-
fm_old_initialize_framework_views
|
59
|
-
|
60
|
-
if ActionController::Base.respond_to?(:append_view_path)
|
61
|
-
ActionController::Base.append_view_path(FM_PATH_VIEW)
|
62
|
-
else
|
63
|
-
ActionController::Base.view_paths << FM_PATH_VIEW
|
64
|
-
end
|
65
|
-
configuration.controller_paths << FM_PATH_CONTROLLER
|
66
|
-
end
|
67
|
-
|
68
|
-
alias_method :fm_old_initialize_framework_views, :initialize_framework_views
|
69
|
-
alias_method :initialize_framework_views, :fm_initialize_framework_views
|
70
|
-
alias_method :fm_old_set_load_path, :set_load_path
|
71
|
-
alias_method :set_load_path, :fm_set_load_path
|
72
|
-
|
21
|
+
if $FM_OVERWRITE || ! File.exist?(FM_ROOT)
|
22
|
+
fm_rails_path = File.dirname(File.dirname(__FILE__)) + "/#{FM_ID}"
|
23
|
+
FileUtils.cp_r(fm_rails_path, File.join(RAILS_ROOT, 'vendor', 'plugins'))
|
73
24
|
end
|
74
25
|
|
75
26
|
require "erb"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filemanager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leon Li
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-02-19 00:00:00 +08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -26,7 +26,6 @@ files:
|
|
26
26
|
- Rakefile
|
27
27
|
- CHANGELOG
|
28
28
|
- README.zh_CN
|
29
|
-
- README
|
30
29
|
- lib/locale.rb
|
31
30
|
- lib/filemanager
|
32
31
|
- lib/filemanager/controller.rb
|
@@ -140,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
139
|
requirements: []
|
141
140
|
|
142
141
|
rubyforge_project: Filemanager
|
143
|
-
rubygems_version: 1.
|
142
|
+
rubygems_version: 1.3.1
|
144
143
|
signing_key:
|
145
144
|
specification_version: 2
|
146
145
|
summary: A online file manager for rails project
|
data/README
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
Filemanager, release 0.2.2 (Nov. 2008)
|
2
|
-
A online file manager for rails project
|
3
|
-
|
4
|
-
Feature
|
5
|
-
=======
|
6
|
-
1. browse, copy, cut, paste, rename, delete, create funtion for file/folder
|
7
|
-
2. unzip function for zip file
|
8
|
-
3. zip and download files
|
9
|
-
4. upload file
|
10
|
-
5. view file by type (picture, movie, office file, plain file)
|
11
|
-
6. support internationalization of both file path and page description
|
12
|
-
|
13
|
-
Setup
|
14
|
-
=======
|
15
|
-
#add the following code at the top of environment.rb
|
16
|
-
|
17
|
-
$FM_OVERWRITE = true
|
18
|
-
require 'filemanager'
|
19
|
-
|
20
|
-
#note: you can remove $FM_OVERWRITE definition, if you want to keep the change of filemanager's file in your rails project,
|
21
|
-
#and meanwhile some updates will be not available if filemanager updated, you can change it according to your need
|
22
|
-
|
23
|
-
Usage
|
24
|
-
=======
|
25
|
-
visiting http://localhost:3000/fm/filemanager after rails started
|
26
|
-
most functions are listed in the popup menu after right click on different object
|
27
|
-
|
28
|
-
configuration file at "RAILS_ROOT/confile/filemanager.yml"
|
29
|
-
default managed folder is "RAILS_ROOT/public/fm_resources"
|
30
|
-
i18n file in "RAILS_ROOT/public/filemanager/javascripts/lang"
|
31
|
-
|
32
|
-
Copyright (c) 2008 Leon Li, released under the MIT license
|