hobo 1.3.0.pre12 → 1.3.0.pre13

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -36,8 +36,7 @@ Rake::TestTask.new(:test) { |t|
36
36
  namespace "test" do
37
37
  desc "Run the doctests"
38
38
  task :doctest do |t|
39
- files=Dir['doctest/*.rdoctest'].map {|f| File.expand_path(f)}.join(' ')
40
- # note, tests in doctest/hobo/ are out of date
39
+ files=Dir['doctests/**/*.rdoctest'].map {|f| File.expand_path(f)}.join(' ')
41
40
  exit(1) if !system("#{RUBYDOCTEST} #{files}")
42
41
  end
43
42
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0.pre12
1
+ 1.3.0.pre13
@@ -240,4 +240,3 @@ Requester cancels
240
240
  => "destroy"
241
241
 
242
242
 
243
- >> FileUtils.rm_rf TEST_APP_ROOT
@@ -325,9 +325,4 @@ 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}
333
328
 
@@ -28,13 +28,12 @@ Contents
28
28
  :host => "localhost",
29
29
  :username => mysql_user,
30
30
  :password => mysql_password)
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')
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__)
34
35
  >> gem 'will_paginate', ">= 3.0.pre"
35
36
  >> require 'will_paginate'
36
- >> require 'hobo_support'
37
- >> require 'hobo_fields'
38
37
  >> require 'hobo'
39
38
  >> ActiveRecord::Base.logger = ActiveSupport::BufferedLogger.new(StringIO.new(''))
40
39
  >>
@@ -67,17 +67,16 @@ 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.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')
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__)
73
74
  {.hidden}
74
75
 
75
76
  And we'll require hobo:
76
77
  {.hidden}
77
78
 
78
79
  >> require 'will_paginate'
79
- >> require 'hobo_support'
80
- >> require 'hobo_fields'
81
80
  >> require 'hobo'
82
81
  {.hidden}
83
82
 
@@ -1,6 +1,7 @@
1
1
  require 'fileutils'
2
2
  system %(rake test:prepare_testapp)
3
- FileUtils.chdir '/tmp/hobo_testapp'
3
+ TESTAPP_PATH = '/tmp/hobo_testapp'
4
+ FileUtils.chdir TESTAPP_PATH
4
5
  require 'config/environment'
5
6
  require 'rails/generators'
6
7
  Rails::Generators.configure!
@@ -7,10 +7,11 @@ module Hobo
7
7
  end
8
8
 
9
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'
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 'dryml_taglibs_initializer.rb', 'config/initializers/dryml_taglibs.rb'
14
+ copy_file 'guest.rb', 'app/models/guest.rb'
14
15
  end
15
16
 
16
17
  end
@@ -0,0 +1 @@
1
+ Dryml.precompile_taglibs if File.basename($0) != "rake" && Rails.env.production?
@@ -17,7 +17,7 @@
17
17
  routes = gr == 'lifecycle_routes' ? router.send(gr.to_sym, subsite) : router.send(gr.to_sym) -%>
18
18
  <%- unless routes.empty? -%>
19
19
 
20
- <%= " " if subsite %><%= "# #{gr.humanize} for controller :#{controller.controller_name}" %>
20
+ <%= " " if subsite %><%= %(# #{gr.humanize} for controller "#{controller.controller_path}") %>
21
21
  <%- end -%>
22
22
  <%- for route in routes -%>
23
23
  <%= " " if subsite %><%= route %>
@@ -49,7 +49,7 @@ module Hobo
49
49
 
50
50
  def redirect_to_with_object_url(destination, *args)
51
51
  if destination.is_one_of?(String, Hash, Symbol)
52
- redirect_to_without_object_url(destination)
52
+ redirect_to_without_object_url(destination, *args)
53
53
  else
54
54
  redirect_to_without_object_url(object_url(destination, *args))
55
55
  end
@@ -70,7 +70,14 @@ module Hobo
70
70
 
71
71
 
72
72
  def ajax_update_response(page_path, render_specs, results={})
73
- renderer = Dryml.page_renderer(view_context, page_path) if page_path
73
+ if page_path
74
+ rr = ActionController::Routing::Routes.recognize_path(page_path)
75
+ identifier = view_context.view_paths.find( rr[:action],
76
+ rr[:controller],
77
+ false,
78
+ view_context.lookup_context.instance_variable_get('@details')).identifier
79
+ renderer = Dryml.page_renderer(view_context, identifier, [], rr[:controller])
80
+ end
74
81
 
75
82
  render :update do |page|
76
83
  page << "var _update = typeof Hobo == 'undefined' ? Element.update : Hobo.updateElement;"
@@ -358,16 +358,15 @@ module Hobo
358
358
  @invalid_record = this
359
359
  opt = ActionController::Routing::Routes.recognize_path(params[:page_path])
360
360
  controller = opt[:controller]
361
- view = opt[:action]
362
- view = default_action if view == Dryml::EMPTY_PAGE
361
+ action = opt[:action]
363
362
 
364
363
  # Hack fix for Bug 477. See also bug 489.
365
- if self.class.name == "#{controller.camelize}Controller" && view == "index"
364
+ if self.class.name == "#{controller.camelize}Controller" && action == "index"
366
365
  params['action'] = 'index'
367
366
  self.action_name = 'index'
368
367
  index
369
368
  else
370
- render :template => "#{controller}/#{view}"
369
+ render :template => "#{controller}/#{action}"
371
370
  end
372
371
  else
373
372
  render :action => default_action
@@ -452,7 +451,7 @@ module Hobo
452
451
  do_pagination = options.delete(:paginate) && finder.respond_to?(:paginate)
453
452
  finder = Array.wrap(options.delete(:scope)).inject(finder) { |a, v| a.send(*Array.wrap(v).flatten) }
454
453
 
455
- options[:order] = :default unless options[:order] || finder.send(:scope, :find)._?[:order]
454
+ options[:order] = finder.default_order unless options[:order] || finder.try.order_values.present?
456
455
 
457
456
  if do_pagination
458
457
  options.reverse_merge!(:page => params[:page] || 1)
@@ -735,7 +734,7 @@ module Hobo
735
734
 
736
735
  def hobo_completions(attribute, finder, options={})
737
736
  options = options.reverse_merge(:limit => 10, :param => :query, :query_scope => "#{attribute}_contains")
738
- finder = finder.limit(options[:limit]) unless finder.send(:scope, :find, :limit)
737
+ finder = finder.limit(options[:limit]) unless finder.try.limit_value
739
738
 
740
739
  begin
741
740
  finder = finder.send(options[:query_scope], params[options[:param]])
@@ -223,7 +223,7 @@ The standard form tag does not have any parameters, nor does it have any default
223
223
  page_path = if (request.post? || request.put?) && params[:page_path]
224
224
  params[:page_path]
225
225
  else
226
- view_name.sub(Dryml::EMPTY_PAGE, params[:action] || '')
226
+ request.fullpath
227
227
  end
228
228
  page_path_hidden = hidden_field_tag("page_path", page_path)
229
229
  end
@@ -115,7 +115,7 @@ With the `your` attribute and in the special case the context is a Hobo::Model::
115
115
  attrs = {}
116
116
  all_attributes.each_pair{|k,v| attrs[k.to_sym] = v} -%>
117
117
  <% if your && belong_class < Hobo::Model::User && this.kind_of?(Hobo::Model::User) && I18n.locale == :en -%>
118
- <your key="&collection" merge-attrs="&{:count=>c, :name=>this.name}.merge(attrs)" capitalize>
118
+ <your key="&collection" merge-attrs="&{:name=>this.name}.merge(attrs)" capitalize>
119
119
  <%= belong_class.human_attribute_name(collection.to_sym, attrs) %>
120
120
  </your>
121
121
  <% else -%>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobo
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1637175961
4
+ hash: -1637175964
5
5
  prerelease: true
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
9
  - 0
10
- - pre12
11
- version: 1.3.0.pre12
10
+ - pre13
11
+ version: 1.3.0.pre13
12
12
  platform: ruby
13
13
  authors:
14
14
  - Tom Locke
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-10-14 00:00:00 -04:00
19
+ date: 2010-10-20 00:00:00 -04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -59,13 +59,13 @@ dependencies:
59
59
  requirements:
60
60
  - - "="
61
61
  - !ruby/object:Gem::Version
62
- hash: -1637175961
62
+ hash: -1637175964
63
63
  segments:
64
64
  - 1
65
65
  - 3
66
66
  - 0
67
- - pre12
68
- version: 1.3.0.pre12
67
+ - pre13
68
+ version: 1.3.0.pre13
69
69
  type: :runtime
70
70
  version_requirements: *id003
71
71
  - !ruby/object:Gem::Dependency
@@ -76,13 +76,13 @@ dependencies:
76
76
  requirements:
77
77
  - - "="
78
78
  - !ruby/object:Gem::Version
79
- hash: -1637175961
79
+ hash: -1637175964
80
80
  segments:
81
81
  - 1
82
82
  - 3
83
83
  - 0
84
- - pre12
85
- version: 1.3.0.pre12
84
+ - pre13
85
+ version: 1.3.0.pre13
86
86
  type: :runtime
87
87
  version_requirements: *id004
88
88
  - !ruby/object:Gem::Dependency
@@ -93,13 +93,13 @@ dependencies:
93
93
  requirements:
94
94
  - - "="
95
95
  - !ruby/object:Gem::Version
96
- hash: -1637175961
96
+ hash: -1637175964
97
97
  segments:
98
98
  - 1
99
99
  - 3
100
100
  - 0
101
- - pre12
102
- version: 1.3.0.pre12
101
+ - pre13
102
+ version: 1.3.0.pre13
103
103
  type: :runtime
104
104
  version_requirements: *id005
105
105
  - !ruby/object:Gem::Dependency
@@ -181,6 +181,7 @@ files:
181
181
  - lib/generators/hobo/basic/templates/application.css
182
182
  - lib/generators/hobo/basic/templates/application.dryml.erb
183
183
  - lib/generators/hobo/basic/templates/dryml-support.js
184
+ - lib/generators/hobo/basic/templates/dryml_taglibs_initializer.rb
184
185
  - lib/generators/hobo/basic/templates/en_injection.yml
185
186
  - lib/generators/hobo/basic/templates/guest.rb
186
187
  - lib/generators/hobo/controller.rb