collection-json-browser 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/javascripts/collection_json_browser/angular.min.js +162 -0
  5. data/app/assets/javascripts/collection_json_browser/angular/controllers/api_controller.js +38 -0
  6. data/app/assets/javascripts/collection_json_browser/application.js +17 -0
  7. data/app/assets/stylesheets/collection_json_browser/application.css +12 -0
  8. data/app/assets/stylesheets/collection_json_browser/bootstrap.css +4960 -0
  9. data/app/controllers/collection_json_browser/application_controller.rb +4 -0
  10. data/app/controllers/collection_json_browser/home_controller.rb +7 -0
  11. data/app/helpers/collection_json_browser/application_helper.rb +4 -0
  12. data/app/views/collection_json_browser/home/index.html +118 -0
  13. data/app/views/layouts/collection_json_browser/application.html.erb +13 -0
  14. data/config/routes.rb +3 -0
  15. data/lib/collection-json-browser.rb +4 -0
  16. data/lib/collection-json-browser/engine.rb +5 -0
  17. data/lib/collection-json-browser/version.rb +3 -0
  18. data/lib/tasks/collection-json-browser_tasks.rake +4 -0
  19. data/test/collection-json-browser_test.rb +7 -0
  20. data/test/dummy/README.rdoc +261 -0
  21. data/test/dummy/Rakefile +7 -0
  22. data/test/dummy/app/assets/images/cat.gif +0 -0
  23. data/test/dummy/app/assets/javascripts/application.js +15 -0
  24. data/test/dummy/app/assets/stylesheets/application.css +20 -0
  25. data/test/dummy/app/controllers/api/application_controller.rb +101 -0
  26. data/test/dummy/app/controllers/api/posts_controller.rb +107 -0
  27. data/test/dummy/app/helpers/application_helper.rb +2 -0
  28. data/test/dummy/app/models/post.rb +3 -0
  29. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  30. data/test/dummy/config.ru +4 -0
  31. data/test/dummy/config/application.rb +59 -0
  32. data/test/dummy/config/boot.rb +10 -0
  33. data/test/dummy/config/database.yml +25 -0
  34. data/test/dummy/config/environment.rb +5 -0
  35. data/test/dummy/config/environments/development.rb +37 -0
  36. data/test/dummy/config/environments/production.rb +67 -0
  37. data/test/dummy/config/environments/test.rb +37 -0
  38. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  39. data/test/dummy/config/initializers/inflections.rb +15 -0
  40. data/test/dummy/config/initializers/mime_types.rb +5 -0
  41. data/test/dummy/config/initializers/secret_token.rb +7 -0
  42. data/test/dummy/config/initializers/session_store.rb +8 -0
  43. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  44. data/test/dummy/config/locales/en.yml +5 -0
  45. data/test/dummy/config/routes.rb +8 -0
  46. data/test/dummy/db/development.sqlite3 +0 -0
  47. data/test/dummy/db/migrate/20130707043713_create_posts.rb +11 -0
  48. data/test/dummy/db/schema.rb +24 -0
  49. data/test/dummy/db/test.sqlite3 +0 -0
  50. data/test/dummy/log/development.log +62530 -0
  51. data/test/dummy/log/test.log +133 -0
  52. data/test/dummy/public/404.html +26 -0
  53. data/test/dummy/public/422.html +26 -0
  54. data/test/dummy/public/500.html +25 -0
  55. data/test/dummy/public/angular-scenario.js +26223 -0
  56. data/test/dummy/public/e2e.html +11 -0
  57. data/test/dummy/public/favicon.ico +0 -0
  58. data/test/dummy/public/links.html +7 -0
  59. data/test/dummy/public/scenarios.js +65 -0
  60. data/test/dummy/script/rails +6 -0
  61. data/test/dummy/tmp/cache/assets/C11/E20/sprockets%2Fa12197364162a50d0a75622881d3751d +0 -0
  62. data/test/dummy/tmp/cache/assets/C40/150/sprockets%2Fa047ea3307600479a1f8295fc4300137 +0 -0
  63. data/test/dummy/tmp/cache/assets/C76/D00/sprockets%2F1141538585172cba9431bc737c1fe290 +0 -0
  64. data/test/dummy/tmp/cache/assets/C9A/610/sprockets%2F0f1cbc34ef00944528423628d2014e0d +0 -0
  65. data/test/dummy/tmp/cache/assets/CB8/F50/sprockets%2F7db66115752dc2d468a6d4852869e31a +0 -0
  66. data/test/dummy/tmp/cache/assets/CC8/CC0/sprockets%2F77ac1342b1ae62c0123f399257a703aa +0 -0
  67. data/test/dummy/tmp/cache/assets/CE5/DB0/sprockets%2F53d6d5203c9d6c96693655151fea1bf3 +0 -0
  68. data/test/dummy/tmp/cache/assets/CF0/4A0/sprockets%2Fdc8ec795245b571236a639c98b183b7e +0 -0
  69. data/test/dummy/tmp/cache/assets/D01/390/sprockets%2F152365a6c64bdbf13d80c22762c0f48b +0 -0
  70. data/test/dummy/tmp/cache/assets/D17/330/sprockets%2F59803fbbf63f56502acdc6710fc47389 +0 -0
  71. data/test/dummy/tmp/cache/assets/D18/FE0/sprockets%2F816d68b6feb37b103be618798b5e0b37 +0 -0
  72. data/test/dummy/tmp/cache/assets/D36/D00/sprockets%2F3a43e8f11605c939cbb04aec364ba775 +0 -0
  73. data/test/dummy/tmp/cache/assets/D58/C00/sprockets%2F7bd61bb28f7ce577f679872a7cc4a477 +0 -0
  74. data/test/dummy/tmp/cache/assets/D69/960/sprockets%2F68d11bd13c04d8959dabbf7680c37b1a +0 -0
  75. data/test/dummy/tmp/cache/assets/D6F/820/sprockets%2F3174b17cc559cf465cd881d7c1ac06dd +0 -0
  76. data/test/dummy/tmp/cache/assets/D74/650/sprockets%2F5c448233c8ef782e60adda4b8f572b6b +0 -0
  77. data/test/dummy/tmp/cache/assets/D97/910/sprockets%2Ff79eba25f30b74073aa198bca71a5ed5 +0 -0
  78. data/test/dummy/tmp/cache/assets/DCC/720/sprockets%2Fc5b1dfb51c6ca4d981cf60f8dc3f6351 +0 -0
  79. data/test/dummy/tmp/cache/assets/DF1/600/sprockets%2F5eabe9a0f53eaa0f7a73d5923d13dad4 +0 -0
  80. data/test/dummy/tmp/cache/assets/DF6/F60/sprockets%2F7e00e27c8a01ced37a4082fcaeee2ee9 +0 -0
  81. data/test/dummy/tmp/cache/assets/DFA/8A0/sprockets%2F59bed50c73a0e1188ff0dc3adbff1d76 +0 -0
  82. data/test/dummy/tmp/cache/assets/E10/600/sprockets%2Ff72f1ec8e8bb832c8b5a960fe3f9ae7d +0 -0
  83. data/test/integration/navigation_test.rb +9 -0
  84. data/test/javascripts/config/karma-e2e.conf.js +22 -0
  85. data/test/javascripts/config/karma.conf.js +19 -0
  86. data/test/javascripts/scripts/e2e-test.bat +11 -0
  87. data/test/javascripts/scripts/e2e-test.sh +9 -0
  88. data/test/javascripts/scripts/private/ScrapeData.js +115 -0
  89. data/test/javascripts/scripts/private/format-json.sh +11 -0
  90. data/test/javascripts/scripts/private/goto_step.bat +15 -0
  91. data/test/javascripts/scripts/private/goto_step.sh +13 -0
  92. data/test/javascripts/scripts/private/push-to-github.sh +7 -0
  93. data/test/javascripts/scripts/private/retag.sh +15 -0
  94. data/test/javascripts/scripts/private/snapshot-web.sh +19 -0
  95. data/test/javascripts/scripts/private/snapshot.sh +43 -0
  96. data/test/javascripts/scripts/test.bat +11 -0
  97. data/test/javascripts/scripts/test.sh +9 -0
  98. data/test/javascripts/scripts/update-repo.sh +13 -0
  99. data/test/javascripts/scripts/watchr.rb +19 -0
  100. data/test/javascripts/scripts/web-server.js +244 -0
  101. data/test/javascripts/test/e2e/scenarios.js +65 -0
  102. data/test/javascripts/test/lib/angular/angular-mocks.js +1768 -0
  103. data/test/javascripts/test/lib/angular/angular-scenario.js +26223 -0
  104. data/test/javascripts/test/lib/angular/version.txt +1 -0
  105. data/test/javascripts/test/unit/controllersSpec.js +54 -0
  106. data/test/javascripts/test/unit/directivesSpec.js +7 -0
  107. data/test/javascripts/test/unit/filtersSpec.js +7 -0
  108. data/test/javascripts/test/unit/servicesSpec.js +7 -0
  109. data/test/test_helper.rb +15 -0
  110. metadata +277 -0
@@ -0,0 +1,11 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>End2end Test Runner</title>
5
+ <meta charset="utf-8">
6
+ <script src="angular-scenario.js" ng-autotest></script>
7
+ <script src="scenarios.js"></script>
8
+ </head>
9
+ <body>
10
+ </body>
11
+ </html>
File without changes
@@ -0,0 +1,7 @@
1
+ <td>{{link.rel}}</td>
2
+ <td>{{link.name}}</td>
3
+ <td>{{link.prompt}}</td>
4
+ <td ng-switch on="link.render">
5
+ <img ng-switch-when="image" ng-src={{link.href}} title={{link.rel}} width=150/>
6
+ <a ng-switch-default href="" ng-click="goTo(link.href)">{{link.href}}</a>
7
+ </td>
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+
3
+ /* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
4
+
5
+ describe('Collection JSON Browser', function() {
6
+ beforeEach(function() {
7
+ browser().navigateTo('/doc');
8
+ });
9
+
10
+ it('displays 1 link', function() {
11
+ expect(repeater('.links tr a').count()).toBe(1);
12
+ });
13
+
14
+ it('displays 1 image', function() {
15
+ expect(repeater('.links tr img').count()).toBe(1);
16
+ });
17
+
18
+ it('displays response status', function() {
19
+ expect(element('.status').text()).toMatch(/\s200\s/);
20
+ });
21
+
22
+ describe('clicking on posts link', function(){
23
+ beforeEach(function() {
24
+ element(".links a:contains('posts')").click();
25
+ });
26
+
27
+ it('sets and displays browser location', function() {
28
+ expect(browser().location().url()).toBe('/api/posts');
29
+ expect(element("#href").val()).toEqual('/api/posts')
30
+ expect(repeater('.links tr a').count()).toBe(0);
31
+ });
32
+
33
+ it('displays a form when the response contains a template', function() {
34
+ expect(element("form[action='/api/posts']")).toBe()
35
+ expect(element("form input#title")).toBe()
36
+ expect(element("form input#content")).toBe()
37
+ expect(element("form input#category")).toBe()
38
+ expect(element("form button[type=submit]")).toBe()
39
+ });
40
+
41
+ it('lists collection items when the form is submitted successfully', function(){
42
+ //TODO: figure out how to test this
43
+ input('field.value').enter('Ruby and Angular')
44
+ input('field.value').enter('Happily ever after')
45
+ input('field.value').enter('ruby')
46
+ //element('#title').attr('value', 'Ruby and Angular')
47
+ //element('#content').attr('value', 'Happily ever after')
48
+ //element('#category').attr('value', 'ruby')
49
+
50
+ element("form button[type=submit]").click()
51
+
52
+ expect(repeater('ol .item').count()).toBe(1);
53
+
54
+ var data = repeater("tr.data")
55
+ //expect(r.row(0)).toEqual(['title', 'Post title', 'Ruby and Angular'])
56
+ //expect(r.row(1)).toEqual(['content', 'Post content', 'Happily ever after'])
57
+ expect(data.row(2)).toEqual(['category', 'Post category', 'ruby'])
58
+
59
+ var links = repeater(".item-links tr")
60
+ expect(links.row(1)).toEqual(['edit-form', 'post', 'Edit post', '/api/posts/1/edit'])
61
+ expect(links.row(2)).toEqual(['comments', 'comments', 'Comments', '/api/posts/1/comments'])
62
+ })
63
+ })
64
+
65
+ });
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActionDispatch::IntegrationTest
4
+ test "Renders the collection json broswer documentation page" do
5
+ get collection_json_browser_path
6
+ assert_match(/Path/, response.body)
7
+ end
8
+ end
9
+
@@ -0,0 +1,22 @@
1
+ basePath = '../';
2
+
3
+ files = [
4
+ ANGULAR_SCENARIO,
5
+ ANGULAR_SCENARIO_ADAPTER,
6
+ 'test/e2e/**/*.js'
7
+ ];
8
+
9
+ autoWatch = false;
10
+
11
+ browsers = ['Chrome'];
12
+
13
+ singleRun = true;
14
+
15
+ proxies = {
16
+ '/': 'http://localhost:3000/doc'
17
+ };
18
+
19
+ junitReporter = {
20
+ outputFile: 'test_out/e2e.xml',
21
+ suite: 'e2e'
22
+ };
@@ -0,0 +1,19 @@
1
+ basePath = '../';
2
+
3
+ files = [
4
+ JASMINE,
5
+ JASMINE_ADAPTER,
6
+ '../../app/assets/javascripts/collection_json_browser/angular.min.js',
7
+ 'test/lib/angular/angular-mocks.js',
8
+ '../../app/assets/javascripts/collection_json_browser/angular/**/*.js',
9
+ 'test/unit/**/*.js'
10
+ ];
11
+
12
+ autoWatch = true;
13
+
14
+ browsers = ['Chrome'];
15
+
16
+ junitReporter = {
17
+ outputFile: 'test_out/unit.xml',
18
+ suite: 'unit'
19
+ };
@@ -0,0 +1,11 @@
1
+ @echo off
2
+
3
+ REM Windows script for running e2e tests
4
+ REM You have to run server and capture some browser first
5
+ REM
6
+ REM Requirements:
7
+ REM - NodeJS (http://nodejs.org/)
8
+ REM - Karma (npm install -g karma)
9
+
10
+ set BASE_DIR=%~dp0
11
+ karma start "%BASE_DIR%\..\config\karma-e2e.conf.js" %*
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+
3
+ BASE_DIR=`dirname $0`
4
+
5
+ echo ""
6
+ echo "Starting Karma Server (http://karma-runner.github.io)"
7
+ echo "-------------------------------------------------------------------"
8
+
9
+ karma start $BASE_DIR/../config/karma-e2e.conf.js $*
@@ -0,0 +1,115 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Script which scrapes http://google.com/phone and generates JSON files used by this application
4
+ // To run this file you will need node.js and dependencies listed below
5
+
6
+ var httpAgent = require('http-agent'),
7
+ jsdom = require('jsdom'),
8
+ fs = require('fs'),
9
+ sys = require('sys');
10
+
11
+
12
+ var agent = httpAgent.create('www.google.com', ['/phone/']);
13
+ var baseDir = __dirname + '/../app/phones/';
14
+ var phones = [];
15
+
16
+ function boolean (text) {
17
+ return /true/i.test(text);
18
+ }
19
+
20
+ agent.addListener('next', function (error, agent) {
21
+ var htmlPage = agent.body.replace('</head>', '</head><body>').
22
+ replace(/<script[\s\S]*?<\/script>/gi, '');
23
+ // console.log(htmlPage);
24
+ var window = jsdom.jsdom(htmlPage).createWindow();
25
+ jsdom.jQueryify(window, 'http://code.jquery.com/jquery-1.4.2.min.js', function (window, jquery) {
26
+ var body = jquery('body');
27
+ if (phones.length) {
28
+ var c1 = body.find('.g-section .g-unit:nth-child(1)');
29
+ var c2 = body.find('.g-section .g-unit:nth-child(2)');
30
+ var phone = {};
31
+ phone.id = agent.url.split(/\//).pop();
32
+ phone.name = body.find('h2').text().trim();
33
+ phone.description = body.find('.description').text().trim();
34
+ phone.availability = c1.find('table:nth-child(1) th:contains("Availability")+td').text().trim().split(/\s*\n\s*/),
35
+ phone.battery = {
36
+ type: c1.find('table:nth-child(2) th:contains("Type")+td').text(),
37
+ talkTime: c1.find('table:nth-child(2) th:contains("Talk time")+td').text(),
38
+ standbyTime: c1.find('table:nth-child(2) th:contains("Standby time")+td').text()
39
+ };
40
+ phone.storage = {
41
+ ram: c1.find('table:nth-child(3) th:contains("RAM")+td').text(),
42
+ flash: c1.find('table:nth-child(3) th:contains("Internal storage")+td').text()
43
+ };
44
+ phone.connectivity = {
45
+ cell: c1.find('table:nth-child(4) th:contains("Network support")+td').text(),
46
+ wifi: c1.find('table:nth-child(4) th:contains("WiFi")+td').text(),
47
+ bluetooth: c1.find('table:nth-child(4) th:contains("Bluetooth")+td').text(),
48
+ infrared: boolean(c1.find('table:nth-child(4) th:contains("Infrared")+td img').attr('src')),
49
+ gps: boolean(c1.find('table:nth-child(4) th:contains("GPS")+td img').attr('src'))
50
+ };
51
+ phone.android = {
52
+ os: c2.find('table:nth-child(1) th:contains("OS Version")+td').text(),
53
+ ui: c2.find('table:nth-child(1) th:contains("UI")+td').text()
54
+ };
55
+ phone.sizeAndWeight = {
56
+ dimensions: c2.find('table:nth-child(2) th:contains("Dimensions")+td').text().trim().split(/\s*\n\s*/),
57
+ weight: c2.find('table:nth-child(2) th:contains("Weight")+td').text().trim()
58
+ };
59
+ phone.display = {
60
+ screenSize: c2.find('table:nth-child(3) th:contains("Screen size")+td').text(),
61
+ screenResolution: c2.find('table:nth-child(3) th:contains("Screen resolution")+td').text(),
62
+ touchScreen: boolean(c2.find('table:nth-child(3) th:contains("Touch screen")+td img').attr('src'))
63
+ };
64
+ phone.hardware = {
65
+ fmRadio: boolean(c2.find('table:nth-child(4) th:contains("FM Radio")+td img').attr('src')),
66
+ physicalKeyboard: c2.find('table:nth-child(4) th:contains("Physical keyboard")+td img').attr('src'),
67
+ accelerometer: boolean(c2.find('table:nth-child(4) th:contains("Accelerometer")+td img').attr('src')),
68
+ cpu: c2.find('table:nth-child(4) th:contains("CPU")+td').text(),
69
+ usb: c2.find('table:nth-child(4) th:contains("USB")+td').text(),
70
+ audioJack: c2.find('table:nth-child(4) th:contains("Audio / headphone jack")+td').text()
71
+ };
72
+ phone.camera= {
73
+ primary: c2.find('table:nth-child(5) th:contains("Primary")+td').text(),
74
+ features: c2.find('table:nth-child(5) th:contains("Features")+td').text().trim().split(/\s*\n\s*/)
75
+ };
76
+ phone.additionalFeatures = c2.find('table:nth-child(6) td').text();
77
+ phone.images = [];
78
+ body.find('#thumbs img').each(function(){
79
+ var imgUrl = 'http://www.google.com' + jquery(this).attr('src');
80
+ phone.images.push({
81
+ small: imgUrl,
82
+ large: imgUrl.replace(/\/small$/, '/large')
83
+ });
84
+ });
85
+ fs.writeSync(fs.openSync(baseDir + phone.id + '.json', 'w'), JSON.stringify(phone));
86
+ } else {
87
+ var age = 0;
88
+ body.find('ul.phonelist li.list').each(function(a){
89
+ var url = jquery(this).find('.name a').attr('href');
90
+ console.log('=======>', url);
91
+ var phone = {};
92
+ phone.id = url.split(/\//).pop();
93
+ phone.age = age++;
94
+ phone.imageUrl = 'http://google.com' +
95
+ jquery(this).find('img.phone').attr('src');
96
+ phone.snippet = jquery(this).find('.description').text().trim();
97
+ phone.name = jquery(this).find('strong').text().trim();
98
+ phone.carrier = jquery(this).find('.buy-from img').attr('alt');
99
+ phone.buyUrl = jquery(this).find('.buy-from a').attr('href');
100
+ console.log(phone);
101
+ phones.push(phone);
102
+ agent.addUrl(url);
103
+ });
104
+ fs.writeSync(fs.openSync(baseDir + '.json', 'w'), JSON.stringify(phones));
105
+ }
106
+ console.log(phone);
107
+ agent.next();
108
+ });
109
+ });
110
+
111
+ agent.addListener('stop', function (error, agent) {
112
+ sys.puts('the agent has stopped');
113
+ });
114
+
115
+ agent.start();
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ #####
4
+ # Helper script for pretty formatting of json files
5
+ #####
6
+
7
+ for file in `ls -a app/phones | grep -v \\\.\$`; do
8
+ cat app/phones/$file | python -mjson.tool > tmp.json
9
+ rm app/phones/$file
10
+ mv tmp.json app/phones/$file
11
+ done
@@ -0,0 +1,15 @@
1
+ @echo off
2
+
3
+ REM Windows script for changing step
4
+ REM This script just copies content of given step into sandbox
5
+
6
+ set SB_DIR=%~dp0
7
+ set STEP=%1
8
+
9
+ rd /Q /S "%SB_DIR%/app/js" ^
10
+ "%SB_DIR%/app/partials" ^
11
+ "%SB_DIR%/app/css" ^
12
+ "%SB_DIR%/test/unit" ^
13
+ "%SB_DIR%/test/e2e"
14
+
15
+ xcopy "%SB_DIR%\..\step-%STEP%" "%SB_DIR%" /E /Y
@@ -0,0 +1,13 @@
1
+ #!/bin/bash
2
+
3
+ base_dir=`dirname $0`
4
+
5
+ rm -rf $base_dir/app/js \
6
+ $base_dir/app/partials \
7
+ $base_dir/app/css \
8
+ $base_dir/test/unit \
9
+ $base_dir/test/e2e
10
+
11
+ cp -r $base_dir/../step-$1/* $base_dir/
12
+
13
+ echo "jumped to step $1"
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+
3
+ REMOTE=${1-origin}
4
+
5
+ scripts/private/retag.sh
6
+ git push --force $REMOTE
7
+ git push --tags --force $REMOTE
@@ -0,0 +1,15 @@
1
+ #!/bin/bash
2
+
3
+ ######
4
+ # This script is useful only for committers to the upstream github repo.
5
+ ######
6
+
7
+ for tag in `git tag`; do
8
+ git tag -d $tag
9
+ done
10
+
11
+ for sha in `git log --oneline | grep step- | cut -d ' ' -f 1`; do
12
+ tag=`git log $sha...$sha~1 --oneline | cut -d ' ' -f 2`
13
+ echo Creating tag $tag for $sha
14
+ git tag $tag $sha
15
+ done
@@ -0,0 +1,19 @@
1
+ #!/bin/bash
2
+
3
+ ROOT_DIR=`dirname $0`/../..
4
+ cd $ROOT_DIR
5
+
6
+ SNAP_DIR=angular-phonecat-snapshots-web
7
+
8
+
9
+ rm -rf $SNAP_DIR
10
+ mkdir $SNAP_DIR
11
+
12
+ for i in {0..11}
13
+ do
14
+ mkdir $SNAP_DIR/step-$i
15
+ git checkout -f step-$i
16
+
17
+ cp -r app test $SNAP_DIR/step-$i/
18
+ rm -rf $SNAP_DIR/step-$i/test/lib/jstestdriver
19
+ done
@@ -0,0 +1,43 @@
1
+ #!/bin/bash
2
+
3
+ ROOT_DIR=`dirname $0`/../..
4
+ cd $ROOT_DIR
5
+
6
+ SNAP_DIR=angular-phonecat-snapshots
7
+
8
+
9
+ rm -rf $SNAP_DIR
10
+ mkdir $SNAP_DIR
11
+
12
+ for i in {0..11}
13
+ do
14
+ mkdir $SNAP_DIR/step-$i
15
+ git checkout -f step-$i
16
+
17
+ if [[ $i = 0 ]]; then
18
+ cp -r app config scripts test $SNAP_DIR/step-0/
19
+ mkdir $SNAP_DIR/step-0/logs
20
+ rm -r $SNAP_DIR/step-0/scripts/private
21
+ rm $SNAP_DIR/step-0/scripts/update-repo.sh
22
+ else
23
+ cp -r app $SNAP_DIR/step-$i/
24
+ mkdir $SNAP_DIR/step-$i/test/
25
+ cp -r test/unit test/e2e $SNAP_DIR/step-$i/test
26
+ rm -r $SNAP_DIR/step-$i/app/img
27
+ rm -r $SNAP_DIR/step-$i/app/lib
28
+ rm -rf $SNAP_DIR/step-$i/app/phones
29
+ fi
30
+
31
+ if [[ $i = 5 ]]; then
32
+ cp -r app/img $SNAP_DIR/step-0/app/
33
+ cp -r app/phones $SNAP_DIR/step-0/app/
34
+ fi
35
+ done
36
+
37
+ mkdir $SNAP_DIR/sandbox
38
+ cp scripts/private/goto_step.sh $SNAP_DIR/sandbox/
39
+ cp scripts/private/goto_step.bat $SNAP_DIR/sandbox/
40
+
41
+ zip -r angular-phonecat-`date +"%y%m%d_%H%M"` $SNAP_DIR
42
+
43
+ git checkout master