Skip to content

Commit

Permalink
Updated to version 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jun 21, 2015
1 parent 28e9bd0 commit 117e76c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 29 deletions.
4 changes: 4 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes #

## 1.1.0 / 2015-06-21
- Fixed #15: Added legacy `.new()` function
- Fixed deprecated warning on package.json

## 1.0.2 / 2015-04-07
- Fixed #16: instances properties defined through objects are not mutable

Expand Down
49 changes: 28 additions & 21 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
# selfish #
# selfish

[![Build Status](https://secure.travis-ci.org/Gozala/selfish.png)](http://travis-ci.org/Gozala/selfish)

Class-free, pure prototypal multiple inheritance that lets you write expressive,
well-structured code.

## Install ##
## Install

### server-side ###
### server-side

npm install selfish

### client-side ###
```bash
npm install selfish
```

bower install selfish
### client-side

```bash
bower install selfish
```

## Require ##
## Require

### server-side ###
### server-side

var Base = require('!raw.github.com/Gozala/selfish/v1.0.0/selfish').Base
```js
var Base = require('!raw.github.com/Gozala/selfish/v1.0.0/selfish').Base
```

### client-side RequireJS ###
### client-side RequireJS

define(['path/to/selfish'], function(selfish) {
var Base = selfish.Base;
}
```js
define(['path/to/selfish'], function(selfish) {
var Base = selfish.Base;
})
```

## Examples ##
## Examples

### Basics ###
### Basics

```js
// Instead of creating classes, you create prototype objects. Let's look
Expand Down Expand Up @@ -81,7 +88,7 @@ pet.call('Benzy') // 'Ruff! Ruff!'
```


### Object composition ###
### Object composition

```js
// In some programs recombining reusable pieces of code is a better option:
Expand Down Expand Up @@ -142,10 +149,10 @@ pink.yellow() // 0.2039
pink.cyan() // 0.0000
```

### Combining composition & inheritance ###
### Combining composition & inheritance

```js
var pixel = new Pixel(11, 23, 'CC3399')
var Pixel = Color.extend({
initialize: function initialize(x, y, color) {
Color.initialize.call(this, color)
this.x = x
Expand All @@ -156,7 +163,7 @@ var pixel = new Pixel(11, 23, 'CC3399')
}
})

var pixel = Pixel.new(11, 23, 'CC3399')
var pixel = new Pixel(11, 23, 'CC3399')
pixel.toString() // 11:23@#CC3399
Pixel.prototype.isPrototypeOf(pixel) // true

Expand All @@ -168,7 +175,7 @@ Color.prototype.isPrototypeOf(pixel) // true
Color.prototype.isPrototypeOf(Pixel.prototype) // true
```

### TODO ###
### TODO

This is a list of things I may introduce in newer versions.

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "selfish",
"main": "selfish.js",
"version": "1.0.2",
"version": "1.1.0",
"homepage": "https://github.com/Gozala/selfish",
"authors": [
"Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)",
Expand Down
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "selfish",
"id": "selfish",
"version": "1.0.2",
"version": "1.1.0",
"description": "Class-free, pure prototypal multiple inheritance",
"keywords": [
"oop",
Expand Down Expand Up @@ -67,10 +67,5 @@
"scripts": {
"test": "./node_modules/.bin/mocha"
},
"licenses": [
{
"type": "MIT",
"url": "http://jeditoolkit.com/LICENSE"
}
]
"license": "MIT"
}

0 comments on commit 117e76c

Please sign in to comment.