roku_builder 3.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/Gemfile +4 -0
  4. data/Gemfile.lock +101 -0
  5. data/Guardfile +21 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +282 -0
  8. data/bin/roku +152 -0
  9. data/config.json.example +28 -0
  10. data/lib/roku_builder.rb +32 -0
  11. data/lib/roku_builder/config_manager.rb +157 -0
  12. data/lib/roku_builder/controller.rb +582 -0
  13. data/lib/roku_builder/inspector.rb +90 -0
  14. data/lib/roku_builder/keyer.rb +52 -0
  15. data/lib/roku_builder/linker.rb +46 -0
  16. data/lib/roku_builder/loader.rb +197 -0
  17. data/lib/roku_builder/manifest_manager.rb +63 -0
  18. data/lib/roku_builder/monitor.rb +62 -0
  19. data/lib/roku_builder/navigator.rb +107 -0
  20. data/lib/roku_builder/packager.rb +47 -0
  21. data/lib/roku_builder/tester.rb +32 -0
  22. data/lib/roku_builder/util.rb +31 -0
  23. data/lib/roku_builder/version.rb +4 -0
  24. data/rakefile +8 -0
  25. data/roku_builder.gemspec +36 -0
  26. data/tests/roku_builder/config_manager_test.rb +400 -0
  27. data/tests/roku_builder/controller_test.rb +250 -0
  28. data/tests/roku_builder/inspector_test.rb +153 -0
  29. data/tests/roku_builder/keyer_test.rb +88 -0
  30. data/tests/roku_builder/linker_test.rb +37 -0
  31. data/tests/roku_builder/loader_test.rb +153 -0
  32. data/tests/roku_builder/manifest_manager_test.rb +25 -0
  33. data/tests/roku_builder/monitor_test.rb +34 -0
  34. data/tests/roku_builder/navigator_test.rb +72 -0
  35. data/tests/roku_builder/packager_test.rb +125 -0
  36. data/tests/roku_builder/test_files/controller_test/load_config_test.json +28 -0
  37. data/tests/roku_builder/test_files/controller_test/valid_config.json +28 -0
  38. data/tests/roku_builder/test_files/loader_test/c +0 -0
  39. data/tests/roku_builder/test_files/loader_test/manifest +0 -0
  40. data/tests/roku_builder/test_files/loader_test/source/a +0 -0
  41. data/tests/roku_builder/test_files/loader_test/source/b +0 -0
  42. data/tests/roku_builder/test_files/manifest_manager_test/manifest_template +2 -0
  43. data/tests/roku_builder/test_helper.rb +6 -0
  44. data/tests/roku_builder/tester_test.rb +33 -0
  45. data/tests/roku_builder/util_test.rb +23 -0
  46. metadata +286 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4fb0f1a154541f38d45f4cec4a78800d5442c4de
4
+ data.tar.gz: 04f1448deacf24c15223993745750f9298b6107a
5
+ SHA512:
6
+ metadata.gz: 40eb84586c9745d4faac4eae184c02be437966d65f71e194d0befb18c78e98e4f73a3fce23ab755ea5721242c928dec6462dea5969c75bd890da8933be0f054d
7
+ data.tar.gz: 0370b82f8bf8d258f2c9ab04b88b4624e73129dd01db3e38cc97a1c15e123a7b2064a9e4820d63b3662fb8f2ca6bf24c1b6d2eb13745829cf7add45acec3ae77
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ doc
3
+ .yardoc
4
+ coverage
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in roku_builder.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,101 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ roku_builder (3.3.1)
5
+ faraday (~> 0.9)
6
+ faraday-digestauth (~> 0.2)
7
+ git (~> 1.2.9)
8
+ net-ping (~> 1.7)
9
+ rubyzip (~> 1.1)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ byebug (3.5.1)
15
+ columnize (~> 0.8)
16
+ debugger-linecache (~> 1.2)
17
+ slop (~> 3.6)
18
+ coderay (1.1.0)
19
+ columnize (0.9.0)
20
+ debugger-linecache (1.2.0)
21
+ docile (1.1.5)
22
+ em-websocket (0.5.1)
23
+ eventmachine (>= 0.12.9)
24
+ http_parser.rb (~> 0.6.0)
25
+ eventmachine (1.0.9.1)
26
+ faraday (0.9.2)
27
+ multipart-post (>= 1.2, < 3)
28
+ faraday-digestauth (0.2.1)
29
+ faraday (~> 0.7)
30
+ net-http-digest_auth (~> 1.4)
31
+ ffi (1.9.10)
32
+ formatador (0.2.5)
33
+ git (1.2.9.1)
34
+ guard (2.13.0)
35
+ formatador (>= 0.2.4)
36
+ listen (>= 2.7, <= 4.0)
37
+ lumberjack (~> 1.0)
38
+ nenv (~> 0.1)
39
+ notiffany (~> 0.0)
40
+ pry (>= 0.9.12)
41
+ shellany (~> 0.0)
42
+ thor (>= 0.18.1)
43
+ guard-compat (1.2.1)
44
+ guard-livereload (2.5.2)
45
+ em-websocket (~> 0.5)
46
+ guard (~> 2.8)
47
+ guard-compat (~> 1.0)
48
+ multi_json (~> 1.8)
49
+ http_parser.rb (0.6.0)
50
+ json (1.8.3)
51
+ listen (3.0.6)
52
+ rb-fsevent (>= 0.9.3)
53
+ rb-inotify (>= 0.9.7)
54
+ lumberjack (1.0.10)
55
+ method_source (0.8.2)
56
+ minitest (5.8.4)
57
+ minitest-autotest (1.0.2)
58
+ minitest-server (~> 1.0)
59
+ minitest-server (1.0.3)
60
+ minitest (~> 5.0)
61
+ multi_json (1.11.2)
62
+ multipart-post (2.0.0)
63
+ nenv (0.3.0)
64
+ net-http-digest_auth (1.4)
65
+ net-ping (1.7.8)
66
+ notiffany (0.0.8)
67
+ nenv (~> 0.1)
68
+ shellany (~> 0.0)
69
+ pry (0.10.3)
70
+ coderay (~> 1.1.0)
71
+ method_source (~> 0.8.1)
72
+ slop (~> 3.4)
73
+ rake (10.5.0)
74
+ rb-fsevent (0.9.7)
75
+ rb-inotify (0.9.7)
76
+ ffi (>= 0.5.0)
77
+ rubyzip (1.1.7)
78
+ shellany (0.0.1)
79
+ simplecov (0.11.2)
80
+ docile (~> 1.1.0)
81
+ json (~> 1.8)
82
+ simplecov-html (~> 0.10.0)
83
+ simplecov-html (0.10.0)
84
+ slop (3.6.0)
85
+ thor (0.19.1)
86
+ yard (0.8.7.6)
87
+
88
+ PLATFORMS
89
+ ruby
90
+
91
+ DEPENDENCIES
92
+ bundler (~> 1.7)
93
+ byebug (~> 3.5)
94
+ guard-livereload (~> 2.5)
95
+ minitest (~> 5.8)
96
+ minitest-autotest (~> 1.0)
97
+ minitest-server (~> 1.0)
98
+ rake (~> 10.0)
99
+ roku_builder!
100
+ simplecov (~> 0.11)
101
+ yard (~> 0.8.7)
data/Guardfile ADDED
@@ -0,0 +1,21 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ guard 'livereload' do
19
+ watch(%r{lib/roku_builder/.+\.rb})
20
+ watch(%r{lib/roku_builder.rb})
21
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2016 Viacom Inc.
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,282 @@
1
+ # RokuBuilder
2
+
3
+ A tool to help with Roku Development. Assists with the following roku
4
+ development tasks:
5
+
6
+ * Sideloading
7
+ * Packaging
8
+ * Building
9
+ * Testing
10
+ * Deeplink testing
11
+ * Intergration test scripting
12
+ * Manifest Updating
13
+ * App Deleteing
14
+ * Package Inspection
15
+ * Monitoring logs
16
+
17
+ The tool allows scripting of the following interactions with the roku:
18
+
19
+ * Conroller inputs
20
+ * Text Input
21
+ * Screencaptures
22
+
23
+ Other tasks the tool can complete:
24
+
25
+ * Configuration Generation
26
+ * Configuration Validation
27
+ * Configuration Updating
28
+
29
+
30
+ ## Installation
31
+
32
+ Install it yourself with:
33
+
34
+ $ gem install roku_builder
35
+
36
+ ## Usage
37
+
38
+ #### Configuration
39
+
40
+ The gem must have a configuration file. To generate this file you can run the
41
+ following command:
42
+
43
+ $ roku --configure
44
+
45
+ This will create the file '~/.roku_config.json' with a default configuration.
46
+ Edit this file to add appropriate values. The following are default
47
+ configuration options:
48
+
49
+ * devices: information for accessing devices
50
+ * devices -> default: id of the default device
51
+ * projects: this is a hash of project objects
52
+ * projects -> default: the key for the default project
53
+
54
+ Each Device has the following options:
55
+
56
+ * ip: ip address of the device
57
+ * user: dev username for the roku device
58
+ * password: dev password for the roku device
59
+
60
+ Each project has the following options:
61
+
62
+ * directory: full path of the git repository the houses the roku app
63
+ * app_name: Name used when packaging the app
64
+ * stages: a hash of stage objects
65
+
66
+ Each stage has the following options:
67
+
68
+ * branch: name of the branch for the given stage
69
+ * key: has of key options for signing a package
70
+ * key -> keyed_pkg: path to a pkg file that has been signed
71
+ * key -> password: password for the signed pkg
72
+
73
+
74
+ #### Sideloading
75
+
76
+ There are several ways to side load an app. You can sideload based on a stage,
77
+ an arbitrary git referance or the working directory.
78
+
79
+ To sideload a stage you can run the following command:
80
+
81
+ $ roku --sideload --stage production
82
+
83
+ This will sideload the production stage. By default the production stage is
84
+ used. So the above is equivalent to the following:
85
+
86
+ $ roku --sideload
87
+
88
+ and:
89
+
90
+ $ roku -l
91
+
92
+ To sideload via a git referance you can run the following command
93
+
94
+ $ roku --sideload --ref master
95
+
96
+ This will sideload the master branch. The following is equivalent:
97
+
98
+ $ roku -lr master
99
+
100
+ To sideload the current working directory you can run the following:
101
+
102
+ $ roku --sideload --working
103
+
104
+ or:
105
+
106
+ $ roku -lw
107
+
108
+ If you choose to sideload via stage or git referance then the roku tool with
109
+ stash any changes in the working directory and then apply the stash after. From
110
+ time to time there may be an issue with this and you will have to clear the
111
+ stash manually.
112
+
113
+ You can also sideload the current directory even if it is not setup as a
114
+ project. If the directory has a manifest file then you can run the following
115
+ command:
116
+
117
+ $ roku --sideload --current
118
+
119
+ or:
120
+
121
+ $ roku -lc
122
+
123
+ #### Packaging
124
+
125
+ To package an app you need to have at least on stage set up in your
126
+ configuration file that has a key. Once you have that setup then you can run
127
+ the following:
128
+
129
+ $ roku --package --stage production
130
+
131
+ or:
132
+
133
+ $ roku -ps production
134
+
135
+ #### Building
136
+
137
+ You can build an app to be sideloaded later or by someone else by using the
138
+ following command:
139
+
140
+ $ roku --build --stage production
141
+
142
+ or:
143
+
144
+ $ roku -bw
145
+
146
+
147
+ #### Monitoring Logs
148
+
149
+ The tool has the ability to monitor the different development logs. You use
150
+ the feature using the command --monitor and passing in the type of log you want
151
+ to monitor. For example the following command will monitor the main
152
+ brightscript log:
153
+
154
+ $ roku --monitor main
155
+
156
+ or:
157
+ $ roku -m main
158
+
159
+ The following are the options to be passed in as type:
160
+
161
+ * main
162
+ * sg
163
+ * task1
164
+ * task2
165
+ * task3
166
+ * taskX
167
+
168
+ The tool connects to the roku via telnet and prints everything that it
169
+ recieves. It will continue indefinatly unless it is stopped via Ctrl-c or
170
+ entering "q".
171
+
172
+ #### Testing
173
+
174
+ There are a few tools that can be used for testing. The testing command will
175
+ sideload the branch defined in the testing stage. It will then connect to the
176
+ device via telnet and look for the following strings and prints everything
177
+ inbetween them:
178
+
179
+ Start delimiter: \*\*\*\*\* STARTING TESTS \*\*\*\*\*
180
+
181
+ End delimiter: \*\*\*\*\* ENDING TESTS \*\*\*\*\*
182
+
183
+ This is designed to be used with the brstest library. Ensure that if you use
184
+ this that the app the prints out a sufficent number of lines after the tests
185
+ are run otherwise it will just grab the test run from last time.
186
+
187
+ Another tool for testing is the navigate command. You can use this to script
188
+ navigation on the roku console. The command is used as follows:
189
+
190
+ $ roku --navigate <command>
191
+
192
+ The possible commands are as follows:
193
+
194
+ * up
195
+ * down
196
+ * right
197
+ * left
198
+ * select
199
+ * back
200
+ * home
201
+ * rew
202
+ * ff
203
+ * play
204
+ * replay
205
+
206
+ There is also a command that will allow you to send text to the roku. It is
207
+ used as follows:
208
+
209
+ $ roku --type <text>
210
+
211
+ #### Other Tools
212
+
213
+ You can restart the roku device using the following command:
214
+
215
+ $ roku --restart
216
+
217
+ You can deeplink into your app using the following command:
218
+
219
+ $ roku --deeplink --mgid <mgid> --content-type <content type>
220
+
221
+ This is currently setup to work with one specific app. It will be generalized
222
+ in the future.
223
+
224
+ You can delete the currently sideloaded app using the following command:
225
+
226
+ $ roku --delete
227
+
228
+ You can use a differnt configuration file useing the following option:
229
+
230
+ & roku --delete --config <path>
231
+
232
+ This path will be expanded so you do not have to use the full path
233
+
234
+ ## Projects
235
+
236
+ The project used in the above examples is a smart default. If you are in a
237
+ project directory then it will use that project. If you not then it will use
238
+ the defualt that you have defined in your config. You can define what project
239
+ you want the command to be run on using the --project option:
240
+
241
+ $ roku -lw --project project1
242
+
243
+ or:
244
+
245
+ $ roku -lw -P project1
246
+
247
+ ## Devices
248
+
249
+ In the examples above the default device is used. If you have multiple devices
250
+ defined in your config then you can select a different one using the following
251
+ option:
252
+
253
+ $ roku -lw --device device2
254
+
255
+ or:
256
+
257
+ $ roku -lw -D device2
258
+
259
+
260
+ ## Documentation
261
+
262
+ To generate the documentation run the following command in the project root
263
+ directory:
264
+
265
+ $ yard doc --protected lib
266
+
267
+
268
+ ## Improvements
269
+
270
+ * Increase testing
271
+ * More Unit Tests
272
+ * Intergration Tests
273
+ * Move RokuBuilder::Controller to RokuBuilder?
274
+ * Allow start and end delimiter for tests to be configured
275
+
276
+ ## Contributing
277
+
278
+ 1. Fork it
279
+ 2. Create your feature branch (`git checkout -b feature/my-new-feature`)
280
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
281
+ 4. Push to the branch (`git push origin feature/my-new-feature`)
282
+ 5. Create a new Pull Request