Skip to content

Commit

Permalink
Add lots of new blank files
Browse files Browse the repository at this point in the history
  • Loading branch information
blittle committed Apr 2, 2013
1 parent 635e0ef commit bd42d78
Show file tree
Hide file tree
Showing 40 changed files with 1,194 additions and 231 deletions.
12 changes: 9 additions & 3 deletions .idea/libraries/Generated_files.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 0 additions & 49 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

398 changes: 314 additions & 84 deletions .idea/workspace.xml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -4,6 +4,8 @@
"description": "Bootstrap template for typescript projects",
"author": "Bret Little",
"dependencies": {
"numeral": "latest",
"underscore": "latest"
},
"devDependencies": {
"jasmine-node": "latest",
Expand Down
12 changes: 0 additions & 12 deletions spec/AutoScopeSpec.js

This file was deleted.

1 change: 0 additions & 1 deletion spec/AutoScopeSpec.js.map

This file was deleted.

18 changes: 0 additions & 18 deletions spec/AutoScopeSpec.ts

This file was deleted.

32 changes: 32 additions & 0 deletions spec/file/FileUtilsSpec.ts
@@ -0,0 +1,32 @@
///<reference path="../../typescript-def/jasmine.d.ts"/>

import FileUtils = module("../../src/file/FileUtils");

describe("File Utils", () => {

var tempPath = "temp.out",
data = [
["some value", "2", "3", 4],
["test", "3", "dsf"]
];

it("Should write a csv file", () => {
FileUtils.FileUtils.writeCSV(data, tempPath, (err) => {
expect(err).toBeNull();
});
});

it("Should read a csv file", (done) => {
FileUtils.FileUtils.writeCSV(data, tempPath, () => {
FileUtils.FileUtils.readCSV("temp.out", (err, readObject) => {
expect(readObject).toBeDefined();
expect(readObject.length).toEqual(2);
expect(readObject[0][2]).toEqual("3");
expect(readObject[0][3]).toEqual('4');
expect(readObject[1][2]).toEqual("dsf");
done();
});
});
});

});
22 changes: 0 additions & 22 deletions src/AutoScope.ts

This file was deleted.

Empty file added src/CGClient.ts
Empty file.
Empty file added src/CGServer.ts
Empty file.
41 changes: 0 additions & 41 deletions src/Telescope.ts

This file was deleted.

Empty file added src/controller/Controller.ts
Empty file.
Empty file added src/controller/dome/Dome.ts
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added src/coordinates/Coordinates.ts
Empty file.
Empty file added src/coordinates/Dec.ts
Empty file.
Empty file added src/coordinates/RightAsc.ts
Empty file.
Empty file added src/coordinates/Spherical.ts
Empty file.
Empty file added src/file/File.ts
Empty file.
51 changes: 51 additions & 0 deletions src/file/FileUtils.ts
@@ -0,0 +1,51 @@
///<reference path="../../typescript-def/node.d.ts"/>
///<reference path="../../typescript-def/underscore.d.ts"/>

import fs = module("fs");
import _ = module("underscore");

export class FileUtils {

/**
* Write an object to a csv file.
* @param obj - A double array, each outer array represents a line in the output csv. Each element of the sub-array
* represents an element in each line of the output csv.
* @param filePath
* @param callback
*/
public static writeCSV(obj: any, filePath: string, callback ?: Function): void {

var outputString = "";

_.each(obj, function(line, i) {
if(i !== 0) outputString += "\r\n";

_.each(line, function(el, i) {
outputString += i === 0 ? el : "," + el;
});
});

fs.writeFile(filePath, outputString, callback);
}

public static readCSV(filePath: string, callback ?: Function): void {
fs.readFile(filePath, (err, data) => {
var lines;

if(err) callback(err);

lines = (data+"").split("\r\n");

_.each(lines, (line, i) => {
lines[i] = (line+"").split(",");
});

callback(null, lines);

});
}

public static writeJSON(obj: Object, filePath: string): void {

}
}
Empty file added src/observation/Image.ts
Empty file.
Empty file added src/observation/Observation.ts
Empty file.
Empty file.
Empty file added src/observatoroy/Observatory.ts
Empty file.
Empty file added src/permissions/org.ts
Empty file.
Empty file added src/permissions/user.ts
Empty file.
2 changes: 2 additions & 0 deletions temp.out
@@ -0,0 +1,2 @@
some value,2,3,4
test,3,dsf
2 changes: 1 addition & 1 deletion typescript-def/jasmine.d.ts
Expand Up @@ -4,7 +4,7 @@

declare function describe(description : string, specDefinitions : () => void ): void;
declare function xdescribe(description : string, specDefinitions : () => void ): void;
declare function it(description : string, func : () => void ): void;
declare function it(description : string, func : (done ?: () => void ) => void ): void;
declare function xit(description : string, func : () => void ): void;
declare function expect(actual: any): jasmine.Matchers;
declare function beforeEach(afterEachFunction:() => void ): void;
Expand Down
1 change: 1 addition & 0 deletions typescript-def/node.d.ts
Expand Up @@ -787,6 +787,7 @@ import stream = module("stream");
export function readFileSync(filename: string): NodeBuffer;
export function readFileSync(filename: string, encoding: string): string;
export function writeFile(filename: string, data: any, encoding?: string, callback?: Function): void;
export function writeFile(filename: string, data: any, callback?: Function): void;
export function writeFileSync(filename: string, data: any, encoding?: string): void;
export function appendFile(filename: string, data: any, encoding?: string, callback?: Function): void;
export function appendFileSync(filename: string, data: any, encoding?: string): void;
Expand Down
42 changes: 42 additions & 0 deletions typescript-def/numeraljs.d.ts
@@ -0,0 +1,42 @@
// Type definitions for Numeral.js
// Project: https://github.com/adamwdraper/Numeral-js
// Definitions by: Vincent Bortone <https://github.com/vbortone/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

interface NumeralJSLanguage {
delimiters: {
thousands: string;
decimal: string;
};
abbreviations: {
thousand: string;
million: string;
billion: string;
trillion: string;
};
ordinal(num: number): string;
currency: {
symbol: string;
};
}

interface Numeral {
(value?: any): Numeral;
version: string;
isNumeral: bool;
language(key: string, values?: NumeralJSLanguage): Numeral;
zeroFormat(format: string): string;
clone(): Numeral;
format(inputString: string): string;
unformat(inputString: string): number;
value(): number;
valueOf(): number;
set (value: any): Numeral;
add(value: any): Numeral;
subtract(value: any): Numeral;
multiply(value: any): Numeral;
divide(value: any): Numeral;
difference(value: any): number;
}

declare var numeral: Numeral;

0 comments on commit bd42d78

Please sign in to comment.