ruby_axe 0.1.0 → 0.1.1

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: c335b511eff235ee9b3322e004f9dc5c0ac490d6e0a1c2338eea5d2c49099929
4
- data.tar.gz: c60ee6f34ecddb5ed52a77e30315407be18dcfec49d4c4bc1924c8ec72fba4f2
3
+ metadata.gz: 73f4c5e0aa8b5fa22b2ad4f737fa53da81014bbf95e37b23d473e9ed515ebd23
4
+ data.tar.gz: f166c61d23f09c1d565932c2bbe0b27081fb663ed6ca235050c7cc609a14359b
5
5
  SHA512:
6
- metadata.gz: 98fffbac4fc973bf5566801f995ad96caf2f4841f26ac1e22ec205a2867a23eac1fbdc483ec30377c8fc49dcd23463f5a26657fb83ac8349215ace29943a0e16
7
- data.tar.gz: 925ef02923ff4d0a4ebe29593ee7828674f10abfc58997e271ea10d825fbd3592b2f9dcd21a871ce27cfd99fed45664002a07754587bcb338cc23b38bb711cea
6
+ metadata.gz: 0cc239ebb160054168dfa1d2312d1a314724b6a5fbf6171b9d04f4f7c3359c84d2e995f82b7d6c31196fed9092e40d26d853305d634110cc2b601867683d0715
7
+ data.tar.gz: 19ea850a2051d42bdc50d298143038f2548f1db2c9e5037048a23b30e698a9fe74e10837c3c6fbf9a1e53946a17af5e05b334c7190b5b4b936fbc80958a69ef3
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/screen_recorder'
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
- ScreenRecorder.new.record(10, 'hello.mov')
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
@@ -7,5 +7,9 @@ module RubyAxe
7
7
  def tell(call)
8
8
  axe "tell application #{call} \n end tell"
9
9
  end
10
+
11
+ def shell(call)
12
+ axe "do shell script #{call}"
13
+ end
10
14
  end
11
15
  end
data/lib/ruby_axe.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  require_relative "ruby_axe/utilities"
3
3
 
4
4
  module RubyAxe
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
 
7
7
  class << self
8
8
  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.0
4
+ version: 0.1.1
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-24 00:00:00.000000000 Z
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/screen_recorder.rb
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