roku 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16f2eefbb9a5eba34dd6a01f2b3dba741daa27fe
4
- data.tar.gz: f9ee1dbc5392ee67d721086c07d63ac52a85b38a
3
+ metadata.gz: 60fe076a6e7109cf813d012b5a58b29945579e75
4
+ data.tar.gz: 51debc4b6b0288e2d4910250cd10353d20865ede
5
5
  SHA512:
6
- metadata.gz: 77259b05ac48366f4acdc10d2d741002a9bb6067cf5b193cf9b719831a90b8ea064561630dab81a65b2e30650b40a77aaf13d681b9e246270841845f3b5987b6
7
- data.tar.gz: 7bf7aa620738469ca378f00ff9ea357b9a4cf8a41a769822449be9ee06672d1e229e133c8470572bfdffe91254fbea56f64e469eb16e6e0b8f848b014c46306a
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
@@ -1,3 +1,3 @@
1
1
  module Roku
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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 = Dir.entries(@inputDir); entries.delete("."); entries.delete("..")
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 = Dir.entries(diskFilePath); subdir.delete("."); subdir.delete("..")
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.2
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-06-28 00:00:00.000000000 Z
11
+ date: 2015-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip