jabe 0.5.9 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. data/{LICENSE.txt → MIT-LICENSE} +1 -1
  2. data/README.textile +46 -31
  3. data/Rakefile +30 -47
  4. data/app/assets/images/jabe/delete.png +0 -0
  5. data/{public/images → app/assets/images/jabe}/delete_page.png +0 -0
  6. data/{public/images → app/assets/images/jabe}/full_page.png +0 -0
  7. data/{public/images → app/assets/images/jabe}/gravatar.gif +0 -0
  8. data/{public/javascripts → app/assets/javascripts/jabe}/application.js +15 -0
  9. data/{public/javascripts → app/assets/javascripts/jabe}/libs/dd_belatedpng.js +0 -0
  10. data/{public/javascripts → app/assets/javascripts/jabe}/libs/modernizr-1.6.min.js +0 -0
  11. data/{public/javascripts → app/assets/javascripts/jabe}/plugins.js +0 -0
  12. data/app/assets/stylesheets/jabe/application.css +3 -0
  13. data/app/{stylesheets → assets/stylesheets/jabe}/boilerplate.scss +0 -0
  14. data/app/{stylesheets → assets/stylesheets/jabe}/jabe.scss +47 -8
  15. data/app/controllers/jabe/admin/base_controller.rb +7 -0
  16. data/app/controllers/jabe/admin/entries_controller.rb +49 -0
  17. data/app/controllers/jabe/admin/settings_controller.rb +13 -0
  18. data/app/controllers/jabe/application_controller.rb +5 -0
  19. data/app/controllers/jabe/comments_controller.rb +34 -0
  20. data/app/controllers/jabe/entries_controller.rb +30 -0
  21. data/app/controllers/jabe/feed_controller.rb +8 -0
  22. data/app/controllers/jabe/sessions_controller.rb +4 -0
  23. data/app/helpers/jabe/application_helper.rb +25 -0
  24. data/app/mailers/jabe/comment_mailer.rb +12 -0
  25. data/app/models/jabe/admin.rb +11 -0
  26. data/app/models/jabe/comment.rb +35 -0
  27. data/app/models/jabe/entry.rb +22 -0
  28. data/app/models/jabe/settings.rb +14 -0
  29. data/app/views/{admin → jabe/admin}/entries/_form.html.haml +1 -1
  30. data/app/views/{admin → jabe/admin}/entries/edit.html.haml +0 -0
  31. data/app/views/{admin → jabe/admin}/entries/index.html.haml +9 -7
  32. data/app/views/{admin → jabe/admin}/entries/new.html.haml +0 -0
  33. data/app/views/{admin → jabe/admin}/settings/edit.html.haml +2 -1
  34. data/app/views/jabe/comment_mailer/notification.html.erb +19 -0
  35. data/app/views/jabe/confirmations/new.html.erb +15 -0
  36. data/app/views/{entries → jabe/entries}/index.html.haml +4 -3
  37. data/app/views/jabe/entries/show.html.haml +49 -0
  38. data/app/views/{feed → jabe/feed}/index.xml.builder +3 -3
  39. data/app/views/jabe/mailer/confirmation_instructions.html.erb +5 -0
  40. data/app/views/jabe/mailer/reset_password_instructions.html.erb +8 -0
  41. data/app/views/jabe/mailer/unlock_instructions.html.erb +7 -0
  42. data/app/views/jabe/passwords/edit.html.erb +19 -0
  43. data/app/views/jabe/passwords/new.html.erb +15 -0
  44. data/app/views/jabe/registrations/edit.html.erb +22 -0
  45. data/app/views/jabe/registrations/new.html.erb +17 -0
  46. data/app/views/jabe/sessions/new.html.erb +15 -0
  47. data/app/views/jabe/shared/_links.erb +25 -0
  48. data/app/views/jabe/unlocks/new.html.erb +15 -0
  49. data/app/views/layouts/jabe/_flashes.html.haml +3 -0
  50. data/app/views/layouts/{_footer.html.haml → jabe/_footer.html.haml} +0 -0
  51. data/app/views/layouts/jabe/_header.html.haml +4 -0
  52. data/app/views/layouts/jabe/_sidebar.html.haml +21 -0
  53. data/app/views/layouts/jabe/application.html.haml +63 -0
  54. data/{test/dummy/vendor/plugins/acts_as_textiled/init.rb → config/initializers/acts_as_textiled.rb} +2 -1
  55. data/config/initializers/devise.rb +3 -0
  56. data/config/initializers/settings.rb +5 -5
  57. data/config/initializers/simple_form.rb +93 -0
  58. data/config/initializers/time_formats.rb +1 -2
  59. data/config/locales/simple_form.en.yml +24 -0
  60. data/config/routes.rb +10 -5
  61. data/{test/dummy/db/migrate/20101229224027_create_settings.rb → db/migrate/20101230010434_create_settings.rb} +7 -2
  62. data/{lib/generators/jabe/templates/migrations/devise_create_admins.rb → db/migrate/20101230010436_devise_create_admins.rb} +6 -6
  63. data/{test/dummy/db/migrate/20101229224030_create_entries.rb → db/migrate/20101230010437_create_entries.rb} +2 -2
  64. data/{test/dummy/db/migrate/20101229224031_create_comments.rb → db/migrate/20101230010438_create_comments.rb} +3 -4
  65. data/{test/dummy/vendor/plugins/acts_as_textiled/lib/acts_as_textiled.rb → lib/acts_as_textiled/base.rb} +0 -0
  66. data/lib/jabe.rb +7 -15
  67. data/lib/jabe/engine.rb +5 -0
  68. data/lib/jabe/version.rb +3 -0
  69. data/lib/tasks/jabe_tasks.rake +4 -0
  70. metadata +187 -601
  71. data/Gemfile +0 -35
  72. data/Gemfile.lock +0 -214
  73. data/VERSION +0 -1
  74. data/app/controllers/admin/base_controller.rb +0 -3
  75. data/app/controllers/admin/entries_controller.rb +0 -42
  76. data/app/controllers/admin/settings_controller.rb +0 -11
  77. data/app/controllers/comments_controller.rb +0 -25
  78. data/app/controllers/entries_controller.rb +0 -26
  79. data/app/controllers/feed_controller.rb +0 -8
  80. data/app/helpers/jabe_helper.rb +0 -13
  81. data/app/models/admin.rb +0 -9
  82. data/app/models/comment.rb +0 -22
  83. data/app/models/entry.rb +0 -17
  84. data/app/models/settings.rb +0 -7
  85. data/app/stylesheets/_will_paginate.scss +0 -102
  86. data/app/stylesheets/handheld.scss +0 -7
  87. data/app/views/entries/_comment_form.html.haml +0 -3
  88. data/app/views/entries/show.html.haml +0 -38
  89. data/app/views/layouts/_header.html.haml +0 -4
  90. data/app/views/layouts/_sidebar.html.haml +0 -21
  91. data/app/views/layouts/application.html.haml +0 -59
  92. data/config/initializers/sass.rb +0 -5
  93. data/lib/generators/jabe/migrations/migrations_generator.rb +0 -38
  94. data/lib/generators/jabe/stylesheets/stylesheets_generator.rb +0 -9
  95. data/lib/generators/jabe/templates/migrations/add_new_settings.rb +0 -17
  96. data/lib/generators/jabe/templates/migrations/create_comments.rb +0 -20
  97. data/lib/generators/jabe/templates/migrations/create_entries.rb +0 -16
  98. data/lib/generators/jabe/templates/migrations/create_settings.rb +0 -21
  99. data/lib/generators/jabe/templates/migrations/create_slugs.rb +0 -18
  100. data/public/.htaccess +0 -220
  101. data/public/apple-touch-icon.png +0 -0
  102. data/public/blackbird/blackbird.css +0 -80
  103. data/public/blackbird/blackbird.js +0 -365
  104. data/public/blackbird/blackbird.png +0 -0
  105. data/public/crossdomain.xml +0 -25
  106. data/public/javascripts/jquery-ui.js +0 -11511
  107. data/public/javascripts/jquery-ui.min.js +0 -404
  108. data/public/javascripts/jquery.js +0 -7179
  109. data/public/javascripts/jquery.min.js +0 -167
  110. data/public/javascripts/libs/profiling/charts.swf +0 -0
  111. data/public/javascripts/libs/profiling/config.js +0 -59
  112. data/public/javascripts/libs/profiling/yahoo-profiling.css +0 -7
  113. data/public/javascripts/libs/profiling/yahoo-profiling.min.js +0 -39
  114. data/public/javascripts/rails.js +0 -154
  115. data/public/nginx.conf +0 -108
  116. data/public/robots.txt +0 -5
  117. data/test/dummy/app/controllers/application_controller.rb +0 -3
  118. data/test/dummy/app/helpers/application_helper.rb +0 -2
  119. data/test/dummy/config/application.rb +0 -52
  120. data/test/dummy/config/boot.rb +0 -10
  121. data/test/dummy/config/environment.rb +0 -5
  122. data/test/dummy/config/environments/development.rb +0 -26
  123. data/test/dummy/config/environments/production.rb +0 -49
  124. data/test/dummy/config/environments/test.rb +0 -35
  125. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  126. data/test/dummy/config/initializers/devise.rb +0 -142
  127. data/test/dummy/config/initializers/inflections.rb +0 -10
  128. data/test/dummy/config/initializers/mime_types.rb +0 -5
  129. data/test/dummy/config/initializers/secret_token.rb +0 -7
  130. data/test/dummy/config/initializers/session_store.rb +0 -8
  131. data/test/dummy/config/routes.rb +0 -58
  132. data/test/dummy/db/migrate/20101229224028_create_slugs.rb +0 -18
  133. data/test/dummy/db/migrate/20101229224029_devise_create_admins.rb +0 -26
  134. data/test/dummy/db/migrate/20110104004400_add_new_settings.rb +0 -17
  135. data/test/dummy/db/schema.rb +0 -110
  136. data/test/dummy/features/step_definitions/admin_steps.rb +0 -14
  137. data/test/dummy/features/step_definitions/email_steps.rb +0 -194
  138. data/test/dummy/features/step_definitions/entry_steps.rb +0 -54
  139. data/test/dummy/features/step_definitions/support_steps.rb +0 -3
  140. data/test/dummy/features/step_definitions/web_steps.rb +0 -219
  141. data/test/dummy/features/support/blueprints.rb +0 -37
  142. data/test/dummy/features/support/env.rb +0 -59
  143. data/test/dummy/features/support/paths.rb +0 -39
  144. data/test/dummy/spec/spec_helper.rb +0 -0
  145. data/test/dummy/spec/support/blueprints.rb +0 -9
  146. data/test/dummy/vendor/plugins/acts_as_textiled/test/fixtures/author.rb +0 -4
  147. data/test/dummy/vendor/plugins/acts_as_textiled/test/fixtures/story.rb +0 -4
  148. data/test/dummy/vendor/plugins/acts_as_textiled/test/helper.rb +0 -87
  149. 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&#8217;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&#8482; the wave of the future? What about acts_as_textiled&#169;? It&#8217;s\ndoubtful. Why does Textile&#8482; smell like <em>Python</em>? Can we do anything to\nfix that? No? Well, I guess there are worse smells &#8211; like Ruby. jk.</p>\n\n\n\t<p>But seriously, ice &gt; water and water &lt; rain. But&#8230;nevermind. 1&#215;1? 1.</p>\n\n\n\t<p>&#8220;You&#8217;re a good kid,&#8221; he said. &#8220;Keep it up.&#8221;</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