Skip to content

Commit

Permalink
changing the app name to githubContributors (costing 2 more lines)
Browse files Browse the repository at this point in the history
  • Loading branch information
daha committed Jul 18, 2012
1 parent bd649c2 commit 64f3d1c
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -13,7 +13,7 @@ Known differenses between this port and the original app:
* No pluralization of the word _contributor_ in the on hover title, of
the contributors thumbs.
* One more json query to GitHub, 4 instead of 3.
* Fewer lines of javascript code, 91 compared to 387, excluding lines
* Fewer lines of javascript code, 93 compared to 387, excluding lines
with comments and empty lines!

Demo
Expand Down
2 changes: 1 addition & 1 deletion app/index-e2e.html
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en" ng-app="ghContribE2E">
<html lang="en" ng-app="githubContributorsE2E">

<head>
<meta charset="utf-8">
Expand Down
2 changes: 1 addition & 1 deletion app/index.html
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en" ng-app="ghContrib">
<html lang="en" ng-app="githubContributors">

<head>
<meta charset="utf-8">
Expand Down
2 changes: 1 addition & 1 deletion app/js/app.js
Expand Up @@ -34,7 +34,7 @@
/*globals angular,SearchCtrl */

// Declare app level module which depends on filters, and services
angular.module('ghContrib', ['ghContrib.services']).
angular.module('githubContributors', ['githubContributors.services']).
config(['$routeProvider', function ($routeProvider) {
'use strict';
$routeProvider.when('/', {
Expand Down
32 changes: 17 additions & 15 deletions app/js/services.js
Expand Up @@ -33,20 +33,22 @@
// OF THE POSSIBILITY OF SUCH DAMAGE.
/*globals angular */

angular.module('ghContrib.services', ['ngResource'], function ($provide) {
'use strict';
$provide.factory('githubResource', function ($resource) {
return $resource('https://api.github.com/:query/:user/:repo/:spec', {
'query': 'users',
'user': 'angular',
'repo': 'repos',
'spec': '',
'callback': 'JSON_CALLBACK',
'per_page': 100
}, {
'get': {
'method': 'JSONP'
}
angular.module('githubContributors.services', ['ngResource'],
function ($provide) {
'use strict';
$provide.factory('githubResource', function ($resource) {
return $resource('https://api.github.com/:query/:user/:repo/:spec',
{
'query': 'users',
'user': 'angular',
'repo': 'repos',
'spec': '',
'callback': 'JSON_CALLBACK',
'per_page': 100
}, {
'get': {
'method': 'JSONP'
}
});
});
});
});
2 changes: 1 addition & 1 deletion scripts/create-e2e-html.sh
Expand Up @@ -4,7 +4,7 @@ infile=$1
dir=`dirname $infile`
outfile=$dir/index-e2e.html

sed -e 's/ng-app="ghContrib"/ng-app="ghContribE2E"/' \
sed -e 's/ng-app="githubContributors"/ng-app="githubContributorsE2E"/' \
-e '/lib\/angular\/angular.js/a \
<script src="../test/lib/angular/angular-mocks.js"></script>
' -e '/js\/app.js/a \
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/app-e2e.js
@@ -1,6 +1,6 @@
/*globals angular,githubResponses */

angular.module('ghContribE2E', ['ghContrib', 'ngMockE2E'])
angular.module('githubContributorsE2E', ['githubContributors', 'ngMockE2E'])
.run(function ($httpBackend) {
'use strict';
$httpBackend.whenGET(/^partials\/[\s]*/).passThrough();
Expand Down
1 change: 0 additions & 1 deletion test/e2e/scenarios.js
Expand Up @@ -141,7 +141,6 @@ describe('GitHub Contributors with mocked data', function () {
expect(element('li:nth-child(3) .repo-forks').text())
.toMatch(/\bFork\b/);
});

});

describe('user bar (no name, and 1 repo and 1 follower)', function () {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/controllersSpec.js
Expand Up @@ -45,7 +45,7 @@ describe('GitHub Contributors controllers', function () {
expect(scope[model].other).toEqual(other);
}

beforeEach(module('ghContrib.services'));
beforeEach(module('githubContributors.services'));
beforeEach(inject(
function ($rootScope, $controller, $routeParams, $httpBackend) {
rootScope = $rootScope;
Expand Down

0 comments on commit 64f3d1c

Please sign in to comment.