blogit 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +13 -6
  3. data/Rakefile +13 -20
  4. data/app/assets/javascripts/blogit/{index.js → application.js} +0 -0
  5. data/app/assets/stylesheets/blogit/themes/default.sass +2 -2
  6. data/app/views/blogit/posts/index.xml.builder +10 -3
  7. data/lib/blogit/configuration.rb +43 -38
  8. data/lib/blogit/parsers/markdown_parser.rb +17 -18
  9. data/lib/blogit/renderers.rb +13 -1
  10. data/lib/blogit/renderers/html_with_albino.rb +4 -3
  11. data/lib/blogit/renderers/html_with_pygments.rb +8 -0
  12. data/lib/blogit/version.rb +1 -1
  13. data/lib/generators/templates/blogit.rb +4 -1
  14. data/lib/tasks/blogit/doc.rake +5 -5
  15. data/spec/dummy/config/application.rb +1 -3
  16. data/spec/dummy/config/database.yml +19 -21
  17. data/spec/dummy/config/environments/development.rb +3 -6
  18. data/spec/dummy/config/environments/test.rb +2 -3
  19. data/spec/dummy/db/migrate/{20150619080551_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb → 20150705003224_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb} +0 -0
  20. data/spec/dummy/db/migrate/{20150619080552_add_missing_unique_indices.acts_as_taggable_on_engine.rb → 20150705003225_add_missing_unique_indices.acts_as_taggable_on_engine.rb} +0 -0
  21. data/spec/dummy/db/migrate/{20150619080553_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb → 20150705003226_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb} +0 -0
  22. data/spec/dummy/db/migrate/{20150619080554_add_missing_taggable_index.acts_as_taggable_on_engine.rb → 20150705003227_add_missing_taggable_index.acts_as_taggable_on_engine.rb} +0 -0
  23. data/spec/dummy/db/migrate/{20150619080555_change_collation_for_tag_names.acts_as_taggable_on_engine.rb → 20150705003228_change_collation_for_tag_names.acts_as_taggable_on_engine.rb} +0 -0
  24. data/spec/dummy/db/schema.rb +32 -32
  25. data/spec/dummy/db/seeds.rb +0 -17
  26. data/spec/dummy/db/test.m.sqlite3 +0 -0
  27. data/spec/dummy/lib/tasks/dummy.rake +14 -12
  28. data/spec/dummy/log/development.log +79 -22568
  29. data/spec/dummy/log/test.log +13578 -9687
  30. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0Lx1PMdTkYC_KT-2wdprTcvmy1kmqJXqj9K4apUwjgI.cache +1 -0
  31. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0S9SaofTLZZfY-KrRNWtPFoZxxqS6a4v1OZKD0kGmtg.cache +2 -0
  32. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/10oiIyPUwof4f-zAqoQa5eb_luPhtVsYTDino7QQW1M.cache +0 -0
  33. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1LaWUvaq4L3XD-JP6ILgltrcRLFuV05J6nzYRqBmmSY.cache +0 -0
  34. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1yAVQ16V-g-NURRK4aGvUABqqjIMI8Ms802x_ODFFzs.cache +2 -0
  35. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/56QVglRoJNQMucM4b8aqs0SjL-4pO7GxTzvfNjX194g.cache +2 -0
  36. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/58aL8wRsOye6siAuJm4Nh_gR83DjQjLuWaMJNZM_81A.cache +2 -0
  37. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5HFBt__e7exzyS1xRQ5Cwp0w8_qDRPyOSEKEf1C8XJQ.cache +1 -0
  38. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5l6FOvMdufm8COSx3H0HaaVtLVKiinJV7WIEIR0PPEw.cache +0 -0
  39. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/615mEtV0HwzhGK6S5I_Z3XIAqTnN162xhUn9_k8pPVU.cache +1 -0
  40. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6umDWTeCAdRJFQzs2MighXzYBTGfV_dyyucYgykfBVo.cache +0 -0
  41. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8qh98rNQE_5DOB9jDlYYr59saMZ7AjSv9ZvcizWEeew.cache +1 -0
  42. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/9Fj_rVgHvlSaNHfQPp6Tw6kSOQWY0PtDjn7HO8yeO6Y.cache +3 -0
  43. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/9ZES5CjW8eMgJMR2p8teniRAMb9CtlA3_F8mA6ZbSXY.cache +1 -0
  44. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/BNaiReF0RzjTxAbpm-MRwjIsgeDSZ6OVLRajwSXTWZw.cache +1 -0
  45. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ElBT8olwMMGx8VUPTaIjDNqMVCXPyLan0ukO8m7PYmI.cache +1 -0
  46. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/EmqUyycvEqeoD6FOjtY14u9_M2OFhr9mHsSL3dsQ6Hc.cache +1 -0
  47. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/GVTABF5YkB5UuM81c_BamW5ztg9Efna9fBLkLPqPQ4o.cache +1 -0
  48. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/GvtlQmjk9NO2JWc1yQbj8mJaSZgxHA9JD4LhA4ntRqk.cache +1 -0
  49. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/HRsSNf9-U410_kMDIcefhywwAsVilC7_8dchGIgqvD8.cache +3 -0
  50. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/IOAOGqCp8d3pB1X4pUxzyG-mQYxgwccD9DAspGNDT94.cache +0 -0
  51. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ir18gySOlm9GabKW6fcid14NxzeT0-fwaZ85C0Cyq90.cache +1 -0
  52. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/K8yWfD94RKQk1liXQDhSJ2dZc1lQVNDkI0OMzbkae-w.cache +1 -0
  53. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/M-NBeWjh9M3fFxkwT7MyfiTN1F893I6mhZwXv_nuWmI.cache +1 -0
  54. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/M0O3cjwe9kqr3ly32TX32HigBMKPRjzeP2eCWPinzE4.cache +1 -0
  55. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/MGQIKzSMbqHU9wRixw8yrY1nQ5Pm2SRc3IG5JTE1kzg.cache +1 -0
  56. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NNFwJ5uq36OCuu55Ur9cny_mvlIFoHkiZ7oXw_ccCp4.cache +1 -0
  57. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Nd3hv75iKmJI6IefgIuy0AWKdvDEPUxubkmS65EdOAw.cache +1 -0
  58. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/O4ZMrjosXy15ncwHPa-cUnS7Ppjqop5-bZcKTsB-36Y.cache +1 -0
  59. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ok04qQXtEs74R-b0-ZJU4zExVXZdHNdN-7IhO-pKh0Q.cache +1 -0
  60. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Pqq5eZ4WuI3VKQ_smCBW-lY7drL62e-TuKgpQHWVr4o.cache +1 -0
  61. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Q3MN5RzlSu40UIaVl72qIsTBc-JUGMijkiTgzeRYxEI.cache +0 -0
  62. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/QUP1_blznjEP87O19sqllsR2vyOAp_Mo6AeVKSzLBts.cache +0 -0
  63. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Qh6-yTqJOSoyFAoG_IvWe2dPlqz6hV1bXfdzJEEEYOo.cache +1 -0
  64. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/S0mMJd9-C0-QRwGHYwedhTAWFhOgDCWVAAT7JcDlca0.cache +1 -0
  65. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/TD8TLr1xtcjbFlCJdkhGBzZ1k1sBggEkT6dEELsfdmQ.cache +0 -0
  66. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/TfVpOlKATPbziuXdFyG6rJ8kkrhnOYijGQZPQu_a7PY.cache +0 -0
  67. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/V8U8-K-bteRgkrfWg70_0g8ewTcFNRDiNKtCFVAQaGA.cache +0 -0
  68. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/VdRI22xS7f7tdmC9Gkmaca5LaroM2X2iP--3HaKdFnA.cache +1 -0
  69. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/X-Sn6rMpp4AeUDcLt_hkfYG3YFZLmhi7Zmf3yPNBmKg.cache +0 -0
  70. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/X9rGsWJfQ8Mj6WUq7LImKUdLZq9E3vr4qFyrerQnaSY.cache +2 -0
  71. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XHD9eK0UlA19CWE9FrWyg0J09vUuHolSILMeJ3f3rI0.cache +1 -0
  72. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XO1eUdb7mg_ZIvakYr_CX9Z55n_Uy-IqOJM2SUgNWCQ.cache +1 -0
  73. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XVQiqKsqsWMIscnk-22CaHaZ6kFqElTej5ndRMV5GoM.cache +1 -0
  74. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XxgRvm0mgTJyMP7XZvwF3K_MAtUZE5PSlBU5iqCfeZM.cache +1 -0
  75. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Y-973Cbpk-OtrzVbaWRuxhKB31wkBEVtP5tkhbH53TQ.cache +0 -0
  76. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YDSbFNOtu-Fb2XBXlMeXFHe-zXVf9EGpduaFL8yHd9Q.cache +1 -0
  77. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YMcl5E-9onyPCcK2hzLYyeNExGbatHIzHP5Jh_6jKNY.cache +0 -0
  78. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YmyWErCo4qBam-A7WA8ovMMhwPNB9P8Di82uw85AeiI.cache +0 -0
  79. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZOnK7Qt-u3GX1kTMBChvdpq9hXmq1oSuKACN8u9c6QY.cache +1 -0
  80. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZqcHKp3Hl7HKcETjeli4KMimkU9S92GcogzrTj9lic8.cache +1 -0
  81. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_3yCZyDv_c1M6Bz-Nu-erDfJBuaTfnZ04gdKwhBKEHI.cache +2 -0
  82. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_Wp-ImqgPb9PcaYaEZICdPv694HbgAqYRCxPbe5cwBg.cache +0 -0
  83. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/aHxH9In8G6F7DaPmCTUdV2diOvPjgsH59ncr-B9zWUA.cache +0 -0
  84. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/aOffLuMG4I6J8LYTEDhclPAs4X-stHa5Q5GNd8qgObs.cache +0 -0
  85. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/atA881npUk3AtJJQThLX7wK0CQn3rK14HHMBCtbDdXI.cache +1 -0
  86. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/b1kOG2yZBlm11v8RCaXE0X2dQjdKV7us5Xmn8Qx7DPg.cache +0 -0
  87. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bAO9MboGyoNi8gCPLRSbjG0TkB0PweOLRiQFHBkvgns.cache +0 -0
  88. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/elraV4ksKL_Szx-jc9cchxoE2JHrM47PrHEZrlS6Kbs.cache +0 -0
  89. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/fTbwK7tdCPA5VY0Pd-0IpQO2FaIu063nqhZJWPFJt0Y.cache +2 -0
  90. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/fdh__WI69dgobxBJ-q4cK5X0K88BR9HJwunjHk24Y5k.cache +1 -0
  91. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/g1aACWGBo08FtRxELpPaUxtYMX7DbEgxWv7LSRdlzdU.cache +2 -0
  92. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gIYoRVihDI_3DdbFzc-6HGxW3dCegbHsO94wJdKcbOg.cache +0 -0
  93. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/h0mp866auTps-UhHCh4-OPdCefSFrO68S7DJN7jfiZU.cache +0 -0
  94. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/h1cKDXlysXDpUAS3zgI0Ht_RjxyG2Psmk8yKUBb9Vjs.cache +1 -0
  95. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jwHQdZ4VwkBStutmNRBKqYJXcp4dv7DZkr9xnEP945M.cache +0 -0
  96. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/k-lFMORLzx_teYmjPrshdsI0oGUQNEHq4h2cncVh8zk.cache +0 -0
  97. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mZ8Bz5ELUwp-sdaC2J2J4Xet8LVIOwmDU1tvxROi-SI.cache +1 -0
  98. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/odiewXBw5bkqH6E6y5ecl53NCmNlaD619cxSQljuWIQ.cache +1 -0
  99. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/okhDGsuN-ZUOl1nQGEETHw2_-vDbTFViIKBneaTN89Q.cache +0 -0
  100. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pZFeq4xDojAHXc4PjkWXC3ZSZ-UYzten2FsbjhvzyAQ.cache +0 -0
  101. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/q7cHnCNk1meQEh62bpWVzRJ-t9RPyns_cnfw_hoWr48.cache +0 -0
  102. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/skN3LrPWLowWLaKrARrEFgpnkER0SYQ5bBrKRVZd8lA.cache +1 -0
  103. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/t5hAY8za1jCanRl1RkIXXEXGGkWp6BuM0EgnVtmmkN0.cache +3 -0
  104. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/tRdrcDvIBz31aduav1dIY8e-CX_t41O2yrmM6JWGJr0.cache +1 -0
  105. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/tiTdBeBzV7AUOIvMl9tVxZSyFeXVMbfRIoS683K6XqY.cache +0 -0
  106. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/upTVPfRV0cO1zf0sDIBj2ubo7dvmS1TPS8hWnc-xBzI.cache +0 -0
  107. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wOlsf7f8f6Ef2vl0mI7b16u_t8NYcpXsgDCrAnj0JXQ.cache +2 -0
  108. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wc5AOfdJoNz2_qSyPBQh1Iu2WFdt34i3Dqj-qg9g_tg.cache +1 -0
  109. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/x6wl88IDFGddP2qxcrcB_nbnaSRe-QmnILQWsPQvviM.cache +0 -0
  110. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/y708_KkfZegUjhbK7CDLNoQtcDDcDi0g6paYYe-QTbY.cache +0 -0
  111. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/z06nwtRCETHbdXKuvmaG_eE3p0XEaE-ukZMXmIZll3o.cache +0 -0
  112. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zKbRfdhoP1Mb3uHtmSFCidZJTh7MJ3YuTjp75fM6EtQ.cache +1 -0
  113. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zL2eF9YAG0BRLCNB1fkm1bZJYR20vGnAbqWsxHg0nKE.cache +0 -0
  114. data/spec/lib/blogit/parsers/markdown_parser_spec.rb +10 -9
  115. data/spec/rails_helper.rb +2 -7
  116. metadata +293 -109
  117. data/app/assets/stylesheets/blogit/themes/default.css +0 -4
  118. data/app/assets/stylesheets/blogit/themes/default.css.map +0 -7
  119. data/app/assets/stylesheets/blogit/themes/default.min.css +0 -2
  120. data/app/assets/stylesheets/blogit/themes/default.min.css.map +0 -7
  121. data/spec/dummy/db/development.sqlite3 +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0ce028f63a809be074f923a4b1870599cd6616ab
4
- data.tar.gz: f0053eda22037fab3ad53ea7719f844c630000df
2
+ SHA256:
3
+ metadata.gz: f9c716ed9ef8c03894a63bc2b0342be087d114551df23bb0b3012b7d8bab6fe5
4
+ data.tar.gz: 2bf4e5ccb458df7370061c4e33bc25294e6cd3df450cb55ea3cc0240b4c49441
5
5
  SHA512:
6
- metadata.gz: dc9cd5c907b64cef43daf98242da3d4f787fa3e9f125a7b476238eaf457f726f7e44b55f4972310210cbaf0f572caf0f8c6f0d17523f0a5aa15a242172c6620d
7
- data.tar.gz: 7999542af4e13f1b5af091963f9be9ad6abf7f582e189a6065aa5e11f9db0e2c2ca6898ea5eaeaada81b58c203a79801b169fa6c0f8e65a316baac201d708c2e
6
+ metadata.gz: 3610d9b3906ee55d231a4bffe80fc0ec4c92e5edce1861b9e07a2991a3a15fe0d2201cf3196c47ddb90b4c9cb9f917976dcd585eb6dc1f255e32c838d61db61c
7
+ data.tar.gz: eeb122baf4b37c7c7dabb8c3c143816e4c64865b3dabd5618cabbd6f4f15b1e7f67a34523941359d9c29b0532315c4d93cfb7af4cd04e25bd8f0efa4b61de74b
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![Test Coverage](https://d3s6mut3hikguw.cloudfront.net/github/KatanaCode/blogit/badges/coverage.svg)](http://codeclimate.com/github/KatanaCode/blogit/badges/)
4
4
  [![Blogit](https://gemnasium.com/KatanaCode/blogit.png)](https://gemnasium.com/KatanaCode/blogit)
5
5
  [![Travis CI](https://travis-ci.org/KatanaCode/blogit.png)](https://travis-ci.org/KatanaCode/blogit.png)
6
+ [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Bodacious/blogit/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
6
7
 
7
8
  # Blogit - A Rails blogging solution
8
9
 
@@ -30,12 +31,12 @@ $ rails g blogit:install
30
31
  rake blogit:install:migrations
31
32
 
32
33
  # You don't need to run this again if you've already done so
33
- rake acts_as_taggable_on:install:migrations
34
+ rake acts_as_taggable_on_engine:install:migrations
34
35
 
35
36
  # This will run any pending migrations
36
37
  rake db:migrate
37
38
 
38
- ```
39
+ ```
39
40
 
40
41
  then add the following to your routes.rb file:
41
42
 
@@ -48,11 +49,11 @@ Finally, declare which of your models acts as blogger in your app (probably User
48
49
 
49
50
  ``` ruby
50
51
  class User < ActiveRecord::Base
51
-
52
+
52
53
  blogs
53
54
 
54
55
  end
55
- ```
56
+ ```
56
57
 
57
58
  Go to http://localhost:3000/blog and see your marvelous new blog.
58
59
 
@@ -69,13 +70,19 @@ Blogit provides you with the following features
69
70
  * Code Syntax Highlighting CSS file (add `*= require pygments` to your app's stylesheet)
70
71
  * CSS themes
71
72
 
73
+ ## Modular
74
+
75
+ We're designing blogit to be as modular as possible, so you can pick and choose the elements you'd like to use.
76
+
77
+ * For **Admin CMS** please install [blogit-admin](https://github.com/katanacode/blogit-admin)
78
+
72
79
  ## Documentation
73
80
 
74
81
  Full documentation and how-to guides available here: http://blogit.katanacode.com
75
82
 
76
83
  ## Issues
77
84
 
78
- If you discover a problem with Blogit, please let us know about it.
85
+ If you discover a problem with Blogit, please let us know about it.
79
86
 
80
87
  **Remember** to search the [issues list](https://github.com/KatanaCode/blogit/issues) first in case your issue has already been raised
81
88
  by another Githuber
@@ -104,4 +111,4 @@ Katana Code are [web developers based in Edinburgh, Scotland](http://katanacode.
104
111
 
105
112
  Copyright © 2011 - 2015 [Katana Code Ltd.](http://katanacode.com)
106
113
 
107
- [GithubLicence]: https://github.com/KatanaCode/blogit/blob/master/MIT-LICENSE
114
+ [GithubLicence]: https://github.com/KatanaCode/blogit/blob/master/MIT-LICENSE
data/Rakefile CHANGED
@@ -1,27 +1,20 @@
1
1
  #!/usr/bin/env rake
2
- begin
3
- require 'bundler/setup'
4
- rescue LoadError
5
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
- end
7
-
8
- APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
9
-
10
- load 'rails/tasks/engine.rake'
11
-
12
- Bundler::GemHelper.install_tasks
13
-
14
-
15
- Dir[File.join(File.dirname(__FILE__), 'lib/tasks/**/*.rake')].each {|f| load f }
16
-
17
- Dir[File.join(File.dirname(__FILE__), 'spec/dummy/lib/tasks/**/*.rake')].each {|f| load f}
18
-
2
+ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
19
3
 
4
+ require "rubygems"
5
+ require 'bundler/setup'
6
+ require 'bundler/gem_tasks'
7
+ require "blogit/version"
20
8
  require 'rspec/core'
21
9
  require 'rspec/core/rake_task'
22
10
 
23
- desc "Run all specs in spec directory (excluding plugin specs)"
11
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
12
+
13
+ load 'rails/tasks/engine.rake'
24
14
 
25
- RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare')
15
+ Dir[File.join(File.dirname(__FILE__), 'lib/tasks/**/*.rake')].each { |f| import f }
16
+ Dir[File.join(File.dirname(__FILE__), 'spec/dummy/lib/tasks/**/*.rake')].
17
+ each { |f| import f }
26
18
 
27
- task :default => :spec
19
+ task :default => :spec
20
+ RSpec::Core::RakeTask.new(:spec)
@@ -1,2 +1,2 @@
1
- @import "base/*"
2
- @import "blocks/*"
1
+ @import "default/base/*"
2
+ @import "default/blocks/*"
@@ -1,11 +1,18 @@
1
- xml.instruct!
2
- xml.urlset :xmlns => 'http://www.sitemaps.org/schemas/sitemap/0.9' do
1
+ xml.instruct!
2
+ xml.urlset :xmlns => 'http://www.sitemaps.org/schemas/sitemap/0.9' do
3
3
 
4
+ # Show the blog index in sitemap
5
+ xml.url do
6
+ xml.loc posts_url
7
+ xml.lastmod @posts.maximum(:updated_at).xmlschema
8
+ end
9
+
10
+ # Include a record for each active post
4
11
  for post in @posts
5
12
  xml.url do
6
13
  xml.loc post_url(post)
7
14
  xml.lastmod post.updated_at.xmlschema
8
15
  end
9
16
  end
10
-
17
+
11
18
  end
@@ -1,22 +1,22 @@
1
1
  module Blogit
2
-
2
+
3
3
  # This class handles the global configuration options for Blogit.
4
4
  # When you run `rails g blogit:install` this will add an initializer file to
5
5
  # config/initializers/blogit.rb with all of the default configurations applied.
6
6
  #
7
7
  # You can read about each of the individual configuration options below.
8
8
  class Configuration
9
-
9
+
10
10
  include ActiveSupport::Configurable
11
-
12
- # An Array containing the default states for {Blogit::Post Posts} that are considered
11
+
12
+ # An Array containing the default states for {Blogit::Post Posts} that are considered
13
13
  # "active". ("Active" {Post posts} are those that can be viewed by the public).
14
14
  ACTIVE_STATES = [:published]
15
15
 
16
- # An Array containing the default states for {Blogit::Post Posts} that are considered
16
+ # An Array containing the default states for {Blogit::Post Posts} that are considered
17
17
  # "hidden". ("Hidden" {Post posts} are those that may not be viewed by the public).
18
- HIDDEN_STATES = [:draft, :archive]
19
-
18
+ HIDDEN_STATES = [:draft, :archive]
19
+
20
20
  # When using redcarpet as content parser, pass these options as defaults.
21
21
  REDCARPET_OPTIONS = {
22
22
  hard_wrap: true,
@@ -26,94 +26,99 @@ module Blogit
26
26
  fenced_code_blocks: true,
27
27
  gh_blockcode: true,
28
28
  }
29
-
30
- ##
29
+
30
+ ##
31
31
  # How do you want to handle comments for your blog?
32
- # Valid options are :active_record, :disquss, or :no for none.
32
+ # Valid options are :active_record, :disquss, or :no for none.
33
33
  # (default: :active_record)
34
34
  config_accessor(:include_comments) { :active_record }
35
-
36
- ##
35
+
36
+ ##
37
37
  # When using :disqus comments, what is the shortname of your forum?
38
38
  # (default: nil)
39
39
  config_accessor(:disqus_shortname, instance_writer: false)
40
-
40
+
41
41
  ##
42
42
  # Load a javascript-based share bar on each blog post?. (default: true)
43
43
  config_accessor(:include_share_bar) { true }
44
-
44
+
45
45
  ##
46
46
  # Twitter username used in the share bar. (default: nil)
47
47
  config_accessor(:twitter_username)
48
-
48
+
49
49
  ##
50
50
  # The name of the controller method we'll call to return the current blogger.
51
51
  # (default: :current_user)
52
52
  config_accessor(:current_blogger_method) { :current_user }
53
-
53
+
54
54
  ##
55
55
  # What method do we call on blogger to return their display name? (default: :username)
56
56
  config_accessor(:blogger_display_name_method) { :username }
57
-
57
+
58
58
  ##
59
59
  # Which DateTime::FORMATS format do we use to display blog and comment publish time
60
60
  # (default: :short)
61
61
  config_accessor(:datetime_format) { :short }
62
-
62
+
63
63
  ##
64
64
  # Number of {Blogit::Post posts} to show per page. This is a configuration for {https://github.com/amatsuda/kaminari Kaminari} (default: 5)
65
65
  #
66
66
  # Returns an Integer
67
67
  config_accessor(:posts_per_page) { 5 }
68
-
68
+
69
69
  ##
70
70
  # If set to true, the comments form will POST and DELETE to the comments
71
71
  # controller using AJAX calls.
72
72
  #
73
73
  # Returns true or false
74
74
  config_accessor(:ajax_comments) { true }
75
-
75
+
76
76
  ##
77
77
  # The default format for parsing the blog content.
78
78
  #
79
79
  # Defaults to :markdown
80
80
  config_accessor(:default_parser) { :markdown }
81
-
81
+
82
82
  ##
83
83
  # Should text within "```" or "`" be highlighted as code?
84
84
  # Defaults to true
85
85
  # @note - At the moment this only works when default_parser is :markdown
86
86
  config_accessor(:highlight_code_syntax) { true }
87
-
87
+
88
+ ##
89
+ # The renderer used for code highlighting
90
+ # Defaults to :albino
91
+ config_accessor(:syntax_highlighter) { :albino }
92
+
88
93
  ##
89
94
  # When using redcarpet as content parser, pass these options as defaults
90
95
  #
91
96
  # Defaults to {REDCARPET_OPTIONS}
92
97
  config_accessor(:redcarpet_options) { REDCARPET_OPTIONS }
93
-
98
+
94
99
  ##
95
100
  # List of states that will be visible to the public
96
101
  #
97
102
  # Defaults to ACTIVE_STATES
98
103
  config_accessor(:active_states) { ACTIVE_STATES }
99
-
104
+
100
105
  ##
101
106
  # List of states that will hide the posts from the public.
102
107
  #
103
108
  # Defaults to HIDDEN_STATES
104
109
  config_accessor(:hidden_states) { HIDDEN_STATES }
105
-
110
+
106
111
  ##
107
112
  # The title of the RSS feed for the blog posts
108
113
  #
109
114
  # Defaults to "[Application Name] Blog Posts"
110
115
  config_accessor(:rss_feed_title, instance_reader: false)
111
-
116
+
112
117
  ##
113
118
  # The description of the RSS feed for the blog posts
114
119
  # Defaults to "[Application Name] Blog Posts"
115
120
  config_accessor(:rss_feed_description, instance_reader: false)
116
-
121
+
117
122
  ##
118
123
  # The layout to be used by the posts controller
119
124
  #
@@ -126,13 +131,13 @@ module Blogit
126
131
  #
127
132
  # Defaults to true
128
133
  config_accessor(:show_post_description) { true }
129
-
130
-
134
+
135
+
131
136
  def default_parser_class
132
137
  "Blogit::Parsers::#{default_parser.to_s.classify}Parser".constantize
133
138
  end
134
139
 
135
- # Sets {#disqus_shortname}.
140
+ # Sets {#disqus_shortname}.
136
141
  # If the user has defined a disqus shortname but hasn't set include_comments to
137
142
  # :disqus will print a warning to the console.
138
143
  #
@@ -155,19 +160,19 @@ module Blogit
155
160
  @rss_feed_title ||= "#{rails_app_name} Blog Posts"
156
161
  end
157
162
 
158
- # The description to use in the index.rss template.
163
+ # The description to use in the index.rss template.
159
164
  # (default: "Latest from [My Application]")
160
165
  #
161
- # Returns a String
166
+ # Returns a String
162
167
  def rss_feed_description
163
168
  @rss_feed_description ||= "Latest from #{rails_app_name}"
164
169
  end
165
170
 
166
-
167
-
171
+
172
+
168
173
  private
169
174
 
170
-
175
+
171
176
  # The name of this application derived from the app's engine name.
172
177
  # If your Rails app module is KatanaCode, the application name will be "Katana Code"
173
178
  #
@@ -179,7 +184,7 @@ module Blogit
179
184
  # Print a warning message to $STDOUT with the prefix "[Blogit]: "
180
185
  #
181
186
  # Examples
182
- #
187
+ #
183
188
  # blogit_warn("Blogit is not a toy!")
184
189
  # # => "[Blogit]: Blogit is not a toy!"
185
190
  #
@@ -188,5 +193,5 @@ module Blogit
188
193
  end
189
194
 
190
195
  end
191
-
192
- end
196
+
197
+ end
@@ -1,17 +1,16 @@
1
1
  class Blogit::Parsers::MarkdownParser
2
-
2
+
3
3
  require "nokogiri"
4
- require "albino"
5
4
  require "blogit/renderers"
6
-
7
- # A String containing the content to be parsed
5
+
6
+ # A String containing the content to be parsed
8
7
  attr_reader :content
9
-
8
+
10
9
  def initialize(content)
11
10
  @content = content
12
11
  end
13
12
 
14
- # The parsed content
13
+ # The parsed content
15
14
  #
16
15
  # Returns an HTML safe String
17
16
  def parsed
@@ -21,26 +20,26 @@ class Blogit::Parsers::MarkdownParser
21
20
 
22
21
 
23
22
  private
24
-
25
-
23
+
24
+
26
25
  # The Redcarpet renderer to use
27
26
  def renderer
28
27
  if Blogit::configuration.highlight_code_syntax
29
- Redcarpet::Render::HTMLWithAlbino
28
+ Blogit::Renderers.choose_highlight_renderer
30
29
  else
31
30
  Redcarpet::Render::HTML
32
31
  end
33
32
  end
34
-
33
+
35
34
  # The Redcarpet Markdown handler
36
35
  def markdown
37
36
  @markdown ||= Redcarpet::Markdown.new(renderer,
38
37
  Blogit.configuration.redcarpet_options)
39
38
  end
40
39
 
41
-
40
+
42
41
  # Ensures pygments is installed
43
- #
42
+ #
44
43
  # Raises StandardError if pygments is not available on this machine
45
44
  def ensure_pygments_is_installed
46
45
  warning = <<-WARNING
@@ -48,15 +47,15 @@ class Blogit::Parsers::MarkdownParser
48
47
  Please either do one of the following:
49
48
 
50
49
  $ sudo easy_install Pygments # to install it
51
-
52
- or
53
-
50
+
51
+ or
52
+
54
53
  set config.highlight_code_syntax to false in your blogit.rb config file.
55
-
54
+
56
55
  WARNING
57
56
  raise warning unless which(:pygmentize)
58
57
  end
59
-
58
+
60
59
  # Check if an executable exists in the load path
61
60
  #
62
61
  # Returns nil if no executable is found
@@ -70,5 +69,5 @@ WARNING
70
69
  end
71
70
  return nil
72
71
  end
73
-
72
+
74
73
  end
@@ -1,3 +1,15 @@
1
1
  module Blogit::Renderers
2
- require "blogit/renderers/html_with_albino"
2
+ def self.choose_highlight_renderer
3
+ case Blogit::configuration.syntax_highlighter
4
+ when :albino
5
+ require "blogit/renderers/html_with_albino"
6
+ Redcarpet::Render::HTMLWithAlbino
7
+ when :pygments
8
+ require "blogit/renderers/html_with_pygments"
9
+ Redcarpet::Render::HTMLWithPygments
10
+ else
11
+ raise Blogit::ConfigurationError,
12
+ "'#{Blogit.configuration.syntax_highlighter}' is not a valid renderer"
13
+ end
14
+ end
3
15
  end