netzke-core 0.5.5 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. data/.autotest +1 -1
  2. data/.gitignore +4 -2
  3. data/CHANGELOG.rdoc +37 -15
  4. data/README.rdoc +93 -28
  5. data/Rakefile +5 -7
  6. data/TODO +24 -3
  7. data/app/controllers/netzke_controller.rb +70 -0
  8. data/app/models/netzke_preference.rb +170 -0
  9. data/autotest/discover.rb +2 -3
  10. data/features/actions.feature +13 -0
  11. data/features/basic.feature +7 -0
  12. data/features/client-server.feature +15 -0
  13. data/features/complex_component.feature +18 -0
  14. data/features/component.feature +13 -0
  15. data/features/component_loader.feature +31 -0
  16. data/features/composition.feature +32 -0
  17. data/features/custom_css.feature +17 -0
  18. data/features/file_inclusion.feature +13 -0
  19. data/features/inheritance.feature +19 -0
  20. data/features/persistence.feature +16 -0
  21. data/features/scopes.feature +17 -0
  22. data/features/step_definitions/custom_css_steps.rb +7 -0
  23. data/features/step_definitions/generic_steps.rb +15 -0
  24. data/features/step_definitions/web_steps.rb +219 -0
  25. data/features/support/env.rb +62 -0
  26. data/features/support/paths.rb +45 -0
  27. data/generators/netzke_core/USAGE +3 -3
  28. data/generators/netzke_core/netzke_core_generator.rb +8 -0
  29. data/install.rb +1 -1
  30. data/javascripts/core.js +542 -499
  31. data/lib/generators/migration_helper.rb +32 -0
  32. data/lib/generators/netzke/USAGE +9 -0
  33. data/lib/generators/netzke/core_generator.rb +24 -0
  34. data/lib/netzke/actions.rb +102 -0
  35. data/lib/netzke/base.rb +77 -529
  36. data/lib/netzke/composition.rb +251 -0
  37. data/lib/netzke/configuration.rb +134 -0
  38. data/lib/netzke/core/masquerading.rb +34 -0
  39. data/lib/netzke/core/session.rb +30 -0
  40. data/lib/netzke/core/version.rb +11 -0
  41. data/lib/netzke/core.rb +53 -0
  42. data/lib/netzke/core_ext/array.rb +30 -0
  43. data/lib/netzke/core_ext/hash.rb +84 -0
  44. data/lib/netzke/core_ext/string.rb +26 -0
  45. data/lib/netzke/core_ext/symbol.rb +13 -0
  46. data/lib/netzke/core_ext/time_with_zone.rb +7 -0
  47. data/lib/netzke/core_ext.rb +5 -141
  48. data/lib/netzke/embedding.rb +21 -0
  49. data/lib/netzke/ext_component.rb +25 -0
  50. data/lib/netzke/javascript.rb +248 -0
  51. data/lib/netzke/persistence.rb +118 -0
  52. data/lib/netzke/rails/action_view_ext.rb +103 -0
  53. data/lib/netzke/{controller_extensions.rb → rails/controller_extensions.rb} +7 -2
  54. data/lib/netzke/rails/routes.rb +7 -0
  55. data/lib/netzke/services.rb +68 -0
  56. data/lib/netzke/session.rb +35 -0
  57. data/lib/netzke/stylesheets.rb +52 -0
  58. data/lib/netzke-core.rb +28 -29
  59. data/netzke-core.gemspec +253 -0
  60. data/spec/component/actions_spec.rb +94 -0
  61. data/spec/component/base_spec.rb +25 -0
  62. data/spec/component/composition_spec.rb +132 -0
  63. data/spec/component/javascript_spec.rb +15 -0
  64. data/spec/core_ext_spec.rb +16 -0
  65. data/spec/spec.opt +2 -0
  66. data/spec/spec_helper.rb +35 -0
  67. data/{test/app_root/db/migrate/20081222035855_create_netzke_preferences.rb → templates/core/create_netzke_preferences.rb} +4 -4
  68. data/test/rails_app/.gitignore +4 -0
  69. data/test/rails_app/Gemfile +36 -0
  70. data/test/rails_app/Gemfile.lock +137 -0
  71. data/test/rails_app/README +15 -0
  72. data/test/rails_app/Rakefile +7 -0
  73. data/test/rails_app/app/components/border_layout_panel.rb +4 -0
  74. data/test/rails_app/app/components/component_loader.rb +59 -0
  75. data/test/rails_app/app/components/component_with_actions.rb +58 -0
  76. data/test/rails_app/app/components/component_with_custom_css.rb +8 -0
  77. data/test/rails_app/app/components/component_with_included_js.rb +16 -0
  78. data/test/rails_app/app/components/component_with_session_persistence.rb +25 -0
  79. data/test/rails_app/app/components/custom.css +3 -0
  80. data/test/rails_app/app/components/deprecated/server_caller.rb +20 -0
  81. data/test/rails_app/app/components/extended_component_with_actions.rb +5 -0
  82. data/test/rails_app/app/components/extended_server_caller.rb +18 -0
  83. data/test/rails_app/app/components/included.js +5 -0
  84. data/test/rails_app/app/components/kinda_complex_component/basic_stuff.rb +35 -0
  85. data/test/rails_app/app/components/kinda_complex_component/extra_stuff.rb +16 -0
  86. data/test/rails_app/app/components/kinda_complex_component.rb +7 -0
  87. data/test/rails_app/app/components/loader_of_component_with_custom_css.rb +15 -0
  88. data/test/rails_app/app/components/scoped_components/deep_scoped_components/some_deep_scoped_component.rb +7 -0
  89. data/test/rails_app/app/components/scoped_components/extended_scoped_component.rb +5 -0
  90. data/test/rails_app/app/components/scoped_components/some_scoped_component.rb +5 -0
  91. data/test/rails_app/app/components/server_caller.rb +21 -0
  92. data/test/rails_app/app/components/simple_component.rb +5 -0
  93. data/test/rails_app/app/components/simple_tab_panel.rb +27 -0
  94. data/test/rails_app/app/components/simple_window.rb +3 -0
  95. data/test/rails_app/app/components/some_composite.rb +65 -0
  96. data/test/rails_app/app/components/some_ext_component.rb +8 -0
  97. data/test/{app_root → rails_app}/app/controllers/application_controller.rb +1 -0
  98. data/test/rails_app/app/controllers/components_controller.rb +12 -0
  99. data/test/rails_app/app/controllers/multiple_components_controller.rb +2 -0
  100. data/test/rails_app/app/controllers/welcome_controller.rb +5 -0
  101. data/test/rails_app/app/helpers/application_helper.rb +2 -0
  102. data/test/rails_app/app/views/layouts/application.html.erb +13 -0
  103. data/test/rails_app/app/views/multiple_components/set_one.html.erb +3 -0
  104. data/test/rails_app/config/application.rb +45 -0
  105. data/test/rails_app/config/boot.rb +13 -0
  106. data/test/rails_app/config/database.yml +22 -0
  107. data/test/rails_app/config/environment.rb +6 -0
  108. data/test/rails_app/config/environments/development.rb +22 -0
  109. data/test/rails_app/config/environments/production.rb +49 -0
  110. data/test/rails_app/config/environments/test.rb +35 -0
  111. data/test/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  112. data/test/rails_app/config/initializers/inflections.rb +10 -0
  113. data/test/rails_app/config/initializers/mime_types.rb +5 -0
  114. data/test/rails_app/config/initializers/netzke.rb +3 -0
  115. data/test/rails_app/config/initializers/secret_token.rb +7 -0
  116. data/test/rails_app/config/initializers/session_store.rb +8 -0
  117. data/test/rails_app/config/locales/en.yml +5 -0
  118. data/test/rails_app/config/routes.rb +64 -0
  119. data/test/rails_app/config.ru +4 -0
  120. data/test/rails_app/db/development_structure.sql +4 -0
  121. data/{generators/netzke_core/templates/create_netzke_preferences.rb → test/rails_app/db/migrate/20100905214933_create_netzke_preferences.rb} +1 -3
  122. data/test/rails_app/db/schema.rb +24 -0
  123. data/test/rails_app/db/seeds.rb +7 -0
  124. data/test/{app_root/config/environments/in_memory.rb → rails_app/lib/tasks/.gitkeep} +0 -0
  125. data/test/rails_app/public/404.html +26 -0
  126. data/test/rails_app/public/422.html +26 -0
  127. data/test/rails_app/public/500.html +26 -0
  128. data/test/{app_root/config/environments/mysql.rb → rails_app/public/favicon.ico} +0 -0
  129. data/test/rails_app/public/images/rails.png +0 -0
  130. data/test/rails_app/public/robots.txt +5 -0
  131. data/test/rails_app/script/rails +6 -0
  132. data/test/{app_root/config/environments/postgresql.rb → rails_app/vendor/plugins/.gitkeep} +0 -0
  133. data/test/unit/netzke_core_test.rb +74 -75
  134. data/test/unit/netzke_preference_test.rb +2 -2
  135. metadata +176 -48
  136. data/lib/app/controllers/netzke_controller.rb +0 -46
  137. data/lib/app/models/netzke_preference.rb +0 -171
  138. data/lib/netzke/action_view_ext.rb +0 -81
  139. data/lib/netzke/base_js.rb +0 -339
  140. data/lib/netzke/routing.rb +0 -9
  141. data/test/app_root/app/models/role.rb +0 -3
  142. data/test/app_root/app/models/user.rb +0 -3
  143. data/test/app_root/config/boot.rb +0 -115
  144. data/test/app_root/config/database.yml +0 -31
  145. data/test/app_root/config/environment.rb +0 -14
  146. data/test/app_root/config/environments/sqlite.rb +0 -0
  147. data/test/app_root/config/environments/sqlite3.rb +0 -0
  148. data/test/app_root/config/routes.rb +0 -4
  149. data/test/app_root/db/migrate/20090423214303_create_roles.rb +0 -11
  150. data/test/app_root/db/migrate/20090423222114_create_users.rb +0 -12
  151. data/test/app_root/lib/console_with_fixtures.rb +0 -4
  152. data/test/app_root/script/console +0 -7
@@ -0,0 +1,35 @@
1
+ class KindaComplexComponent < Netzke::Base
2
+ # Note the use of ActiveSupport::Concern module
3
+ module BasicStuff
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ action :some_action
8
+ action :another_action
9
+
10
+ # Calling main class' methods is simple
11
+ js_method :on_some_action, <<-JS
12
+ function(){ this.items.last().setTitle("Action triggered"); }
13
+ JS
14
+
15
+ # Another way of defining a JS method
16
+ js_method :on_another_action do
17
+ <<-JS
18
+ function(){ this.items.first().setTitle("Another action triggered"); }
19
+ JS
20
+ end
21
+
22
+ js_properties(
23
+ :active_tab => 0, :bbar => [:some_action.action, :another_action.action]
24
+ )
25
+
26
+ # Instance method, overridden in the ExtraStuff module
27
+ # config
28
+ end
29
+
30
+ def final_config
31
+ super.merge(:items => [{:title => "Panel One"}, {:title => "Panel Two"}])
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,16 @@
1
+ class KindaComplexComponent < Netzke::Base
2
+ module ExtraStuff
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ component :server_caller
7
+ end
8
+
9
+ # Let's add another tab with a Netzke component in it
10
+ def final_config
11
+ orig = super
12
+ orig[:items] << js_component(:server_caller)
13
+ orig
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,7 @@
1
+ # This is an example of dividing component's code into modules. Use it to build complex components.
2
+ class KindaComplexComponent < Netzke::Base
3
+ js_base_class "Ext.TabPanel"
4
+
5
+ include BasicStuff
6
+ include ExtraStuff
7
+ end
@@ -0,0 +1,15 @@
1
+ # Loads a component with custom CSS, to make sure that also dynamically loaded components get the correct CSS applied
2
+ class LoaderOfComponentWithCustomCss < Netzke::Base
3
+ component :component_with_custom_css, :class_name => "ComponentWithCustomCss", :lazy_loading => true
4
+
5
+ js_properties :title => "LoaderOfComponentWithCustomCss", :layout => 'fit', :bbar => [{:text => "Load ComponentWithCustomCss", :ref => "../button"}]
6
+
7
+ js_method :init_component, <<-JS
8
+ function(){
9
+ #{js_full_class_name}.superclass.initComponent.call(this);
10
+ this.button.on('click', function(){
11
+ this.loadComponent({id: 'component_with_custom_css', container: this.getId()});
12
+ }, this);
13
+ }
14
+ JS
15
+ end
@@ -0,0 +1,7 @@
1
+ module ScopedComponents
2
+ module DeepScopedComponents
3
+ class SomeDeepScopedComponent < ScopedComponents::SomeScopedComponent
4
+ js_properties :title => "Some Deep Scoped Component Title", :html => "Some Deep Scoped Component HTML"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module ScopedComponents
2
+ class ExtendedScopedComponent < SomeScopedComponent
3
+ js_properties :title => "Extended Scoped Component Title", :html => "Extended Scoped Component HTML"
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module ScopedComponents
2
+ class SomeScopedComponent < Netzke::Base
3
+ js_properties :title => "Some Scoped Component Title", :html => "Some Scoped Component HTML"
4
+ end
5
+ end
@@ -0,0 +1,21 @@
1
+ class ServerCaller < Netzke::Base
2
+ action :bug_server, :text => "Call server"
3
+
4
+ js_properties(
5
+ :title => "Server Caller",
6
+ :html => "Wow",
7
+ :bbar => [:bug_server.action]
8
+ )
9
+
10
+ js_method :on_bug_server, <<-JS
11
+ function(){
12
+ this.whatsUp();
13
+ this.update('You should see the response from the server in the title bar the very next moment');
14
+ }
15
+ JS
16
+
17
+ endpoint :whats_up do |params|
18
+ {:set_title => "All quiet here on the server"}
19
+ end
20
+
21
+ end
@@ -0,0 +1,5 @@
1
+ class SimpleComponent < Netzke::Base
2
+ js_properties :title => "SimpleComponent",
3
+ :html => "Inner text"
4
+ end
5
+
@@ -0,0 +1,27 @@
1
+ class SimpleTabPanel < Netzke::Base
2
+ js_base_class "Ext.TabPanel"
3
+
4
+ js_property :active_tab, 0
5
+
6
+ config :items => [{
7
+ # Loading a primitive BorderLayoutPanel here
8
+ :class_name => "BorderLayoutPanel",
9
+ :title => "A border layout panel",
10
+ :items => [{
11
+ :region => :north,
12
+ :height => 100,
13
+ :title => "I'm NOT a Netzke component",
14
+ :html => "I'm a simple panel"
15
+ },{
16
+ :region => :center,
17
+ :class_name => "ServerCaller"
18
+ },{
19
+ :region => :west,
20
+ :width => 300,
21
+ :split => true,
22
+ :class_name => "ExtendedServerCaller"
23
+ }]
24
+ },{
25
+ :class_name => "ExtendedServerCaller"
26
+ }]
27
+ end
@@ -0,0 +1,3 @@
1
+ class SimpleWindow < Netzke::Base
2
+ js_base_class "Ext.Window"
3
+ end
@@ -0,0 +1,65 @@
1
+ class SomeComposite < Netzke::Base
2
+ js_properties :title => "Static Composite",
3
+ :layout => 'border',
4
+ :bbar => [
5
+ :update_west_panel.action,
6
+ :update_center_panel.action,
7
+ :update_west_from_server.action,
8
+ :update_east_south_from_server.action
9
+ ]
10
+
11
+ action :update_center_panel
12
+ action :update_west_panel
13
+ action :update_west_from_server
14
+ action :update_east_south_from_server
15
+
16
+ config :items => [
17
+ js_component(:center_panel, :region => 'center'),
18
+ js_component(:west_panel, :region => 'west', :width => 300, :split => true),
19
+ {:layout => 'border', :region => :east, :width => 500, :split => true, :items => [
20
+ js_component(:east_center_panel, :region => :center),
21
+ js_component(:east_south_panel, :region => :south, :height => 200, :split => true)
22
+ ]},
23
+ ]
24
+
25
+ component :west_panel, :class_name => "ExtendedServerCaller"
26
+
27
+ component :center_panel, :class_name => "ServerCaller"
28
+
29
+ component :east_center_panel, :class_name => "SimpleComponent", :title => "A panel"
30
+
31
+ component :east_south_panel, :class_name => "SimpleComponent", :title => "Another panel"
32
+
33
+ endpoint :update_east_south do |params|
34
+ {:east_south_panel => {:set_title => "Here's an update for south panel in east panel"}}
35
+ end
36
+
37
+ endpoint :update_west do |params|
38
+ {:west_panel => {:set_title => "Here's an update for west panel"}}
39
+ end
40
+
41
+ js_method :on_update_west_panel, <<-JS
42
+ function(){
43
+ this.items.filter('name', 'west_panel').first().body.update('West Panel Body Updated');
44
+ }
45
+ JS
46
+
47
+ js_method :on_update_center_panel, <<-JS
48
+ function(){
49
+ this.items.filter('name', 'center_panel').first().body.update('Center Panel Body Updated');
50
+ }
51
+ JS
52
+
53
+ js_method :on_update_east_south_from_server, <<-JS
54
+ function(){
55
+ this.updateEastSouth();
56
+ }
57
+ JS
58
+
59
+ js_method :on_update_west_from_server, <<-JS
60
+ function(){
61
+ this.updateWest();
62
+ }
63
+ JS
64
+
65
+ end
@@ -0,0 +1,8 @@
1
+ # Non-netzke Ext component
2
+ class SomeExtComponent < Netzke::ExtComponent
3
+ def config
4
+ {
5
+ :html => "HELLOOO"
6
+ }
7
+ end
8
+ end
@@ -1,2 +1,3 @@
1
1
  class ApplicationController < ActionController::Base
2
+ protect_from_forgery
2
3
  end
@@ -0,0 +1,12 @@
1
+ class ComponentsController < ApplicationController
2
+ def show
3
+ component_name = params[:component].gsub("::", "_").underscore
4
+ render :inline => "<%= netzke :#{component_name}, :class_name => '#{params[:component]}' %>", :layout => true
5
+ end
6
+
7
+ # Just a test for a pure Ext component - not sure if it's useful.
8
+ def ext
9
+ component_name = params[:component].gsub("::", "_").underscore
10
+ render :inline => "<%= ext :#{component_name} %>", :layout => true
11
+ end
12
+ end
@@ -0,0 +1,2 @@
1
+ class MultipleComponentsController < ApplicationController
2
+ end
@@ -0,0 +1,5 @@
1
+ class WelcomeController < ApplicationController
2
+ def index
3
+ render :text => "This is a test app build into netzke_core"
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>RailsApp</title>
5
+ <%= csrf_meta_tag %>
6
+ <%= netzke_init %>
7
+ </head>
8
+ <body>
9
+
10
+ <%= yield %>
11
+
12
+ </body>
13
+ </html>
@@ -0,0 +1,3 @@
1
+ <%= netzke :simple_component %>
2
+ <%= netzke :component_loader %>
3
+ <%= netzke :some_composite %>
@@ -0,0 +1,45 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # If you have a Gemfile, require the gems listed there, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(:default, Rails.env) if defined?(Bundler)
8
+
9
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
10
+ require 'netzke-core'
11
+
12
+ module RailsApp
13
+ class Application < Rails::Application
14
+ # Settings in config/environments/* take precedence over those specified here.
15
+ # Application configuration should go into files in config/initializers
16
+ # -- all .rb files in that directory are automatically loaded.
17
+
18
+ # Custom directories with classes and modules you want to be autoloadable.
19
+ config.autoload_paths += %W(#{config.root}/lib)
20
+
21
+ # Only load the plugins named here, in the order given (default is alphabetical).
22
+ # :all can be used as a placeholder for all plugins not explicitly named.
23
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
24
+
25
+ # Activate observers that should always be running.
26
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
27
+
28
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30
+ # config.time_zone = 'Central Time (US & Canada)'
31
+
32
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34
+ # config.i18n.default_locale = :de
35
+
36
+ # JavaScript files you want as :defaults (application.js is always included).
37
+ # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
38
+
39
+ # Configure the default encoding used in templates for Ruby 1.9.
40
+ config.encoding = "utf-8"
41
+
42
+ # Configure sensitive parameters which will be filtered from the log file.
43
+ config.filter_parameters += [:password]
44
+ end
45
+ end
@@ -0,0 +1,13 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ gemfile = File.expand_path('../../Gemfile', __FILE__)
5
+ begin
6
+ ENV['BUNDLE_GEMFILE'] = gemfile
7
+ require 'bundler'
8
+ Bundler.setup
9
+ rescue Bundler::GemNotFound => e
10
+ STDERR.puts e.message
11
+ STDERR.puts "Try running `bundle install`."
12
+ exit!
13
+ end if File.exist?(gemfile)
@@ -0,0 +1,22 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3-ruby (not necessary on OS X Leopard)
3
+ development:
4
+ adapter: sqlite3
5
+ database: db/development.sqlite3
6
+ pool: 5
7
+ timeout: 5000
8
+
9
+ # Warning: The database defined as "test" will be erased and
10
+ # re-generated from your development database when you run "rake".
11
+ # Do not set this db to the same as development or production.
12
+ test:
13
+ adapter: sqlite3
14
+ database: db/test.sqlite3
15
+ pool: 5
16
+ timeout: 5000
17
+
18
+ production:
19
+ adapter: sqlite3
20
+ database: db/production.sqlite3
21
+ pool: 5
22
+ timeout: 5000
@@ -0,0 +1,6 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+
5
+ # Initialize the rails application
6
+ RailsApp::Application.initialize!
@@ -0,0 +1,22 @@
1
+ RailsApp::Application.configure do
2
+ # Settings specified here will take precedence over those in config/environment.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the webserver when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_view.debug_rjs = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Don't care if the mailer can't send
18
+ config.action_mailer.raise_delivery_errors = false
19
+
20
+ # Print deprecation notices to the Rails logger
21
+ config.active_support.deprecation = :log
22
+ end
@@ -0,0 +1,49 @@
1
+ RailsApp::Application.configure do
2
+ # Settings specified here will take precedence over those in config/environment.rb
3
+
4
+ # The production environment is meant for finished, "live" apps.
5
+ # Code is not reloaded between requests
6
+ config.cache_classes = true
7
+
8
+ # Full error reports are disabled and caching is turned on
9
+ config.consider_all_requests_local = false
10
+ config.action_controller.perform_caching = true
11
+
12
+ # Specifies the header that your server uses for sending files
13
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
14
+
15
+ # For nginx:
16
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
17
+
18
+ # If you have no front-end server that supports something like X-Sendfile,
19
+ # just comment this out and Rails will serve the files
20
+
21
+ # See everything in the log (default is :info)
22
+ # config.log_level = :debug
23
+
24
+ # Use a different logger for distributed setups
25
+ # config.logger = SyslogLogger.new
26
+
27
+ # Use a different cache store in production
28
+ # config.cache_store = :mem_cache_store
29
+
30
+ # Disable Rails's static asset server
31
+ # In production, Apache or nginx will already do this
32
+ config.serve_static_assets = false
33
+
34
+ # Enable serving of images, stylesheets, and javascripts from an asset server
35
+ # config.action_controller.asset_host = "http://assets.example.com"
36
+
37
+ # Disable delivery errors, bad email addresses will be ignored
38
+ # config.action_mailer.raise_delivery_errors = false
39
+
40
+ # Enable threaded mode
41
+ # config.threadsafe!
42
+
43
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
44
+ # the I18n.default_locale when a translation can not be found)
45
+ config.i18n.fallbacks = true
46
+
47
+ # Send deprecation notices to registered listeners
48
+ config.active_support.deprecation = :notify
49
+ end
@@ -0,0 +1,35 @@
1
+ RailsApp::Application.configure do
2
+ # Settings specified here will take precedence over those in config/environment.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Log error messages when you accidentally call methods on nil.
11
+ config.whiny_nils = true
12
+
13
+ # Show full error reports and disable caching
14
+ config.consider_all_requests_local = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Raise exceptions instead of rendering exception templates
18
+ config.action_dispatch.show_exceptions = false
19
+
20
+ # Disable request forgery protection in test environment
21
+ config.action_controller.allow_forgery_protection = false
22
+
23
+ # Tell Action Mailer not to deliver emails to the real world.
24
+ # The :test delivery method accumulates sent emails in the
25
+ # ActionMailer::Base.deliveries array.
26
+ config.action_mailer.delivery_method = :test
27
+
28
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
29
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
30
+ # like if you have constraints or database-specific column types
31
+ # config.active_record.schema_format = :sql
32
+
33
+ # Print deprecation notices to the stderr
34
+ config.active_support.deprecation = :stderr
35
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,3 @@
1
+ Netzke::Core.setup do |config|
2
+ # config.ext_location = "blah"
3
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ RailsApp::Application.config.secret_token = '37d8da5a1af6fb203bcbdb7ad5a944a8ed0fdc568594b9000319294a8b696d607dacf64bc521bdf7036790f7e1a65627bab7df5a29cd58d78239b7e6dd8377ae'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ RailsApp::Application.config.session_store :cookie_store, :key => '_rails_app_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rake db:sessions:create")
8
+ # RailsApp::Application.config.session_store :active_record_store
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,64 @@
1
+ RailsApp::Application.routes.draw do
2
+ # The priority is based upon order of creation:
3
+ # first created -> highest priority.
4
+
5
+ # Sample of regular route:
6
+ # match 'products/:id' => 'catalog#view'
7
+ # Keep in mind you can assign values other than :controller and :action
8
+
9
+ # Sample of named route:
10
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
+ # This route can be invoked with purchase_url(:id => product.id)
12
+
13
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
14
+ # resources :products
15
+
16
+ # Sample resource route with options:
17
+ # resources :products do
18
+ # member do
19
+ # get :short
20
+ # post :toggle
21
+ # end
22
+ #
23
+ # collection do
24
+ # get :sold
25
+ # end
26
+ # end
27
+
28
+ # Sample resource route with sub-resources:
29
+ # resources :products do
30
+ # resources :comments, :sales
31
+ # resource :seller
32
+ # end
33
+
34
+ # Sample resource route with more complex sub-resources
35
+ # resources :products do
36
+ # resources :comments
37
+ # resources :sales do
38
+ # get :recent, :on => :collection
39
+ # end
40
+ # end
41
+
42
+ # Sample resource route within a namespace:
43
+ # namespace :admin do
44
+ # # Directs /admin/products/* to Admin::ProductsController
45
+ # # (app/controllers/admin/products_controller.rb)
46
+ # resources :products
47
+ # end
48
+
49
+ # You can have the root of your site routed with "root"
50
+ # just remember to delete public/index.html.
51
+ root :to => "welcome#index"
52
+
53
+ # See how all your routes lay out with "rake routes"
54
+
55
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
56
+ # Note: This route will make all actions in every controller accessible via GET requests.
57
+
58
+ match 'components/:component' => 'components#show', :as => "components"
59
+ match 'ext/:component' => 'components#ext', :as => "ext"
60
+
61
+ match ':controller(/:action(/:id(.:format)))'
62
+
63
+ netzke
64
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run RailsApp::Application
@@ -0,0 +1,4 @@
1
+ CREATE TABLE "netzke_preferences" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar(255), "value" text, "user_id" integer, "role_id" integer, "created_at" datetime, "updated_at" datetime);
2
+ CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL);
3
+ CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version");
4
+ INSERT INTO schema_migrations (version) VALUES ('20100905214933');
@@ -1,12 +1,10 @@
1
1
  class CreateNetzkePreferences < ActiveRecord::Migration
2
2
  def self.up
3
3
  create_table :netzke_preferences do |t|
4
- t.string :name
5
- t.string :pref_type
4
+ t.string :key
6
5
  t.text :value
7
6
  t.integer :user_id
8
7
  t.integer :role_id
9
- t.string :widget_name
10
8
 
11
9
  t.timestamps
12
10
  end