captains_log 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca91a722ba012f18b60fd8c1aea016469cbbcc04
4
- data.tar.gz: 4b475b545d919231dacaf58ab9908a20792913c5
3
+ metadata.gz: e428ffbb92c4c5d10c34f0812a48fdcdd54972f7
4
+ data.tar.gz: db96b934a469f481aa6a442d05ade858be13fb8e
5
5
  SHA512:
6
- metadata.gz: a32ad52e271bdbc1dc5631fbe404870f24d7d80131ebc44a42bba32a0febd8f06b3d2141377ee60de005c5380d650233effc73470070295e888ad957fa406cba
7
- data.tar.gz: 63311b204e8c173789427ae1f44c1ec519981fbcd9c8d70cb2c469adf8c1cb86bf41d2347db3ae67cf2263387ad9e433326bb66bc6f2a349fcc81f07126e58ea
6
+ metadata.gz: 758e3caec0568f04089bb3e1516395a818e9a14409ece0fd56ec0371b6bbd879c1be9b6e38f5f95f39a1d858494d81f7500e602320b024d86490a3a52b35333f
7
+ data.tar.gz: 772b6f45bf3247a72b1b53c9b1c4e911dd680836ed21311861bbd38a1ae7e27429a1277822325e71af4293df72f3269d8b2ea61aecb673b1bba9ba5f32726310
data/README.rdoc CHANGED
@@ -1,3 +1,35 @@
1
- = CaptainsLog
1
+ {<img src="https://badge.fury.io/rb/captains_log.svg" alt="Gem Version" />}[http://badge.fury.io/rb/captains_log]
2
2
 
3
- This project rocks and uses MIT-LICENSE.
3
+ = Captain's Log
4
+
5
+ WARNING: Captains Log will scan any given text for code to evaluate. It is highly recommended that you do not use this against user-input. For your application's security, please only use Captain's Log against input from trusted administrators.
6
+
7
+ This project rocks and uses MIT-LICENSE.
8
+
9
+ == Installation
10
+
11
+ 1. Add Captains Log to your application's Gemfile
12
+
13
+ gem 'captains_log', '0.0.1'
14
+
15
+ Note: It is recommended that you provide the version number as breaking changes may be released with minor version bumps.
16
+
17
+ == Usage
18
+
19
+ Captain's Log evaluates lines of Ruby embedded in larger bodies of texts, such as blog entries. As a programmer, it enables me to demonstrate functional code from blog posts stored in my database. In order to recognise these blocks of code, we use a made-up HTML tag: `<eval>[code to execute]</eval>`.
20
+
21
+ In your body of text, ensure that code blocks to be evaluated are concatenated onto one line and surrounded by the `eval` tag.
22
+
23
+ To have Captain's Log evaluate these code blocks in your texts, use the `captains_log` helper:
24
+
25
+ <%= captains_log(@blog_post.body) %>
26
+
27
+ If `captains_log` isn't to your tastes, you can of course surround the helper in an alternative helper of your own. On my site, I use `badass_digest`:
28
+
29
+ def badass_digest(content)
30
+ captains_log(content)
31
+ end
32
+
33
+ Using your own alternative is then as easy as utilising the original:
34
+
35
+ <%= badass_digest(@blog_post.body) %>
@@ -1,3 +1,3 @@
1
1
  module CaptainsLog
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: captains_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom Bruce
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-25 00:00:00.000000000 Z
11
+ date: 2015-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails