eufycam 0.4.0 → 0.5.0

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
  SHA256:
3
- metadata.gz: b577e85b8d9067709afbbbb262165142355407c222223269142fff40b450ea47
4
- data.tar.gz: df586188720ac10d594ecb565b728fa24699f002ee43e7028d08f0210eb51884
3
+ metadata.gz: 83ba1530498979809ceec9a6faeee9c51870754d22df118ffd27e25be38f5162
4
+ data.tar.gz: d34cef190e53bbc8df1304ef69b7102ad19ae155d35b626eb72ba51d4cc8457e
5
5
  SHA512:
6
- metadata.gz: 698f55c4fed95fd52e6a5dbf9ac5e905998b939026981b091b14b063a989c301a37bb2d20bb657b296e147088c7bbab3db9fd2d1dd046d64a2d31ddf3fe5c674
7
- data.tar.gz: d2aed35f0834c33fb740d7d036f2e2bcca85e848288fa4541c2c1505c5a13789d3a249e2277f9cba2c205241006d1c8f7cfb4606c2409438707d8d8366f051e0
6
+ metadata.gz: f452985f7bd95c78d6e2c753f87ad731e8fb400286a2c110f78a04d1e86699d91600cc75f91b328f7cce39aa591d268da7daa602327dcb5db009d94d309fc300
7
+ data.tar.gz: 7de22be43aac6f5247945d1a4ab22da32e0f36f122ac4db446466246f37b026ff7738e9595f9e7dad5f096069fd6dcc34b6a237f016b84fdf904a82c0e873e94
@@ -0,0 +1 @@
1
+ * @kyledecot
@@ -137,6 +137,10 @@ jobs:
137
137
  release_name: ${{ github.ref }}
138
138
  draft: false
139
139
  prerelease: false
140
+ - name: Docker
141
+ run: docker build . -t kyledecot/eufycam:latest
142
+ - run: echo ${{ secrets.DOCKER_PASSWORD}} docker login -u ${{ secrets.DOCKER_USERNAME}} --password-stdin
143
+ - run: docker push kyledecot/eufycam:latest
140
144
 
141
145
  - name: Upload Release Asset
142
146
  uses: actions/upload-release-asset@v1
@@ -0,0 +1,27 @@
1
+ FROM ruby:2.6.5-alpine AS build
2
+
3
+ VOLUME ["/data"]
4
+
5
+ RUN gem install bundler
6
+
7
+ RUN apk add --update-cache \
8
+ git \
9
+ ffmpeg \
10
+ which \
11
+ build-base \
12
+ && rm -rf /var/cache/apk/*
13
+
14
+ COPY . .
15
+ RUN bundle install --
16
+
17
+ RUN bundle exe rake build && \
18
+ gem install eufycam-$(bundle exec rake version:current).gem
19
+
20
+ RUN which ffmpeg
21
+ RUN which eufycam
22
+ RUN which ruby
23
+
24
+ WORKDIR /data
25
+
26
+ ENTRYPOINT ["eufycam"]
27
+
@@ -1,9 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eufycam (0.4.0)
5
- colorize (~> 0.8)
4
+ eufycam (0.5.0)
6
5
  gli (~> 2.19)
6
+ lumberjack (~> 1.2)
7
+ rainbow (~> 3.0)
7
8
  terminal-table (~> 1.8)
8
9
 
9
10
  GEM
@@ -11,7 +12,6 @@ GEM
11
12
  specs:
12
13
  ast (2.4.0)
13
14
  coderay (1.1.2)
14
- colorize (0.8.1)
15
15
  diff-lcs (1.3)
16
16
  docile (1.3.2)
17
17
  ffi (1.12.2)
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # eufycam
2
2
 
3
- ![Default](https://github.com/kyledecot/eufycam/workflows/Default/badge.svg)
3
+ [![Default](https://github.com/kyledecot/eufycam/workflows/Default/badge.svg)](https://github.com/kyledecot/eufycam/actions?query=workflow%3ADefault)
4
+
4
5
  ## Installation
5
6
 
6
7
  Add this line to your application's Gemfile:
@@ -19,7 +20,13 @@ Or install it yourself as:
19
20
 
20
21
  ## Usage
21
22
 
22
- TODO: Write usage instructions here
23
+ ### CLI
24
+
25
+ ```bash
26
+ eufycam help
27
+ ```
28
+
29
+ ### Ruby
23
30
 
24
31
  ## Development
25
32
 
@@ -0,0 +1,14 @@
1
+ ---
2
+ version: '3'
3
+
4
+ services:
5
+ eufycam:
6
+ build: .
7
+ volumes:
8
+ - data:/foo
9
+ environment:
10
+ - EUFYCAM_EMAIL
11
+ - EUFYCAM_PASSWORD
12
+
13
+ volumes:
14
+ data:
@@ -25,8 +25,9 @@ Gem::Specification.new do |spec|
25
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ['lib']
27
27
 
28
- spec.add_runtime_dependency 'colorize', '~> 0.8'
29
28
  spec.add_runtime_dependency 'gli', '~> 2.19'
29
+ spec.add_runtime_dependency 'lumberjack', '~> 1.2'
30
+ spec.add_runtime_dependency 'rainbow', '~> 3.0'
30
31
  spec.add_runtime_dependency 'terminal-table', '~> 1.8'
31
32
 
32
33
  spec.add_development_dependency 'bundler', '~> 2.0'
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'eufycam'
5
4
  require 'eufycam/cli'
6
5
 
7
- Eufycam::CLI.run(ARGV)
6
+ exit Eufycam::CLI.run(ARGV)
@@ -2,13 +2,18 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'gli'
5
+ require 'shellwords'
5
6
  require 'terminal-table'
6
- require 'colorize'
7
+ require 'rainbow'
8
+ require 'eufycam'
9
+ require 'lumberjack'
7
10
 
8
11
  module Eufycam
9
12
  class CLI
10
13
  extend GLI::App
11
14
 
15
+ LOGGER = Lumberjack::Logger.new(STDOUT)
16
+
12
17
  flag 'email',
13
18
  default_value: ENV['EUFYCAM_EMAIL'],
14
19
  arg_name: 'EMAIL'
@@ -19,17 +24,35 @@ module Eufycam
19
24
  arg_name: 'PASSWORD'
20
25
 
21
26
  command :devices do |devices|
22
- devices.command :timelapse do |timelapse|
23
- timelapse.flag 'device-name', arg_name: 'DEVICE_NAME'
27
+ devices.command 'timelapse' do |timelapse|
28
+ timelapse.flag 'device-name', arg_name: 'DEVICE_NAME', desc: 'Device name'
29
+ timelapse.flag 'interval', arg_name: 'INTERVAL', default_value: 60, desc: 'Interval in seconds', type: Integer
30
+
31
+ timelapse.action do |global_options, options, _args|
32
+ client = Client.new(global_options.slice(:email, :password))
33
+
34
+ LOGGER.info("Device Name: #{options['device-name']}")
35
+
36
+ url = client.start_stream(
37
+ device_name: options['device-name']
38
+ )['url']
39
+
40
+ loop do
41
+ command = "ffmpeg -loglevel quiet -i \"#{url}\" -vframes 1 eufycam-#{Time.now.to_i}.jpg"
24
42
 
25
- timelapse.action do |_global_options, options, _args|
26
- # client = Client.new(global_options.slice('username', 'password'))
43
+ LOGGER.info("COMMAND: #{command}")
27
44
 
28
- puts "capture a timelapse #{options['device-name']}"
45
+ `#{command}`
46
+
47
+ print '.'
48
+ sleep options[:interval]
49
+ end
29
50
  end
30
51
  end
31
52
 
32
53
  devices.command 'start-stream' do |start_stream|
54
+ start_stream.flag 'device-name', arg_name: 'DEVICE_NAME'
55
+
33
56
  start_stream.action do |global_options, options, _args|
34
57
  client = Client.new(**global_options.slice(:email, :password))
35
58
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Eufycam
4
- VERSION = '0.4.0'
4
+ VERSION = '0.5.0'
5
5
  end
metadata CHANGED
@@ -1,43 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eufycam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Decot
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-20 00:00:00.000000000 Z
11
+ date: 2020-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: colorize
14
+ name: gli
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.8'
19
+ version: '2.19'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.8'
26
+ version: '2.19'
27
27
  - !ruby/object:Gem::Dependency
28
- name: gli
28
+ name: lumberjack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.19'
33
+ version: '1.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.19'
40
+ version: '1.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rainbow
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: terminal-table
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -172,6 +186,7 @@ executables:
172
186
  extensions: []
173
187
  extra_rdoc_files: []
174
188
  files:
189
+ - ".github/CODEOWNERS"
175
190
  - ".github/ISSUE_TEMPLATE/bug_report.md"
176
191
  - ".github/ISSUE_TEMPLATE/feature_request.md"
177
192
  - ".github/workflows/default.yml"
@@ -179,6 +194,7 @@ files:
179
194
  - ".rspec"
180
195
  - ".rubocop.yml"
181
196
  - ".ruby-version"
197
+ - Dockerfile
182
198
  - Gemfile
183
199
  - Gemfile.lock
184
200
  - Guardfile
@@ -186,6 +202,7 @@ files:
186
202
  - README.md
187
203
  - Rakefile
188
204
  - bin/setup
205
+ - docker-compose.yml
189
206
  - eufycam.gemspec
190
207
  - exe/eufycam
191
208
  - lib/eufycam.rb