jabe 0.5.9 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{LICENSE.txt → MIT-LICENSE} +1 -1
- data/README.textile +46 -31
- data/Rakefile +30 -47
- data/app/assets/images/jabe/delete.png +0 -0
- data/{public/images → app/assets/images/jabe}/delete_page.png +0 -0
- data/{public/images → app/assets/images/jabe}/full_page.png +0 -0
- data/{public/images → app/assets/images/jabe}/gravatar.gif +0 -0
- data/{public/javascripts → app/assets/javascripts/jabe}/application.js +15 -0
- data/{public/javascripts → app/assets/javascripts/jabe}/libs/dd_belatedpng.js +0 -0
- data/{public/javascripts → app/assets/javascripts/jabe}/libs/modernizr-1.6.min.js +0 -0
- data/{public/javascripts → app/assets/javascripts/jabe}/plugins.js +0 -0
- data/app/assets/stylesheets/jabe/application.css +3 -0
- data/app/{stylesheets → assets/stylesheets/jabe}/boilerplate.scss +0 -0
- data/app/{stylesheets → assets/stylesheets/jabe}/jabe.scss +47 -8
- data/app/controllers/jabe/admin/base_controller.rb +7 -0
- data/app/controllers/jabe/admin/entries_controller.rb +49 -0
- data/app/controllers/jabe/admin/settings_controller.rb +13 -0
- data/app/controllers/jabe/application_controller.rb +5 -0
- data/app/controllers/jabe/comments_controller.rb +34 -0
- data/app/controllers/jabe/entries_controller.rb +30 -0
- data/app/controllers/jabe/feed_controller.rb +8 -0
- data/app/controllers/jabe/sessions_controller.rb +4 -0
- data/app/helpers/jabe/application_helper.rb +25 -0
- data/app/mailers/jabe/comment_mailer.rb +12 -0
- data/app/models/jabe/admin.rb +11 -0
- data/app/models/jabe/comment.rb +35 -0
- data/app/models/jabe/entry.rb +22 -0
- data/app/models/jabe/settings.rb +14 -0
- data/app/views/{admin → jabe/admin}/entries/_form.html.haml +1 -1
- data/app/views/{admin → jabe/admin}/entries/edit.html.haml +0 -0
- data/app/views/{admin → jabe/admin}/entries/index.html.haml +9 -7
- data/app/views/{admin → jabe/admin}/entries/new.html.haml +0 -0
- data/app/views/{admin → jabe/admin}/settings/edit.html.haml +2 -1
- data/app/views/jabe/comment_mailer/notification.html.erb +19 -0
- data/app/views/jabe/confirmations/new.html.erb +15 -0
- data/app/views/{entries → jabe/entries}/index.html.haml +4 -3
- data/app/views/jabe/entries/show.html.haml +49 -0
- data/app/views/{feed → jabe/feed}/index.xml.builder +3 -3
- data/app/views/jabe/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/jabe/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/jabe/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/jabe/passwords/edit.html.erb +19 -0
- data/app/views/jabe/passwords/new.html.erb +15 -0
- data/app/views/jabe/registrations/edit.html.erb +22 -0
- data/app/views/jabe/registrations/new.html.erb +17 -0
- data/app/views/jabe/sessions/new.html.erb +15 -0
- data/app/views/jabe/shared/_links.erb +25 -0
- data/app/views/jabe/unlocks/new.html.erb +15 -0
- data/app/views/layouts/jabe/_flashes.html.haml +3 -0
- data/app/views/layouts/{_footer.html.haml → jabe/_footer.html.haml} +0 -0
- data/app/views/layouts/jabe/_header.html.haml +4 -0
- data/app/views/layouts/jabe/_sidebar.html.haml +21 -0
- data/app/views/layouts/jabe/application.html.haml +63 -0
- data/{test/dummy/vendor/plugins/acts_as_textiled/init.rb → config/initializers/acts_as_textiled.rb} +2 -1
- data/config/initializers/devise.rb +3 -0
- data/config/initializers/settings.rb +5 -5
- data/config/initializers/simple_form.rb +93 -0
- data/config/initializers/time_formats.rb +1 -2
- data/config/locales/simple_form.en.yml +24 -0
- data/config/routes.rb +10 -5
- data/{test/dummy/db/migrate/20101229224027_create_settings.rb → db/migrate/20101230010434_create_settings.rb} +7 -2
- data/{lib/generators/jabe/templates/migrations/devise_create_admins.rb → db/migrate/20101230010436_devise_create_admins.rb} +6 -6
- data/{test/dummy/db/migrate/20101229224030_create_entries.rb → db/migrate/20101230010437_create_entries.rb} +2 -2
- data/{test/dummy/db/migrate/20101229224031_create_comments.rb → db/migrate/20101230010438_create_comments.rb} +3 -4
- data/{test/dummy/vendor/plugins/acts_as_textiled/lib/acts_as_textiled.rb → lib/acts_as_textiled/base.rb} +0 -0
- data/lib/jabe.rb +7 -15
- data/lib/jabe/engine.rb +5 -0
- data/lib/jabe/version.rb +3 -0
- data/lib/tasks/jabe_tasks.rake +4 -0
- metadata +187 -601
- data/Gemfile +0 -35
- data/Gemfile.lock +0 -214
- data/VERSION +0 -1
- data/app/controllers/admin/base_controller.rb +0 -3
- data/app/controllers/admin/entries_controller.rb +0 -42
- data/app/controllers/admin/settings_controller.rb +0 -11
- data/app/controllers/comments_controller.rb +0 -25
- data/app/controllers/entries_controller.rb +0 -26
- data/app/controllers/feed_controller.rb +0 -8
- data/app/helpers/jabe_helper.rb +0 -13
- data/app/models/admin.rb +0 -9
- data/app/models/comment.rb +0 -22
- data/app/models/entry.rb +0 -17
- data/app/models/settings.rb +0 -7
- data/app/stylesheets/_will_paginate.scss +0 -102
- data/app/stylesheets/handheld.scss +0 -7
- data/app/views/entries/_comment_form.html.haml +0 -3
- data/app/views/entries/show.html.haml +0 -38
- data/app/views/layouts/_header.html.haml +0 -4
- data/app/views/layouts/_sidebar.html.haml +0 -21
- data/app/views/layouts/application.html.haml +0 -59
- data/config/initializers/sass.rb +0 -5
- data/lib/generators/jabe/migrations/migrations_generator.rb +0 -38
- data/lib/generators/jabe/stylesheets/stylesheets_generator.rb +0 -9
- data/lib/generators/jabe/templates/migrations/add_new_settings.rb +0 -17
- data/lib/generators/jabe/templates/migrations/create_comments.rb +0 -20
- data/lib/generators/jabe/templates/migrations/create_entries.rb +0 -16
- data/lib/generators/jabe/templates/migrations/create_settings.rb +0 -21
- data/lib/generators/jabe/templates/migrations/create_slugs.rb +0 -18
- data/public/.htaccess +0 -220
- data/public/apple-touch-icon.png +0 -0
- data/public/blackbird/blackbird.css +0 -80
- data/public/blackbird/blackbird.js +0 -365
- data/public/blackbird/blackbird.png +0 -0
- data/public/crossdomain.xml +0 -25
- data/public/javascripts/jquery-ui.js +0 -11511
- data/public/javascripts/jquery-ui.min.js +0 -404
- data/public/javascripts/jquery.js +0 -7179
- data/public/javascripts/jquery.min.js +0 -167
- data/public/javascripts/libs/profiling/charts.swf +0 -0
- data/public/javascripts/libs/profiling/config.js +0 -59
- data/public/javascripts/libs/profiling/yahoo-profiling.css +0 -7
- data/public/javascripts/libs/profiling/yahoo-profiling.min.js +0 -39
- data/public/javascripts/rails.js +0 -154
- data/public/nginx.conf +0 -108
- data/public/robots.txt +0 -5
- data/test/dummy/app/controllers/application_controller.rb +0 -3
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/config/application.rb +0 -52
- data/test/dummy/config/boot.rb +0 -10
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -26
- data/test/dummy/config/environments/production.rb +0 -49
- data/test/dummy/config/environments/test.rb +0 -35
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/devise.rb +0 -142
- data/test/dummy/config/initializers/inflections.rb +0 -10
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/routes.rb +0 -58
- data/test/dummy/db/migrate/20101229224028_create_slugs.rb +0 -18
- data/test/dummy/db/migrate/20101229224029_devise_create_admins.rb +0 -26
- data/test/dummy/db/migrate/20110104004400_add_new_settings.rb +0 -17
- data/test/dummy/db/schema.rb +0 -110
- data/test/dummy/features/step_definitions/admin_steps.rb +0 -14
- data/test/dummy/features/step_definitions/email_steps.rb +0 -194
- data/test/dummy/features/step_definitions/entry_steps.rb +0 -54
- data/test/dummy/features/step_definitions/support_steps.rb +0 -3
- data/test/dummy/features/step_definitions/web_steps.rb +0 -219
- data/test/dummy/features/support/blueprints.rb +0 -37
- data/test/dummy/features/support/env.rb +0 -59
- data/test/dummy/features/support/paths.rb +0 -39
- data/test/dummy/spec/spec_helper.rb +0 -0
- data/test/dummy/spec/support/blueprints.rb +0 -9
- data/test/dummy/vendor/plugins/acts_as_textiled/test/fixtures/author.rb +0 -4
- data/test/dummy/vendor/plugins/acts_as_textiled/test/fixtures/story.rb +0 -4
- data/test/dummy/vendor/plugins/acts_as_textiled/test/helper.rb +0 -87
- data/test/dummy/vendor/plugins/acts_as_textiled/test/textiled_test.rb +0 -145
@@ -1,145 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), 'helper')
|
2
|
-
|
3
|
-
context "An ActiveRecord instance acting as textiled" do
|
4
|
-
specify "should return nil for empty fields" do
|
5
|
-
story = Story.new
|
6
|
-
|
7
|
-
story.description.should.be.nil
|
8
|
-
story.description_source.should.be.nil
|
9
|
-
story.description_plain.should.be.nil
|
10
|
-
end
|
11
|
-
|
12
|
-
specify "should enhance attributes with html, textile, and plain versions" do
|
13
|
-
story = Story.find(1)
|
14
|
-
|
15
|
-
desc_html = '_why announces <i>Sandbox</i>'
|
16
|
-
desc_textile = '_why announces __Sandbox__'
|
17
|
-
desc_plain = '_why announces Sandbox'
|
18
|
-
|
19
|
-
story.description.should.equal desc_html
|
20
|
-
story.description(:source).should.equal desc_textile
|
21
|
-
story.description(:plain).should.equal desc_plain
|
22
|
-
|
23
|
-
story.description_source.should.equal desc_textile
|
24
|
-
story.description_plain.should.equal desc_plain
|
25
|
-
|
26
|
-
# make sure we don't overwrite anything - thanks James
|
27
|
-
story.description.should.equal desc_html
|
28
|
-
story.description(:source).should.equal desc_textile
|
29
|
-
story.description(:plain).should.equal desc_plain
|
30
|
-
|
31
|
-
story.description_source.should.equal desc_textile
|
32
|
-
story.description_plain.should.equal desc_plain
|
33
|
-
end
|
34
|
-
|
35
|
-
specify "should raise when given a non-sensical option" do
|
36
|
-
story = Story.find(1)
|
37
|
-
|
38
|
-
proc { story.description(:cassadaga) }.should.raise
|
39
|
-
end
|
40
|
-
|
41
|
-
specify "should pick up changes to attributes" do
|
42
|
-
story = Story.find(2)
|
43
|
-
|
44
|
-
start_html = '<i>Beautify</i> your <strong>IRb</strong> prompt'
|
45
|
-
story.description.should.equal start_html
|
46
|
-
|
47
|
-
story.description = "**IRb** is simple"
|
48
|
-
changed_html = "<b>IRb</b> is simple"
|
49
|
-
story.description.should.equal changed_html
|
50
|
-
|
51
|
-
story.save
|
52
|
-
|
53
|
-
story.description.should.equal changed_html
|
54
|
-
story.description_plain.should.equal 'IRb is simple'
|
55
|
-
end
|
56
|
-
|
57
|
-
specify "should be able to toggle whether textile is active or not" do
|
58
|
-
story = Story.find(2)
|
59
|
-
|
60
|
-
desc_html = '<i>Beautify</i> your <strong>IRb</strong> prompt'
|
61
|
-
desc_textile = '__Beautify__ your *IRb* prompt'
|
62
|
-
|
63
|
-
story.description.should.equal desc_html
|
64
|
-
story.textiled = false
|
65
|
-
story.description.should.equal desc_textile
|
66
|
-
|
67
|
-
story.save
|
68
|
-
|
69
|
-
story.description.should.equal desc_textile
|
70
|
-
story.textiled = true
|
71
|
-
story.description.should.equal desc_html
|
72
|
-
end
|
73
|
-
|
74
|
-
specify "should textile attributes across associations" do
|
75
|
-
story = Story.find(2)
|
76
|
-
|
77
|
-
blog_html = '<a href="http://ozmm.org">ones zeros majors and minors</a>'
|
78
|
-
blog_textile = '"ones zeros majors and minors":http://ozmm.org'
|
79
|
-
blog_plain = 'ones zeros majors and minors'
|
80
|
-
|
81
|
-
story.author.blog.should.equal blog_html
|
82
|
-
story.author.blog_source.should.equal blog_textile
|
83
|
-
story.author.blog_plain.should.equal blog_plain
|
84
|
-
end
|
85
|
-
|
86
|
-
specify "should be able to toggle across associations" do
|
87
|
-
story = Story.find(1)
|
88
|
-
|
89
|
-
blog_html = '<a href="http://redhanded.hobix.com">RedHanded</a>'
|
90
|
-
blog_textile = '"RedHanded":http://redhanded.hobix.com'
|
91
|
-
blog_plain = 'RedHanded'
|
92
|
-
|
93
|
-
story.author.blog.should.equal blog_html
|
94
|
-
story.author.textiled = false
|
95
|
-
|
96
|
-
story.author.blog.should.equal blog_textile
|
97
|
-
story.author.textiled = true
|
98
|
-
|
99
|
-
story.author.blog.should.equal blog_html
|
100
|
-
end
|
101
|
-
|
102
|
-
specify "should enhance text attributes" do
|
103
|
-
story = Story.find(3)
|
104
|
-
|
105
|
-
body_html = %[<p><em>Textile</em> is useful because it makes text <em>slightly</em> easier to <strong>read</strong>.</p>\n\n\n\t<p>If only it were so <strong>easy</strong> to use in every programming language. In Rails,\nwith the help of <a href="http://google.com/search?q=acts_as_textiled">acts_as_textiled</a>,\nit’s way easy. Thanks in no small part to <span style="color:red;">RedCloth</span>, of course.</p>]
|
106
|
-
body_textile = %[_Textile_ is useful because it makes text _slightly_ easier to *read*.\n\nIf only it were so *easy* to use in every programming language. In Rails,\nwith the help of "acts_as_textiled":http://google.com/search?q=acts_as_textiled,\nit's way easy. Thanks in no small part to %{color:red}RedCloth%, of course.\n]
|
107
|
-
body_plain = %[Textile is useful because it makes text slightly easier to read.\n\n\n\tIf only it were so easy to use in every programming language. In Rails,\nwith the help of acts_as_textiled,\nit's way easy. Thanks in no small part to RedCloth, of course.]
|
108
|
-
|
109
|
-
story.body.should.equal body_html
|
110
|
-
story.body_source.should.equal body_textile
|
111
|
-
story.body_plain.should.equal body_plain
|
112
|
-
end
|
113
|
-
|
114
|
-
specify "should handle character conversions" do
|
115
|
-
story = Story.find(4)
|
116
|
-
|
117
|
-
body_html = "<p>Is Textile™ the wave of the future? What about acts_as_textiled©? It’s\ndoubtful. Why does Textile™ smell like <em>Python</em>? Can we do anything to\nfix that? No? Well, I guess there are worse smells – like Ruby. jk.</p>\n\n\n\t<p>But seriously, ice > water and water < rain. But…nevermind. 1×1? 1.</p>\n\n\n\t<p>“You’re a good kid,” he said. “Keep it up.”</p>"
|
118
|
-
body_plain = %[Is Textile(TM) the wave of the future? What about acts_as_textiled(C)? It's\ndoubtful. Why does Textile(TM) smell like Python? Can we do anything to\nfix that? No? Well, I guess there are worse smells-like Ruby. jk.\n\n\n\tBut seriously, ice > water and water < rain. But...nevermind. 1x1? 1.\n\n\n\t"You're a good kid," he said. "Keep it up."]
|
119
|
-
|
120
|
-
story.body.should.equal body_html
|
121
|
-
story.body_plain.should.equal body_plain
|
122
|
-
end
|
123
|
-
|
124
|
-
specify "should be able to do on-demand textile caching" do
|
125
|
-
story = Story.find(1)
|
126
|
-
|
127
|
-
desc_html = '_why announces <i>Sandbox</i>'
|
128
|
-
|
129
|
-
story.textiled.size.should.equal 0
|
130
|
-
|
131
|
-
story.textilize
|
132
|
-
|
133
|
-
story.textiled.size.should.equal 2
|
134
|
-
story.description.should.equal desc_html
|
135
|
-
end
|
136
|
-
|
137
|
-
specify "should work well with after_find callbacks" do
|
138
|
-
story = StoryWithAfterFind.find(2)
|
139
|
-
|
140
|
-
desc_html = '<i>Beautify</i> your <strong>IRb</strong> prompt'
|
141
|
-
|
142
|
-
story.textiled.size.should.equal 2
|
143
|
-
story.description.should.equal desc_html
|
144
|
-
end
|
145
|
-
end
|