hobo 1.3.0.pre26 → 1.3.0.pre27
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/generators/hobo/setup_wizard/setup_wizard_generator.rb +1 -1
- data/lib/generators/hobo/test_framework/test_framework_generator.rb +1 -1
- data/lib/hobo/controller.rb +2 -2
- data/lib/hobo/controller/model.rb +1 -1
- data/lib/hobo/engine.rb +4 -0
- data/lib/hobo/extensions/action_view/translation_helper.rb +0 -2
- data/lib/hobo/helper.rb +1 -1
- data/lib/hobo/model/lifecycles.rb +1 -1
- data/lib/hobo/model/view_hints.rb +67 -47
- data/lib/hobo/rapid/generators/rapid/forms.dryml.erb +1 -1
- data/lib/hobo/rapid/taglibs/rapid_pages.dryml +1 -1
- metadata +7 -60
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.0.
|
1
|
+
1.3.0.pre27
|
@@ -113,7 +113,7 @@ NOTE: You might want to sign up as the administrator before adding this!
|
|
113
113
|
end
|
114
114
|
inject_into_file 'app/controllers/application_controller.rb', <<EOI, :after => "protect_from_forgery\n" if private_site
|
115
115
|
include Hobo::Controller::AuthenticationSupport
|
116
|
-
before_filter :except => [:login, :forgot_password] do
|
116
|
+
before_filter :except => [:login, :forgot_password, :accept_invitation, :do_accept_invitation] do
|
117
117
|
login_required unless #{@user_resource_name.camelize}.count == 0
|
118
118
|
end
|
119
119
|
EOI
|
@@ -63,7 +63,7 @@ private
|
|
63
63
|
block = "\n config.generators do |g|"
|
64
64
|
block << "\n g.test_framework :#{n}, :fixtures => #{options[:fixtures].inspect}" if !options[:fixtures] || name != 'test_unit'
|
65
65
|
block << "\n g.fallbacks[:#{n}] = :test_unit" unless name == 'test_unit'
|
66
|
-
block << "\n g.fixture_replacement
|
66
|
+
block << "\n g.fixture_replacement = :#{options[:fixture_replacement]}" unless options[:fixture_replacement].blank?
|
67
67
|
block << "\n end\n"
|
68
68
|
environment block
|
69
69
|
end
|
data/lib/hobo/controller.rb
CHANGED
@@ -27,7 +27,7 @@ module Hobo
|
|
27
27
|
end
|
28
28
|
before_filter :set_mailer_default_url_options
|
29
29
|
@included_taglibs = []
|
30
|
-
rescue_from ActionController::RoutingError, :with => :not_found
|
30
|
+
rescue_from ActionController::RoutingError, :with => :not_found unless Rails.env.development?
|
31
31
|
end
|
32
32
|
Hobo::Helper.add_to_controller(klass)
|
33
33
|
end
|
@@ -77,7 +77,7 @@ module Hobo
|
|
77
77
|
renderer = Dryml.page_renderer(view_context, identifier, [], controller)
|
78
78
|
|
79
79
|
render :update do |page|
|
80
|
-
page << options[:preamble] || "var _update = typeof Hobo == 'undefined' ? Element.update : Hobo.updateElement;"
|
80
|
+
page << (options[:preamble] || "var _update = typeof Hobo == 'undefined' ? Element.update : Hobo.updateElement;")
|
81
81
|
for spec in render_specs
|
82
82
|
function = spec[:function] || "_update"
|
83
83
|
dom_id = spec[:id]
|
@@ -27,7 +27,7 @@ module Hobo
|
|
27
27
|
helper_method :model, :current_user
|
28
28
|
before_filter :set_no_cache_headers
|
29
29
|
|
30
|
-
rescue_from ActiveRecord::RecordNotFound, :with => :not_found
|
30
|
+
rescue_from ActiveRecord::RecordNotFound, :with => :not_found unless Rails.env.development?
|
31
31
|
|
32
32
|
rescue_from Hobo::PermissionDeniedError, :with => :permission_denied
|
33
33
|
rescue_from Hobo::Model::Lifecycles::LifecycleKeyError, :with => :permission_denied
|
data/lib/hobo/engine.rb
CHANGED
@@ -33,11 +33,15 @@ module Hobo
|
|
33
33
|
require 'hobo/extensions/active_record/relation_with_origin'
|
34
34
|
require 'hobo/extensions/active_model/name'
|
35
35
|
require 'hobo/extensions/active_model/translation'
|
36
|
+
# added legacy namespace for backward compatibility
|
37
|
+
# TODO: remove the following line if Hobo::VERSION > 1.3.x
|
38
|
+
Hobo::ViewHints = Hobo::Model::ViewHints
|
36
39
|
end
|
37
40
|
|
38
41
|
ActiveSupport.on_load(:action_view) do
|
39
42
|
require 'hobo/extensions/action_view/tag_helper'
|
40
43
|
require 'hobo/extensions/action_view/translation_helper'
|
44
|
+
include Hobo::Helper::Translations::Normalizer
|
41
45
|
end
|
42
46
|
|
43
47
|
ActiveSupport.on_load(:before_initialize) do
|
data/lib/hobo/helper.rb
CHANGED
@@ -34,7 +34,7 @@ module Hobo
|
|
34
34
|
|
35
35
|
module_eval "class ::#{name}::LifecycleStateField < HoboFields::Types::LifecycleState; end"
|
36
36
|
state_field_class = self::LifecycleStateField
|
37
|
-
state_field_class.
|
37
|
+
state_field_class.model_name = name
|
38
38
|
end
|
39
39
|
|
40
40
|
dsl = Hobo::Model::Lifecycles::DeclarationDSL.new(lifecycle)
|
@@ -2,62 +2,82 @@ module Hobo
|
|
2
2
|
module Model
|
3
3
|
class ViewHints
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
class << self
|
6
|
+
|
7
|
+
# allows delayed set of children in order to avoid circular references
|
8
|
+
# triggered by declaring children in the model
|
9
|
+
def children(*args)
|
10
|
+
if args.empty? # reader
|
11
|
+
if @children_args.nil? # value already set
|
12
|
+
@children ||= []
|
13
|
+
else # set
|
14
|
+
child_model = model.reflect_on_association(@children_args.first).klass
|
15
|
+
if child_model.view_hints.parent.nil? and !child_model.view_hints.parent_defined
|
16
|
+
parent = model.reverse_reflection(@children_args.first)
|
17
|
+
child_model.view_hints.parent(parent.name, :undefined => true) if parent
|
18
|
+
end
|
19
|
+
@children = @children_args
|
20
|
+
@children_args = nil
|
21
|
+
@children
|
13
22
|
end
|
14
|
-
|
15
|
-
|
16
|
-
arg = if block
|
17
|
-
instance_exec(*args, &block)
|
18
|
-
else
|
19
|
-
args.first
|
20
|
-
end
|
21
|
-
instance_variable_set("@#{ivname}", arg)
|
23
|
+
else # writer (only stores the args for delayed setting)
|
24
|
+
@children_args = args
|
22
25
|
end
|
23
26
|
end
|
24
|
-
end
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
def inline_booleans(*args)
|
29
|
+
if args.empty? # reader
|
30
|
+
if @inline_booleans_args.nil?
|
31
|
+
@inline_booleans ||= []
|
32
|
+
else
|
33
|
+
@inline_booleans = if @inline_booleans_args.first == true
|
34
|
+
model.columns.select { |c| c.type == :boolean }.*.name
|
35
|
+
else
|
36
|
+
@inline_booleans_args.*.to_s
|
37
|
+
end
|
38
|
+
@inline_booleans_args = nil
|
39
|
+
@inline_booleans
|
40
|
+
end
|
41
|
+
else # writer
|
42
|
+
@inline_booleans_args = args
|
43
|
+
end
|
32
44
|
end
|
33
|
-
args
|
34
|
-
end
|
35
|
-
|
36
|
-
setter :parent, nil do |*args|
|
37
|
-
options = args.extract_options!
|
38
|
-
parent_defined(true) unless options[:undefined]
|
39
|
-
args.first
|
40
|
-
end
|
41
45
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
def parent(*args)
|
47
|
+
if args.empty? #reader
|
48
|
+
@parent
|
49
|
+
else # writer
|
50
|
+
options = args.extract_options!
|
51
|
+
parent_defined(true) unless options[:undefined]
|
52
|
+
@parent = args.first
|
53
|
+
end
|
54
|
+
end
|
49
55
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
56
|
+
def parent_defined(arg=nil)
|
57
|
+
if arg.nil?
|
58
|
+
@parent_defined
|
59
|
+
else
|
60
|
+
@parent_defined = arg
|
61
|
+
end
|
62
|
+
end
|
57
63
|
|
58
|
-
|
64
|
+
def paginate?(arg=nil)
|
65
|
+
if arg.nil?
|
66
|
+
@paginate ||= !sortable?
|
67
|
+
else
|
68
|
+
@paginate = arg
|
69
|
+
end
|
70
|
+
end
|
59
71
|
|
60
|
-
|
72
|
+
def sortable?(arg=nil)
|
73
|
+
if arg.nil?
|
74
|
+
@sortable ||= defined?(ActiveRecord::Acts::List::InstanceMethods) &&
|
75
|
+
model < ActiveRecord::Acts::List::InstanceMethods &&
|
76
|
+
model.new.try.scope_condition == "1 = 1"
|
77
|
+
else
|
78
|
+
@sortable = arg
|
79
|
+
end
|
80
|
+
end
|
61
81
|
|
62
82
|
def _name
|
63
83
|
@_name ||= name.sub(/Hints$/, '')
|
@@ -37,7 +37,7 @@ model_key = model.to_s.underscore
|
|
37
37
|
<input type="hidden" name="key" value="&this.lifecycle.provided_key" if="&this.lifecycle.provided_key"/>
|
38
38
|
<field-list fields="<%= transition.parameters * ', ' %>" param/>
|
39
39
|
<div param="actions">
|
40
|
-
<submit label="#{
|
40
|
+
<submit label="#{t 'activerecord.attributes.<%= model_key %>.lifecycle.transitions.<%= transition.name.to_s %>', :default=>['<%= transition.name.to_s.titleize %>']}" param/><or-cancel param="cancel"/>
|
41
41
|
</div>
|
42
42
|
</form>
|
43
43
|
</def>
|
@@ -104,7 +104,7 @@ The easiest way to see what this tag does is to look at the source.
|
|
104
104
|
|
105
105
|
-->
|
106
106
|
<def tag="not-found-page" attrs="message">
|
107
|
-
<% message ||= "The page you
|
107
|
+
<% message ||= t("hobo.messages.not_found", :default=>["The page you requested cannot be found."]) %>
|
108
108
|
<page merge>
|
109
109
|
<body: class="not-found"/>
|
110
110
|
<content: param>
|
metadata
CHANGED
@@ -1,14 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hobo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 3
|
9
|
-
- 0
|
10
|
-
- pre26
|
11
|
-
version: 1.3.0.pre26
|
4
|
+
prerelease: 6
|
5
|
+
version: 1.3.0.pre27
|
12
6
|
platform: ruby
|
13
7
|
authors:
|
14
8
|
- Tom Locke
|
@@ -16,7 +10,7 @@ autorequire:
|
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
12
|
|
19
|
-
date: 2011-
|
13
|
+
date: 2011-02-22 00:00:00 -04:00
|
20
14
|
default_executable:
|
21
15
|
dependencies:
|
22
16
|
- !ruby/object:Gem::Dependency
|
@@ -27,11 +21,6 @@ dependencies:
|
|
27
21
|
requirements:
|
28
22
|
- - ">="
|
29
23
|
- !ruby/object:Gem::Version
|
30
|
-
hash: 7
|
31
|
-
segments:
|
32
|
-
- 3
|
33
|
-
- 0
|
34
|
-
- 0
|
35
24
|
version: 3.0.0
|
36
25
|
type: :runtime
|
37
26
|
version_requirements: *id001
|
@@ -43,11 +32,6 @@ dependencies:
|
|
43
32
|
requirements:
|
44
33
|
- - ">="
|
45
34
|
- !ruby/object:Gem::Version
|
46
|
-
hash: 961915916
|
47
|
-
segments:
|
48
|
-
- 3
|
49
|
-
- 0
|
50
|
-
- pre
|
51
35
|
version: 3.0.pre
|
52
36
|
type: :runtime
|
53
37
|
version_requirements: *id002
|
@@ -59,13 +43,7 @@ dependencies:
|
|
59
43
|
requirements:
|
60
44
|
- - "="
|
61
45
|
- !ruby/object:Gem::Version
|
62
|
-
|
63
|
-
segments:
|
64
|
-
- 1
|
65
|
-
- 3
|
66
|
-
- 0
|
67
|
-
- pre26
|
68
|
-
version: 1.3.0.pre26
|
46
|
+
version: 1.3.0.pre27
|
69
47
|
type: :runtime
|
70
48
|
version_requirements: *id003
|
71
49
|
- !ruby/object:Gem::Dependency
|
@@ -76,13 +54,7 @@ dependencies:
|
|
76
54
|
requirements:
|
77
55
|
- - "="
|
78
56
|
- !ruby/object:Gem::Version
|
79
|
-
|
80
|
-
segments:
|
81
|
-
- 1
|
82
|
-
- 3
|
83
|
-
- 0
|
84
|
-
- pre26
|
85
|
-
version: 1.3.0.pre26
|
57
|
+
version: 1.3.0.pre27
|
86
58
|
type: :runtime
|
87
59
|
version_requirements: *id004
|
88
60
|
- !ruby/object:Gem::Dependency
|
@@ -93,13 +65,7 @@ dependencies:
|
|
93
65
|
requirements:
|
94
66
|
- - "="
|
95
67
|
- !ruby/object:Gem::Version
|
96
|
-
|
97
|
-
segments:
|
98
|
-
- 1
|
99
|
-
- 3
|
100
|
-
- 0
|
101
|
-
- pre26
|
102
|
-
version: 1.3.0.pre26
|
68
|
+
version: 1.3.0.pre27
|
103
69
|
type: :runtime
|
104
70
|
version_requirements: *id005
|
105
71
|
- !ruby/object:Gem::Dependency
|
@@ -110,9 +76,6 @@ dependencies:
|
|
110
76
|
requirements:
|
111
77
|
- - ">="
|
112
78
|
- !ruby/object:Gem::Version
|
113
|
-
hash: 3
|
114
|
-
segments:
|
115
|
-
- 0
|
116
79
|
version: "0"
|
117
80
|
type: :development
|
118
81
|
version_requirements: *id006
|
@@ -124,9 +87,6 @@ dependencies:
|
|
124
87
|
requirements:
|
125
88
|
- - ">="
|
126
89
|
- !ruby/object:Gem::Version
|
127
|
-
hash: 3
|
128
|
-
segments:
|
129
|
-
- 0
|
130
90
|
version: "0"
|
131
91
|
type: :development
|
132
92
|
version_requirements: *id007
|
@@ -138,11 +98,6 @@ dependencies:
|
|
138
98
|
requirements:
|
139
99
|
- - ">="
|
140
100
|
- !ruby/object:Gem::Version
|
141
|
-
hash: 9
|
142
|
-
segments:
|
143
|
-
- 0
|
144
|
-
- 7
|
145
|
-
- 5
|
146
101
|
version: 0.7.5
|
147
102
|
type: :development
|
148
103
|
version_requirements: *id008
|
@@ -365,25 +320,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
365
320
|
requirements:
|
366
321
|
- - ">="
|
367
322
|
- !ruby/object:Gem::Version
|
368
|
-
hash: 3
|
369
|
-
segments:
|
370
|
-
- 0
|
371
323
|
version: "0"
|
372
324
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
373
325
|
none: false
|
374
326
|
requirements:
|
375
327
|
- - ">="
|
376
328
|
- !ruby/object:Gem::Version
|
377
|
-
hash: 23
|
378
|
-
segments:
|
379
|
-
- 1
|
380
|
-
- 3
|
381
|
-
- 6
|
382
329
|
version: 1.3.6
|
383
330
|
requirements: []
|
384
331
|
|
385
332
|
rubyforge_project: hobo
|
386
|
-
rubygems_version: 1.
|
333
|
+
rubygems_version: 1.5.0
|
387
334
|
signing_key:
|
388
335
|
specification_version: 3
|
389
336
|
summary: The web app builder for Rails
|