mack 0.8.0.101 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. data/CHANGELOG +29 -0
  2. data/bin/mackery-console +6 -5
  3. data/bin/mackery-server +23 -7
  4. data/lib/mack.rb +0 -3
  5. data/lib/mack/application.rb +161 -0
  6. data/lib/mack/assets/asset_helpers.rb +8 -0
  7. data/lib/mack/assets/assets_mgr.rb +0 -10
  8. data/lib/mack/boot/app.rb +46 -0
  9. data/lib/mack/boot/assets.rb +10 -0
  10. data/lib/mack/boot/configuration.rb +87 -0
  11. data/lib/mack/boot/console.rb +36 -0
  12. data/lib/mack/boot/core.rb +21 -0
  13. data/lib/mack/boot/environment.rb +22 -0
  14. data/lib/mack/boot/extensions.rb +13 -0
  15. data/lib/mack/boot/gem_tasks.rb +20 -0
  16. data/lib/mack/boot/gems.rb +18 -0
  17. data/lib/mack/boot/hello.rb +11 -0
  18. data/lib/mack/{initialization → boot}/helpers.rb +8 -3
  19. data/lib/mack/boot/initializers.rb +17 -0
  20. data/lib/mack/boot/lib.rb +19 -0
  21. data/lib/mack/{initialization → boot}/logging.rb +16 -9
  22. data/lib/mack/{initialization → boot}/logging/basic_layout.rb +0 -0
  23. data/lib/mack/{initialization → boot}/logging/color_layout.rb +1 -1
  24. data/lib/mack/{initialization → boot}/logging/filter.rb +0 -0
  25. data/lib/mack/boot/paths.rb +234 -0
  26. data/lib/mack/boot/plugins.rb +26 -0
  27. data/lib/mack/boot/portlets.rb +20 -0
  28. data/lib/mack/boot/routes.rb +15 -0
  29. data/lib/mack/boot/version.rb +7 -0
  30. data/lib/mack/controller/request.rb +5 -2
  31. data/lib/mack/controller/uploaded_file.rb +4 -0
  32. data/lib/mack/core_extensions/kernel.rb +26 -0
  33. data/lib/mack/core_extensions/object.rb +16 -0
  34. data/lib/mack/generators/mack_application_generator/manifest.yml +5 -3
  35. data/lib/mack/generators/mack_application_generator/templates/config/initializers/portlets.rb.template +9 -0
  36. data/lib/mack/generators/mack_application_generator/templates/public/stylesheets/scaffold.css.template +4 -0
  37. data/lib/mack/generators/portlet_generator/portlet_generator.rb +2 -0
  38. data/lib/mack/generators/portlet_generator/templates/README.template +3 -0
  39. data/lib/mack/generators/portlet_generator/templates/portlet_config/portlet.spec.template +28 -0
  40. data/lib/mack/portlets/manager.rb +27 -0
  41. data/lib/mack/portlets/portlet.rb +93 -0
  42. data/lib/mack/portlets/unpacker.rb +34 -0
  43. data/lib/mack/rendering/engine/erubis.rb +2 -2
  44. data/lib/mack/rendering/type/file_base.rb +8 -4
  45. data/lib/mack/rendering/type/public.rb +4 -2
  46. data/lib/mack/routing/resource_proxy.rb +30 -4
  47. data/lib/mack/routing/route_map.rb +28 -15
  48. data/lib/mack/routing/route_object.rb +57 -24
  49. data/lib/mack/routing/urls.rb +12 -2
  50. data/lib/mack/runner.rb +6 -154
  51. data/lib/mack/sessions/cookie_session_store.rb +2 -1
  52. data/lib/mack/tasks/mack_dump_tasks.rake +62 -18
  53. data/lib/mack/tasks/mack_tasks.rake +1 -15
  54. data/lib/mack/tasks/portlet_tasks.rake +33 -0
  55. data/lib/mack/tasks/rake_rules.rake +6 -0
  56. data/lib/mack/tasks/test_tasks.rake +4 -6
  57. data/lib/mack/testing/helpers.rb +12 -4
  58. data/lib/mack/utils/server.rb +7 -1
  59. data/lib/mack/utils/static.rb +19 -0
  60. data/lib/mack/version.rb +1 -1
  61. data/lib/mack/view_helpers/all_helpers.rb +0 -8
  62. data/lib/mack/view_helpers/date_time_helpers.rb +18 -12
  63. data/lib/mack/view_helpers/form_helpers.rb +9 -0
  64. data/lib/mack/view_helpers/html_helpers.rb +18 -7
  65. data/lib/mack/view_helpers/link_helpers.rb +2 -1
  66. data/lib/mack/view_helpers/object_helpers.rb +1 -1
  67. data/lib/mack_app.rb +26 -14
  68. data/lib/mack_core.rb +50 -39
  69. data/lib/mack_tasks.rb +46 -19
  70. metadata +37 -18
  71. data/lib/mack/initialization/application.rb +0 -53
  72. data/lib/mack/initialization/boot_loader.rb +0 -72
  73. data/lib/mack/initialization/configuration.rb +0 -101
  74. data/lib/mack/initialization/console.rb +0 -29
  75. data/lib/mack/initialization/environment.rb +0 -16
  76. data/lib/mack/initialization/plugins.rb +0 -16
  77. data/lib/mack/initialization/server/simple_server.rb +0 -19
  78. data/lib/mack/tasks/mack_server_tasks.rake +0 -24
  79. data/lib/mack/utils/paths.rb +0 -154
@@ -1,16 +0,0 @@
1
- module Mack
2
- # Allows hook methods for the loading of the environment.
3
- module Environment
4
- include Extlib::Hook
5
-
6
- # Requires the Mack application classes only once.
7
- # This is the method you want to add 'hooks' on for
8
- # application load setup.
9
- def self.load
10
- ivar_cache do
11
- require File.join(File.dirname(__FILE__), "..", "..", "mack_app")
12
- end
13
- end
14
-
15
- end
16
- end
@@ -1,16 +0,0 @@
1
- boot_load(:plugins, :initializers) do
2
- Mack.logger.debug "Initializing plugins..." unless configatron.mack.log.disable_initialization_logging
3
- plugins = [] # a list of all plugins
4
- Dir.glob(Mack::Paths.plugins("*")).each do |d|
5
- plugins << d
6
- $: << File.join(d, "lib") # add the lib for this plugin to the global load path
7
- end
8
- plugins.sort.each do |plug|
9
- begin
10
- require File.join(plug, "init.rb") # load the init.rb for each plugin.
11
- rescue Exception => e
12
- puts e.message
13
- end
14
- $:.delete(File.join(plug, "lib")) # remove the plugins lib directory from the global load path.
15
- end
16
- end
@@ -1,19 +0,0 @@
1
- module Mack
2
- # Even though it's called, SimpleServer, this might be the only server you need to run
3
- # a Mack application.
4
- #
5
- # This SimpleServer does not use Thin. But does work with anything that Rack has a handler for.
6
- class SimpleServer
7
-
8
- class << self
9
-
10
- def run(options)
11
- r = "Rack::Handler::#{options[:handler].camelcase}"
12
- puts "Starting app using: #{r} in #{options[:environment]} mode on port: #{options[:port]}"
13
- eval(r).run(Mack::Utils::Server.build_app, :Port => options[:port])
14
- end
15
-
16
- end
17
-
18
- end
19
- end
@@ -1,24 +0,0 @@
1
- namespace :mack do
2
-
3
- namespace :server do
4
-
5
- desc "Starts the webserver."
6
- task :start do |t|
7
- puts %{
8
- This task has been removed. Please use the 'mackery' command to start/stop the server:
9
-
10
- $ mackery server
11
-
12
- The environment can be set like this:
13
-
14
- $ mackery server -e test
15
-
16
- $ mackery server -p 8080 -e production # etc...
17
- }
18
- end # start
19
-
20
- end # server
21
-
22
- end # mack
23
-
24
- alias_task :server, "log:clear", "mack:server:start"
@@ -1,154 +0,0 @@
1
- module Mack
2
- module Paths
3
-
4
- # <MACK_PROJECT_ROOT>
5
- def self.root(*files)
6
- File.join(Mack.root, *files)
7
- end
8
-
9
- # <MACK_PROJECT_ROOT>/public
10
- def self.public(*files)
11
- Mack::Paths.root("public", *files)
12
- end
13
-
14
- # <MACK_PROJECT_ROOT>/public/images
15
- def self.images(*files)
16
- Mack::Paths.public("images", *files)
17
- end
18
-
19
- # <MACK_PROJECT_ROOT>/public/javascripts
20
- def self.javascripts(*files)
21
- Mack::Paths.public("javascripts", *files)
22
- end
23
-
24
- # <MACK_PROJECT_ROOT>/public/stylesheets
25
- def self.stylesheets(*files)
26
- Mack::Paths.public("stylesheets", *files)
27
- end
28
-
29
- # <MACK_PROJECT_ROOT>/app
30
- def self.app(*files)
31
- Mack::Paths.root("app", *files)
32
- end
33
-
34
- # <MACK_PROJECT_ROOT>/log
35
- def self.log(*files)
36
- Mack::Paths.root("log", *files)
37
- end
38
-
39
- # <MACK_PROJECT_ROOT>/test
40
- def self.test(*files)
41
- Mack::Paths.root("test", *files)
42
- end
43
-
44
- # <MACK_PROJECT_ROOT>/tmp
45
- def self.tmp(*files)
46
- Mack::Paths.root("tmp", *files)
47
- end
48
-
49
- # <MACK_PROJECT_ROOT>/test/models
50
- def self.model_tests(*files)
51
- Mack::Paths.test("models", *files)
52
- end
53
-
54
- # <MACK_PROJECT_ROOT>/test/controllers
55
- def self.controller_tests(*files)
56
- Mack::Paths.test("controllers", *files)
57
- end
58
-
59
- def self.test_helpers(*files)
60
- Mack::Paths.test("helpers", *files)
61
- end
62
-
63
- # <MACK_PROJECT_ROOT>/test/helpers/controllers
64
- def self.controller_helper_tests(*files)
65
- Mack::Paths.test_helpers("controllers", *files)
66
- end
67
-
68
- # <MACK_PROJECT_ROOT>/test/helpers/views
69
- def self.view_helper_tests(*files)
70
- Mack::Paths.test_helpers("views", *files)
71
- end
72
-
73
- # <MACK_PROJECT_ROOT>/app/views
74
- def self.views(*files)
75
- Mack::Paths.app("views", *files)
76
- end
77
-
78
- # <MACK_PROJECT_ROOT>/app/views/layouts
79
- def self.layouts(*files)
80
- Mack::Paths.views("layouts", *files)
81
- end
82
-
83
- # <MACK_PROJECT_ROOT>/app/controllers
84
- def self.controllers(*files)
85
- Mack::Paths.app("controllers", *files)
86
- end
87
-
88
- # <MACK_PROJECT_ROOT>/app/models
89
- def self.models(*files)
90
- Mack::Paths.app("models", *files)
91
- end
92
-
93
- # <MACK_PROJECT_ROOT>/app/helpers
94
- def self.helpers(*files)
95
- Mack::Paths.app("helpers", *files)
96
- end
97
-
98
- # <MACK_PROJECT_ROOT>/app/helpers/controllers
99
- def self.controller_helpers(*files)
100
- Mack::Paths.helpers("controllers", *files)
101
- end
102
-
103
- # <MACK_PROJECT_ROOT>/app/helpers/views
104
- def self.view_helpers(*files)
105
- Mack::Paths.helpers("views", *files)
106
- end
107
-
108
- # <MACK_PROJECT_ROOT>/lib
109
- def self.lib(*files)
110
- Mack::Paths.root("lib", *files)
111
- end
112
-
113
- # <MACK_PROJECT_ROOT>/lib/tasks
114
- def self.tasks(*files)
115
- Mack::Paths.lib("tasks", *files)
116
- end
117
-
118
- # <MACK_PROJECT_ROOT>/db
119
- def self.db(*files)
120
- Mack::Paths.root("db", *files)
121
- end
122
-
123
- # <MACK_PROJECT_ROOT>/db/migrations
124
- def self.migrations(*files)
125
- Mack::Paths.db("migrations", *files)
126
- end
127
-
128
- # <MACK_PROJECT_ROOT>/config
129
- def self.config(*files)
130
- Mack::Paths.root("config", *files)
131
- end
132
-
133
- # <MACK_PROJECT_ROOT>/config/configatron
134
- def self.configatron(*files)
135
- Mack::Paths.config("configatron", *files)
136
- end
137
-
138
- # <MACK_PROJECT_ROOT>/config/initializers
139
- def self.initializers(*files)
140
- Mack::Paths.config("initializers", *files)
141
- end
142
-
143
- # <MACK_PROJECT_ROOT>/vendor
144
- def self.vendor(*files)
145
- Mack::Paths.root("vendor", *files)
146
- end
147
-
148
- # <MACK_PROJECT_ROOT>/vendor/plugins
149
- def self.plugins(*files)
150
- Mack::Paths.vendor("plugins", *files)
151
- end
152
-
153
- end # Paths
154
- end # Mack