agate 0.3.2 → 0.3.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 200e8b6f74c86f6af6c5ceab85df62eca7114d87
4
- data.tar.gz: 816851daffb692bbab0657639a7b60f863cb82b3
3
+ metadata.gz: 9283043e09bdcd1998ea3718ccf784d86d53943e
4
+ data.tar.gz: 0283e186ae0a76ef6585fa9d4acb5378abbb4bf7
5
5
  SHA512:
6
- metadata.gz: bd54d6bb08818be23f434c716854e3b122c5e62b15322f489bdefa7e360c9f5126f6a63c54c332a225864a712b6bd8ebe42217cf474a5f56534cb769399ba806
7
- data.tar.gz: 333eddfae6f8b29d964f2d1ecbffc93079f4561ef42dda11ecfb265112ef051359bac508784750a6e6af45779c4a2a007309c7b66db305496ed102d000203449
6
+ metadata.gz: 28c3cbcf9ed5a705dde577b36b18ebd51fbbdfa36bd5033d326ee7a4e9d370ece0c92068b58052327384c0cfcf411e0f67b37c7540f6430cce3db3af8a3b5d3a
7
+ data.tar.gz: 008fa85a64a4eac0b5260662a53a6c650d8d1f31b25c2b8c6443ab38bc8801abd884f4961b2a263592587a0ab86de9e5ca215b6d3bb84faec5cc815ab239c7c7
@@ -1,13 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
3
  - 1.9.2
5
4
  - 1.9.3
6
5
  - 2.0.0
7
- - jruby-18mode
8
6
  - jruby-19mode
9
- - rbx-18mode
10
7
  - rbx-19mode
11
8
  - ruby-head
12
9
  - jruby-head
13
- - ree
data/README.md CHANGED
@@ -6,12 +6,28 @@
6
6
  [![Code Climate](https://codeclimate.com/github/jbhannah/agate.png)](https://codeclimate.com/github/jbhannah/agate)
7
7
  [![Coverage Status](https://coveralls.io/repos/jbhannah/agate/badge.png?branch=master)](https://coveralls.io/r/jbhannah/agate)
8
8
 
9
- Wrap ruby characters (e.g. furigana, Pinyin, Zhuyin) in text with the
10
- [HTML5 `ruby` element][].
9
+ Wrap ruby characters (currently only furigana) in text with the
10
+ [HTML5 `ruby` element][]. **Requires Ruby 1.9 or later (or compabible
11
+ engine).**
11
12
 
12
13
  ## Usage
13
14
 
15
+ Install the gem with
16
+
17
+ gem install agate
18
+
19
+ or add it to your `Gemfile`:
20
+
21
+ ```ruby
22
+ gem "agate", "~> 0.3.2"
23
+ ```
24
+
25
+ To markup a simple string with delimited furigana:
26
+
14
27
  ```ruby
28
+ require "rubygems"
29
+ require "agate"
30
+
15
31
  options = {
16
32
  # can be any single character or pair of characters which surround ruby characters in text to parse
17
33
  :delimiters => "【】" # default delimiters
@@ -23,8 +23,8 @@ module Agate
23
23
 
24
24
  # Parse `text` and return it with ruby character markup
25
25
  def parse(text)
26
- first = @options[:delimiters].chars.first
27
- last = @options[:delimiters].chars.last
26
+ first = @options[:delimiters][0]
27
+ last = @options[:delimiters][-1]
28
28
 
29
29
  first = /#{'\\' + first}/ if RESERVED.include? first
30
30
  last = /#{'\\' + last}/ if RESERVED.include? last
@@ -1,3 +1,3 @@
1
1
  module Agate
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse B. Hannah