Skip to content

Commit

Permalink
Initial release of 1.0.0-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Aronoff committed Jul 16, 2015
1 parent 6efbacf commit 538a678
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 41 deletions.
4 changes: 2 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# string-split version history
# split version history

## *1.0-0* (July ?, 2015)
## *1.0-0* (July 16, 2015)

+ Initial public release

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# string-split [![Build Status](https://drone.io/bitbucket.org/telemachus/split/status.png)](https://drone.io/bitbucket.org/telemachus/split/latest)
# split [![Build Status](https://drone.io/bitbucket.org/telemachus/split/status.png)](https://drone.io/bitbucket.org/telemachus/split/latest)

## Synopsis

Lua doesn't provide a `split` function, though such a function is nearly
mandatory for working with text. As a result [a lot of people have made their
own][wiki]. This library provides two split functions: a standard one and an
iterator version.
A string `split` function and iterator for Lua, which doesn't provide such
a function in its standard string library. Such a function is clearly useful,
and [many people have written their own][wiki].

[wiki]: http://lua-users.org/wiki/SplitJoin

Expand Down
6 changes: 3 additions & 3 deletions doc/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<head>
<meta charset="utf-8">
<meta name="author" content="Peter Aronoff">
<title>string-split version history</title>
<title>split version history</title>
<link rel="stylesheet" href="normalize.css" media="screen,projection">
<link rel="stylesheet" href="screen.css" media="screen,projection">
</head>
<body>
<h1>string-split version history</h1>
<h1>split version history</h1>

<h2><em>1.0-0</em> (July ?, 2015)</h2>
<h2><em>1.0-0</em> (July 16, 2015)</h2>

<ul>
<li>Initial public release</li>
Expand Down
11 changes: 5 additions & 6 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
<head>
<meta charset="utf-8">
<meta name="author" content="Peter Aronoff">
<title>string-split documentation</title>
<title>split documentation</title>
<link rel="stylesheet" href="normalize.css" media="screen,projection">
<link rel="stylesheet" href="screen.css" media="screen,projection">
</head>
<body>
<h1>string-split <a href="https://drone.io/bitbucket.org/telemachus/split/latest"><img src="https://drone.io/bitbucket.org/telemachus/split/status.png" alt="Build Status" /></a></h1>
<h1>split <a href="https://drone.io/bitbucket.org/telemachus/split/latest"><img src="https://drone.io/bitbucket.org/telemachus/split/status.png" alt="Build Status" /></a></h1>

<h2>Synopsis</h2>

<p>Lua doesn&rsquo;t provide a <code>split</code> function, though such a function is nearly
mandatory for working with text. As a result <a href="http://lua-users.org/wiki/SplitJoin">a lot of people have made their
own</a>. This library provides two split functions: a standard one and an
iterator version.</p>
<p>A string <code>split</code> function and iterator for Lua, which doesn&rsquo;t provide such
a function in its standard string library. Such a function is clearly useful,
and <a href="http://lua-users.org/wiki/SplitJoin">many people have written their own</a>.</p>

<h2>Usage</h2>

Expand Down
2 changes: 1 addition & 1 deletion doc/license.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="author" content="Peter Aronoff">
<title>string-split license</title>
<title>split license</title>
<link rel="stylesheet" href="normalize.css" media="screen,projection">
<link rel="stylesheet" href="screen.css" media="screen,projection">
</head>
Expand Down
6 changes: 3 additions & 3 deletions make-doc.bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mkdir -p doc
printf "<head>\n"
printf "<meta charset=\"utf-8\">\n"
printf "<meta name=\"author\" content=\"Peter Aronoff\">\n"
printf "<title>string-split documentation</title>\n"
printf "<title>split documentation</title>\n"
printf "<link rel=\"stylesheet\" href=\"normalize.css\" "
printf "media=\"screen,projection\">\n"
printf "<link rel=\"stylesheet\" href=\"screen.css\" "
Expand All @@ -28,7 +28,7 @@ mkdir -p doc
printf "<head>\n"
printf "<meta charset=\"utf-8\">\n"
printf "<meta name=\"author\" content=\"Peter Aronoff\">\n"
printf "<title>string-split version history</title>\n"
printf "<title>split version history</title>\n"
printf "<link rel=\"stylesheet\" href=\"normalize.css\" "
printf "media=\"screen,projection\">\n"
printf "<link rel=\"stylesheet\" href=\"screen.css\" "
Expand All @@ -46,7 +46,7 @@ mkdir -p doc
printf "<head>\n"
printf "<meta charset=\"utf-8\">\n"
printf "<meta name=\"author\" content=\"Peter Aronoff\">\n"
printf "<title>string-split license</title>\n"
printf "<title>split license</title>\n"
printf "<link rel=\"stylesheet\" href=\"normalize.css\" "
printf "media=\"screen,projection\">\n"
printf "<link rel=\"stylesheet\" href=\"screen.css\" "
Expand Down
18 changes: 0 additions & 18 deletions split-1.0-0.rockspec

This file was deleted.

24 changes: 24 additions & 0 deletions split-1.0.0-1.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package = 'split'
version = '1.0.0-1'
source = {
url = 'https://bitbucket.org/telemachus/split/downloads/split-v1.0.0-1.tar.gz',
dir = 'split'
}
description = {
summary = 'String split function and iterator for Lua',
detailed = [[
A string split function and iterator for Lua since the string standard
library doesn't come with one.
]],
homepage = 'https://bitbucket.org/telemachus/split',
license = 'BSD 3-Clause',
maintainer = 'Peter Aronoff <[email protected]>'
}
dependencies = { 'lua >= 5.1' }
build = {
type = 'builtin',
modules = {
split = 'src/split.lua',
},
copy_directories = { 'doc' }
}
6 changes: 3 additions & 3 deletions src/split.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--- string-split: a split function for Lua
--- split: string split function and iterator for Lua
--
-- Peter Aronoff
-- BSD 3-Clause License
Expand Down Expand Up @@ -113,8 +113,8 @@ end
return {
split = split,
spliterator = spliterator,
_VERSION = "1.0-0",
_VERSION = "1.0-0-1",
_AUTHOR = "Peter Aronoff",
_URL = "https://bitbucket.org/telemachus/string-split",
_URL = "https://bitbucket.org/telemachus/split",
_LICENSE = 'BSD 3-Clause',
}
24 changes: 24 additions & 0 deletions test/test-utf8.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env lua
local t = require 'tapered'
package.path = '../src/?.lua;' .. package.path
local split = require 'split'.split

local s, got

s = 'fōö,bàr,bízz,bũzz'
got = split(s, ',')
t.is(#got, 4, "split('fōö,bàr,bízz,bũzz', ',') returns four items")
t.is(got[1], 'fōö', "The first item is 'fōö'")
t.is(got[2], 'bàr', "The second item is 'bàr'")
t.is(got[3], 'bízz', "The third item is 'bízz'")
t.is(got[4], 'bũzz', "The fourth item is 'bũzz'")

s = 'ἄνδραἦμοιἦἔννεπεἦΜοῦσαἦπολύτροπον'
got = split(s, '')
t.is(#got, 5,
"split('ἄνδραἦμοιἦἔννεπεἦΜοῦσαἦπολύτροπον', 'ἦ') returns five items")
t.is(got[1], 'ἄνδρα', "The first item is 'ἄνδρα'")
t.is(got[2], 'μοι', "The second item is 'μοι'")
t.is(got[3], 'ἔννεπε', "The third item is 'ἔννεπε'")
t.is(got[4], 'Μοῦσα', "The fourth item is 'Μοῦσα'")
t.is(got[5], 'πολύτροπον', "The fifth item is 'πολύτροπον'")

0 comments on commit 538a678

Please sign in to comment.