Skip to content

Commit

Permalink
common functionality was extracted into riak-entity
Browse files Browse the repository at this point in the history
  • Loading branch information
podviaznikov committed Dec 4, 2011
1 parent 629b572 commit d69cd99
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 214 deletions.
84 changes: 0 additions & 84 deletions lib/dao/dao.coffee

This file was deleted.

2 changes: 1 addition & 1 deletion lib/dao/objects.dao.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Dao = require("./dao").Dao
Dao = require("riak-entity").Dao

## ObjectsDao
## -------------
Expand Down
2 changes: 1 addition & 1 deletion lib/dao/repos.dao.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Dao = require("./dao").Dao
Dao = require("riak-entity").Dao
Repo = require("../objects/repo").Repo

class ReposDao extends Dao
Expand Down
2 changes: 1 addition & 1 deletion lib/dao/users.dao.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_ = require "underscore"
Dao = require("./dao").Dao
Dao = require("riak-entity").Dao
reposDao = require("./repos.dao").newInstance()
blobsDao = require("./blobs.dao").newInstance()
commitsDao = require("./commits.dao").newInstance()
Expand Down
5 changes: 3 additions & 2 deletions lib/massive.git.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
async = require "async"
_ = require "underscore"
validators = require "./validators/input.validators"
utils = require("./objects/utils")

# Dao objects
ReposDao = require "./dao/repos.dao"
Expand All @@ -18,6 +17,8 @@ Blob = exports.Blob = require("./objects/blob").Blob
Commit = exports.Commit = require("./objects/commit").Commit
TreeEntry = exports.TreeEntry = require("./objects/tree.entry").TreeEntry

# Utility method for merging two arrays into one.
mergeArrays = (first, second) -> Array::push.apply first, second

MassiveGit = exports.MassiveGit = class MassiveGit

Expand Down Expand Up @@ -121,7 +122,7 @@ MassiveGit = exports.MassiveGit = class MassiveGit
mergedEntries = tree.entries
newEntriesNames = (entry.name for entry in newEntries)
mergedEntries = _.reject mergedEntries, (entry) -> _.include newEntriesNames, entry.name
utils.mergeArrays mergedEntries, newEntries
mergeArrays mergedEntries, newEntries
async.series tasks, (err, results) =>
if err
callback err
Expand Down
37 changes: 0 additions & 37 deletions lib/objects/git.entity.coffee

This file was deleted.

2 changes: 1 addition & 1 deletion lib/objects/git.object.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
crypto = require "crypto"
GitEntity = require("./git.entity").GitEntity
GitEntity = require("riak-entity").Entity

sha1 = (data) -> crypto.createHash("sha1").update(data).digest("hex")

Expand Down
4 changes: 2 additions & 2 deletions lib/objects/repo.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GitEntity = require("./git.entity").GitEntity
Entity = require("riak-entity").Entity

# Repo
# ---------
Expand All @@ -9,7 +9,7 @@ GitEntity = require("./git.entity").GitEntity
# `public` - flag that indicated whether repo is public or private. Default to `true`.
# `commit` - last commit for this repository. Can be `null` if repository wasn't commited previously.
# `forkedFrom` - id of the repository from which this was cloned. Default to `null`.
Repo = exports.Repo = class Repo extends GitEntity
Repo = exports.Repo = class Repo extends Entity

constructor: (@name, @author, @type, @public = true, @commit, @forkedFrom = null) ->

Expand Down
6 changes: 3 additions & 3 deletions lib/objects/user.coffee
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
_ = require "underscore"
GitEntity = require("./git.entity").GitEntity
_ = require "underscore"
Entity = require("riak-entity").Entity

# User
# ------------
# Class represent information about user in the system.
# User has `id` (which is username) and `email`.
User = exports.User = class User extends GitEntity
User = exports.User = class User extends Entity

constructor: (@_id, @email, @_links = []) ->

Expand Down
22 changes: 0 additions & 22 deletions lib/objects/utils.coffee

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"node": "~v0.4.12"
},
"dependencies": {
"riak-js": ">=0.4.1",
"riak-entity": ">=0.1.0",
"coffee-script": ">=1.1.2",
"underscore": ">=1.2.0",
"validator": ">=0.3.0"
Expand Down
31 changes: 0 additions & 31 deletions test/git.entity.coffee

This file was deleted.

28 changes: 0 additions & 28 deletions test/utils.coffee

This file was deleted.

0 comments on commit d69cd99

Please sign in to comment.