equipment 0.1.0 → 1.4.84

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/CHANGES +9 -0
  2. data/LICENSE +340 -0
  3. data/README +29 -12
  4. data/Rakefile +157 -0
  5. data/TODO +14 -0
  6. data/doc/structure.dia +0 -0
  7. data/doc/structure.png +0 -0
  8. data/lib/camping_ext.rb +72 -0
  9. data/lib/equipment.rb +39 -116
  10. data/lib/ext.rb +33 -0
  11. data/lib/ext/active_record.rb +146 -0
  12. data/lib/ext/basic_auth.rb +15 -15
  13. data/lib/ext/controls.rb +16 -14
  14. data/lib/ext/flash.rb +35 -17
  15. data/lib/ext/form_helpers.rb +46 -0
  16. data/lib/ext/forward.rb +44 -15
  17. data/lib/ext/js_helpers.rb +66 -19
  18. data/lib/ext/logging.rb +61 -0
  19. data/lib/ext/mount.rb +33 -27
  20. data/lib/ext/negociate_content.rb +90 -0
  21. data/lib/ext/og.rb +18 -10
  22. data/lib/ext/og_scaffold.rb +5 -8
  23. data/lib/ext/resource.rb +127 -0
  24. data/lib/ext/security.rb +66 -31
  25. data/lib/ext/sendfile.rb +3 -4
  26. data/lib/ext/settings.rb +243 -0
  27. data/lib/ext/template_view.rb +9 -37
  28. data/lib/ext/use_helper.rb +6 -10
  29. data/lib/ext/view.rb +98 -0
  30. data/lib/ext/view_slot.rb +60 -0
  31. data/lib/mimetype_ext.rb +12 -0
  32. data/lib/more/typecast.rb +288 -0
  33. data/lib/ruby_ext.rb +126 -0
  34. data/share/js/date_ext.js +234 -0
  35. data/share/js/es-confirm.js +23 -0
  36. data/share/js/event-selector.js +145 -0
  37. data/share/js/jquery.js +1793 -0
  38. data/share/js/prototype.js +2012 -0
  39. metadata +50 -35
  40. data/ProjectInfo +0 -55
  41. data/examples/basicauthtest.rb +0 -59
  42. data/examples/erubytest.rb +0 -36
  43. data/examples/flashtest.rb +0 -46
  44. data/examples/index.erb +0 -9
  45. data/examples/mounttest.rb +0 -34
  46. data/examples/ogtest.rb +0 -41
  47. data/examples/patchestest.rb +0 -40
  48. data/examples/sendfiletest.rb +0 -29
  49. data/lib/ext/forms.rb +0 -22
  50. data/lib/ext/patches.rb +0 -130
  51. data/lib/ext/ressource.rb +0 -88
metadata CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: equipment
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.0
7
- date: 2006-07-06 00:00:00 +02:00
8
- summary: Camping equipments
6
+ version: 1.4.84
7
+ date: 2006-09-12 00:00:00 +02:00
8
+ summary: Equipments (for Camping).
9
9
  require_paths:
10
10
  - lib
11
11
  email: zimba.tm@gmail.com
12
12
  homepage: http://equipment.rubyforge.org
13
13
  rubyforge_project: equipment
14
- description:
14
+ description: Equipment is a set of extensions you can use with your Camping apps.
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin
@@ -28,46 +28,61 @@ cert_chain:
28
28
  authors:
29
29
  - Jonas Pfenniger
30
30
  files:
31
- - lib
32
- - .
33
- - examples
34
- - lib/ext
35
- - lib/ext/patches.rb
36
- - examples/erubytest.rb
37
- - examples/index.erb
31
+ - Rakefile
32
+ - TODO
33
+ - README
34
+ - LICENSE
35
+ - CHANGES
36
+ - doc/structure.png
37
+ - doc/structure.dia
38
+ - lib/camping_ext.rb
39
+ - lib/ext.rb
40
+ - lib/ruby_ext.rb
41
+ - lib/equipment.rb
42
+ - lib/mimetype_ext.rb
43
+ - lib/ext/app_util.rb
38
44
  - lib/ext/eruby_view.rb
39
- - lib/ext/template_view.rb
40
- - lib/ext/og_session.rb
41
- - examples/sendfiletest.rb
42
- - lib/ext/basic_auth.rb
45
+ - lib/ext/form_helpers.rb
46
+ - lib/ext/logging.rb
47
+ - lib/ext/resource.rb
48
+ - lib/ext/negociate_content.rb
49
+ - lib/ext/sendfile.rb
43
50
  - lib/ext/xml_view.rb
44
- - README
45
51
  - lib/ext/use_helper.rb
46
- - lib/equipment.rb
52
+ - lib/ext/flash.rb
47
53
  - lib/ext/js_helpers.rb
54
+ - lib/ext/settings.rb
55
+ - lib/ext/mount.rb
56
+ - lib/ext/basic_auth.rb
48
57
  - lib/ext/controls.rb
49
- - lib/ext/ressource.rb
50
- - examples/basicauthtest.rb
51
- - examples/patchestest.rb
52
- - examples/flashtest.rb
53
- - lib/ext/app_util.rb
54
58
  - lib/ext/forward.rb
55
- - lib/ext/security.rb
56
- - lib/ext/sendfile.rb
57
- - examples/ogtest.rb
58
- - examples/mounttest.rb
59
- - lib/ext/forms.rb
60
- - lib/ext/og_scaffold.rb
61
- - lib/ext/mount.rb
62
59
  - lib/ext/og.rb
63
- - ProjectInfo
64
- - lib/ext/flash.rb
60
+ - lib/ext/template_view.rb
61
+ - lib/ext/og_scaffold.rb
62
+ - lib/ext/security.rb
63
+ - lib/ext/og_session.rb
64
+ - lib/ext/active_record.rb
65
+ - lib/ext/view.rb
66
+ - lib/ext/view_slot.rb
67
+ - lib/more/typecast.rb
68
+ - share/js
69
+ - share/js/prototype.js
70
+ - share/js/date_ext.js
71
+ - share/js/event-selector.js
72
+ - share/js/jquery.js
73
+ - share/js/es-confirm.js
65
74
  test_files: []
66
75
 
67
- rdoc_options: []
68
-
69
- extra_rdoc_files: []
70
-
76
+ rdoc_options:
77
+ - --title
78
+ - Equipment
79
+ - --main
80
+ - README
81
+ - --line-numbers
82
+ extra_rdoc_files:
83
+ - README
84
+ - LICENSE
85
+ - CHANGES
71
86
  executables: []
72
87
 
73
88
  extensions: []
@@ -1,55 +0,0 @@
1
- --- %YAML:1.0
2
-
3
- title : &title Equipment
4
- name : &pkg equipment
5
- version : '0.1.0'
6
- status : alpha
7
-
8
- author : Jonas Pfenniger
9
- email : &email zimba.tm@gmail.com
10
- username : &username zimbatm
11
- homepage : "http://equipment.rubyforge.org"
12
-
13
- summary : Camping equipments
14
-
15
- description: >
16
- Equipment is a set of ready to use extensions for Camping.
17
-
18
- rubyforge:
19
- project: *pkg
20
- username: zimbatm
21
-
22
- dependencies:
23
- - [ camping, '>= 1.4.2' ]
24
-
25
- executables: []
26
-
27
- #=================================================
28
- # Unremark and use as needed. Often defaults
29
- # are sufficiant and need not specify
30
- # extra parameters.
31
- #=================================================
32
-
33
- package: !!package
34
- distribute : [ gem, zip, tgz ] # tgz zip deb tar.bzip2 gem
35
- exclude : [ _darcs, doc, web ]
36
-
37
- rdoc: !!rdoc
38
-
39
- test: !!test
40
-
41
- release: !!release
42
- host : rubyforge.org
43
- username : *username
44
- project : *pkg
45
- groupid : 811
46
- package : *title
47
- dir : 'dist'
48
-
49
- publish: !!publish
50
- target : rubyforge
51
- type : web
52
- host : rubyforge.org
53
- username : *username
54
- dir : web
55
-
@@ -1,59 +0,0 @@
1
- require 'camping'
2
- require 'ext/basic_auth'
3
-
4
- $DBG = true
5
-
6
- Camping.goes :BasicAuthTest
7
-
8
- module BasicAuthTest
9
- Ext::BasicAuth.equip(self)
10
-
11
- module Base
12
- def authenticate
13
- @user, @pass = super
14
- end
15
- end
16
-
17
- module Controllers
18
- # Allow not authenticated users
19
- class Index < R '/'
20
- def get; render :index ; end
21
- end
22
-
23
- class AskAuth < R '/ask_auth'
24
-
25
- def authorize(user, pass, force=true)
26
- puts "Authorize called"
27
- return false
28
- (user == pass and not user.empty?) || super
29
- end
30
-
31
- def get; render :ask_auth ; end
32
- end
33
- end
34
-
35
- module Views
36
- def layout
37
- html do
38
- head { title "BasicAuth test" }
39
- body do
40
- pre 'user : ' + @user.inspect
41
- pre 'pass : ' + @pass.inspect
42
- div { yield }
43
- end
44
- end
45
- end
46
-
47
- def index
48
- h1 "Index"
49
- p 'User must be equal to the password.'
50
- a "AskAuth", :href=>R(AskAuth)
51
- end
52
-
53
- def ask_auth
54
- h2 "You're authenticated now."
55
- a "Index", :href=>R(Index)
56
- end
57
-
58
- end
59
- end
@@ -1,36 +0,0 @@
1
- require 'camping'
2
- require 'ext/eruby_view'
3
-
4
- $DBG = true
5
-
6
- Camping.goes :ErubyTest
7
-
8
-
9
- module ErubyTest
10
- Ext::ErubyView.equip(self)
11
-
12
- Views.template_root = File.dirname(__FILE__)
13
-
14
- module Controllers
15
- class Index < R '/'
16
- def get
17
- @somevar = 'var var'
18
- render :index
19
- end
20
- end
21
- end
22
-
23
- module Views
24
- def layout
25
- html do
26
- head { title "Erubis test" }
27
- body { yield }
28
- end
29
- end
30
-
31
- def index
32
- h1 "No template"
33
- end
34
- end
35
- end
36
-
@@ -1,46 +0,0 @@
1
- require 'camping'
2
- require 'ext/flash'
3
-
4
- $DBG = true
5
-
6
- Camping.goes :FlashTest
7
-
8
-
9
- module FlashTest
10
- Ext::Flash.equip(self)
11
-
12
- module Controllers
13
- class Index < R '/'
14
- def get; render :index ; end
15
- end
16
-
17
- class SomeError
18
- def get;
19
- 1 / 0
20
- rescue => ex
21
- flash.error = ex.message
22
- redirect R(Index)
23
- end
24
- end
25
- end
26
-
27
- module Views
28
- def layout
29
- html do
30
- head do
31
- title "Flash test"
32
- end
33
- body do
34
- pre 'Cookies: ' + @cookies.inspect
35
- p "Error : #{flash.error}" if flash.error
36
- self << yield
37
- end
38
- end
39
- end
40
-
41
- def index
42
- h1 "Index"
43
- a "SomeError", :href=>R(SomeError)
44
- end
45
- end
46
- end
@@ -1,9 +0,0 @@
1
- <h1>Erubis view</h1>
2
-
3
- <p>Somevar : <%= @somevar.inspect %></p>
4
-
5
- <p>Some link : <%= R(Index) %></p>
6
-
7
- <p>template class : <%= self.class %></p>
8
-
9
-
@@ -1,34 +0,0 @@
1
- require 'camping'
2
- require 'ext/mount'
3
-
4
- $DBG = true
5
-
6
- Camping.goes :MountTest
7
-
8
-
9
- module MountTest
10
- Ext::Mount.equip(self)
11
-
12
- module Controllers
13
- mount File.dirname(File.expand_path(__FILE__)), :name=>:Dir, :url=>'/dir'
14
-
15
- class Index < R '/'
16
- def get; render :index ; end
17
- end
18
- end
19
-
20
- module Views
21
- def layout
22
- html do
23
- head { title "Mount test" }
24
- body { yield }
25
- end
26
- end
27
-
28
- def index
29
- h1 "Index"
30
- a "DirListing", :href=>"/dir" #,:href=>R(Example)
31
- end
32
- end
33
- end
34
-
@@ -1,41 +0,0 @@
1
- require 'camping'
2
- require 'ext/og_scaffold'
3
-
4
- $DBG = true
5
-
6
- Camping.goes :OgTest
7
-
8
- module OgTest
9
- Ext::OgScaffold.equip(self)
10
-
11
- module Models
12
- self.og = {:store => :mysql, :name=>'og_test', :user=>'root'}
13
-
14
- class User
15
- attr_accessor :login, String
16
- attr_accessor :password, String
17
- belongs_to Group
18
- end
19
-
20
- class Group
21
- attr_accessor :name, String
22
- has_many User
23
- end
24
- end
25
-
26
- module Controllers
27
- class Index < R '/'
28
- def get
29
- render :index
30
- end
31
- end
32
- end
33
-
34
- module Views
35
- def index
36
- h1 "Index"
37
- p "Nothing special here"
38
- end
39
- end
40
-
41
- end
@@ -1,40 +0,0 @@
1
- require 'camping'
2
- require 'ext/patches'
3
-
4
- $DBG = true
5
-
6
- Camping.goes :PatchesTest
7
-
8
-
9
- module PatchesTest
10
- Ext::Patches.equip(self)
11
-
12
- module Controllers
13
- class Index < R '/'
14
- def get
15
- render :index
16
- end
17
- end
18
-
19
- class ZeroDiv
20
- def get
21
- 1 / 0
22
- end
23
- end
24
- end
25
-
26
- module Views
27
- def layout
28
- html do
29
- head { title "Patches test" }
30
- body { yield }
31
- end
32
- end
33
-
34
- def index
35
- h1 "Hello"
36
- a "ZeroDiv", :href => R(ZeroDiv)
37
- end
38
- end
39
- end
40
-
@@ -1,29 +0,0 @@
1
- require 'camping'
2
- require 'ext/sendfile'
3
-
4
- $DBG = true
5
-
6
- Camping.goes(:SendfileTest)
7
-
8
- Ext::Sendfile.equip(SendfileTest)
9
-
10
- module SendfileTest
11
-
12
- module Controllers
13
- class Index < R '/'
14
- def get; render :index ; end
15
- end
16
-
17
- class GetSelf
18
- def get; sendfile __FILE__ end
19
- end
20
- end
21
-
22
- module Views
23
- def index
24
- h1 "Index"
25
- a "Get self", :href=>R(GetSelf)
26
- end
27
- end
28
- end
29
-