compages 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.project +18 -0
- data/README +180 -0
- data/Rakefile +10 -0
- data/app/controllers/application.rb +4 -0
- data/app/controllers/contents_controller.rb +116 -0
- data/app/controllers/pages_controller.rb +59 -0
- data/app/controllers/render_controller.rb +24 -0
- data/app/helpers/application_helper.rb +6 -0
- data/app/helpers/contents_helper.rb +5 -0
- data/app/helpers/pages_helper.rb +5 -0
- data/app/helpers/render_helper.rb +2 -0
- data/app/models/content.rb +26 -0
- data/app/models/meta_data.rb +3 -0
- data/app/models/page.rb +106 -0
- data/app/models/page_element.rb +9 -0
- data/app/views/contents/_content_preview.rhtml +1 -0
- data/app/views/contents/_contents_list.rhtml +3 -0
- data/app/views/contents/_show_library.rhtml +60 -0
- data/app/views/contents/_write_now.rhtml +42 -0
- data/app/views/layouts/pages.rhtml +24 -0
- data/app/views/layouts/render.rhtml +11 -0
- data/app/views/pages/_change_theme.rhtml +0 -0
- data/app/views/pages/_edit_menu.rhtml +62 -0
- data/app/views/pages/_page_listed.rhtml +13 -0
- data/app/views/pages/_select_theme.rhtml +4 -0
- data/app/views/pages/edit.rhtml +35 -0
- data/app/views/pages/index.rhtml +45 -0
- data/app/views/pages/list.rhtml +41 -0
- data/app/views/pages/list_a.rhtml +40 -0
- data/app/views/pages/welcome.rhtml +27 -0
- data/app/views/render/_blank.rhtml +3 -0
- data/app/views/render/show.rhtml +1 -0
- data/bin/compages +14 -0
- data/config/boot.rb +44 -0
- data/config/database.yml.home +35 -0
- data/config/environment.rb +53 -0
- data/config/environments/development.rb +21 -0
- data/config/environments/production.rb +18 -0
- data/config/environments/test.rb +19 -0
- data/config/routes.rb +32 -0
- data/db/Copia di schema.rb +48 -0
- data/db/migrate/001_create_pages.rb +12 -0
- data/db/migrate/002_create_contents.rb +12 -0
- data/db/migrate/003_create_meta_datas.rb +14 -0
- data/db/migrate/004_create_page_elements.rb +17 -0
- data/db/migrate/005_add_urlnames.rb +15 -0
- data/db/migrate/006_add_sessions.rb +15 -0
- data/db/schema.mysql.sql +65 -0
- data/db/schema.postgresql.sql +65 -0
- data/db/schema.rb +49 -0
- data/db/schema.sqlite.sql +65 -0
- data/db/schema.sqlserver.sql +71 -0
- data/db/schema_version +1 -0
- data/doc/ER-model/v1.dia +0 -0
- data/doc/ER-model/v2.dia +0 -0
- data/doc/ER-model/v3.dia +0 -0
- data/doc/README_FOR_APP +2 -0
- data/doc/esempi/doc-vir/ecds.htm +2362 -0
- data/doc/esempi/doc-vir/ecds_files/search.gif +0 -0
- data/doc/esempi/doc-vir/ecds_files/upld.gif +0 -0
- data/doc/esempi/doc-vir/ecds_files/upld.jpg +0 -0
- data/installer/apache13.conf.example.template +33 -0
- data/installer/apache20.conf.example.template +40 -0
- data/installer/lighttpd.conf.example.template +6 -0
- data/installer/rails_installer_defaults.yml +5 -0
- data/lib/redcloth.rb +1130 -0
- data/lib/render_engine.rb +94 -0
- data/lib/tasks/release.rake +46 -0
- data/public/.htaccess +41 -0
- data/public/404.html +8 -0
- data/public/500.html +8 -0
- data/public/_index.html +277 -0
- data/public/favicon.ico +0 -0
- data/public/images/body_bg.gif +0 -0
- data/public/images/body_bg_short.gif +0 -0
- data/public/images/ie_shadow.png +0 -0
- data/public/images/journal_reflex.gif +0 -0
- data/public/images/journal_shadow.gif +0 -0
- data/public/images/logo_journal_small.bmp +0 -0
- data/public/images/logo_journal_small.png +0 -0
- data/public/images/page_edit_shadow.png +0 -0
- data/public/images/restore_bar.png +0 -0
- data/public/images/spinner.gif +0 -0
- data/public/javascripts/application.js +23 -0
- data/public/javascripts/controls.js +815 -0
- data/public/javascripts/dragdrop.js +913 -0
- data/public/javascripts/effects.js +958 -0
- data/public/javascripts/lowpro.js +307 -0
- data/public/javascripts/prototype.js +2006 -0
- data/public/robots.txt +1 -0
- data/public/stylesheets/compages.css +196 -0
- data/public/stylesheets/editing.css +180 -0
- data/public/stylesheets/editing_ie_filth.css +36 -0
- data/public/themes/Doc_basic/_script.js +342 -0
- data/public/themes/Doc_basic/images/Thumbs.db +0 -0
- data/public/themes/Doc_basic/images/search.gif +0 -0
- data/public/themes/Doc_basic/images/upld.gif +0 -0
- data/public/themes/Doc_basic/images/upld.jpg +0 -0
- data/public/themes/Doc_basic/index.html +114 -0
- data/public/themes/Doc_basic/style.css +1743 -0
- data/public/themes/color7boxes/default2.css +42 -0
- data/public/themes/color7boxes/index.html +40 -0
- data/public/themes/prova/index.html +12 -0
- data/public/zDoc/images/search.gif +0 -0
- data/public/zDoc/images/upld.gif +0 -0
- data/public/zDoc/images/upld.jpg +0 -0
- data/public/zDoc/index.html +176 -0
- data/public/zDoc/script.js +342 -0
- data/public/zDoc/style.css +1741 -0
- data/script/about +3 -0
- data/script/breakpointer +3 -0
- data/script/console +3 -0
- data/script/destroy +3 -0
- data/script/generate +3 -0
- data/script/performance/benchmarker +3 -0
- data/script/performance/profiler +3 -0
- data/script/plugin +3 -0
- data/script/process/reaper +3 -0
- data/script/process/spawner +3 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/test/fixtures/contents.yml +5 -0
- data/test/fixtures/meta_datas.yml +5 -0
- data/test/fixtures/page_elements.yml +5 -0
- data/test/fixtures/pages.yml +5 -0
- data/test/functional/contents_controller_test.rb +18 -0
- data/test/functional/pages_controller_test.rb +18 -0
- data/test/functional/render_controller_test.rb +18 -0
- data/test/test_helper.rb +28 -0
- data/test/unit/content_test.rb +10 -0
- data/test/unit/meta_data_test.rb +10 -0
- data/test/unit/page_element_test.rb +10 -0
- data/test/unit/page_test.rb +10 -0
- data/tmp/sessions/ruby_sess.0ced4c30e36477ab +0 -0
- data/tmp/sessions/ruby_sess.20fbe26671422e70 +0 -0
- data/tmp/sessions/ruby_sess.2c72521f3a7e2ba9 +0 -0
- data/tmp/sessions/ruby_sess.4107a69d982a2eb7 +0 -0
- data/tmp/sessions/ruby_sess.573ded9c7fdd9035 +0 -0
- data/tmp/sessions/ruby_sess.5a9767815bb96258 +0 -0
- data/tmp/sessions/ruby_sess.85d723b794005388 +0 -0
- data/tmp/sessions/ruby_sess.875b3b3e3529afdb +0 -0
- data/tmp/sessions/ruby_sess.936766f3a397c88b +0 -0
- data/tmp/sessions/ruby_sess.984e2e4c9a2e7891 +0 -0
- data/tmp/sessions/ruby_sess.a1faebd7448bc45d +0 -0
- data/tmp/sessions/ruby_sess.a415768c7635bc15 +0 -0
- data/tmp/sessions/ruby_sess.b2dadcbe6c1b0add +0 -0
- data/tmp/sessions/ruby_sess.ca9100beb103a428 +0 -0
- data/tmp/sessions/ruby_sess.d649c800a046efde +0 -0
- data/tmp/sessions/ruby_sess.db73bbfafd5a537c +0 -0
- data/tmp/sessions/ruby_sess.e32487b847524df1 +0 -0
- data/tmp/sessions/ruby_sess.f4e45d67828cc437 +0 -0
- data/tmp/sessions/ruby_sess.f5a3f064f2f7a26f +0 -0
- data/tmp/sessions/ruby_sess.ff0c47b35f238cda +0 -0
- data/vendor/plugins/acts_as_urlnameable.tar.gz +0 -0
- data/vendor/plugins/acts_as_urlnameable/LICENSE +19 -0
- data/vendor/plugins/acts_as_urlnameable/README +193 -0
- data/vendor/plugins/acts_as_urlnameable/Rakefile +25 -0
- data/vendor/plugins/acts_as_urlnameable/TODO +5 -0
- data/vendor/plugins/acts_as_urlnameable/db/00x_add_urlnames_table.rb +15 -0
- data/vendor/plugins/acts_as_urlnameable/db/urlnames_table.sql +7 -0
- data/vendor/plugins/acts_as_urlnameable/doc/classes/ActiveRecord/Acts/Urlnameable/ClassMethods.html +167 -0
- data/vendor/plugins/acts_as_urlnameable/doc/classes/ActiveRecord/Acts/Urlnameable/InstanceMethods.html +213 -0
- data/vendor/plugins/acts_as_urlnameable/doc/classes/ActiveRecord/Acts/Urlnameable/SingletonMethods.html +189 -0
- data/vendor/plugins/acts_as_urlnameable/doc/created.rid +1 -0
- data/vendor/plugins/acts_as_urlnameable/doc/files/LICENSE.html +129 -0
- data/vendor/plugins/acts_as_urlnameable/doc/files/README.html +333 -0
- data/vendor/plugins/acts_as_urlnameable/doc/files/TODO.html +121 -0
- data/vendor/plugins/acts_as_urlnameable/doc/files/lib/acts_as_urlnameable_rb.html +101 -0
- data/vendor/plugins/acts_as_urlnameable/doc/fr_class_index.html +29 -0
- data/vendor/plugins/acts_as_urlnameable/doc/fr_file_index.html +30 -0
- data/vendor/plugins/acts_as_urlnameable/doc/fr_method_index.html +34 -0
- data/vendor/plugins/acts_as_urlnameable/doc/index.html +24 -0
- data/vendor/plugins/acts_as_urlnameable/doc/rdoc-style.css +208 -0
- data/vendor/plugins/acts_as_urlnameable/init.rb +3 -0
- data/vendor/plugins/acts_as_urlnameable/lib/acts_as_urlnameable.rb +159 -0
- data/vendor/plugins/acts_as_urlnameable/lib/urlname.rb +3 -0
- data/vendor/plugins/acts_as_urlnameable/test/acts_as_urlnameable_test.rb +233 -0
- data/vendor/plugins/acts_as_urlnameable/test/connection.rb +8 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/article.rb +13 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/articles.yml +62 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/page.rb +14 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/pages.yml +35 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/people.yml +9 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/person.rb +26 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/schema.rb +24 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/section.rb +5 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/sections.yml +9 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/urlnames.yml +153 -0
- data/vendor/plugins/acts_as_urlnameable/test/test_helper.rb +42 -0
- data/vendor/plugins/gems/README +30 -0
- data/vendor/plugins/gems/init.rb +9 -0
- data/vendor/plugins/gems/tasks/gems_tasks.rake +32 -0
- data/vendor/plugins/unobtrusive_javascript/CHANGELOG +72 -0
- data/vendor/plugins/unobtrusive_javascript/README +73 -0
- data/vendor/plugins/unobtrusive_javascript/Rakefile +33 -0
- data/vendor/plugins/unobtrusive_javascript/about.yml +6 -0
- data/vendor/plugins/unobtrusive_javascript/assets/javascripts/lowpro.js +307 -0
- data/vendor/plugins/unobtrusive_javascript/init.rb +21 -0
- data/vendor/plugins/unobtrusive_javascript/install.rb +1 -0
- data/vendor/plugins/unobtrusive_javascript/lib/actionview_helpers_patches.rb +17 -0
- data/vendor/plugins/unobtrusive_javascript/lib/asset_tag_helper_patches.rb +33 -0
- data/vendor/plugins/unobtrusive_javascript/lib/behaviour_caching.rb +70 -0
- data/vendor/plugins/unobtrusive_javascript/lib/controllers/unobtrusive_javascript_controller.rb +52 -0
- data/vendor/plugins/unobtrusive_javascript/lib/prototype_helper_patches.rb +72 -0
- data/vendor/plugins/unobtrusive_javascript/lib/scriptaculous_helper_patches.rb +62 -0
- data/vendor/plugins/unobtrusive_javascript/lib/tag_helper_patches.rb +37 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs.rb +32 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs/behaviour_helper.rb +62 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs/behaviour_script.rb +54 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs/behaviour_script_converter.rb +23 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs/controller_methods.rb +55 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs/helpers.rb +152 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs/javascript_proxies.rb +57 -0
- data/vendor/plugins/unobtrusive_javascript/tasks/unobtrusive_javascript_tasks.rake +15 -0
- data/vendor/plugins/unobtrusive_javascript/test/asset_tag_helper_patches_test.rb +32 -0
- data/vendor/plugins/unobtrusive_javascript/test/behaviour_helper_test.rb +180 -0
- data/vendor/plugins/unobtrusive_javascript/test/behaviour_script_converter_test.rb +72 -0
- data/vendor/plugins/unobtrusive_javascript/test/behaviour_script_test.rb +98 -0
- data/vendor/plugins/unobtrusive_javascript/test/config/environment.rb +8 -0
- data/vendor/plugins/unobtrusive_javascript/test/config/routes.rb +4 -0
- data/vendor/plugins/unobtrusive_javascript/test/config/schema.rb +3 -0
- data/vendor/plugins/unobtrusive_javascript/test/controller_methods_test.rb +48 -0
- data/vendor/plugins/unobtrusive_javascript/test/helpers_test.rb +186 -0
- data/vendor/plugins/unobtrusive_javascript/test/javascript_proxies_test.rb +3 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/boot.rb +26 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/gem/action_controller.rb +11 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/gem/action_mailer.rb +4 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/gem/active_record.rb +27 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/gem/rails.rb +31 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/ptk.rb +148 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/suite/difference.rb +23 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/stubs/controller_stub.rb +10 -0
- data/vendor/plugins/unobtrusive_javascript/test/ptk_helper.rb +29 -0
- data/vendor/plugins/unobtrusive_javascript/test/tag_helper_patches_test.rb +59 -0
- data/vendor/plugins/unobtrusive_javascript/test/test_helper.rb +25 -0
- data/vendor/plugins/unobtrusive_javascript/test/unobtrusive_javascript_controller_test.rb +95 -0
- data/vendor/plugins/unobtrusive_javascript/uninstall.rb +1 -0
- data/vendor/redcloth/bin/redcloth +3 -0
- data/vendor/redcloth/doc/CHANGELOG +160 -0
- data/vendor/redcloth/doc/COPYING +25 -0
- data/vendor/redcloth/doc/README +106 -0
- data/vendor/redcloth/doc/REFERENCE +216 -0
- data/vendor/redcloth/doc/make.rb +359 -0
- data/vendor/redcloth/lib/redcloth.rb +1130 -0
- data/vendor/redcloth/run-tests.rb +28 -0
- data/vendor/redcloth/setup.rb +1376 -0
- data/vendor/redcloth/tests/code.yml +105 -0
- data/vendor/redcloth/tests/hard_breaks.yml +26 -0
- data/vendor/redcloth/tests/images.yml +171 -0
- data/vendor/redcloth/tests/instiki.yml +39 -0
- data/vendor/redcloth/tests/links.yml +155 -0
- data/vendor/redcloth/tests/lists.yml +77 -0
- data/vendor/redcloth/tests/markdown.yml +218 -0
- data/vendor/redcloth/tests/poignant.yml +64 -0
- data/vendor/redcloth/tests/table.yml +198 -0
- data/vendor/redcloth/tests/textism.yml +406 -0
- metadata +432 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
class Page < ActiveRecord::Base
|
2
|
+
belongs_to :section
|
3
|
+
acts_as_urlnameable :title
|
4
|
+
|
5
|
+
end
|
6
|
+
|
7
|
+
class BadPage < Page
|
8
|
+
acts_as_urlnameable :title, :validate => :nobody
|
9
|
+
end
|
10
|
+
|
11
|
+
class BadderPage < Page
|
12
|
+
belongs_to :section
|
13
|
+
acts_as_urlnameable :title, :validate => :section
|
14
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
first:
|
2
|
+
id: 1
|
3
|
+
title: some test page about ruby
|
4
|
+
body: this is a test page about ruby
|
5
|
+
section_id: 1
|
6
|
+
second:
|
7
|
+
id: 2
|
8
|
+
title: another test page about ruby
|
9
|
+
body: this is another test page about ruby
|
10
|
+
section_id: 1
|
11
|
+
third:
|
12
|
+
id: 3
|
13
|
+
title: yet another test page about ruby
|
14
|
+
body: this is yet another test page about ruby
|
15
|
+
section_id: 1
|
16
|
+
fourth:
|
17
|
+
id: 4
|
18
|
+
title: a test page about rails specifically
|
19
|
+
body: this page is about rails
|
20
|
+
section_id: 2
|
21
|
+
fifth:
|
22
|
+
id: 5
|
23
|
+
title: this page is about code
|
24
|
+
body: something about code
|
25
|
+
section_id: 3
|
26
|
+
sixth:
|
27
|
+
id: 6
|
28
|
+
title: test for multiple finder
|
29
|
+
body: this is a test page for multiple finder
|
30
|
+
section_id: 1
|
31
|
+
seventh:
|
32
|
+
id: 7
|
33
|
+
title: test for multiple finder
|
34
|
+
body: this is a test page for multiple finder
|
35
|
+
section_id: 2
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class Person < ActiveRecord::Base
|
2
|
+
has_many :articles, :dependent => true
|
3
|
+
has_many :custom_articles, :class_name => 'SpecialArticle', :dependent => true
|
4
|
+
acts_as_urlnameable :full_name
|
5
|
+
|
6
|
+
end
|
7
|
+
|
8
|
+
class PersonWithCustomValidation < Person
|
9
|
+
|
10
|
+
protected
|
11
|
+
def validate_urlname
|
12
|
+
errors.add(:urlname, "is invalid. You've got it all wrong! I'm not a name, I AM a number!")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class Writer < Person
|
17
|
+
acts_as_urlnameable :full_name
|
18
|
+
|
19
|
+
protected
|
20
|
+
|
21
|
+
alias_method :old_urlnameify, :urlnameify
|
22
|
+
def urlnameify(text)
|
23
|
+
'writer_' + old_urlnameify(text)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
ActiveRecord::Schema.define do
|
2
|
+
create_table 'articles', :force => true do |t|
|
3
|
+
t.column 'title', :string
|
4
|
+
t.column 'body', :text
|
5
|
+
t.column 'person_id', :integer
|
6
|
+
t.column 'comments_enabled', :boolean, :default => true
|
7
|
+
t.column 'type', :string
|
8
|
+
end
|
9
|
+
|
10
|
+
create_table 'pages', :force => true do |t|
|
11
|
+
t.column 'title', :string
|
12
|
+
t.column 'body', :text
|
13
|
+
t.column 'section_id', :integer
|
14
|
+
end
|
15
|
+
|
16
|
+
create_table 'sections', :force => true do |t|
|
17
|
+
t.column 'name', :string
|
18
|
+
end
|
19
|
+
|
20
|
+
create_table 'people', :force => true do |t|
|
21
|
+
t.column 'full_name', :string
|
22
|
+
t.column 'password', :string
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,153 @@
|
|
1
|
+
# Article urlname fixtures
|
2
|
+
urlname_1:
|
3
|
+
id: 1
|
4
|
+
nameable_id: 1
|
5
|
+
nameable_type: Article
|
6
|
+
name: old_first_test_title
|
7
|
+
|
8
|
+
urlname_2:
|
9
|
+
id: 2
|
10
|
+
nameable_id: 1
|
11
|
+
nameable_type: Article
|
12
|
+
name: first_test_article
|
13
|
+
|
14
|
+
urlname_3:
|
15
|
+
id: 3
|
16
|
+
nameable_id: 4
|
17
|
+
nameable_type: Article
|
18
|
+
name: fourth_test_article
|
19
|
+
|
20
|
+
urlname_4:
|
21
|
+
id: 4
|
22
|
+
nameable_id: 2
|
23
|
+
nameable_type: Article
|
24
|
+
name: second_test_article
|
25
|
+
|
26
|
+
urlname_5:
|
27
|
+
id: 5
|
28
|
+
nameable_id: 3
|
29
|
+
nameable_type: Article
|
30
|
+
name: old_third_test_title
|
31
|
+
|
32
|
+
urlname_6:
|
33
|
+
id: 6
|
34
|
+
nameable_id: 3
|
35
|
+
nameable_type: Article
|
36
|
+
name: third_test_article
|
37
|
+
|
38
|
+
urlname_7:
|
39
|
+
id: 7
|
40
|
+
nameable_id: 5
|
41
|
+
nameable_type: Article
|
42
|
+
name: fifth_test_article
|
43
|
+
|
44
|
+
urlname_8:
|
45
|
+
id: 8
|
46
|
+
nameable_id: 1
|
47
|
+
nameable_type: Article
|
48
|
+
name: first_test_article_edit
|
49
|
+
|
50
|
+
urlname_9:
|
51
|
+
id: 9
|
52
|
+
nameable_id: 7
|
53
|
+
nameable_type: Article
|
54
|
+
name: seventh_test_article
|
55
|
+
|
56
|
+
urlname_10:
|
57
|
+
id: 10
|
58
|
+
nameable_id: 9
|
59
|
+
nameable_type: Article
|
60
|
+
name: ninth_test_article
|
61
|
+
|
62
|
+
# Person urlname fixtures
|
63
|
+
urlname_11:
|
64
|
+
id: 11
|
65
|
+
nameable_id: 1
|
66
|
+
nameable_type: Person
|
67
|
+
name: joe_smith
|
68
|
+
|
69
|
+
urlname_12:
|
70
|
+
id: 12
|
71
|
+
nameable_id: 2
|
72
|
+
nameable_type: Person
|
73
|
+
name: jane_somebody
|
74
|
+
|
75
|
+
urlname_13:
|
76
|
+
id: 13
|
77
|
+
nameable_id: 2
|
78
|
+
nameable_type: Person
|
79
|
+
name: jane_smith
|
80
|
+
|
81
|
+
urlname_14:
|
82
|
+
id: 14
|
83
|
+
nameable_id: 2
|
84
|
+
nameable_type: Person
|
85
|
+
name: jane_bloggs
|
86
|
+
|
87
|
+
# Section urlname fixtures
|
88
|
+
urlname_15:
|
89
|
+
id: 15
|
90
|
+
nameable_id: 1
|
91
|
+
nameable_type: Section
|
92
|
+
name: ruby
|
93
|
+
|
94
|
+
urlname_16:
|
95
|
+
id: 16
|
96
|
+
nameable_id: 1
|
97
|
+
nameable_type: Section
|
98
|
+
name: ruuuby
|
99
|
+
|
100
|
+
urlname_17:
|
101
|
+
id: 17
|
102
|
+
nameable_id: 2
|
103
|
+
nameable_type: Section
|
104
|
+
name: ruby_on_rails
|
105
|
+
|
106
|
+
urlname_18:
|
107
|
+
id: 18
|
108
|
+
nameable_id: 3
|
109
|
+
nameable_type: Section
|
110
|
+
name: code
|
111
|
+
|
112
|
+
# Page urlname fixtures
|
113
|
+
urlname_19:
|
114
|
+
id: 19
|
115
|
+
nameable_id: 1
|
116
|
+
nameable_type: Page
|
117
|
+
name: some_test_page_about_ruby
|
118
|
+
|
119
|
+
urlname_20:
|
120
|
+
id: 20
|
121
|
+
nameable_id: 2
|
122
|
+
nameable_type: Page
|
123
|
+
name: another_test_page_about_ruby
|
124
|
+
|
125
|
+
urlname_21:
|
126
|
+
id: 21
|
127
|
+
nameable_id: 3
|
128
|
+
nameable_type: Page
|
129
|
+
name: yet_another_test_page_about_ruby
|
130
|
+
|
131
|
+
urlname_22:
|
132
|
+
id: 22
|
133
|
+
nameable_id: 4
|
134
|
+
nameable_type: Page
|
135
|
+
name: a_test_page_about_rails_specifically
|
136
|
+
|
137
|
+
urlname_23:
|
138
|
+
id: 23
|
139
|
+
nameable_id: 5
|
140
|
+
nameable_type: Page
|
141
|
+
name: this_page_is_about_code
|
142
|
+
|
143
|
+
urlname_24:
|
144
|
+
id: 24
|
145
|
+
nameable_id: 6
|
146
|
+
nameable_type: Page
|
147
|
+
name: test_for_multiple_finder
|
148
|
+
|
149
|
+
urlname_25:
|
150
|
+
id: 25
|
151
|
+
nameable_id: 7
|
152
|
+
nameable_type: Page
|
153
|
+
name: test_for_multiple_finder
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', '..', '..', 'config', 'boot')
|
2
|
+
Rails::Initializer.run(:require_frameworks)
|
3
|
+
Rails::Initializer.run(:load_plugins)
|
4
|
+
$: << '../'
|
5
|
+
$: << '../lib/'
|
6
|
+
require File.dirname(__FILE__) + '/connection'
|
7
|
+
require 'test_help'
|
8
|
+
|
9
|
+
Test::Unit::TestCase.fixture_path = File.dirname(__FILE__) + "/fixtures/"
|
10
|
+
|
11
|
+
class Test::Unit::TestCase #:nodoc:
|
12
|
+
def create_fixtures(*table_names)
|
13
|
+
if block_given?
|
14
|
+
Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names) { yield }
|
15
|
+
else
|
16
|
+
Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.require_fixture_classes(table_names=nil)
|
21
|
+
(table_names || fixture_table_names).each do |table_name|
|
22
|
+
file_name = table_name.to_s
|
23
|
+
file_name = file_name.singularize if ActiveRecord::Base.pluralize_table_names
|
24
|
+
begin
|
25
|
+
file_path = File.dirname(__FILE__) + "/fixtures/#{file_name}"
|
26
|
+
require file_path
|
27
|
+
rescue LoadError
|
28
|
+
# Let's hope the developer has included it himself
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Turn off transactional fixtures if you're working with MyISAM tables in MySQL
|
34
|
+
self.use_transactional_fixtures = true
|
35
|
+
# self.use_transactional_fixtures = false
|
36
|
+
|
37
|
+
# Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david)
|
38
|
+
self.use_instantiated_fixtures = false
|
39
|
+
# self.use_instantiated_fixtures = true
|
40
|
+
|
41
|
+
# Add more helper methods to be used by all tests here...
|
42
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
Gems
|
2
|
+
====
|
3
|
+
|
4
|
+
This is a small plugin that helps with Ruby Gem management for your application.
|
5
|
+
It will automatically include all gem/lib paths into the $LOAD_PATH on startup.
|
6
|
+
|
7
|
+
To freeze gems:
|
8
|
+
|
9
|
+
$ rake gems:freeze GEM=tzinfo
|
10
|
+
(in /path/to/app)
|
11
|
+
rm -rf vendor/tzinfo-0.1.2
|
12
|
+
cd /path/to/app/config/../vendor
|
13
|
+
mkdir -p tzinfo-0.1.2
|
14
|
+
Unpacked tzinfo 0.1.2 to 'tzinfo-0.1.2'
|
15
|
+
cd -
|
16
|
+
|
17
|
+
Be sure to require them in your environment.rb if you want them available.
|
18
|
+
|
19
|
+
$ script/console
|
20
|
+
Loading development environment.
|
21
|
+
>> TZInfo
|
22
|
+
NameError: uninitialized constant TZInfo
|
23
|
+
>> require 'Tzinfo'
|
24
|
+
=> true
|
25
|
+
>> TZInfo
|
26
|
+
=> TZInfo
|
27
|
+
|
28
|
+
You can also freeze specific versions:
|
29
|
+
|
30
|
+
rake gems:freeze GEM=tzinfo VERSION=0.1.2
|
@@ -0,0 +1,9 @@
|
|
1
|
+
standard_dirs = ['rails', 'plugins']
|
2
|
+
gems = Dir[File.join(RAILS_ROOT, "vendor/**")]
|
3
|
+
if gems.any?
|
4
|
+
gems.each do |dir|
|
5
|
+
next if standard_dirs.include?(File.basename(dir))
|
6
|
+
lib = File.join(dir, 'lib')
|
7
|
+
$LOAD_PATH.unshift(lib) if File.directory?(lib)
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
namespace :gems do
|
2
|
+
task :freeze do
|
3
|
+
raise "No gem specified" unless gem_name = ENV['GEM']
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
Gem.manage_gems
|
7
|
+
|
8
|
+
gem = (version = ENV['VERSION']) ?
|
9
|
+
Gem.cache.search(gem_name, "= #{version}").first :
|
10
|
+
Gem.cache.search(gem_name).sort_by { |g| g.version }.last
|
11
|
+
|
12
|
+
version ||= gem.version.version rescue nil
|
13
|
+
|
14
|
+
unless gem && path = Gem::UnpackCommand.new.get_path(gem_name, version)
|
15
|
+
raise "No gem #{gem_name} #{version} is installed. Do 'gem list #{gem_name}' to see what you have available."
|
16
|
+
end
|
17
|
+
|
18
|
+
target_dir = ENV['TO'] || File.basename(path).sub(/\.gem$/, '')
|
19
|
+
rm_rf "vendor/#{target_dir}"
|
20
|
+
|
21
|
+
chdir File.join(RAILS_ROOT, 'vendor') do
|
22
|
+
mkdir_p target_dir
|
23
|
+
Gem::Installer.new(path).unpack(target_dir)
|
24
|
+
puts "Unpacked #{gem_name} #{version} to '#{target_dir}'"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
task :unfreeze do
|
29
|
+
raise "No gem specified" unless gem_name = ENV['GEM']
|
30
|
+
Dir["vendor/#{gem_name}-*"].each { |d| rm_rf d }
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
== rel-0.3.2
|
2
|
+
* FIXED: Error when trying to convert nil from hash (ticket #8)
|
3
|
+
|
4
|
+
* FIXED: Got tests running inside a Rails app
|
5
|
+
|
6
|
+
* UPDATED: Refactored BehaviourScriptConverter
|
7
|
+
|
8
|
+
== rel-0.3.1
|
9
|
+
* FIXED: Issues with Rails edge have now been resolved. Have changed the UnobtrusiveJavascript module to UJS. This has one API change - use UJS::Routes in routes.rb
|
10
|
+
|
11
|
+
* FIXED: Major issue when restarting server (server just hangs) due to serializing of behaviour scripts to the session. Objects are now converted to and from a hash before serializing to the session. All reports suggest that this has fixed the issue. Please raise a ticket if you get any more weird errors.
|
12
|
+
|
13
|
+
* FIXED: remote_function was incorrectly quoting JS (ticket #3)
|
14
|
+
|
15
|
+
* FIXED: :external => false now works for apply_behaviours (ticket #5)
|
16
|
+
|
17
|
+
* FIXED: element.replace_html inside Ruby behaviour block wasn't working, this is now fixed (ticket #4)
|
18
|
+
|
19
|
+
* FIXED: behaviours_url now works correctly when using mongrel url-prefix (ticket #6)
|
20
|
+
|
21
|
+
* FIXED: Resolved some documentation issues
|
22
|
+
|
23
|
+
== rel-0.3
|
24
|
+
* FIXED: Problems with rake:unobtrusive_javascript:install (ticket #12 on old trac)
|
25
|
+
|
26
|
+
* FIXED: Problems with back button (result of caching feature) (ticket #10 on old trac)
|
27
|
+
|
28
|
+
* Refactored a lot of the code and increased test coverage significantly
|
29
|
+
|
30
|
+
* NEW: Out-of-the box caching using HTTP ETags and advanced behaviour caching
|
31
|
+
|
32
|
+
* NEW: Apply multiple behaviours at once with apply_behaviours
|
33
|
+
|
34
|
+
* NEW: Behaviour helpers to easily and unobtrusively apply scriptaculous effects
|
35
|
+
|
36
|
+
* UPDATED: Updated lowpro.js library
|
37
|
+
|
38
|
+
* UPDATED: Added :external option support to tag_options
|
39
|
+
|
40
|
+
* NEW: :prevent_default option to cancel original event behaviour such as link following and form submission
|
41
|
+
|
42
|
+
== rel-0.2.2
|
43
|
+
* FIXED: Change the way tag_options detects javascript events, using blank? instead of include? as some Rails helpers insert an empty onclick handler.
|
44
|
+
|
45
|
+
== rel-0.2.1
|
46
|
+
* FIXED: Added an about.yml file - bad Luke - practice what you preach!
|
47
|
+
|
48
|
+
* FIXED: Fixed the plugin in edge rails by explicitly requiring the controller file
|
49
|
+
|
50
|
+
== rel-0.2
|
51
|
+
|
52
|
+
* UPDATED: register_js_behaviour has been renamed to apply_behaviour and now takes an optional options hash and a block, which allows you to write your behaviours in pure Ruby. register_js_behaviour remains as an alias for backwards compatibility but is officially deprecated; it will probably be removed in the next release. There are also aliases for the American spelling of behaviour for our friends on the other side of the pond.
|
53
|
+
|
54
|
+
* NEW: You can now attach behaviours directly to elements using content_tag and tag by passing in javascript event handlers in the HTML options hash (:onclick, :onmousedown etc.) - they'll be extracted to the external behaviours file automatically.
|
55
|
+
|
56
|
+
* UPDATED: The core Rails AJAX/Javascript helpers (link_to_remote, button_to_function, link_to_function, form_remote_tag etc.) now work out of the box.
|
57
|
+
|
58
|
+
* NEW: There is no need to explicitly specify an HTML ID for the elements you want to attach behaviour to - if you don't, one will be generated automatically for you.
|
59
|
+
|
60
|
+
* NEW: Options to render behaviour rules directly in your page inside script blocks instead of in the external behaviour file.
|
61
|
+
|
62
|
+
* FIXED: Behaviours inside AJAX-loaded partials will now work.
|
63
|
+
|
64
|
+
* UPDATED: event:Selectors and domReady javascript libraries are replaced with the lowPro.js library by Dan Webb
|
65
|
+
|
66
|
+
* UPDATED: Javascript behaviours now have access to a single variable - event. To access the element the event was applied to, use this.
|
67
|
+
|
68
|
+
* UPDATED: Behaviours can now cancel the default action by returning false as well as using Event.stop(event)
|
69
|
+
|
70
|
+
* FIXED: The required javascript files will be copied to your public folder automatically on installation. There is also a rake task for copying files across when upgrading the plugin.
|
71
|
+
|
72
|
+
* NEW: Lots more documentation!
|