Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
* update angular promise library
* use .then() instead of .promise()
* create non-minifed dist file
* move promise library from bower deps to npm dev deps
* create npm reference
* update readme

(close #7)
  • Loading branch information
JohnnyTheTank committed Jan 9, 2016
1 parent d15e8f2 commit 8eec411
Show file tree
Hide file tree
Showing 10 changed files with 559 additions and 96 deletions.
36 changes: 24 additions & 12 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,48 @@
module.exports = function(grunt) {

var banner = '/**\n @name: <%= pkg.name %> \n @version: <%= pkg.version %> (<%= grunt.template.today("dd-mm-yyyy") %>) \n @author: <%= pkg.author %> \n @url: <%= pkg.homepage %> \n @license: <%= pkg.license %>\n*/\n';

var files = [
'src/aping-github-directive.js',
'src/aping-github-helper.js',
'node_modules/angular-github-api-factory/src/angular-github-api-factory.js'
];

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
js: {
files : {
'dist/aping-plugin-github.min.js' : [
'src/aping-github-directive.js',
'src/aping-github-helper.js',
'bower_components/angular-github-api-factory/src/angular-github-api-factory.js'
]
'dist/aping-plugin-github.min.js' : files
}
},
options: {
banner: '\n/*! <%= pkg.name %> v<%= pkg.version %> (<%= grunt.template.today("dd-mm-yyyy") %>) by <%= pkg.author %> */\n',
banner: banner,
}
},
concat: {
options: {
separator: ';',
banner: banner,
},
dist: {
files : {
'dist/aping-plugin-github.js' : files
}
},
},
watch: {
minifiyJs: {
files: [
'src/aping-github-directive.js',
'src/aping-github-helper.js',
'bower_components/angular-github-api-factory/src/angular-github-api-factory.js'
],
tasks: ['uglify'],
files: files,
tasks: ['uglify', 'concat'],
options: {
spawn: true,
}
}
}
});

grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');

Expand Down
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,40 @@

# Information
* **Supported apiNG models: `repo`**
* Used promise library: [angular-github-api-factory](https://github.com/JohnnyTheTank/angular-github-api-factory) _(included in minified distribution file)_
* Used promise library: [angular-github-api-factory](https://github.com/JohnnyTheTank/angular-github-api-factory) _(included in distribution files)_

# Documentation
I. INSTALLATION
II. API KEY
III. USAGE

## I. INSTALLATION
a) Get files
b) Include files
a) Get file
b) Include file
c) Add dependencies
d) Add the plugin

### a) Get files
### a) Get file
You can choose your preferred method of installation:

* Via bower: `bower install apiNG-plugin-github --save`
* Download from github: [apiNG-plugin-github.zip](https://github.com/JohnnyTheTank/apiNG-plugin-github/zipball/master)
Install via either [bower](http://bower.io/), [npm](https://www.npmjs.com/) or downloaded files:

### b) Include files
* `bower install apiNG-plugin-github --save`
* `npm install aping-plugin-github --save`
* download [apiNG-plugin-github.zip](https://github.com/JohnnyTheTank/apiNG-plugin-github/zipball/master)

### b) Include file
Include `aping-plugin-github.min.js` in your apiNG application

```html
<!-- when using bower -->
<script src="bower_components/apiNG-plugin-github/dist/aping-plugin-github.min.js"></script>

<!-- when using npm -->
<script src="node_modules/aping-plugin-github/dist/aping-plugin-github.min.js"></script>

<!-- when using downloaded files -->
<script src="aping-plugin-github.min.js"></script>
```

### c) Add dependencies
Expand Down
7 changes: 3 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"authors": [
"Jonathan Hornung <jonathan.hornung@gmail.com>"
],
"version": "0.6.0",
"version": "0.7.0",
"description": "github plugin for apiNG",
"main": "dist/apiNG-plugin-github.min.js",
"main": "dist/aping-plugin-github.min.js",
"moduleType": [],
"keywords": [
"aping",
Expand All @@ -25,7 +25,6 @@
"tests"
],
"dependencies": {
"apiNG": "*",
"angular-github-api-factory": "*"
"apiNG": "*"
}
}
4 changes: 3 additions & 1 deletion demo/aping-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
apingApp.config(['$provide', function ($provide) {

$provide.constant("apingApiKeys", {
'github': [{'access_token':'<YOUR_GITHUB_ACCESS_TOKEN>'}]
'github': [
{'access_token':'<YOUR_GITHUB_ACCESS_TOKEN>'},
]
});

$provide.constant("apingDefaultSettings", {
Expand Down
21 changes: 10 additions & 11 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@
<script src="../bower_components/apiNG/dist/aping.min.js"></script>
<script src="aping-config.js"></script>
<script src="app.js"></script>
<script src="../bower_components/angular-github-api-factory/src/angular-github-api-factory.js"></script>
<script src="../src/aping-github-directive.js"></script>
<script src="../src/aping-github-helper.js"></script>
<script src="../dist/aping-plugin-github.js"></script>
</head>
<body ng-app="app">
<h1>Repos by User</h1>
<aping model="repo" items="40" aping-github="[{'user':'JohnnyTheTank'}]"></aping>
<hr>
<h1>Repo by User and Name</h1>
<aping model="repo" items="40" aping-github="[{'user':'JohnnyTheTank', 'repo':'apiNG'}]"></aping>
<hr>
<h1>Repos by Name</h1>
<aping model="repo" items="20" aping-github="[{'search':'apiNG', 'sort':'stars', 'order':'desc'}]"></aping>

<!--
<h1>Activity by User</h1>
<aping
Expand All @@ -23,13 +30,5 @@ <h1>Activity by User</h1>
</aping>
<hr>
-->
<h1>Repos by User</h1>
<aping model="repo" items="40" aping-github="[{'user':'JohnnyTheTank'}]"></aping>
<hr>
<h1>Repo by User and Name</h1>
<aping model="repo" items="40" aping-github="[{'user':'JohnnyTheTank', 'repo':'apiNG'}]"></aping>
<hr>
<h1>Repos by Name</h1>
<aping model="repo" items="20" aping-github="[{'search':'apiNG', 'sort':'stars', 'order':'desc'}]"></aping>
</body>
</html>
Loading

0 comments on commit 8eec411

Please sign in to comment.