Skip to content

Commit 71b36bd

Browse files
committed
Merge pull request #55 from zimme/meteor-integration
Add meteor.js packaging
2 parents d17beba + c2046a0 commit 71b36bd

File tree

6 files changed

+96
-3
lines changed

6 files changed

+96
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.build*

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,20 @@ This project orginially started out to be a pull request for [ifightcrime's](htt
1111
- Bootstrap Notifier
1212

1313

14-
## Bower Officially Supported
15-
I would like to thank [Błażej Krysiak](https://github.com/IjinPL) for doing this!
14+
## Official support
15+
16+
### Bower
17+
```
18+
bower install bootstrap.growl
19+
```
20+
Thanks to [Błażej Krysiak](https://github.com/IjinPL)
21+
22+
### Meteor
23+
1624
```
17-
bower install bootstrap.growl
25+
meteor add mouse0270:bootstrap-growl
1826
```
27+
Thanks to [Simon Fridlund](https://github.com/zimme)
1928

2029
## Changelog
2130
##### Version 2.0.1

meteor/package.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
var packageJson = JSON.parse(Npm.require("fs").readFileSync('package.json'));
2+
var packageName = 'mouse0270:bootstrap-growl';
3+
var where = 'client';
4+
5+
Package.describe({
6+
git: 'https://github.com/mouse0270/bootstrap-growl',
7+
name: packageName,
8+
summary: 'Turns standard Bootstrap alerts into "Growl-like" notifications',
9+
version: packageJson.version,
10+
});
11+
12+
Package.onUse(function (api) {
13+
api.versionsFrom('1.0');
14+
api.use('jquery', where);
15+
api.addFiles('bootstrap-growl.js', where);
16+
});
17+
18+
Package.onTest(function (api) {
19+
api.use(packageName, where);
20+
api.use('tinytest', where);
21+
22+
api.addFiles('meteor/test.js', where);
23+
});

meteor/publish.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Publish package on Meteor's Atmosphere.js
2+
3+
# Make sure Meteor is installed, per https://www.meteor.com/install. The curl'ed
4+
# script is totally safe; takes 2 minutes to read its source and check.
5+
type meteor >/dev/null 2>&1 || { curl https://install.meteor.com/ | sh; }
6+
7+
# sanity check: make sure we're in the root directory of the checkout
8+
DIR=$( cd "$( dirname "$0" )" && pwd )
9+
cd $DIR/..
10+
11+
# Meteor expects package.js to be in the root directory of the checkout, so copy
12+
# it there temporarily
13+
cp meteor/package.js ./
14+
15+
# publish package, creating it if it's the first time we're publishing
16+
PACKAGE_NAME=$(grep -i name package.js | head -1 | cut -d "'" -f 2)
17+
PACKAGE_EXISTS=$(meteor search $PACKAGE_NAME 2>/dev/null | wc -l)
18+
19+
if [ $PACKAGE_EXISTS -gt 0 ]; then
20+
meteor publish
21+
else
22+
meteor publish --create
23+
fi
24+
25+
rm package.js

meteor/runtests.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Test Meteor package before publishing to Atmosphere.js
2+
3+
# Make sure Meteor is installed, per https://www.meteor.com/install. The curl'ed
4+
# script is totally safe; takes 2 minutes to read its source and check.
5+
type meteor >/dev/null 2>&1 || { curl https://install.meteor.com/ | sh; }
6+
7+
# sanity check: make sure we're in the root directory of the checkout
8+
DIR=$( cd "$( dirname "$0" )" && pwd )
9+
cd $DIR/..
10+
11+
# Meteor expects package.js to be in the root directory of the checkout, so copy
12+
# it there temporarily
13+
cp meteor/package.js ./
14+
15+
# run tests and delete the temporary package.js even if Ctrl+C is pressed
16+
int_trap() {
17+
echo
18+
echo "Tests interrupted."
19+
}
20+
21+
trap int_trap INT
22+
23+
meteor test-packages ./
24+
25+
PACKAGE_NAME=$(grep -i name package.js | head -1 | cut -d "'" -f 2)
26+
rm -rf ".build.$PACKAGE_NAME"
27+
rm -rf ".build.local-test:$PACKAGE_NAME"
28+
rm versions.json 2>/dev/null
29+
30+
rm package.js

meteor/test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
Tinytest.add('Instantiation', function(test) {
4+
test.notEqual($.growl, undefined);
5+
});

0 commit comments

Comments
 (0)