hobo 1.3.0.RC4 → 1.3.0.pre10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. data/CHANGES.txt +234 -282
  2. data/Rakefile +3 -3
  3. data/VERSION +1 -1
  4. data/app/controllers/dev_controller.rb +2 -2
  5. data/bin/hobo +3 -3
  6. data/config/routes.rb +1 -1
  7. data/doctests/hobo/lifecycles.rdoctest +1 -0
  8. data/doctests/hobo/model.rdoctest +5 -0
  9. data/doctests/hobo/multi_model_forms.rdoctest +5 -4
  10. data/doctests/hobo/scopes.rdoctest +8 -11
  11. data/doctests/prepare_testapp.rb +1 -2
  12. data/hobo.gemspec +2 -2
  13. data/lib/generators/hobo/admin_subsite/admin_subsite_generator.rb +11 -5
  14. data/lib/generators/hobo/admin_subsite/templates/admin.css +2 -20
  15. data/lib/generators/hobo/admin_subsite/templates/admin_tag_injection.erb +1 -3
  16. data/lib/generators/hobo/admin_subsite/templates/controller.rb.erb +5 -5
  17. data/lib/generators/hobo/admin_subsite/templates/users_index.dryml +1 -3
  18. data/lib/generators/hobo/basic/basic_generator.rb +17 -0
  19. data/lib/generators/hobo/{assets → basic}/templates/application.css +0 -0
  20. data/lib/generators/hobo/{assets → basic}/templates/application.dryml.erb +1 -1
  21. data/lib/generators/hobo/{assets → basic}/templates/dryml-support.js +2 -2
  22. data/lib/generators/hobo/{assets → basic}/templates/en_injection.yml +0 -0
  23. data/lib/generators/hobo/{assets → basic}/templates/guest.rb +0 -0
  24. data/lib/generators/hobo/controller.rb +1 -6
  25. data/lib/generators/hobo/front_controller/front_controller_generator.rb +3 -2
  26. data/{app/views/dev → lib/generators/hobo/front_controller/templates}/summary.dryml +10 -7
  27. data/lib/generators/hobo/hints/hints_generator.rb +12 -0
  28. data/lib/generators/hobo/hints/templates/hints.rb.erb +5 -0
  29. data/lib/generators/hobo/hints/templates/model_injection.rb.erb +36 -0
  30. data/lib/generators/hobo/i18n/i18n_generator.rb +9 -1
  31. data/lib/generators/hobo/i18n/templates/app.en.yml +1 -1
  32. data/lib/generators/hobo/i18n/templates/app.es-DO.yml +24 -0
  33. data/lib/generators/hobo/i18n/templates/app.it.yml +1 -5
  34. data/lib/generators/hobo/i18n/templates/app.pt-PT.yml +0 -1
  35. data/lib/generators/hobo/i18n/templates/default_count_injection.rb +10 -0
  36. data/lib/generators/hobo/i18n/templates/hobo.en.yml +10 -26
  37. data/lib/generators/hobo/i18n/templates/{hobo.es.yml → hobo.es-DO.yml} +10 -27
  38. data/lib/generators/hobo/i18n/templates/hobo.it.yml +4 -20
  39. data/lib/generators/hobo/i18n/templates/hobo.pt-PT.yml +9 -25
  40. data/lib/generators/hobo/model.rb +13 -0
  41. data/lib/generators/hobo/model/USAGE +3 -2
  42. data/lib/generators/hobo/model/model_generator.rb +1 -2
  43. data/lib/generators/hobo/rapid/rapid_generator.rb +0 -2
  44. data/lib/generators/hobo/rapid/templates/hobo-rapid.js +93 -78
  45. data/lib/generators/hobo/rapid/templates/ie7-recalc.js +21 -21
  46. data/lib/generators/hobo/rapid/templates/lowpro.js +31 -31
  47. data/lib/generators/hobo/rapid/templates/reset.css +1 -1
  48. data/lib/generators/hobo/rapid/templates/themes/clean/public/stylesheets/clean.css +16 -17
  49. data/lib/generators/hobo/rapid/templates/themes/clean/public/stylesheets/rapid-ui.css +3 -3
  50. data/lib/generators/hobo/rapid/templates/themes/clean/views/clean.dryml +1 -1
  51. data/lib/generators/hobo/resource/resource_generator.rb +1 -1
  52. data/lib/generators/hobo/routes/router.rb +4 -4
  53. data/lib/generators/hobo/routes/routes_generator.rb +1 -12
  54. data/lib/generators/hobo/routes/templates/hobo_routes.rb.erb +1 -1
  55. data/lib/generators/hobo/setup_wizard/setup_wizard_generator.rb +43 -88
  56. data/lib/generators/hobo/subsite.rb +5 -18
  57. data/lib/generators/hobo/subsite/subsite_generator.rb +1 -1
  58. data/lib/generators/hobo/subsite/templates/controller.rb.erb +1 -1
  59. data/lib/generators/hobo/subsite_taglib/templates/taglib.dryml.erb +2 -2
  60. data/lib/generators/hobo/test_framework/test_framework_generator.rb +7 -7
  61. data/lib/generators/hobo/user_controller/templates/controller.rb.erb +3 -8
  62. data/lib/generators/hobo/user_mailer/templates/activation.erb +2 -2
  63. data/lib/generators/hobo/user_mailer/templates/forgot_password.erb +2 -2
  64. data/lib/generators/hobo/user_mailer/templates/invite.erb +2 -2
  65. data/lib/generators/hobo/user_mailer/templates/mailer.rb.erb +17 -10
  66. data/lib/generators/hobo/user_mailer/user_mailer_generator.rb +1 -1
  67. data/lib/generators/hobo/user_model/USAGE +9 -2
  68. data/lib/generators/hobo/user_model/user_model_generator.rb +1 -2
  69. data/lib/hobo.rb +7 -13
  70. data/lib/hobo/controller.rb +14 -21
  71. data/lib/hobo/controller/authentication_support.rb +23 -1
  72. data/lib/hobo/controller/model.rb +53 -48
  73. data/lib/hobo/controller/{user_base.rb → user.rb} +36 -47
  74. data/lib/hobo/engine.rb +11 -25
  75. data/lib/hobo/extensions/action_controller/hobo_methods.rb +1 -25
  76. data/lib/hobo/extensions/active_model/translation.rb +1 -1
  77. data/lib/hobo/extensions/active_record/{associations/collection.rb → association_collection.rb} +3 -12
  78. data/lib/hobo/extensions/active_record/{associations/proxy.rb → association_proxy.rb} +7 -6
  79. data/lib/hobo/extensions/active_record/association_reflection.rb +19 -0
  80. data/lib/hobo/extensions/active_record/hobo_methods.rb +1 -1
  81. data/lib/hobo/extensions/active_record/scopes.rb +31 -0
  82. data/lib/hobo/extensions/array.rb +1 -13
  83. data/lib/hobo/helper.rb +6 -27
  84. data/lib/hobo/helper/translations.rb +90 -39
  85. data/lib/hobo/model.rb +20 -72
  86. data/lib/hobo/model/lifecycles.rb +11 -12
  87. data/lib/hobo/model/lifecycles/lifecycle.rb +4 -12
  88. data/lib/hobo/model/lifecycles/transition.rb +0 -1
  89. data/lib/hobo/model/permissions.rb +3 -2
  90. data/lib/hobo/model/scopes/apply_scopes.rb +1 -1
  91. data/lib/hobo/model/scopes/automatic_scopes.rb +80 -78
  92. data/lib/hobo/model/{user_base.rb → user.rb} +7 -9
  93. data/lib/hobo/rapid/generators/rapid/cards.dryml.erb +2 -2
  94. data/lib/hobo/rapid/generators/rapid/forms.dryml.erb +4 -5
  95. data/lib/hobo/rapid/generators/rapid/pages.dryml.erb +27 -26
  96. data/lib/hobo/rapid/helper.rb +5 -10
  97. data/lib/hobo/rapid/taglibs/rapid.dryml +1 -1
  98. data/lib/hobo/rapid/taglibs/rapid_core.dryml +42 -72
  99. data/lib/hobo/rapid/taglibs/rapid_document_tags.dryml +2 -2
  100. data/lib/hobo/rapid/taglibs/rapid_editing.dryml +16 -36
  101. data/lib/hobo/rapid/taglibs/rapid_forms.dryml +49 -87
  102. data/lib/hobo/rapid/taglibs/rapid_generics.dryml +2 -2
  103. data/lib/hobo/rapid/taglibs/rapid_i18n.dryml +75 -50
  104. data/lib/hobo/rapid/taglibs/rapid_lifecycles.dryml +5 -7
  105. data/lib/hobo/rapid/taglibs/rapid_navigation.dryml +2 -2
  106. data/lib/hobo/rapid/taglibs/rapid_pages.dryml +7 -8
  107. data/lib/hobo/rapid/taglibs/rapid_plus.dryml +43 -66
  108. data/lib/hobo/rapid/taglibs/rapid_summary.dryml +45 -16
  109. data/lib/hobo/rapid/taglibs/rapid_translations.dryml +36 -0
  110. data/lib/hobo/rapid/taglibs/rapid_user_pages.dryml +8 -8
  111. data/lib/hobo/routes.rb +23 -22
  112. data/lib/hobo/view_hints.rb +101 -0
  113. data/test/irt/generators/admin_subsite.irt +1 -1
  114. data/test/irt/generators/{assets.irt → basic.irt} +2 -2
  115. data/test/irt/generators/front_controller.irt +4 -2
  116. data/test/irt/generators/partials/_subsite_taglib_variables.rb +1 -1
  117. data/test/irt/generators/subsite.irt +1 -1
  118. data/test/permissions/test_permissions.rb +103 -103
  119. metadata +108 -69
  120. data/lib/generators/hobo/admin_subsite/USAGE +0 -25
  121. data/lib/generators/hobo/admin_subsite/templates/application.dryml +0 -1
  122. data/lib/generators/hobo/assets/USAGE +0 -5
  123. data/lib/generators/hobo/assets/assets_generator.rb +0 -18
  124. data/lib/generators/hobo/assets/templates/dryml_taglibs_initializer.rb +0 -1
  125. data/lib/generators/hobo/controller/USAGE +0 -3
  126. data/lib/generators/hobo/i18n/USAGE +0 -3
  127. data/lib/generators/hobo/i18n/templates/app.de.yml +0 -30
  128. data/lib/generators/hobo/i18n/templates/app.es.yml +0 -31
  129. data/lib/generators/hobo/i18n/templates/app.fr.yml +0 -26
  130. data/lib/generators/hobo/i18n/templates/app.nb.yml +0 -25
  131. data/lib/generators/hobo/i18n/templates/app.ru.yml +0 -24
  132. data/lib/generators/hobo/i18n/templates/hobo.de.yml +0 -204
  133. data/lib/generators/hobo/i18n/templates/hobo.fr.yml +0 -195
  134. data/lib/generators/hobo/i18n/templates/hobo.nb.yml +0 -198
  135. data/lib/generators/hobo/i18n/templates/hobo.ru.yml +0 -200
  136. data/lib/generators/hobo/rapid/templates/themes/clean-sidemenu/public/images/100-ACD3E6-DBE1E5-H.png +0 -0
  137. data/lib/generators/hobo/rapid/templates/themes/clean-sidemenu/public/images/100-DBE1E5-FCFEF5-H.png +0 -0
  138. data/lib/generators/hobo/rapid/templates/themes/clean-sidemenu/public/images/300-3B5F87-ACD3E6-H.png +0 -0
  139. data/lib/generators/hobo/rapid/templates/themes/clean-sidemenu/public/images/spinner.gif +0 -0
  140. data/lib/generators/hobo/rapid/templates/themes/clean-sidemenu/public/stylesheets/clean-sidemenu.css +0 -81
  141. data/lib/generators/hobo/rapid/templates/themes/clean-sidemenu/views/clean-sidemenu.dryml +0 -30
  142. data/lib/generators/hobo/resource/USAGE +0 -39
  143. data/lib/generators/hobo/subsite/USAGE +0 -24
  144. data/lib/generators/hobo/subsite_taglib/USAGE +0 -4
  145. data/lib/generators/hobo/test_framework/USAGE +0 -2
  146. data/lib/generators/hobo/user_controller/USAGE +0 -3
  147. data/lib/generators/hobo/user_mailer/USAGE +0 -2
  148. data/lib/generators/hobo/user_resource/USAGE +0 -10
  149. data/lib/hobo/extensions/action_view/translation_helper.rb +0 -25
  150. data/lib/hobo/extensions/active_record/associations/reflection.rb +0 -23
  151. data/lib/hobo/extensions/active_record/associations/scope.rb +0 -35
  152. data/lib/hobo/extensions/active_record/relation_with_origin.rb +0 -32
  153. data/lib/hobo/extensions/i18n.rb +0 -17
  154. data/lib/hobo/helper/translations/normalizer.rb +0 -39
  155. data/lib/hobo/model/view_hints.rb +0 -123
data/Rakefile CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/rdoctask'
3
3
  require 'rake/testtask'
4
- require 'tmpdir'
5
4
 
6
5
  require 'active_record'
7
6
  ActiveRecord::ActiveRecordError # hack for https://rails.lighthouseapp.com/projects/8994/tickets/2577-when-using-activerecordassociations-outside-of-rails-a-nameerror-is-thrown
@@ -15,7 +14,7 @@ RUBY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']).
15
14
  RUBYDOCTEST = ENV['RUBYDOCTEST'] || "#{RUBY} -S rubydoctest"
16
15
 
17
16
  GEM_ROOT = File.expand_path('../', __FILE__)
18
- TESTAPP_PATH = File.join Dir.tmpdir, 'hobo_testapp'
17
+ TESTAPP_PATH = '/tmp/hobo_testapp'
19
18
  BIN = File.expand_path('../bin/hobo', __FILE__)
20
19
  require 'hobo_support/common_tasks'
21
20
  include HoboSupport::CommonTasks
@@ -37,7 +36,8 @@ Rake::TestTask.new(:test) { |t|
37
36
  namespace "test" do
38
37
  desc "Run the doctests"
39
38
  task :doctest do |t|
40
- files=Dir['doctests/**/*.rdoctest'].map {|f| File.expand_path(f)}.join(' ')
39
+ files=Dir['doctest/*.rdoctest'].map {|f| File.expand_path(f)}.join(' ')
40
+ # note, tests in doctest/hobo/ are out of date
41
41
  exit(1) if !system("#{RUBYDOCTEST} #{files}")
42
42
  end
43
43
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0.RC4
1
+ 1.3.0.pre10
@@ -5,7 +5,7 @@ class DevController < ActionController::Base
5
5
  before_filter :developer_modes_only
6
6
 
7
7
  def set_current_user
8
- model = params[:model] || Hobo::Model::UserBase.default_user_model
8
+ model = params[:model] || Hobo::Model::User.default_user_model
9
9
  self.current_user = if params[:login]
10
10
  model.where(model.login_attribute => params[:login]).first
11
11
  else
@@ -18,7 +18,7 @@ class DevController < ActionController::Base
18
18
 
19
19
  def developer_modes_only
20
20
  # Belt and braces. In addition to this check, the routes only get
21
- # defined when developer_features is true
21
+ # defined when developer_features? is true
22
22
  render :text => "Permission Denied", :status => 403 unless Rails.application.config.hobo.developer_features
23
23
  end
24
24
 
data/bin/hobo CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'fileutils'
3
3
 
4
- if ENV["HOBODEV"]
5
- dev_root = File.expand_path ENV["HOBODEV"], FileUtils.pwd
4
+ if ENV["HOBO_DEV_ROOT"]
5
+ dev_root = File.expand_path ENV["HOBO_DEV_ROOT"], FileUtils.pwd
6
6
  $:.unshift "#{dev_root}/hobo_support/lib"
7
7
  else
8
8
  require 'rubygems'
@@ -12,7 +12,7 @@ begin
12
12
  require 'hobo_support/command'
13
13
  rescue LoadError
14
14
  puts "The 'hobo_support' gem is not installed.
15
- You probably need to set the HOBODEV environment variable to your local hobo git-repository path."
15
+ You probably need to set the HOBO_DEV_ROOT environment variable to the local repository path."
16
16
  exit
17
17
  end
18
18
 
@@ -1,6 +1,6 @@
1
1
  Rails.application.routes.draw do
2
2
 
3
3
  match 'dryml/:action', :controller => 'dryml_support', :as => 'dryml_support'
4
- match 'dev/:action', :controller => 'dev', :as => 'dev_support' if Rails.application.config.hobo.developer_features
4
+ match 'dev/:action', :controller => 'dev', :as => 'dev_support'
5
5
 
6
6
  end
@@ -240,3 +240,4 @@ Requester cancels
240
240
  => "destroy"
241
241
 
242
242
 
243
+ >> FileUtils.rm_rf TEST_APP_ROOT
@@ -325,4 +325,9 @@ This provides a shortcut to the corresponding
325
325
  >> Post.view_hints
326
326
  => PostHints
327
327
 
328
+ Cleanup
329
+ {.hidden}
330
+
331
+ >> FileUtils.rm_rf TEST_APP_ROOT
332
+ {.hidden}
328
333
 
@@ -28,12 +28,13 @@ Contents
28
28
  :host => "localhost",
29
29
  :username => mysql_user,
30
30
  :password => mysql_password)
31
- >> $:.unshift File.expand_path('../../../../hobo_support/lib', __FILE__)
32
- >> $:.unshift File.expand_path('../../../../hobo_fields/lib', __FILE__)
33
- >> $:.unshift File.expand_path('../../../../dryml/lib', __FILE__)
34
- >> $:.unshift File.expand_path('../../../lib', __FILE__)
31
+ >> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../../hobo_fields/lib')
32
+ >> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../../hobo_support/lib')
33
+ >> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../../hobo/lib')
35
34
  >> gem 'will_paginate', ">= 3.0.pre"
36
35
  >> require 'will_paginate'
36
+ >> require 'hobo_support'
37
+ >> require 'hobo_fields'
37
38
  >> require 'hobo'
38
39
  >> ActiveRecord::Base.logger = ActiveSupport::BufferedLogger.new(StringIO.new(''))
39
40
  >>
@@ -67,16 +67,17 @@ We also need to get ActiveRecord set up with a database connection
67
67
  Some load path manipulation:
68
68
  {.hidden}
69
69
 
70
- >> $:.unshift File.expand_path('../../../../hobo_support/lib', __FILE__)
71
- >> $:.unshift File.expand_path('../../../../hobo_fields/lib', __FILE__)
72
- >> $:.unshift File.expand_path('../../../../dryml/lib', __FILE__)
73
- >> $:.unshift File.expand_path('../../../lib', __FILE__)
70
+ >> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../../hobo_fields/lib')
71
+ >> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../../hobo_support/lib')
72
+ >> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../../hobo/lib')
74
73
  {.hidden}
75
74
 
76
75
  And we'll require hobo:
77
76
  {.hidden}
78
77
 
79
78
  >> require 'will_paginate'
79
+ >> require 'hobo_support'
80
+ >> require 'hobo_fields'
80
81
  >> require 'hobo'
81
82
  {.hidden}
82
83
 
@@ -285,14 +286,10 @@ Gives the N most recent items:
285
286
 
286
287
  ## include
287
288
 
288
- DEPRECATED: Automatic scope :include has been deprecated: use :includes instead.
289
+ Adding the include function to your query chain has the same effect as
290
+ the `:include` option to the `find` method.
289
291
 
290
- ## includes
291
-
292
- >> Person.search("B", :name).includes(:friends).*.name # test LH#839
293
- => ["Bryan", "Bethany"]
294
-
295
- >> Person.includes(:friends).*.name
292
+ >> Person.include(:friends).*.name
296
293
  => ["Bryan", "Bethany"]
297
294
 
298
295
  ## search
@@ -1,7 +1,6 @@
1
1
  require 'fileutils'
2
2
  system %(rake test:prepare_testapp)
3
- TESTAPP_PATH = '/tmp/hobo_testapp'
4
- FileUtils.chdir TESTAPP_PATH
3
+ FileUtils.chdir '/tmp/hobo_testapp'
5
4
  require 'config/environment'
6
5
  require 'rails/generators'
7
6
  Rails::Generators.configure!
@@ -1,6 +1,5 @@
1
1
  name = File.basename( __FILE__, '.gemspec' )
2
2
  version = File.read(File.expand_path('../VERSION', __FILE__)).strip
3
- require 'date'
4
3
 
5
4
  Gem::Specification.new do |s|
6
5
 
@@ -11,10 +10,11 @@ Gem::Specification.new do |s|
11
10
  s.summary = 'The web app builder for Rails'
12
11
  s.description = 'The web app builder for Rails'
13
12
 
13
+ s.add_runtime_dependency('rails', [">= 3.0.0"])
14
+ s.add_runtime_dependency('will_paginate', [">= 3.0.pre"])
14
15
  s.add_runtime_dependency('hobo_support', ["= #{version}"])
15
16
  s.add_runtime_dependency('hobo_fields', ["= #{version}"])
16
17
  s.add_runtime_dependency('dryml', ["= #{version}"])
17
- s.add_runtime_dependency('will_paginate', [">= 3.0.0"])
18
18
 
19
19
  s.add_development_dependency('rubydoctest', [">= 0"])
20
20
  s.add_development_dependency('shoulda', [">= 0"])
@@ -5,8 +5,8 @@ module Hobo
5
5
  # overrides the default
6
6
  argument :name, :type => :string, :default => 'admin', :optional => true
7
7
 
8
+ include Generators::Hobo::Subsite
8
9
  include Generators::Hobo::InviteOnly
9
- include Generators::HoboSupport::EvalTemplate
10
10
 
11
11
  def self.banner
12
12
  "rails generate hobo:admin_subsite [NAME=admin] [options]"
@@ -17,20 +17,26 @@ module Hobo
17
17
  end
18
18
 
19
19
  def generate_admin_user_controller
20
- invoke "hobo:controller", ["#{file_name}/#{options[:user_resource_name].pluralize.underscore}"], options
20
+ invoke "hobo:controller", ["#{file_name}/#{options[:user_resource_name].pluralize.underscore}"]
21
21
  template "users_index.dryml", "app/views/#{file_name}/#{options[:user_resource_name].pluralize.underscore}/index.dryml"
22
22
  end
23
23
 
24
24
  def generate_site_taglib
25
- invoke 'hobo:subsite_taglib', [name], options.merge(:admin => true)
25
+ invoke 'hobo:subsite_taglib', [name],
26
+ :user_resource_name => options[:user_resource_name],
27
+ :admin => true,
28
+ :invite_only => invite_only?
26
29
  end
27
30
 
28
31
  def append_admin_tag_into_application_taglib
32
+ source = File.expand_path(find_in_source_paths('admin_tag_injection.erb'))
29
33
  destination = File.join(Rails.root, "app/views/taglibs/application.dryml")
30
- append_file(destination) { eval_template('admin_tag_injection.erb') }
34
+ context = instance_eval('binding')
35
+ append_file destination do
36
+ ERB.new(::File.binread(source), nil, '-').result(context)
37
+ end
31
38
  end
32
39
 
33
- include Generators::Hobo::Subsite
34
40
 
35
41
  end
36
42
  end
@@ -1,20 +1,2 @@
1
- body {
2
- background-color: #333;
3
- background-image: none;
4
- }
5
-
6
- .page-header {
7
- background: #555;
8
- }
9
-
10
- .page-header.sidemenu {
11
- background: none;
12
- }
13
-
14
- .page-header h1 a {
15
- color:#FCFFF5;
16
- }
17
-
18
- #main-nav-container {
19
- background:#555555
20
- }
1
+ html, body { background: #333;}
2
+ .page-header { background: #555; }
@@ -2,9 +2,7 @@
2
2
  <extend tag="page">
3
3
  <old-page merge>
4
4
  <footer:>
5
- <a href="&<%= file_name %>_<%= options[:user_resource_name].underscore.pluralize %>_url" if="&current_user.administrator?">
6
- <t key="hobo.admin.subsite_name"><%= name.titleize %></t>
7
- </a>
5
+ <a href="&<%= file_name %>_<%= options[:user_resource_name].underscore.pluralize %>_url" if="&current_user.administrator?">Admin</a>
8
6
  </footer:>
9
7
  </old-page>
10
8
  </extend>
@@ -1,13 +1,13 @@
1
1
  class <%= subsite_name %>::<%= subsite_name %>SiteController < ApplicationController
2
2
 
3
3
  hobo_controller
4
-
4
+
5
5
  before_filter :admin_required
6
-
6
+
7
7
  private
8
-
8
+
9
9
  def admin_required
10
10
  redirect_to home_page unless current_user.administrator?
11
- end
12
-
11
+ end
12
+
13
13
  end
@@ -1,7 +1,5 @@
1
1
  <index-page without-new-form>
2
2
  <after-count:>
3
- <a with="&<%= options[:user_resource_name].camelize %>" action="invite">
4
- <t key="hobo.admin.invite_new_user">Invite a new user</t>
5
- </a>
3
+ <a with="&<%= options[:user_resource_name].camelize %>" action="invite">Invite a new user</a>
6
4
  </after-count:>
7
5
  </index-page>
@@ -0,0 +1,17 @@
1
+ module Hobo
2
+ class BasicGenerator < Rails::Generators::Base
3
+ source_root File.expand_path('../templates', __FILE__)
4
+
5
+ def self.banner
6
+ "rails generate hobo:basic"
7
+ end
8
+
9
+ def copy_rapid_files
10
+ template 'application.dryml.erb', 'app/views/taglibs/application.dryml'
11
+ copy_file 'application.css', 'public/stylesheets/application.css'
12
+ copy_file 'dryml-support.js', 'public/javascripts/dryml-support.js'
13
+ copy_file 'guest.rb', 'app/models/guest.rb'
14
+ end
15
+
16
+ end
17
+ end
@@ -1,6 +1,6 @@
1
1
  <!-- Global taglib - these tags are shared across all subsites -->
2
2
 
3
- <include src="rapid" gem="hobo"/>
3
+ <include src="rapid" plugin="hobo"/>
4
4
 
5
5
  <include src="taglibs/auto/rapid/cards"/>
6
6
  <include src="taglibs/auto/rapid/pages"/>
@@ -1,5 +1,5 @@
1
1
  Event.addBehavior({
2
- 'body:click' : function(event) {
2
+ 'body:click' : function(event) {
3
3
  if (event.shiftKey && event.altKey) {
4
4
  Dryml.click(event)
5
5
  Event.stop(event)
@@ -122,7 +122,7 @@ var Dryml = {
122
122
  },
123
123
 
124
124
  removeMenu: function() {
125
- if (Dryml.menu) {
125
+ if (Dryml.menu) {
126
126
  $("dryml-menu-style").remove()
127
127
  Dryml.menu.remove()
128
128
  Dryml.menu = null
@@ -2,11 +2,7 @@ module Generators
2
2
  module Hobo
3
3
  Controller = classy_module do
4
4
 
5
- # check_class_collision :suffix => 'Controller'
6
-
7
- class_option :helpers, :type => :boolean,
8
- :desc => "Generates helper files",
9
- :default => !Rails.application.config.hobo.dryml_only_templates
5
+ check_class_collision :suffix => 'Controller'
10
6
 
11
7
  def self.banner
12
8
  "rails generate hobo:controller #{self.arguments.map(&:usage).join(' ')}"
@@ -22,7 +18,6 @@ module Generators
22
18
  end
23
19
 
24
20
  def generate_helper
25
- return unless options[:helpers]
26
21
  invoke 'helper', [name], options
27
22
  end
28
23
 
@@ -32,8 +32,9 @@ module Hobo
32
32
  template 'controller.rb.erb', File.join('app/controllers',"#{file_path}_controller.rb")
33
33
  end
34
34
 
35
- def generate_index
35
+ def generate_index_and_summary
36
36
  template("index.dryml", File.join('app/views', file_path, "index.dryml"))
37
+ template("summary.dryml", File.join('app/views', file_path, "summary.dryml"))
37
38
  end
38
39
 
39
40
  def remove_index_html
@@ -43,7 +44,7 @@ module Hobo
43
44
 
44
45
  def add_routes
45
46
  return unless options[:add_routes]
46
- route "match 'search' => '#{file_path}#search', :as => 'site_search'"
47
+ route "match 'search' => '#{file_path}#search', :as => 'search'"
47
48
  if class_path.empty?
48
49
  route "root :to => '#{file_path}#index'"
49
50
  else
@@ -8,11 +8,12 @@
8
8
  <tr> <td>Application Name</td> <td><app-name/></td> </tr>
9
9
  <tr> <td>Application Location</td> <td><rails-root/></td> </tr>
10
10
  <tr> <td>Rails Version</td> <td><rails-version/></td> </tr>
11
+ <tr> <td>Rails Location</td> <td><rails-location/></td> </tr>
11
12
  <tr> <td>Mode</td> <td><rails-env/></td> </tr>
12
13
  </table>
13
14
 
14
15
  <h3>Change Control</h3>
15
- <table class="app-summary">
16
+ <table class="app-summary">
16
17
  <tr> <th></th><th></th></tr>
17
18
  <tr> <td>Method</td> <td><cms-method/></td> </tr>
18
19
  <if test="&cms_method.strip=='git'">
@@ -24,13 +25,15 @@
24
25
  </table>
25
26
 
26
27
 
27
- <h3>Bundled Gems</h3>
28
+ <h3>Gems</h3>
28
29
  <table class="app-summary">
29
30
  <with-gems>
30
- <tr if="&first_item?"><th></th><th>Version</th><th>Dependencies</th></tr>
31
+ <tr if="&first_item?"><th></th><th>Required</th><th>Installed</th><th>Status</th><th>Dependencies</th></tr>
31
32
  <tr>
32
33
  <td><gem-name/></td>
33
- <td><gem-version/></td>
34
+ <td><gem-version-required/></td>
35
+ <td><gem-version/></td>
36
+ <td><gem-frozen/></td>
34
37
  <td><gem-dependencies/></td>
35
38
  </tr>
36
39
  </with-gems>
@@ -72,8 +75,8 @@
72
75
  <td><model-table-comment/></td>
73
76
  </tr>
74
77
  </with-models>
75
- </table>
76
-
78
+ </table>
79
+
77
80
  <with-models>
78
81
  <h3 if="&this.try.table_name"><model-name /></h3>
79
82
  <table class="app-summary">
@@ -99,4 +102,4 @@
99
102
  </with-models>
100
103
  </div>
101
104
  </content:>
102
- </page>
105
+ </page>
@@ -0,0 +1,12 @@
1
+ module Hobo
2
+ class HintsGenerator < Rails::Generators::NamedBase
3
+ source_root File.expand_path('../templates', __FILE__)
4
+
5
+ check_class_collision :suffix => 'Hints'
6
+
7
+ def generate_hints
8
+ template 'hints.rb.erb', File.join("app/viewhints", "#{file_path}_hints.rb")
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ class <%= class_name %>Hints < Hobo::ViewHints
2
+
3
+ # children :primary_collection1, :aside_collection1, :aside_collection2
4
+
5
+ end