This repository has been archived by the owner on Oct 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c6381da
Showing
15 changed files
with
339 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<template name="Constellation_anti_gravity_header"> | ||
</template> | ||
|
||
<template name="Constellation_anti_gravity_menu"> | ||
<div style="text-indent: 8px;"><button>Check Packages</button></div> | ||
</template> | ||
|
||
<template name="Constellation_anti_gravity_main"> | ||
{{#unless mainContent.error}} | ||
{{#unless mainContent.loading}} | ||
{{#each package in mainContent.packages}} | ||
<strong><a href="https://atmospherejs.com/{{convertPackageName package.packageName}}" target="_blank">{{package.packageName}}</a></strong><br> | ||
App Version: {{package.currentAppVersion}}<br> | ||
Latest Verison: {{package.latestMeteorVersion}}<br> | ||
Publish Date: {{package.publishDate}}<br><br> | ||
{{/each}} | ||
{{else}} | ||
Checking... | ||
{{/unless}} | ||
{{else}} | ||
Theres and error {{mainContent.error}} | ||
{{/unless}} | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var Constellation = Package["constellation:console"].API; | ||
|
||
Constellation.addTab({ | ||
name: 'Anti-Gravity', | ||
headerContentTemplate: 'Constellation_anti_gravity_header', | ||
menuContentTemplate: 'Constellation_anti_gravity_menu', | ||
mainContentTemplate: 'Constellation_anti_gravity_main' | ||
}); | ||
|
||
var mainContent = new ReactiveVar(null); | ||
|
||
Template.Constellation_anti_gravity_main.helpers({ | ||
mainContent: function() { | ||
return mainContent.get(); | ||
}, | ||
convertPackageName: function(packageName) { | ||
return packageName.replace(':', '/'); | ||
} | ||
}); | ||
|
||
Template.Constellation_anti_gravity_menu.helpers({ | ||
dictionaries: function() {}, | ||
selected: function() { | ||
return true; | ||
}, | ||
}); | ||
|
||
Template.Constellation_anti_gravity_menu.events({ | ||
'click button': function(evt, tmpl) { | ||
mainContent.set({ | ||
loading: true, | ||
}); | ||
Meteor.call('fourquet:anti-gravity/package-difference', function(error, result) { | ||
if (error) { | ||
mainContent.set({ | ||
error: error, | ||
}); | ||
} else { | ||
mainContent.set({ | ||
packages: result, | ||
}); | ||
} | ||
}); | ||
}, | ||
}); | ||
|
||
Meteor.subscribe('atmosPackages'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file contains information which helps Meteor properly upgrade your | ||
# app when you run 'meteor update'. You should check it into version control | ||
# with your project. | ||
|
||
notices-for-0.9.0 | ||
notices-for-0.9.1 | ||
0.9.4-platform-file | ||
notices-for-facebook-graph-api-2 | ||
1.2.0-standard-minifiers-package | ||
1.2.0-meteor-platform-split | ||
1.2.0-cordova-changes | ||
1.2.0-breaking-changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file contains a token that is unique to your project. | ||
# Check it into your repository along with the rest of this directory. | ||
# It can be used for purposes such as: | ||
# - ensuring you don't accidentally deploy one app on top of another | ||
# - providing package authors with aggregated statistics | ||
|
||
1ax9qksihweyuq0ftkl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Meteor packages used by this project, one per line. | ||
# Check this file (and the other files in this directory) into your repository. | ||
# | ||
# 'meteor add' and 'meteor remove' will edit this file for you, | ||
# but you can also edit it by hand. | ||
|
||
autopublish | ||
insecure | ||
standard-minifiers | ||
meteor-base | ||
mobile-experience | ||
mongo | ||
blaze-html-templates | ||
session | ||
jquery | ||
tracker | ||
logging | ||
reload | ||
random | ||
ejson | ||
spacebars | ||
check | ||
old-package-tester | ||
fortawesome:fontawesome | ||
fourquet:anti-gravity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
server | ||
browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<head> | ||
<title>Anti-Gravity Example</title> | ||
</head> | ||
|
||
<body> | ||
<h1>Welcome to Anti-Gravity!</h1> | ||
Press <b>Control + C</b> to open Constellation Console. | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Package.describe({ | ||
name: 'old-package-tester', | ||
version: '0.0.1', | ||
summary: '', | ||
git: '', | ||
documentation: '' | ||
}); | ||
|
||
Package.onUse(function(api) { | ||
api.versionsFrom('1.0'); | ||
api.use('momentjs:moment'); | ||
api.imply('momentjs:moment'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Package.describe({ | ||
name: 'fourquet:anti-gravity', | ||
version: '1.0.0', | ||
summary: '', | ||
git: '', | ||
documentation: 'README.md', | ||
debugOnly: true | ||
}); | ||
|
||
Package.onUse(function(api) { | ||
api.versionsFrom('1.0'); | ||
api.use([ | ||
'templating', | ||
'session', | ||
'blaze', | ||
'underscore', | ||
'ejson', | ||
'tracker', | ||
'reactive-var', | ||
'reactive-dict', | ||
'constellation:[email protected]', | ||
], | ||
'client'); | ||
api.imply('constellation:console'); | ||
api.use([ | ||
'ddp', | ||
'http', | ||
'[email protected]', | ||
]); | ||
|
||
api.addFiles([ | ||
'anti-gravity.html', | ||
'anti-gravity.js' | ||
], 'client'); | ||
api.addFiles('server.js', 'server'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
var fs = Npm.require('fs'); | ||
var Future = Npm.require('fibers/future'); | ||
|
||
Meteor.methods({ | ||
'fourquet:anti-gravity/app-package-information': function() { | ||
var filePath = process.env.PWD + '/.meteor/versions'; | ||
var packages = []; | ||
var packageNameString = ''; | ||
var future = new Future(); | ||
fs.exists(filePath, function(exists) { | ||
if (exists) { | ||
fs.readFile(filePath, function(err, data) { | ||
var bufferString = data.toString(); | ||
var bufferStringSplit = bufferString.split('\n'); | ||
if (bufferStringSplit[bufferStringSplit.length - 1] === '') { | ||
bufferStringSplit.pop(); | ||
} | ||
bufferStringSplit.map(function(item) { | ||
packageNameString += (packageNameString === '') ? item.split('@')[0] : ',' + item.split('@')[0]; | ||
packages.push(objectify(item)); | ||
}); | ||
future.return({ | ||
packageNameString: packageNameString, | ||
packages: packages, | ||
}); | ||
}); | ||
} | ||
}); | ||
return future.wait(); | ||
}, | ||
'fourquet:anti-gravity/meteor-package-information': function(packageNameString) { | ||
var url = 'https://atmospherejs.com/a/packages/findByNames?names=' + packageNameString; | ||
var future = new Future(); | ||
var result = HTTP.get(url, { | ||
timeout: 30000, | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, | ||
}, Meteor.bindEnvironment(function(error, result) { | ||
if (error) { | ||
future.throw(error); | ||
} else { | ||
future.return(result.data); | ||
} | ||
})); | ||
return future.wait(); | ||
}, | ||
'fourquet:anti-gravity/package-difference': function() { | ||
var future = new Future(); | ||
Meteor.call('fourquet:anti-gravity/app-package-information', function(error, result) { | ||
if (error) { | ||
future.throw(error); | ||
} else { | ||
future.return(result); | ||
} | ||
}); | ||
var appPackageInfo = future.wait(); | ||
var meteorPackageInformation = Meteor.call('fourquet:anti-gravity/meteor-package-information', appPackageInfo.packageNameString); | ||
var appPackages = _.reduce(appPackageInfo.packages, function(memo, package) { | ||
return _.extend(memo, package); | ||
}, {}); | ||
var packageDifferences = []; | ||
_.each(meteorPackageInformation, function(meteorPackage) { | ||
if (appPackages[meteorPackage.name] && | ||
appPackages[meteorPackage.name] !== | ||
meteorPackage.latestVersion.version) { | ||
var d = new Date(); | ||
d.setTime(meteorPackage.latestVersion.published.$date); | ||
var publishDate = (d.getMonth() + 1) + '/' + d.getDate() + '/' + d.getFullYear(); | ||
packageDifferences.push({ | ||
packageName: meteorPackage.name, | ||
currentAppVersion: appPackages[meteorPackage.name], | ||
latestMeteorVersion: meteorPackage.latestVersion.version, | ||
publishDate: publishDate, | ||
}); | ||
} | ||
}); | ||
return packageDifferences; | ||
}, | ||
}); | ||
|
||
function objectify(item) { | ||
var itemSplit = {}; | ||
itemSplit[[item.split('@')[0]]] = item.split('@')[1]; | ||
return itemSplit; | ||
}; |