ruby_axe 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +7 -2
- data/lib/ruby_axe/screen_capture.rb +16 -0
- data/lib/ruby_axe/utilities.rb +4 -0
- data/lib/ruby_axe.rb +4 -1
- metadata +3 -3
- data/lib/ruby_axe/screen_recorder.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1da56f9392eeeb2780f1fb81f3da1f563d3a0b099ea7444068f6c1b202f3b4a4
|
4
|
+
data.tar.gz: 3a020109500fbffd1c78e3623429219f9b8b1fea2b102291788691a365de9d84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab023e355e2509a89260755e80daae80cb0b47a8b37c4ebb8edc888e59fbc1701ad8149f064379669d4b576dcad0a2597f33ffe91286628079e1c05e35d677eb
|
7
|
+
data.tar.gz: 511de161b4e7dbb321b0c5c7cdf758aff0fe5d19fc206bbd1b5487844c95e719bbb626cd5b008f3002e8c8139257db6106dff4c8eff0175b6c674399a71998e0
|
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require "bundler/gem_tasks"
|
4
4
|
require "rspec/core/rake_task"
|
5
5
|
require_relative 'lib/ruby_axe/application'
|
6
|
-
require_relative 'lib/ruby_axe/
|
6
|
+
require_relative 'lib/ruby_axe/screen_capture'
|
7
7
|
require_relative 'lib/ruby_axe/window'
|
8
8
|
|
9
9
|
RSpec::Core::RakeTask.new(:spec)
|
@@ -36,5 +36,10 @@ end
|
|
36
36
|
|
37
37
|
desc 'Record screen'
|
38
38
|
task :record do
|
39
|
-
|
39
|
+
ScreenCapture.new.record('test.mov', 10)
|
40
|
+
end
|
41
|
+
|
42
|
+
desc 'Take a screenshot'
|
43
|
+
task :screenshot do
|
44
|
+
ScreenCapture.new.screenshot('pic.png')
|
40
45
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require_relative 'application'
|
2
|
+
|
3
|
+
module RubyAxe
|
4
|
+
class ScreenCapture < Application
|
5
|
+
def initialize(name = 'screencapture')
|
6
|
+
super(name)
|
7
|
+
end
|
8
|
+
|
9
|
+
def record(output, seconds = 0, delay = 0)
|
10
|
+
screenshot(output, delay, " -V #{seconds + 5} ")
|
11
|
+
end
|
12
|
+
def screenshot(output, delay = 0, video = '')
|
13
|
+
shell("\"#{name} -T #{delay} #{video} #{output}\"")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/ruby_axe/utilities.rb
CHANGED
data/lib/ruby_axe.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require_relative 'ruby_axe/application'
|
3
|
+
require_relative 'ruby_axe/screen_capture'
|
2
4
|
require_relative "ruby_axe/utilities"
|
5
|
+
require_relative 'ruby_axe/window'
|
3
6
|
|
4
7
|
module RubyAxe
|
5
|
-
VERSION = '0.1.
|
8
|
+
VERSION = '0.1.2'
|
6
9
|
|
7
10
|
class << self
|
8
11
|
include Utilities
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_axe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aguspe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This gem gives you an easy option to use applescript to control your
|
14
14
|
MacOS
|
@@ -27,7 +27,7 @@ files:
|
|
27
27
|
- Rakefile
|
28
28
|
- lib/ruby_axe.rb
|
29
29
|
- lib/ruby_axe/application.rb
|
30
|
-
- lib/ruby_axe/
|
30
|
+
- lib/ruby_axe/screen_capture.rb
|
31
31
|
- lib/ruby_axe/utilities.rb
|
32
32
|
- lib/ruby_axe/window.rb
|
33
33
|
- sig/ruby_axe.rbs
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require_relative 'application'
|
2
|
-
|
3
|
-
module RubyAxe
|
4
|
-
class ScreenRecorder < Application
|
5
|
-
def initialize
|
6
|
-
super('QuickTime Player')
|
7
|
-
end
|
8
|
-
|
9
|
-
def record(seconds, path)
|
10
|
-
tell(" \"#{name}\" \n start new screen recording \n delay #{seconds} \n stop new screen recording \n #{output_path(path)}")
|
11
|
-
end
|
12
|
-
|
13
|
-
def output_path(path)
|
14
|
-
"set newDoc to last item of (documents whose name contains \"Untitled\") \n
|
15
|
-
export newDoc in \"#{path}\" using settings preset \"Quicktime Movie\" \n"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|