robeaux 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/README.markdown +41 -61
  3. data/css/application.css +2 -0
  4. data/css/application.css.map +7 -0
  5. data/index.html +5 -39
  6. data/js/script.js +7 -0
  7. data/robeaux.gemspec +16 -8
  8. metadata +11 -104
  9. data/.gitignore +0 -1
  10. data/Gruntfile.js +0 -43
  11. data/Makefile +0 -22
  12. data/css/fonts.css +0 -59
  13. data/css/main.css +0 -1
  14. data/css/normalize.css +0 -425
  15. data/css/style.css +0 -558
  16. data/css/themes/artoo.css +0 -3
  17. data/css/themes/blackboard.css +0 -1
  18. data/css/themes/cylon.css +0 -3
  19. data/css/themes/dark.css +0 -1
  20. data/css/themes/gobot.css +0 -3
  21. data/css/themes/gray.css +0 -1
  22. data/css/themes/whiteboard.css +0 -1
  23. data/js/app.js +0 -1
  24. data/js/controllers/device_commands_ctrl.js +0 -81
  25. data/js/controllers/device_events_ctrl.js +0 -31
  26. data/js/controllers/index_ctrl.js +0 -9
  27. data/js/controllers/nav_ctrl.js +0 -5
  28. data/js/controllers/robot_commands_ctrl.js +0 -33
  29. data/js/controllers/robot_ctrl.js +0 -25
  30. data/js/controllers/themes_ctrl.js +0 -36
  31. data/js/controllers/widget_editor_ctrl.js +0 -44
  32. data/js/controllers/widgets_ctrl.js +0 -40
  33. data/js/directives/widget.js +0 -50
  34. data/js/router.js +0 -27
  35. data/js/services/themes.js +0 -90
  36. data/js/services/widgets.js +0 -86
  37. data/js/vendor/angular-route.min.js +0 -13
  38. data/js/vendor/angular.min.js +0 -212
  39. data/js/widgets/attitude.html +0 -32
  40. data/js/widgets/attitude.js +0 -27
  41. data/js/widgets/mindwave.html +0 -51
  42. data/js/widgets/mindwave.js +0 -23
  43. data/less/app.less +0 -21
  44. data/less/objects/buttons.less +0 -32
  45. data/less/objects/connections.less +0 -28
  46. data/less/objects/device.less +0 -30
  47. data/less/objects/forms.less +0 -29
  48. data/less/objects/list.less +0 -27
  49. data/less/objects/nav.less +0 -33
  50. data/less/objects/robot.less +0 -43
  51. data/less/objects/themes.less +0 -18
  52. data/less/objects/widgets.less +0 -85
  53. data/less/support/buttons.less +0 -39
  54. data/less/support/container.less +0 -9
  55. data/less/support/forms.less +0 -18
  56. data/less/support/mixins.less +0 -3
  57. data/less/themes/blackboard.less +0 -158
  58. data/less/themes/dark.less +0 -148
  59. data/less/themes/default.less +0 -52
  60. data/less/themes/gray.less +0 -121
  61. data/less/themes/whiteboard.less +0 -152
  62. data/less/vendor/elements.less +0 -156
  63. data/less/vendor/normalize.less +0 -425
  64. data/less/vendor/semantic-grid.less +0 -67
  65. data/less/views/devices.less +0 -47
  66. data/less/views/robots.less +0 -132
  67. data/less/views/themes.less +0 -31
  68. data/less/views/widgets.less +0 -50
  69. data/package.json +0 -21
  70. data/partials/device.html +0 -76
  71. data/partials/index.html +0 -17
  72. data/partials/robot.html +0 -127
  73. data/partials/themes.html +0 -42
  74. data/partials/widget_editor.html +0 -68
  75. data/test/controllers/device_commands_ctrl.js +0 -129
  76. data/test/controllers/device_events_ctrl.js +0 -82
  77. data/test/controllers/index_ctrl.js +0 -48
  78. data/test/controllers/nav_ctrl.js +0 -40
  79. data/test/controllers/robot_commands_ctrl.js +0 -127
  80. data/test/controllers/robot_ctrl.js +0 -62
  81. data/test/controllers/themes_ctrl.js +0 -96
  82. data/test/controllers/widget_editor_ctrl.js +0 -111
  83. data/test/controllers/widgets_ctrl.js +0 -74
  84. data/test/functions/functions.js +0 -30
  85. data/test/karma.conf.js +0 -76
  86. data/test/karma_test_all.conf.js +0 -23
  87. data/test/karma_test_controllers.conf.js +0 -19
  88. data/test/karma_test_functions.conf.js +0 -14
  89. data/test/karma_test_services.conf.js +0 -17
  90. data/test/services/themes.js +0 -122
  91. data/test/services/widgets.js +0 -104
  92. data/test/support/myDevice.json +0 -15
  93. data/test/support/myRobot.json +0 -31
  94. data/test/support/robots.json +0 -33
  95. data/test/support/themes.json +0 -9
  96. data/test/support/widgets.json +0 -18
  97. data/test/vendor/angular-mocks.js +0 -2163
  98. data/test/vendor/jasmine-jquery.js +0 -704
  99. data/test/vendor/jquery.js +0 -8755
@@ -1,48 +0,0 @@
1
- describe("Testing Controllers", function() {
2
- describe('Controller IndexCtrl:', function() {
3
-
4
- beforeEach(module('robeaux'));
5
-
6
- var $scope, $rootScope, $httpBackend, $location, $timeout, testController, data;
7
-
8
- beforeEach(inject(function($injector) {
9
- $timeout = $injector.get('$timeout');
10
- $httpBackend = $injector.get('$httpBackend');
11
- $rootScope = $injector.get('$rootScope');
12
- $location = $injector.get('$location');
13
- $scope = $rootScope.$new();
14
-
15
- var $controller = $injector.get('$controller');
16
-
17
- testController = function() {
18
- return $controller('IndexCtrl', {
19
- '$scope': $scope
20
- });
21
- };
22
-
23
- var controller = testController();
24
-
25
- jasmine.getJSONFixtures().fixturesPath='base/test/support';
26
- data = loadJSONFixtures('robots.json')['robots.json'];
27
- $httpBackend.expect('GET', '/api/robots').respond(data);
28
- $httpBackend.flush();
29
- }));
30
-
31
- afterEach(function() {
32
- $httpBackend.verifyNoOutstandingExpectation();
33
- $httpBackend.verifyNoOutstandingRequest();
34
- });
35
-
36
- it('should get array of robots', function() {
37
- expect($scope.robots).toEqual(data.robots);
38
- });
39
-
40
- describe('details:', function() {
41
- it('should redirect to robot show page', function() {
42
- expect($location.path()).toEqual('');
43
- $scope.details(data.robots[0].name);
44
- expect($location.path()).toEqual('/robots/' + data.robots[0].name);
45
- });
46
- });
47
- });
48
- });
@@ -1,40 +0,0 @@
1
- describe("Testing Controllers", function() {
2
- describe('Controller NavCtrl:', function() {
3
-
4
- beforeEach(module('robeaux'));
5
-
6
- var $scope, $rootScope, $httpBackend, $location, $timeout, testController;
7
-
8
- beforeEach(inject(function($injector) {
9
- $timeout = $injector.get('$timeout');
10
- $httpBackend = $injector.get('$httpBackend');
11
- $rootScope = $injector.get('$rootScope');
12
- $location = $injector.get('$location');
13
- $scope = $rootScope.$new();
14
-
15
- var $controller = $injector.get('$controller');
16
-
17
- testController = function() {
18
- return $controller('NavCtrl', {
19
- '$scope': $scope
20
- });
21
- };
22
-
23
- var controller = testController();
24
- }));
25
-
26
- afterEach(function() {
27
- $httpBackend.verifyNoOutstandingExpectation();
28
- $httpBackend.verifyNoOutstandingRequest();
29
- });
30
-
31
- describe('active:', function() {
32
- it('should return if current path is the same as the location path', function() {
33
- $location.path('robots');
34
-
35
- expect($scope.active('robots')).toEqual(true);
36
- expect($scope.active('robots/myRobot')).toEqual(false);
37
- });
38
- });
39
- });
40
- });
@@ -1,127 +0,0 @@
1
- describe("Testing Controllers", function() {
2
- describe('Controller RobotCommandsCtrl:', function() {
3
-
4
- beforeEach(module('robeaux'));
5
-
6
- var $scope, $rootScope, $httpBackend, $timeout, $routeParams, testController;
7
- var $injector = angular.injector(['robeaux', 'ng']);
8
-
9
- beforeEach(inject(function($injector) {
10
- $timeout = $injector.get('$timeout');
11
- $httpBackend = $injector.get('$httpBackend');
12
- $rootScope = $injector.get('$rootScope');
13
- $routeParams = $injector.get('$routeParams');
14
- $scope = $rootScope.$new();
15
-
16
- var $controller = $injector.get('$controller');
17
-
18
- testController = function() {
19
- return $controller('RobotCommandsCtrl', {
20
- '$scope': $scope
21
- });
22
- };
23
- var controller = testController();
24
-
25
- jasmine.getJSONFixtures().fixturesPath='base/test/support';
26
- var data = loadJSONFixtures('myRobot.json')['myRobot.json'];
27
- $scope.robot = data.robot;
28
- $scope.robot.params = [ { name: '', value: '', type: 'string' } ];
29
- $scope.robot.results = [];
30
- }));
31
-
32
- afterEach(function() {
33
- $httpBackend.verifyNoOutstandingExpectation();
34
- $httpBackend.verifyNoOutstandingRequest();
35
- });
36
-
37
- describe('command:', function() {
38
- it('should be an empty string', function (){
39
- expect($scope.command).toBe("");
40
- });
41
- });
42
-
43
- describe('command types:', function() {
44
- it('should be an array of string, boolean and number', function (){
45
- var command_types = [ 'string', 'boolean', 'number' ];
46
- expect($scope.types).toEqual(command_types);
47
- });
48
- });
49
-
50
- describe('isDisabled:', function() {
51
- it('should return true if command is empty', function (){
52
- expect($scope.isDisabled()).toBe(true);
53
- });
54
-
55
- it('should return false if command exist', function (){
56
- $scope.command = 'test_command'
57
- expect($scope.isDisabled()).toBe(false);
58
- });
59
- });
60
-
61
- describe('addParam:', function() {
62
- it('should add params if last', function (){
63
- expect($scope.robot.params.length).toBe(1)
64
- $scope.addParam($scope.robot);
65
- expect($scope.robot.params.length).toBe(2)
66
- });
67
-
68
- it('should not add params if not last', function (){
69
- expect($scope.robot.params.length).toBe(1)
70
- $scope.addParam();
71
- expect($scope.robot.params.length).toBe(1)
72
- });
73
- });
74
-
75
- describe('removeParam:', function() {
76
- it('should remove param if there is more than one', function (){
77
- $scope.robot.params = [
78
- { name: '', value: '', type: 'string' },
79
- { name: '', value: '', type: 'string' }
80
- ];
81
-
82
- expect($scope.robot.params.length).toBe(2)
83
- $scope.removeParam($scope.robot);
84
- expect($scope.robot.params.length).toBe(1)
85
- });
86
-
87
- it('should not remove param if there just one', function (){
88
- $scope.robot.params = [
89
- { name: '', value: '', type: 'string' }
90
- ];
91
-
92
- expect($scope.robot.params.length).toBe(1)
93
- $scope.removeParam($scope.robot);
94
- expect($scope.robot.params.length).toBe(1)
95
- });
96
-
97
- it('should remove the correct param passed to the function', function (){
98
- $scope.robot.params = [
99
- { name: 'param1', value: 'value1', type: 'string' },
100
- { name: 'param2', value: 'value2', type: 'string' }
101
- ];
102
-
103
- var param_to_remove = { name: 'param1', value: 'value1', type: 'string' };
104
- var param_to_keep = { name: 'param2', value: 'value2', type: 'string' };
105
-
106
- expect($scope.robot.params[0]).toEqual(param_to_remove)
107
- $scope.removeParam(param_to_remove);
108
- expect($scope.robot.params[0]).toEqual(param_to_keep)
109
- });
110
- });
111
-
112
- describe('submit:', function() {
113
- it('should run command and return results', function (){
114
- $scope.robot.name = "myRobot";
115
- $scope.command = "relax";
116
- $scope.robot.params= [{'name': 'relax', 'value':'true', 'type':'string'}];
117
- var params = {'relax': 'true'};
118
- var data= {'result': "myRobot says relax"};
119
-
120
- $scope.submit();
121
- $httpBackend.expectPOST('/api/robots/myRobot/commands/relax', params).respond(data);
122
- $httpBackend.flush();
123
- expect($scope.robot.results).toEqual([{'result': "myRobot says relax"}])
124
- });
125
- });
126
- });
127
- });
@@ -1,62 +0,0 @@
1
- describe("Testing Controllers", function() {
2
- describe('Controller RobotCtrl:', function() {
3
-
4
- beforeEach(module('robeaux'));
5
-
6
- var $scope, $rootScope, $httpBackend, $timeout, $routeParams, testController;
7
-
8
- beforeEach(inject(function($injector) {
9
- $timeout = $injector.get('$timeout');
10
- $httpBackend = $injector.get('$httpBackend');
11
- $rootScope = $injector.get('$rootScope');
12
- $routeParams = $injector.get('$routeParams');
13
- $scope = $rootScope.$new();
14
-
15
- var $controller = $injector.get('$controller');
16
-
17
- testController = function() {
18
- return $controller('RobotCtrl', {
19
- '$scope': $scope
20
-
21
- });
22
- };
23
- var controller = testController();
24
-
25
- jasmine.getJSONFixtures().fixturesPath='base/test/support';
26
- $httpBackend.expect('GET', '/api/robots/' + $routeParams.robot).respond(loadJSONFixtures('myRobot.json')['myRobot.json']);
27
- $httpBackend.flush();
28
-
29
- }));
30
-
31
- afterEach(function() {
32
- $httpBackend.verifyNoOutstandingExpectation();
33
- $httpBackend.verifyNoOutstandingRequest();
34
- });
35
-
36
- it('should get robot details', function() {
37
- var data = loadJSONFixtures('myRobot.json')['myRobot.json'];
38
- data.robot.params = [ { name: '', value: '', type: 'string' } ];
39
- data.robot.results = [];
40
- expect($scope.robot).toEqual(data.robot);
41
- });
42
-
43
- describe('select:', function() {
44
- it('should select a device', function (){
45
- var robotArray= [{"name": "robo1"},{"name":"robo2"}];
46
- $scope.robot = robotArray;
47
- $scope.select($scope.robot[1]);
48
- expect($scope.robot[1]).toEqual($scope.device);
49
- expect($scope.robot[0]).toNotEqual($scope.device);
50
- });
51
- });
52
-
53
- describe('selected:', function() {
54
- it('should return if device is still selected', function (){
55
- var robotArray= [{"name": "robo1"},{"name":"robo2"}];
56
- $scope.robot = robotArray;
57
- $scope.select($scope.robot);
58
- expect($scope.selected($scope.robot)).toBeTruthy();
59
- });
60
- });
61
- });
62
- });
@@ -1,96 +0,0 @@
1
- describe("Testing Controllers", function() {
2
- describe('Controller ThemesCtrl:', function() {
3
-
4
- beforeEach(module('robeaux'));
5
-
6
- var $scope, $rootScope, $httpBackend, $timeout, $routeParams, testController, data;
7
-
8
- beforeEach(inject(function($injector) {
9
- localStorage.clear();
10
- $timeout = $injector.get('$timeout');
11
- $httpBackend = $injector.get('$httpBackend');
12
- $rootScope = $injector.get('$rootScope');
13
- $routeParams = $injector.get('$routeParams');
14
- $scope = $rootScope.$new();
15
- $scope.themes = $injector.get('Themes')
16
-
17
- var $controller = $injector.get('$controller');
18
-
19
- testController = function() {
20
- return $controller('ThemesCtrl', {
21
- '$scope': $scope
22
-
23
- });
24
- };
25
- var controller = testController();
26
- jasmine.getJSONFixtures().fixturesPath='base/test/support';
27
- data = loadJSONFixtures('themes.json')['themes.json'];
28
-
29
- }));
30
-
31
- afterEach(function() {
32
- $scope.themes = null;
33
- $httpBackend.verifyNoOutstandingExpectation();
34
- $httpBackend.verifyNoOutstandingRequest();
35
- });
36
-
37
- it('should get array of themes', function() {
38
- expect($scope.themes.list).toEqual(data.themes);
39
- });
40
-
41
- describe('add:', function() {
42
- it('should not add theme with empty name', function() {
43
- expect($scope.themes.list.length).toEqual(5);
44
- $scope.add('');
45
- expect($scope.themes.list.length).toEqual(5);
46
- $scope.add();
47
- expect($scope.themes.list.length).toEqual(5);
48
- });
49
-
50
- it('should not add theme if name already exist', function() {
51
- expect($scope.themes.list.length).toEqual(5);
52
- $scope.add('artoo');
53
- expect($scope.themes.list.length).toEqual(5);
54
- });
55
-
56
- it('should add theme', function() {
57
- expect($scope.themes.list.length).toEqual(5);
58
- $scope.add('first theme');
59
- expect($scope.themes.list.length).toEqual(6);
60
- });
61
-
62
- it('should add theme and put it on edit mode', function() {
63
- expect($scope.editing).toEqual(null);
64
- $scope.add('second theme');
65
- expect($scope.editing.name).toEqual('second theme');
66
- });
67
- });
68
-
69
- describe('edit:', function() {
70
- it('should not set theme on edit mode if is not a custom theme', function() {
71
- expect($scope.editing).toEqual(null);
72
- $scope.edit(data.themes[0].name)
73
- expect($scope.editing).toEqual(null);
74
- });
75
-
76
- it('should not set theme on edit mode if theme is already being edited', function() {
77
- expect($scope.editing).toEqual(null);
78
- $scope.add('third theme')
79
- expect($scope.editing.name).toEqual('third theme');
80
-
81
- $scope.edit('third theme');
82
- expect($scope.editing).toEqual(null);
83
- });
84
- });
85
-
86
- describe('remove:', function() {
87
- it('should remove theme', function() {
88
- expect($scope.themes.list.length).toEqual(5);
89
- $scope.remove('artoo');
90
- expect($scope.themes.list.length).toEqual(4);
91
- });
92
- });
93
-
94
-
95
- });
96
- });
@@ -1,111 +0,0 @@
1
- describe("Testing Controllers", function() {
2
- describe('Controller WidgetEditorCtrl:', function() {
3
-
4
- beforeEach(module('robeaux'));
5
-
6
- var $scope, $rootScope, $httpBackend, $timeout, testController, data;
7
-
8
- beforeEach(inject(function($injector) {
9
- localStorage.clear();
10
- $timeout = $injector.get('$timeout');
11
- $httpBackend = $injector.get('$httpBackend');
12
- $rootScope = $injector.get('$rootScope');
13
- $scope = $rootScope.$new();
14
- $scope.widgets = $injector.get('Widgets');
15
-
16
- var $controller = $injector.get('$controller');
17
-
18
- testController = function() {
19
- return $controller('WidgetEditorCtrl', {
20
- '$scope': $scope
21
- });
22
- };
23
-
24
- var controller = testController();
25
- jasmine.getJSONFixtures().fixturesPath='base/test/support';
26
- data = loadJSONFixtures('widgets.json')['widgets.json'];
27
-
28
- }));
29
-
30
- afterEach(function() {
31
- $httpBackend.verifyNoOutstandingExpectation();
32
- $httpBackend.verifyNoOutstandingRequest();
33
- });
34
-
35
- it('should get array of widgets', function() {
36
- expect($scope.widgets.list).toEqual(data.widgets);
37
- });
38
-
39
- describe('add:', function() {
40
- it('should not add widget with empty name', function() {
41
- expect($scope.widgets.list.length).toEqual(2);
42
- $scope.add();
43
- expect($scope.widgets.list.length).toEqual(2);
44
- $scope.add('');
45
- expect($scope.widgets.list.length).toEqual(2);
46
- });
47
-
48
- it('should add widget', function() {
49
- expect($scope.widgets.list.length).toEqual(2);
50
- $scope.add('new widget');
51
- expect($scope.widgets.list.length).toEqual(3);
52
- });
53
-
54
- it('should add widget and put it on edit mode', function() {
55
- expect($scope.editing).toEqual(null);
56
- $scope.add('second widget');
57
- expect($scope.editing.name).toEqual('second widget');
58
- });
59
- });
60
-
61
- describe('edit:', function() {
62
- it('should not set widget on edit mode if is not a custom widget', function() {
63
- expect($scope.editing).toEqual(null);
64
- $scope.edit(data.widgets[0].name)
65
- expect($scope.editing).toEqual(null);
66
- });
67
-
68
- it('should not set widget on edit mode if widget is already being edited', function() {
69
- expect($scope.editing).toEqual(null);
70
- $scope.add('third widget')
71
- expect($scope.editing.name).toEqual('third widget');
72
-
73
- $scope.edit('third widget');
74
- expect($scope.editing).toEqual(null);
75
- });
76
- });
77
-
78
- describe('addAttr:', function() {
79
- it('should not add attr to the widget if widget is not on edit mode', function() {
80
- $scope.newAttr = 'new attr';
81
- expect($scope.editing).toEqual(null);
82
- $scope.addAttr();
83
- expect($scope.editing).toEqual(null);
84
- });
85
-
86
- it('should add attr to the widget if widget is on edit mode', function() {
87
- $scope.editing = $scope.widgets.list[0];
88
- $scope.newAttr = 'new attr';
89
- expect($scope.editing.attrs.length).toEqual(3);
90
- $scope.addAttr();
91
- expect($scope.editing.attrs.length).toEqual(4);
92
- });
93
- });
94
-
95
- describe('removeAttr:', function() {
96
- it('should not remove attr to the widget if widget is not on edit mode', function() {
97
- $scope.newAttr = 'new attr';
98
- expect($scope.editing).toEqual(null);
99
- $scope.removeAttr();
100
- expect($scope.editing).toEqual(null);
101
- });
102
-
103
- it('should remove attr to the widget if widget is on edit mode', function() {
104
- $scope.editing = $scope.widgets.list[0];
105
- expect($scope.editing.attrs.length).toEqual(3);
106
- $scope.removeAttr();
107
- expect($scope.editing.attrs.length).toEqual(2);
108
- });
109
- });
110
- });
111
- });