hobo 1.1.0.pre3 → 1.1.0.pre4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.txt CHANGED
@@ -16,18 +16,42 @@ subversion.
16
16
 
17
17
  === Hobo 1.1 ===
18
18
 
19
+ The biggest change to Hobo 1.1 is that DRYML has been split into it's
20
+ own gem and may now be used independently of Hobo or Rails:
21
+
22
+ Dryml.render("<html><%= this %>></html>", {:this => something})
23
+
24
+ Automatic scopes has gained any\_of\_:
25
+
26
+ Person.any_of_friends(Jack, Jill)
27
+
19
28
  The default password validation has been changed to 6 characters, one
20
29
  of which must not be lowercase. Luckily, we also made the password
21
30
  validation easier to change. See
22
31
  [Bug #638](https://hobo.lighthouseapp.com/projects/8324/tickets/638) for
23
32
  more information.
24
33
 
34
+ The `input-many`, `name-one` and `sortable-collection` tags have been
35
+ updated. See the documentation for more details.
36
+
37
+ New tags have been added: `sortable-input-many`, `login-form`.
38
+
39
+ Some css class names have been changed. Hobo 1.0 creates class names
40
+ with the '[]' characters, which is technically illegal, although
41
+ supported by all browsers. However, this does cause problems with
42
+ some third party libraries, such as JQuery.
43
+
44
+ All code changes may viewed on the [github
45
+ log](https://github.com/tablatom/hobo/compare/v1.0.2...v1.0.3)
46
+
47
+
25
48
  === Hobo 1.0.3 ===
26
49
 
27
- This is a security release. All applications that use the reset
28
- password functionality should upgrade.
50
+ This is a security release. All applications that use the reset
51
+ password functionality or are on versions of Rails prior to version
52
+ 2.3.4 should upgrade.
29
53
 
30
- To patch the vulnerability, two changes have been made.
54
+ To patch the reset password vulnerability, two changes have been made.
31
55
 
32
56
  First of all, the lifecycle key hash mechanism has been changed.
33
57
  Existing lifecycle keys will become invalid after you upgrade.
@@ -41,13 +65,26 @@ the `:keep_key => true` option to a transition.
41
65
  More information about the vulnerability can be viewed on the [bug
42
66
  report](https://hobo.lighthouseapp.com/projects/8324/tickets/666-user-model-secure-links-have-low-security).
43
67
 
44
- All code changes may viewed on the [github
45
- log](https://github.com/tablatom/hobo/compare/v1.0.2...v1.0.3)
68
+ Other changes:
69
+
70
+ The text input tag (`<textarea>`) has a security hole with versions of
71
+ Rails prior to 2.3.4. This release makes these old versions of Rails
72
+ safe again, although it is highly recommended that you upgrade to
73
+ Rails 2.3.11 because of other security vulnerabilities on earlier versions
74
+ of Rails.
46
75
 
47
76
  The "include" automatic scope has been aliased to "includes" to
48
77
  increase future compatibility with Rails 3. Future versions of Hobo
49
78
  will remove support for "include".
50
79
 
80
+ This release increases compatibility with Ruby v1.9.2.
81
+
82
+ Hobo 1.0.2 introduced a major problem with chained scopes. This has
83
+ been fixed.
84
+
85
+ All code changes may viewed on the [github
86
+ log](https://github.com/tablatom/hobo/compare/v1.0.2...v1.0.3)
87
+
51
88
  === Hobo 1.0.2 ===
52
89
 
53
90
  This release is almost identical to 1.0.1 except that it updates the
data/Rakefile CHANGED
@@ -10,7 +10,11 @@ $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '/../hobosupport/
10
10
  require 'hobo'
11
11
 
12
12
  RUBY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']).sub(/.*\s.*/m, '"\&"')
13
- RUBYDOCTEST = ENV['RUBYDOCTEST'] || "#{RUBY} -S rubydoctest"
13
+ if defined?(Bundler)
14
+ RUBYDOCTEST = 'bundle exec rubydoctest'
15
+ else
16
+ RUBYDOCTEST = ENV['RUBYDOCTEST'] || "#{RUBY} -S rubydoctest"
17
+ end
14
18
 
15
19
  desc "Default Task"
16
20
  task :default => [ :test ]
@@ -67,6 +71,3 @@ Jeweler::Tasks.new do |gemspec|
67
71
  gemspec.files.include %w(tasks/environments.rake tasks/hobo_tasks.rake)
68
72
  end
69
73
  Jeweler::GemcutterTasks.new
70
- Jeweler::RubyforgeTasks.new do |rubyforge|
71
- rubyforge.doc_task = false
72
- end
data/hobo.gemspec ADDED
@@ -0,0 +1,206 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{hobo}
8
+ s.version = "1.1.0.pre4"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Tom Locke"]
12
+ s.date = %q{2011-02-25}
13
+ s.default_executable = %q{hobo}
14
+ s.email = %q{tom@tomlocke.com}
15
+ s.executables = ["hobo"]
16
+ s.extra_rdoc_files = [
17
+ "README"
18
+ ]
19
+ s.files = [
20
+ "CHANGES.txt",
21
+ "LICENSE.txt",
22
+ "README",
23
+ "Rakefile",
24
+ "bin/hobo",
25
+ "doctest/hobo/hobo_helper.rdoctest",
26
+ "doctest/hobo/lifecycles.rdoctest",
27
+ "doctest/model.rdoctest",
28
+ "doctest/multi_model_forms.rdoctest",
29
+ "doctest/scopes.rdoctest",
30
+ "hobo.gemspec",
31
+ "lib/action_view_extensions/helpers/tag_helper.rb",
32
+ "lib/active_record/association_collection.rb",
33
+ "lib/active_record/association_proxy.rb",
34
+ "lib/active_record/association_reflection.rb",
35
+ "lib/active_record/viewhints_validations_interceptor.rb",
36
+ "lib/hobo.rb",
37
+ "lib/hobo/accessible_associations.rb",
38
+ "lib/hobo/authentication_support.rb",
39
+ "lib/hobo/controller.rb",
40
+ "lib/hobo/dev_controller.rb",
41
+ "lib/hobo/find_for.rb",
42
+ "lib/hobo/generator.rb",
43
+ "lib/hobo/guest.rb",
44
+ "lib/hobo/hobo_helper.rb",
45
+ "lib/hobo/include_in_save.rb",
46
+ "lib/hobo/lifecycles.rb",
47
+ "lib/hobo/lifecycles/actions.rb",
48
+ "lib/hobo/lifecycles/creator.rb",
49
+ "lib/hobo/lifecycles/lifecycle.rb",
50
+ "lib/hobo/lifecycles/state.rb",
51
+ "lib/hobo/lifecycles/transition.rb",
52
+ "lib/hobo/model.rb",
53
+ "lib/hobo/model_controller.rb",
54
+ "lib/hobo/model_router.rb",
55
+ "lib/hobo/permissions.rb",
56
+ "lib/hobo/permissions/associations.rb",
57
+ "lib/hobo/rapid_helper.rb",
58
+ "lib/hobo/scopes.rb",
59
+ "lib/hobo/scopes/apply_scopes.rb",
60
+ "lib/hobo/scopes/association_proxy_extensions.rb",
61
+ "lib/hobo/scopes/automatic_scopes.rb",
62
+ "lib/hobo/scopes/named_scope_extensions.rb",
63
+ "lib/hobo/tasks/rails.rb",
64
+ "lib/hobo/translations.rb",
65
+ "lib/hobo/undefined.rb",
66
+ "lib/hobo/undefined_access_error.rb",
67
+ "lib/hobo/user.rb",
68
+ "lib/hobo/user_controller.rb",
69
+ "lib/hobo/view_hints.rb",
70
+ "rails/init.rb",
71
+ "rails_generators/hobo/USAGE",
72
+ "rails_generators/hobo/hobo_generator.rb",
73
+ "rails_generators/hobo/templates/application.css",
74
+ "rails_generators/hobo/templates/application.dryml",
75
+ "rails_generators/hobo/templates/dryml-support.js",
76
+ "rails_generators/hobo/templates/guest.rb",
77
+ "rails_generators/hobo/templates/initializer.rb",
78
+ "rails_generators/hobo_admin_site/USAGE",
79
+ "rails_generators/hobo_admin_site/hobo_admin_site_generator.rb",
80
+ "rails_generators/hobo_admin_site/templates/admin.css",
81
+ "rails_generators/hobo_admin_site/templates/application.dryml",
82
+ "rails_generators/hobo_admin_site/templates/controller.rb",
83
+ "rails_generators/hobo_admin_site/templates/site_taglib.dryml",
84
+ "rails_generators/hobo_admin_site/templates/users_index.dryml",
85
+ "rails_generators/hobo_front_controller/USAGE",
86
+ "rails_generators/hobo_front_controller/hobo_front_controller_generator.rb",
87
+ "rails_generators/hobo_front_controller/templates/controller.rb",
88
+ "rails_generators/hobo_front_controller/templates/functional_test.rb",
89
+ "rails_generators/hobo_front_controller/templates/helper.rb",
90
+ "rails_generators/hobo_front_controller/templates/index.dryml",
91
+ "rails_generators/hobo_front_controller/templates/summary.dryml",
92
+ "rails_generators/hobo_model/USAGE",
93
+ "rails_generators/hobo_model/hobo_model_generator.rb",
94
+ "rails_generators/hobo_model/templates/fixtures.yml",
95
+ "rails_generators/hobo_model/templates/hints.rb",
96
+ "rails_generators/hobo_model/templates/model.rb",
97
+ "rails_generators/hobo_model/templates/unit_test.rb",
98
+ "rails_generators/hobo_model_controller/USAGE",
99
+ "rails_generators/hobo_model_controller/hobo_model_controller_generator.rb",
100
+ "rails_generators/hobo_model_controller/templates/controller.rb",
101
+ "rails_generators/hobo_model_controller/templates/functional_test.rb",
102
+ "rails_generators/hobo_model_controller/templates/helper.rb",
103
+ "rails_generators/hobo_model_resource/USAGE",
104
+ "rails_generators/hobo_model_resource/hobo_model_resource_generator.rb",
105
+ "rails_generators/hobo_model_resource/templates/controller.rb",
106
+ "rails_generators/hobo_model_resource/templates/functional_test.rb",
107
+ "rails_generators/hobo_model_resource/templates/helper.rb",
108
+ "rails_generators/hobo_rapid/USAGE",
109
+ "rails_generators/hobo_rapid/hobo_rapid_generator.rb",
110
+ "rails_generators/hobo_rapid/templates/IE7.js",
111
+ "rails_generators/hobo_rapid/templates/blank.gif",
112
+ "rails_generators/hobo_rapid/templates/hobo-rapid.css",
113
+ "rails_generators/hobo_rapid/templates/hobo-rapid.js",
114
+ "rails_generators/hobo_rapid/templates/ie7-recalc.js",
115
+ "rails_generators/hobo_rapid/templates/lowpro.js",
116
+ "rails_generators/hobo_rapid/templates/reset.css",
117
+ "rails_generators/hobo_rapid/templates/themes/clean/public/images/101-3B5F87-ACD3E6.png",
118
+ "rails_generators/hobo_rapid/templates/themes/clean/public/images/30-3E547A-242E42.png",
119
+ "rails_generators/hobo_rapid/templates/themes/clean/public/images/30-DBE1E5-FCFEF5.png",
120
+ "rails_generators/hobo_rapid/templates/themes/clean/public/images/300-ACD3E6-fff.png",
121
+ "rails_generators/hobo_rapid/templates/themes/clean/public/images/50-ACD3E6-fff.png",
122
+ "rails_generators/hobo_rapid/templates/themes/clean/public/images/fieldbg.gif",
123
+ "rails_generators/hobo_rapid/templates/themes/clean/public/images/pencil.png",
124
+ "rails_generators/hobo_rapid/templates/themes/clean/public/images/small_close.png",
125
+ "rails_generators/hobo_rapid/templates/themes/clean/public/images/spinner.gif",
126
+ "rails_generators/hobo_rapid/templates/themes/clean/public/stylesheets/clean.css",
127
+ "rails_generators/hobo_rapid/templates/themes/clean/public/stylesheets/rapid-ui.css",
128
+ "rails_generators/hobo_rapid/templates/themes/clean/views/clean.dryml",
129
+ "rails_generators/hobo_subsite/USAGE",
130
+ "rails_generators/hobo_subsite/hobo_subsite_generator.rb",
131
+ "rails_generators/hobo_subsite/templates/application.dryml",
132
+ "rails_generators/hobo_subsite/templates/controller.rb",
133
+ "rails_generators/hobo_subsite/templates/site_taglib.dryml",
134
+ "rails_generators/hobo_user_controller/USAGE",
135
+ "rails_generators/hobo_user_controller/hobo_user_controller_generator.rb",
136
+ "rails_generators/hobo_user_controller/templates/accept_invitation.dryml",
137
+ "rails_generators/hobo_user_controller/templates/controller.rb",
138
+ "rails_generators/hobo_user_controller/templates/functional_test.rb",
139
+ "rails_generators/hobo_user_controller/templates/helper.rb",
140
+ "rails_generators/hobo_user_model/USAGE",
141
+ "rails_generators/hobo_user_model/hobo_user_model_generator.rb",
142
+ "rails_generators/hobo_user_model/templates/fixtures.yml",
143
+ "rails_generators/hobo_user_model/templates/forgot_password.erb",
144
+ "rails_generators/hobo_user_model/templates/invite.erb",
145
+ "rails_generators/hobo_user_model/templates/mailer.rb",
146
+ "rails_generators/hobo_user_model/templates/model.rb",
147
+ "rails_generators/hobo_user_model/templates/unit_test.rb",
148
+ "rapid_generators/rapid/cards.dryml.erb",
149
+ "rapid_generators/rapid/forms.dryml.erb",
150
+ "rapid_generators/rapid/pages.dryml.erb",
151
+ "script/destroy",
152
+ "script/generate",
153
+ "taglibs/rapid.dryml",
154
+ "taglibs/rapid_core.dryml",
155
+ "taglibs/rapid_document_tags.dryml",
156
+ "taglibs/rapid_editing.dryml",
157
+ "taglibs/rapid_forms.dryml",
158
+ "taglibs/rapid_generics.dryml",
159
+ "taglibs/rapid_lifecycles.dryml",
160
+ "taglibs/rapid_navigation.dryml",
161
+ "taglibs/rapid_pages.dryml",
162
+ "taglibs/rapid_plus.dryml",
163
+ "taglibs/rapid_summary.dryml",
164
+ "taglibs/rapid_support.dryml",
165
+ "taglibs/rapid_translations.dryml",
166
+ "taglibs/rapid_user_pages.dryml",
167
+ "tasks/environments.rake",
168
+ "tasks/hobo_tasks.rake",
169
+ "test/generators/test_generator_helper.rb",
170
+ "test/generators/test_helper.rb",
171
+ "test/generators/test_hobo_model_controller_generator.rb",
172
+ "test/permissions/models/models.rb",
173
+ "test/permissions/models/schema.rb",
174
+ "test/permissions/test_permissions.rb"
175
+ ]
176
+ s.homepage = %q{http://hobocentral.net/}
177
+ s.require_paths = ["lib"]
178
+ s.rubyforge_project = %q{hobo}
179
+ s.rubygems_version = %q{1.4.2}
180
+ s.summary = %q{The web app builder for Rails}
181
+
182
+ if s.respond_to? :specification_version then
183
+ s.specification_version = 3
184
+
185
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
186
+ s.add_runtime_dependency(%q<rails>, [">= 2.2.2", "< 3.0.0"])
187
+ s.add_runtime_dependency(%q<will_paginate>, [">= 2.3.11", "~> 2"])
188
+ s.add_runtime_dependency(%q<hobosupport>, ["= 1.1.0.pre4"])
189
+ s.add_runtime_dependency(%q<hobofields>, ["= 1.1.0.pre4"])
190
+ s.add_runtime_dependency(%q<dryml>, ["= 1.1.0.pre4"])
191
+ else
192
+ s.add_dependency(%q<rails>, [">= 2.2.2", "< 3.0.0"])
193
+ s.add_dependency(%q<will_paginate>, [">= 2.3.11", "~> 2"])
194
+ s.add_dependency(%q<hobosupport>, ["= 1.1.0.pre4"])
195
+ s.add_dependency(%q<hobofields>, ["= 1.1.0.pre4"])
196
+ s.add_dependency(%q<dryml>, ["= 1.1.0.pre4"])
197
+ end
198
+ else
199
+ s.add_dependency(%q<rails>, [">= 2.2.2", "< 3.0.0"])
200
+ s.add_dependency(%q<will_paginate>, [">= 2.3.11", "~> 2"])
201
+ s.add_dependency(%q<hobosupport>, ["= 1.1.0.pre4"])
202
+ s.add_dependency(%q<hobofields>, ["= 1.1.0.pre4"])
203
+ s.add_dependency(%q<dryml>, ["= 1.1.0.pre4"])
204
+ end
205
+ end
206
+
@@ -29,6 +29,22 @@ module ActiveRecord
29
29
  proxy_reflection.klass
30
30
  end
31
31
 
32
+ # DO NOT call super here - AssociationProxy's version loads the collection, and that's bad.
33
+ # TODO: this really belongs in Rails; migrate it there ASAP
34
+ def respond_to?(*args)
35
+ return super if has_one_collection?
36
+ proxy_respond_to?(*args) || [].respond_to?(*args)
37
+ end
38
+
39
+ def is_a?(klass)
40
+ if has_one_collection?
41
+ load_target
42
+ @target.is_a?(klass)
43
+ else
44
+ [].is_a?(klass)
45
+ end
46
+ end
47
+
32
48
  private
33
49
 
34
50
  def set_reverse_association(object)
@@ -41,6 +57,10 @@ module ActiveRecord
41
57
  end
42
58
  end
43
59
 
60
+ def has_one_collection?
61
+ proxy_reflection.macro == :has_one
62
+ end
63
+
44
64
  end
45
65
  end
46
66
  end
data/lib/hobo.rb CHANGED
@@ -22,8 +22,8 @@ class HoboError < RuntimeError; end
22
22
 
23
23
  module Hobo
24
24
 
25
- VERSION = "1.1.0.pre3"
26
-
25
+ VERSION = "1.1.0.pre4"
26
+
27
27
  class PermissionDeniedError < RuntimeError; end
28
28
 
29
29
  class RawJs < String; end
@@ -242,7 +242,7 @@ module Hobo
242
242
  if field
243
243
  # Field can be a dot separated path
244
244
  if field.is_a?(String) && (path = field.split(".")).length > 1
245
- _, _, object = Hobo.get_field_path(object, path[0..-2])
245
+ _, _, object = Dryml.get_field_path(object, path[0..-2])
246
246
  field = path.last
247
247
  end
248
248
  elsif (origin = object.try.origin)
@@ -350,11 +350,12 @@ edit collections a `Category` model in your application:
350
350
  <def tag="collection-input" for="ActiveRecord::Base"><select-many merge/></def>
351
351
 
352
352
 
353
- <!-- A `<textarea>` input -->
353
+ <!-- A `<textarea>` input. Attributes are passed through to [text_area_tag](http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-text_area_tag). -->
354
354
  <def tag="input" for="text" attrs="name">
355
- <%= text_area_tag(name, this, attributes) %>
355
+ <%= text_area_tag(name, attributes["escape"]==false ? this : html_escape(this), attributes) %>
356
356
  </def>
357
357
 
358
+
358
359
  <!-- A checkbox plus a hidden-field. The hidden field trick comes from Rails - it means that when the checkbox is not checked, the parameter name is still submitted, with a '0' value (the value is '1' when the checkbox is checked) -->
359
360
  <def tag="input" for="boolean" attrs="name">
360
361
  <%= unless attributes[:disabled]
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobo
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1876988186
5
- prerelease: true
4
+ hash: 1923831953
5
+ prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
9
  - 0
10
- - pre3
11
- version: 1.1.0.pre3
10
+ - pre
11
+ - 4
12
+ version: 1.1.0.pre4
12
13
  platform: ruby
13
14
  authors:
14
15
  - Tom Locke
@@ -16,7 +17,7 @@ autorequire:
16
17
  bindir: bin
17
18
  cert_chain: []
18
19
 
19
- date: 2011-01-16 00:00:00 -05:00
20
+ date: 2011-02-25 00:00:00 -05:00
20
21
  default_executable: hobo
21
22
  dependencies:
22
23
  - !ruby/object:Gem::Dependency
@@ -73,13 +74,14 @@ dependencies:
73
74
  requirements:
74
75
  - - "="
75
76
  - !ruby/object:Gem::Version
76
- hash: -1876988186
77
+ hash: 1923831953
77
78
  segments:
78
79
  - 1
79
80
  - 1
80
81
  - 0
81
- - pre3
82
- version: 1.1.0.pre3
82
+ - pre
83
+ - 4
84
+ version: 1.1.0.pre4
83
85
  type: :runtime
84
86
  version_requirements: *id003
85
87
  - !ruby/object:Gem::Dependency
@@ -90,13 +92,14 @@ dependencies:
90
92
  requirements:
91
93
  - - "="
92
94
  - !ruby/object:Gem::Version
93
- hash: -1876988186
95
+ hash: 1923831953
94
96
  segments:
95
97
  - 1
96
98
  - 1
97
99
  - 0
98
- - pre3
99
- version: 1.1.0.pre3
100
+ - pre
101
+ - 4
102
+ version: 1.1.0.pre4
100
103
  type: :runtime
101
104
  version_requirements: *id004
102
105
  - !ruby/object:Gem::Dependency
@@ -107,13 +110,14 @@ dependencies:
107
110
  requirements:
108
111
  - - "="
109
112
  - !ruby/object:Gem::Version
110
- hash: -1876988186
113
+ hash: 1923831953
111
114
  segments:
112
115
  - 1
113
116
  - 1
114
117
  - 0
115
- - pre3
116
- version: 1.1.0.pre3
118
+ - pre
119
+ - 4
120
+ version: 1.1.0.pre4
117
121
  type: :runtime
118
122
  version_requirements: *id005
119
123
  description:
@@ -122,8 +126,8 @@ executables:
122
126
  - hobo
123
127
  extensions: []
124
128
 
125
- extra_rdoc_files: []
126
-
129
+ extra_rdoc_files:
130
+ - README
127
131
  files:
128
132
  - CHANGES.txt
129
133
  - LICENSE.txt
@@ -135,6 +139,7 @@ files:
135
139
  - doctest/model.rdoctest
136
140
  - doctest/multi_model_forms.rdoctest
137
141
  - doctest/scopes.rdoctest
142
+ - hobo.gemspec
138
143
  - lib/action_view_extensions/helpers/tag_helper.rb
139
144
  - lib/active_record/association_collection.rb
140
145
  - lib/active_record/association_proxy.rb
@@ -284,8 +289,8 @@ homepage: http://hobocentral.net/
284
289
  licenses: []
285
290
 
286
291
  post_install_message:
287
- rdoc_options:
288
- - --charset=UTF-8
292
+ rdoc_options: []
293
+
289
294
  require_paths:
290
295
  - lib
291
296
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -311,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
316
  requirements: []
312
317
 
313
318
  rubyforge_project: hobo
314
- rubygems_version: 1.3.7
319
+ rubygems_version: 1.4.2
315
320
  signing_key:
316
321
  specification_version: 3
317
322
  summary: The web app builder for Rails