Skip to content

Commit

Permalink
got github going :) ... next migrate all the docs!! :)
Browse files Browse the repository at this point in the history
  • Loading branch information
msuarz committed Aug 30, 2012
1 parent ed6a14e commit e989f8d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
3 changes: 1 addition & 2 deletions docs/github/settings.coffee
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,7 @@
@settings = @settings =
docs: docs:
source: 'github' reader: 'github'
repo: 'git://github.com/limadelic/frankendoc.wiki.git' repo: 'git://github.com/limadelic/frankendoc.wiki.git'
root: 'frankendoc'
type: '.md' type: '.md'
code: code:
root: 'docs/src' root: 'docs/src'
7 changes: 3 additions & 4 deletions docs/src/frank.coffee
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,6 @@
{ exec } = require 'child_process' { $ } = require '../../src/utils/shell'


class @Frank class @Frank


'> frank @args': (args, done) -> '> frank @args': (args) ->
exec 'coffee src/frank ' + args, (err, @out) -> done err $ 'coffee src/frank ' + args

23 changes: 23 additions & 0 deletions src/readers/github.coffee
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,23 @@
fs = require 'fs'
{ $ } = require '../utils/shell'
docs = require './docs'

@read = -> new Github().read()

class Github

constructor: ->
settings.docs.root = settings.docs.repo.match(/.*\/(.*)?.git$/)[1]

read: ->
@clone()
try docs.read()
finally @cleanup()

clone: -> $ 'git clone ' + settings.docs.repo

cleanup: -> $ @rmdir() + settings.docs.root

rmdir: -> if @windows() then 'rd /s /q ' else 'rm -r -f '

windows: -> process.platform[0..2] is 'win'
3 changes: 3 additions & 0 deletions src/utils/shell.coffee
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,3 @@
p = require 'child_process'

@$ = (command) -> p.sync.exec command

0 comments on commit e989f8d

Please sign in to comment.