Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Renames to data.
Browse files Browse the repository at this point in the history
  • Loading branch information
robotlolita committed Dec 25, 2013
1 parent 5ee8b2e commit be9ada9
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 49 deletions.
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ lib: src/*.ls
dist:
mkdir -p dist

dist/monads.either.umd.js: compile dist
$(browserify) lib/index.js --standalone folktale.monads.Either > $@
dist/data.either.umd.js: compile dist
$(browserify) lib/index.js --standalone folktale.data.Either > $@

dist/monads.either.umd.min.js: dist/monads.either.umd.js
dist/data.either.umd.min.js: dist/data.either.umd.js
$(uglify) --mangle - < $^ > $@

# ----------------------------------------------------------------------
bundle: dist/monads.either.umd.js
bundle: dist/data.either.umd.js

minify: dist/monads.either.umd.min.js
minify: dist/data.either.umd.min.js

compile: lib

Expand All @@ -37,14 +37,14 @@ test:
$(lsc) test/tap.ls

package: compile documentation bundle minify
mkdir -p dist/monads.either-$(VERSION)
cp -r docs/literate dist/monads.either-$(VERSION)/docs
cp -r lib dist/monads.either-$(VERSION)
cp dist/*.js dist/monads.either-$(VERSION)
cp package.json dist/monads.either-$(VERSION)
cp README.md dist/monads.either-$(VERSION)
cp LICENCE dist/monads.either-$(VERSION)
cd dist && tar -czf monads.either-$(VERSION).tar.gz monads.either-$(VERSION)
mkdir -p dist/data.either-$(VERSION)
cp -r docs/literate dist/data.either-$(VERSION)/docs
cp -r lib dist/data.either-$(VERSION)
cp dist/*.js dist/data.either-$(VERSION)
cp package.json dist/data.either-$(VERSION)
cp README.md dist/data.either-$(VERSION)
cp LICENCE dist/data.either-$(VERSION)
cd dist && tar -czf data.either-$(VERSION).tar.gz data.either-$(VERSION)

publish: clean
npm install
Expand Down
46 changes: 24 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Monads: Either
==============
The Either Monad
================

[![Build Status](https://secure.travis-ci.org/folktale/monads.either.png?branch=master)](https://travis-ci.org/folktale/monads.either)
[![NPM version](https://badge.fury.io/js/monads.either.png)](http://badge.fury.io/js/monads.either)
[![Dependencies Status](https://david-dm.org/folktale/monads.either.png)](https://david-dm.org/folktale/monads.either)
[![Build Status](https://secure.travis-ci.org/folktale/data.either.png?branch=master)](https://travis-ci.org/folktale/data.either)
[![NPM version](https://badge.fury.io/js/data.either.png)](http://badge.fury.io/js/data.either)
[![Dependencies Status](https://david-dm.org/folktale/data.either.png)](https://david-dm.org/folktale/data.either)
[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges)


Expand All @@ -26,7 +26,7 @@ provided for the common interface in [Fantasy Land][].
## Example

```js
var Either = require('monads.either')
var Either = require('data.either')

// + type: String -> Either(Error, String)
function read(path) {
Expand All @@ -50,38 +50,38 @@ intro.map(function(a) {
The easiest way is to grab it from NPM. If you're running in a Browser
environment, you can use [Browserify][]

$ npm install monads.either
$ npm install data.either


### Using with CommonJS

If you're not using NPM, [Download the latest release][release], and require
the `monads.either.umd.js` file:
the `data.either.umd.js` file:

```js
var Either = require('monads.either')
var Either = require('data.either')
```


### Using with AMD

[Download the latest release][release], and require the `monads.either.umd.js`
[Download the latest release][release], and require the `data.either.umd.js`
file:

```js
require(['monads.either'], function(Either) {
require(['data.either'], function(Either) {
( ... )
})
```


### Using without modules

[Download the latest release][release], and load the `monads.either.umd.js`
file. The properties are exposed in the global `folktale.monads.Either` object:
[Download the latest release][release], and load the `data.either.umd.js`
file. The properties are exposed in the global `folktale.data.Either` object:

```html
<script src="/path/to/monads.either.umd.js"></script>
<script src="/path/to/data.either.umd.js"></script>
```


Expand All @@ -90,21 +90,21 @@ file. The properties are exposed in the global `folktale.monads.Either` object:
If you want to compile this library from the source, you'll need [Git][],
[Make][], [Node.js][], and run the following commands:

$ git clone git://github.com/folktale/monads.either.git
$ cd monads.either
$ git clone git://github.com/folktale/data.either.git
$ cd data.either
$ npm install
$ make bundle

This will generate the `dist/monads.either.umd.js` file, which you can load in
This will generate the `dist/data.either.umd.js` file, which you can load in
any JavaScript environment.


## Documentation

You can [read the documentation online][docs] or build it yourself:

$ git clone git://github.com/folktale/monads.either.git
$ cd monads.either
$ git clone git://github.com/folktale/data.either.git
$ cd data.either
$ npm install
$ make documentation

Expand All @@ -121,14 +121,16 @@ platforms by the use of shims. Just include [es5-shim][] :)

Copyright (c) 2013 Quildreen Motta.

Released under the [MIT licence](https://github.com/folktale/monads.either/blob/master/LICENCE).
Released under the [MIT licence](https://github.com/folktale/data.either/blob/master/LICENCE).

<!-- links -->
[Fantasy Land]: https://github.com/fantasyland/fantasy-land
[Browserify]: http://browserify.org/
[release]: https://github.com/folktale/monads.either/releases/download/v0.2.0/monads.either-0.2.0.tar.gz
[Git]: http://git-scm.com/
[Make]: http://www.gnu.org/software/make/
[Node.js]: http://nodejs.org/
[es5-shim]: https://github.com/kriskowal/es5-shim
[docs]: http://folktale.github.io/monads.either
[docs]: http://folktale.github.io/data.either
<!-- [release: https://github.com/folktale/data.either/releases/download/v$VERSION/data.either-$VERSION.tar.gz] -->
[release]: https://github.com/folktale/data.either/releases/download/v1.0.0/data.either-1.0.0.tar.gz
<!-- [/release] -->
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "monads.either",
"name": "data.either",
"version": "0.2.0",
"description": "A monad for disjunctions. (e.g.: computations that may fail)",
"main": "lib/index.js",
Expand All @@ -9,16 +9,19 @@
},
"repository": {
"type": "git",
"url": "https://github.com/folktale/monads.either"
"url": "https://github.com/folktale/data.either"
},
"keywords": [
"fantasy-land",
"folktale"
"folktale",
"monads",
"algebraic",
"disjunction"
],
"author": "Quildreen Motta",
"license": "MIT",
"bugs": {
"url": "https://github.com/folktale/monads.either/issues"
"url": "https://github.com/folktale/data.either/issues"
},
"dependencies": {},
"devDependencies": {
Expand All @@ -30,4 +33,4 @@
"uglify-js": "~2.4.3",
"laws": "~0.2.0"
}
}
}
2 changes: 1 addition & 1 deletion src/index.ls
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# can naturally aggregate failures — monads shortcut on the first
# failure.
#
# [Validation]: https://github.com/folktale/monads.validation
# [Validation]: https://github.com/folktale/data.validation

# ## Class: Either(a, b)
#
Expand Down
37 changes: 29 additions & 8 deletions tools/bump-version.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
var pkg = require('../package.json')
var fs = require('fs')
var fs = require('fs')

function read(n) {
return fs.readFileSync(n, 'utf-8')
}

function write(n, s) {
return fs.writeFileSync(n, s, 'utf-8')
}

function minor(a) {
return [a[0], a[1], Number(a[2]) + 1] }
return [a[0], a[1], Number(a[2]) + 1]
}

function feature(a) {
return [a[0], Number(a[1]) + 1, 0] }
return [a[0], Number(a[1]) + 1, 0]
}

function major(a) {
return [Number(a[0]) + 1, 0, 0] }
return [Number(a[0]) + 1, 0, 0]
}

function bump(what, version) {
return what === 'MAJOR'? major(version)
: what === 'FEATURE'? feature(version)
: /* otherwise */ minor(version) }
return what === 'MAJOR' ? major(version) : what === 'FEATURE' ? feature(version) : /* otherwise */
minor(version)
}


var old_version = pkg.version

pkg.version = bump(process.argv[2], pkg.version.split('.')).join('.')
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2))
write('package.json', JSON.stringify(pkg, null, 2))

var readme = read('README.md').replace(/<\!-- \[release:\s*(.+?)\s*\] -->[\s\S]*?<\!-- \[\/release\] -->/, function(_, s) {
return '<!-- [release: ' + s + '] -->\n' + '[release]: ' + s.replace(/\$VERSION/g, pkg.version) + '\n' + '<!-- [/release] -->'
})
write('README.md', readme)

console.log('Bumped from ' + old_version + ' to ' + pkg.version)

0 comments on commit be9ada9

Please sign in to comment.