blogit 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +13 -6
- data/Rakefile +13 -20
- data/app/assets/javascripts/blogit/{index.js → application.js} +0 -0
- data/app/assets/stylesheets/blogit/themes/default.sass +2 -2
- data/app/views/blogit/posts/index.xml.builder +10 -3
- data/lib/blogit/configuration.rb +43 -38
- data/lib/blogit/parsers/markdown_parser.rb +17 -18
- data/lib/blogit/renderers.rb +13 -1
- data/lib/blogit/renderers/html_with_albino.rb +4 -3
- data/lib/blogit/renderers/html_with_pygments.rb +8 -0
- data/lib/blogit/version.rb +1 -1
- data/lib/generators/templates/blogit.rb +4 -1
- data/lib/tasks/blogit/doc.rake +5 -5
- data/spec/dummy/config/application.rb +1 -3
- data/spec/dummy/config/database.yml +19 -21
- data/spec/dummy/config/environments/development.rb +3 -6
- data/spec/dummy/config/environments/test.rb +2 -3
- 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
- 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
- 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
- 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
- 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
- data/spec/dummy/db/schema.rb +32 -32
- data/spec/dummy/db/seeds.rb +0 -17
- data/spec/dummy/db/test.m.sqlite3 +0 -0
- data/spec/dummy/lib/tasks/dummy.rake +14 -12
- data/spec/dummy/log/development.log +79 -22568
- data/spec/dummy/log/test.log +13578 -9687
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0Lx1PMdTkYC_KT-2wdprTcvmy1kmqJXqj9K4apUwjgI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0S9SaofTLZZfY-KrRNWtPFoZxxqS6a4v1OZKD0kGmtg.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/10oiIyPUwof4f-zAqoQa5eb_luPhtVsYTDino7QQW1M.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1LaWUvaq4L3XD-JP6ILgltrcRLFuV05J6nzYRqBmmSY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1yAVQ16V-g-NURRK4aGvUABqqjIMI8Ms802x_ODFFzs.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/56QVglRoJNQMucM4b8aqs0SjL-4pO7GxTzvfNjX194g.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/58aL8wRsOye6siAuJm4Nh_gR83DjQjLuWaMJNZM_81A.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5HFBt__e7exzyS1xRQ5Cwp0w8_qDRPyOSEKEf1C8XJQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5l6FOvMdufm8COSx3H0HaaVtLVKiinJV7WIEIR0PPEw.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/615mEtV0HwzhGK6S5I_Z3XIAqTnN162xhUn9_k8pPVU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6umDWTeCAdRJFQzs2MighXzYBTGfV_dyyucYgykfBVo.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8qh98rNQE_5DOB9jDlYYr59saMZ7AjSv9ZvcizWEeew.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/9Fj_rVgHvlSaNHfQPp6Tw6kSOQWY0PtDjn7HO8yeO6Y.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/9ZES5CjW8eMgJMR2p8teniRAMb9CtlA3_F8mA6ZbSXY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/BNaiReF0RzjTxAbpm-MRwjIsgeDSZ6OVLRajwSXTWZw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ElBT8olwMMGx8VUPTaIjDNqMVCXPyLan0ukO8m7PYmI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/EmqUyycvEqeoD6FOjtY14u9_M2OFhr9mHsSL3dsQ6Hc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/GVTABF5YkB5UuM81c_BamW5ztg9Efna9fBLkLPqPQ4o.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/GvtlQmjk9NO2JWc1yQbj8mJaSZgxHA9JD4LhA4ntRqk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/HRsSNf9-U410_kMDIcefhywwAsVilC7_8dchGIgqvD8.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/IOAOGqCp8d3pB1X4pUxzyG-mQYxgwccD9DAspGNDT94.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ir18gySOlm9GabKW6fcid14NxzeT0-fwaZ85C0Cyq90.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/K8yWfD94RKQk1liXQDhSJ2dZc1lQVNDkI0OMzbkae-w.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/M-NBeWjh9M3fFxkwT7MyfiTN1F893I6mhZwXv_nuWmI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/M0O3cjwe9kqr3ly32TX32HigBMKPRjzeP2eCWPinzE4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/MGQIKzSMbqHU9wRixw8yrY1nQ5Pm2SRc3IG5JTE1kzg.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NNFwJ5uq36OCuu55Ur9cny_mvlIFoHkiZ7oXw_ccCp4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Nd3hv75iKmJI6IefgIuy0AWKdvDEPUxubkmS65EdOAw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/O4ZMrjosXy15ncwHPa-cUnS7Ppjqop5-bZcKTsB-36Y.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ok04qQXtEs74R-b0-ZJU4zExVXZdHNdN-7IhO-pKh0Q.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Pqq5eZ4WuI3VKQ_smCBW-lY7drL62e-TuKgpQHWVr4o.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Q3MN5RzlSu40UIaVl72qIsTBc-JUGMijkiTgzeRYxEI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/QUP1_blznjEP87O19sqllsR2vyOAp_Mo6AeVKSzLBts.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Qh6-yTqJOSoyFAoG_IvWe2dPlqz6hV1bXfdzJEEEYOo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/S0mMJd9-C0-QRwGHYwedhTAWFhOgDCWVAAT7JcDlca0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/TD8TLr1xtcjbFlCJdkhGBzZ1k1sBggEkT6dEELsfdmQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/TfVpOlKATPbziuXdFyG6rJ8kkrhnOYijGQZPQu_a7PY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/V8U8-K-bteRgkrfWg70_0g8ewTcFNRDiNKtCFVAQaGA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/VdRI22xS7f7tdmC9Gkmaca5LaroM2X2iP--3HaKdFnA.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/X-Sn6rMpp4AeUDcLt_hkfYG3YFZLmhi7Zmf3yPNBmKg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/X9rGsWJfQ8Mj6WUq7LImKUdLZq9E3vr4qFyrerQnaSY.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XHD9eK0UlA19CWE9FrWyg0J09vUuHolSILMeJ3f3rI0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XO1eUdb7mg_ZIvakYr_CX9Z55n_Uy-IqOJM2SUgNWCQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XVQiqKsqsWMIscnk-22CaHaZ6kFqElTej5ndRMV5GoM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XxgRvm0mgTJyMP7XZvwF3K_MAtUZE5PSlBU5iqCfeZM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Y-973Cbpk-OtrzVbaWRuxhKB31wkBEVtP5tkhbH53TQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YDSbFNOtu-Fb2XBXlMeXFHe-zXVf9EGpduaFL8yHd9Q.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YMcl5E-9onyPCcK2hzLYyeNExGbatHIzHP5Jh_6jKNY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YmyWErCo4qBam-A7WA8ovMMhwPNB9P8Di82uw85AeiI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZOnK7Qt-u3GX1kTMBChvdpq9hXmq1oSuKACN8u9c6QY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZqcHKp3Hl7HKcETjeli4KMimkU9S92GcogzrTj9lic8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_3yCZyDv_c1M6Bz-Nu-erDfJBuaTfnZ04gdKwhBKEHI.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_Wp-ImqgPb9PcaYaEZICdPv694HbgAqYRCxPbe5cwBg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/aHxH9In8G6F7DaPmCTUdV2diOvPjgsH59ncr-B9zWUA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/aOffLuMG4I6J8LYTEDhclPAs4X-stHa5Q5GNd8qgObs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/atA881npUk3AtJJQThLX7wK0CQn3rK14HHMBCtbDdXI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/b1kOG2yZBlm11v8RCaXE0X2dQjdKV7us5Xmn8Qx7DPg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bAO9MboGyoNi8gCPLRSbjG0TkB0PweOLRiQFHBkvgns.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/elraV4ksKL_Szx-jc9cchxoE2JHrM47PrHEZrlS6Kbs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/fTbwK7tdCPA5VY0Pd-0IpQO2FaIu063nqhZJWPFJt0Y.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/fdh__WI69dgobxBJ-q4cK5X0K88BR9HJwunjHk24Y5k.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/g1aACWGBo08FtRxELpPaUxtYMX7DbEgxWv7LSRdlzdU.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gIYoRVihDI_3DdbFzc-6HGxW3dCegbHsO94wJdKcbOg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/h0mp866auTps-UhHCh4-OPdCefSFrO68S7DJN7jfiZU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/h1cKDXlysXDpUAS3zgI0Ht_RjxyG2Psmk8yKUBb9Vjs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jwHQdZ4VwkBStutmNRBKqYJXcp4dv7DZkr9xnEP945M.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/k-lFMORLzx_teYmjPrshdsI0oGUQNEHq4h2cncVh8zk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mZ8Bz5ELUwp-sdaC2J2J4Xet8LVIOwmDU1tvxROi-SI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/odiewXBw5bkqH6E6y5ecl53NCmNlaD619cxSQljuWIQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/okhDGsuN-ZUOl1nQGEETHw2_-vDbTFViIKBneaTN89Q.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pZFeq4xDojAHXc4PjkWXC3ZSZ-UYzten2FsbjhvzyAQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/q7cHnCNk1meQEh62bpWVzRJ-t9RPyns_cnfw_hoWr48.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/skN3LrPWLowWLaKrARrEFgpnkER0SYQ5bBrKRVZd8lA.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/t5hAY8za1jCanRl1RkIXXEXGGkWp6BuM0EgnVtmmkN0.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/tRdrcDvIBz31aduav1dIY8e-CX_t41O2yrmM6JWGJr0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/tiTdBeBzV7AUOIvMl9tVxZSyFeXVMbfRIoS683K6XqY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/upTVPfRV0cO1zf0sDIBj2ubo7dvmS1TPS8hWnc-xBzI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wOlsf7f8f6Ef2vl0mI7b16u_t8NYcpXsgDCrAnj0JXQ.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wc5AOfdJoNz2_qSyPBQh1Iu2WFdt34i3Dqj-qg9g_tg.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/x6wl88IDFGddP2qxcrcB_nbnaSRe-QmnILQWsPQvviM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/y708_KkfZegUjhbK7CDLNoQtcDDcDi0g6paYYe-QTbY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/z06nwtRCETHbdXKuvmaG_eE3p0XEaE-ukZMXmIZll3o.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zKbRfdhoP1Mb3uHtmSFCidZJTh7MJ3YuTjp75fM6EtQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zL2eF9YAG0BRLCNB1fkm1bZJYR20vGnAbqWsxHg0nKE.cache +0 -0
- data/spec/lib/blogit/parsers/markdown_parser_spec.rb +10 -9
- data/spec/rails_helper.rb +2 -7
- metadata +293 -109
- data/app/assets/stylesheets/blogit/themes/default.css +0 -4
- data/app/assets/stylesheets/blogit/themes/default.css.map +0 -7
- data/app/assets/stylesheets/blogit/themes/default.min.css +0 -2
- data/app/assets/stylesheets/blogit/themes/default.min.css.map +0 -7
- data/spec/dummy/db/development.sqlite3 +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f9c716ed9ef8c03894a63bc2b0342be087d114551df23bb0b3012b7d8bab6fe5
|
4
|
+
data.tar.gz: 2bf4e5ccb458df7370061c4e33bc25294e6cd3df450cb55ea3cc0240b4c49441
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3610d9b3906ee55d231a4bffe80fc0ec4c92e5edce1861b9e07a2991a3a15fe0d2201cf3196c47ddb90b4c9cb9f917976dcd585eb6dc1f255e32c838d61db61c
|
7
|
+
data.tar.gz: eeb122baf4b37c7c7dabb8c3c143816e4c64865b3dabd5618cabbd6f4f15b1e7f67a34523941359d9c29b0532315c4d93cfb7af4cd04e25bd8f0efa4b61de74b
|
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
[](http://codeclimate.com/github/KatanaCode/blogit/badges/)
|
4
4
|
[](https://gemnasium.com/KatanaCode/blogit)
|
5
5
|
[](https://travis-ci.org/KatanaCode/blogit.png)
|
6
|
+
[](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
|
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
|
-
|
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
|
-
|
11
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
12
|
+
|
13
|
+
load 'rails/tasks/engine.rake'
|
24
14
|
|
25
|
-
|
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)
|
File without changes
|
@@ -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
|
data/lib/blogit/configuration.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/blogit/renderers.rb
CHANGED
@@ -1,3 +1,15 @@
|
|
1
1
|
module Blogit::Renderers
|
2
|
-
|
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
|