changed dependency for gosimple/slug, they had finally removed the gopkgs dependency, Fixes #2153

This commit is contained in:
Torkel Ödegaard
2015-06-12 08:53:20 +02:00
parent 48175101c6
commit 7ce31bfaa0
28 changed files with 40 additions and 425 deletions
-6
View File
@@ -1,6 +0,0 @@
unidecode
=========
Unicode transliterator in Golang - Replaces non-ASCII characters with their ASCII approximations.
View other available versions, documentation and examples at http://gopkgs.com/unidecode
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
_*
cover*.out
@@ -4,9 +4,10 @@ slug
Package `slug` generate slug from unicode string, URL-friendly slugify with
multiple languages support.
[![GoDoc](https://godoc.org/github.com/dalu/slug?status.png)](https://godoc.org/github.com/dalu/slug)
[![GoDoc](https://godoc.org/github.com/gosimple/slug?status.png)](https://godoc.org/github.com/gosimple/slug)
[![Build Status](https://drone.io/github.com/gosimple/slug/status.png)](https://drone.io/github.com/gosimple/slug/latest)
[Documentation online](http://godoc.org/github.com/dalu/slug)
[Documentation online](http://godoc.org/github.com/gosimple/slug)
## Example
@@ -37,9 +38,12 @@ multiple languages support.
fmt.Println(textSub) // Will print 'sand-is-hot'
}
### Requests or bugs?
<https://github.com/gosimple/slug/issues>
## Installation
go get -u github.com/dalu/slug
go get -u github.com/gosimple/slug
## License
@@ -12,7 +12,7 @@ Example:
package main
import(
"github.com/dalu/slug"
"github.com/gosimple/slug"
"fmt"
)
@@ -35,5 +35,9 @@ Example:
textSub := slug.Make("water is hot")
fmt.Println(textSub) // Will print 'sand-is-hot'
}
Requests or bugs?
https://github.com/gosimple/slug/issues
*/
package slug
@@ -6,9 +6,10 @@
package slug
import (
"github.com/dalu/unidecode"
"regexp"
"strings"
"github.com/rainycape/unidecode"
)
var (
+6
View File
@@ -0,0 +1,6 @@
unidecode
=========
Unicode transliterator in Golang - Replaces non-ASCII characters with their ASCII approximations.
[![GoDoc](https://godoc.org/github.com/rainycape/unidecode?status.svg)](https://godoc.org/github.com/rainycape/unidecode)
@@ -5,12 +5,9 @@ import (
"encoding/binary"
"io"
"strings"
"sync"
)
var (
decoded = false
mutex sync.Mutex
transliterations [65536][]rune
transCount = rune(len(transliterations))
getUint16 = binary.LittleEndian.Uint16
+4
View File
@@ -0,0 +1,4 @@
package unidecode
// AUTOGENERATED - DO NOT EDIT!
@@ -4,15 +4,15 @@
package unidecode
import (
"sync"
"unicode"
"gopkgs.com/pool.v1"
)
const pooledCapacity = 64
var (
slicePool = pool.New(0)
slicePool sync.Pool
decodingOnce sync.Once
)
// Unidecode implements a unicode transliterator, which
@@ -23,14 +23,7 @@ var (
// with their closest ASCII counterparts.
// e.g. Unicode("áéíóú") => "aeiou"
func Unidecode(s string) string {
if !decoded {
mutex.Lock()
if !decoded {
decodeTransliterations()
decoded = true
}
mutex.Unlock()
}
decodingOnce.Do(decodeTransliterations)
l := len(s)
var r []rune
if l > pooledCapacity {