roku 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +20 -0
- data/lib/roku/config.rb +1 -0
- data/lib/roku/version.rb +1 -1
- data/lib/roku/zip.rb +6 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60fe076a6e7109cf813d012b5a58b29945579e75
|
4
|
+
data.tar.gz: 51debc4b6b0288e2d4910250cd10353d20865ede
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1af5b37845a1d08a15b2b7bded88c5a7611fd4089c96912fd2800609b3e85605b142ce072b9bcbd45a30a5bfd110db1976e4235b5e8e91d4f645eadb081b0a25
|
7
|
+
data.tar.gz: cb7a58482af7be12258c4ce0f01d679077742aab7071fd89faae9a5f0908d4fbf8e79d9a282bcfc5000dc715da5d307e68d1da3554c1874b1d5329ee403aeca1
|
data/README.md
CHANGED
@@ -53,6 +53,26 @@ username : "rokudev"
|
|
53
53
|
password : "1234"
|
54
54
|
```
|
55
55
|
|
56
|
+
### Build Output
|
57
|
+
|
58
|
+
By default builds will output to a temporary directory. You may specify the build output in the roku.yml configuration file with the key `output`.
|
59
|
+
|
60
|
+
Example File:
|
61
|
+
```yml
|
62
|
+
ip : "192.168.1.6"
|
63
|
+
username : "rokudev"
|
64
|
+
password : "1234"
|
65
|
+
directory : "/Users/exampleuser/code/brightscript/example_project"
|
66
|
+
output : "/Users/exampleuser/code/brightscript/example_project/builds/roku.zip"
|
67
|
+
```
|
68
|
+
|
69
|
+
**Note:** You may use Time conversion specifications in the output name.
|
70
|
+
|
71
|
+
```yml
|
72
|
+
output : "/Users/exampleuser/code/brightscript/example_project/builds/roku-%m-%d-%Y.zip"
|
73
|
+
# Translates into "/Users/exampleuser/code/brightscript/example_project/builds/roku-01-20-2015.zip"
|
74
|
+
```
|
75
|
+
|
56
76
|
## Usage
|
57
77
|
|
58
78
|
Depending on your configuration (see above), simply run `roku` from your command line to build and deploy your project to your Roku development box.
|
data/lib/roku/config.rb
CHANGED
@@ -14,6 +14,7 @@ module Roku
|
|
14
14
|
def config
|
15
15
|
@config ||= fetch_config.tap do |config|
|
16
16
|
@directory = config['directory'] if config['directory']
|
17
|
+
@build_output = Time.now.strftime(config['output']) if config['output']
|
17
18
|
end
|
18
19
|
rescue Errno::ENOENT
|
19
20
|
raise Exception::NotConfigured, "Please configure gem. See https://github.com/stephenbaldwin/roku#configuration for more information"
|
data/lib/roku/version.rb
CHANGED
data/lib/roku/zip.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
# This example is pulled straight from https://github.com/rubyzip/rubyzip/blob/master/samples/example_recursive.rb
|
2
|
-
# With the exception of a minor class method addition on line 8
|
2
|
+
# With the exception of a minor class method addition on line 8 and dot file exclusion on line 9
|
3
3
|
require 'zip'
|
4
4
|
|
5
5
|
module Roku
|
6
6
|
class Zip
|
7
7
|
|
8
8
|
def self.generate(input, output); new(input, output).write; end
|
9
|
+
def files_in(dir)
|
10
|
+
Dir.entries(dir).select {|file| file =~ /^[^\.]/ }
|
11
|
+
end
|
9
12
|
|
10
13
|
# Initialize with the directory to zip and the location of the output archive.
|
11
14
|
def initialize(inputDir, outputFile)
|
@@ -15,7 +18,7 @@ module Roku
|
|
15
18
|
|
16
19
|
# Zip the input directory.
|
17
20
|
def write
|
18
|
-
entries =
|
21
|
+
entries = files_in(@inputDir)
|
19
22
|
io = ::Zip::File.open(@outputFile, ::Zip::File::CREATE);
|
20
23
|
|
21
24
|
writeEntries(entries, "", io)
|
@@ -32,7 +35,7 @@ module Roku
|
|
32
35
|
puts "Deflating " + diskFilePath
|
33
36
|
if File.directory?(diskFilePath)
|
34
37
|
io.mkdir(zipFilePath)
|
35
|
-
subdir =
|
38
|
+
subdir = files_in(diskFilePath)
|
36
39
|
writeEntries(subdir, zipFilePath, io)
|
37
40
|
else
|
38
41
|
io.get_output_stream(zipFilePath) { |f| f.puts(File.open(diskFilePath, "rb").read())}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Baldwin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|