macos 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 +4 -4
- data/Gemfile +12 -0
- data/README.md +12 -29
- data/bin/console +8 -0
- data/bin/setup +6 -0
- data/lib/macos/screen.rb +14 -0
- data/lib/macos/version.rb +1 -1
- data/lib/macos.rb +11 -3
- metadata +22 -9
- data/.rspec +0 -3
- data/.rubocop.yml +0 -8
- data/LICENSE.txt +0 -21
- data/Rakefile +0 -12
- data/sig/macos.rbs +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd5cbbc912f0fab0192641cb14735ebbd151c1db00381dc1f837174a2dc2bff2
|
4
|
+
data.tar.gz: 30c5de93807739ead6fc84a5fdc899bf6041b5c9946f6b4f21961704d808ecda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 974a5ed9a34e8a890179836a5ad80d2fe584b5218d948d390d586fd8fd7df04d9bd303e248e30020f893675236b4f94ab53697f3faebd0a8ca64a6c02dbd0621
|
7
|
+
data.tar.gz: 766c1ea410a4f9e7ca8e7d05b2e5eddb115932c41356c8dfce44020558a68d3ede27cd9237449173b2a1e87656e8d3f12d18100f57d5c90e6a4c69a604b52b7e
|
data/Gemfile
ADDED
data/README.md
CHANGED
@@ -1,39 +1,22 @@
|
|
1
|
-
#
|
1
|
+
# MacOS.rb
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/macos`. To experiment with that code, run `bin/console` for an interactive prompt.
|
3
|
+
A library for interacting with your Mac through ruby.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
Install the gem and add to the application's Gemfile by executing:
|
12
|
-
|
13
|
-
```bash
|
14
|
-
bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
|
15
|
-
```
|
16
|
-
|
17
|
-
If bundler is not being used to manage dependencies, install the gem by executing:
|
18
|
-
|
19
|
-
```bash
|
20
|
-
gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
|
7
|
+
```ruby
|
8
|
+
gem install macos
|
21
9
|
```
|
22
10
|
|
23
11
|
## Usage
|
24
12
|
|
25
|
-
|
13
|
+
### Screen
|
26
14
|
|
27
|
-
|
15
|
+
```ruby
|
16
|
+
require 'macos'
|
28
17
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/macos.
|
36
|
-
|
37
|
-
## License
|
38
|
-
|
39
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
18
|
+
screen = MacOS::screen
|
19
|
+
screen.capture do |tempfile|
|
20
|
+
# ...
|
21
|
+
end
|
22
|
+
```
|
data/bin/console
ADDED
data/bin/setup
ADDED
data/lib/macos/screen.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
module MacOS
|
2
|
+
module Screen
|
3
|
+
# @yield [tempfile]
|
4
|
+
# @yieldparam tempfile [Tempfile]
|
5
|
+
def capture
|
6
|
+
tempfile = Tempfile.new(['screenshot', '.png'])
|
7
|
+
system("screencapture -o -x #{tempfile.path}")
|
8
|
+
yield tempfile
|
9
|
+
ensure
|
10
|
+
tempfile.close
|
11
|
+
tempfile.unlink
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/macos/version.rb
CHANGED
data/lib/macos.rb
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require 'zeitwerk'
|
4
4
|
|
5
|
-
|
5
|
+
loader = Zeitwerk::Loader.for_gem
|
6
|
+
loader.inflector.inflect 'macos' => 'MacOS'
|
7
|
+
loader.setup
|
8
|
+
|
9
|
+
module MacOS
|
6
10
|
class Error < StandardError; end
|
7
|
-
|
11
|
+
|
12
|
+
# @return [MacOS::Screen]
|
13
|
+
def screen
|
14
|
+
Screen.new
|
15
|
+
end
|
8
16
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: macos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Sylvestre
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2024-11-18 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: zeitwerk
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
description: An interface (designed for LLMs) to macOS.
|
14
28
|
email:
|
15
29
|
- kevin@ksylvest.com
|
@@ -17,14 +31,13 @@ executables: []
|
|
17
31
|
extensions: []
|
18
32
|
extra_rdoc_files: []
|
19
33
|
files:
|
20
|
-
-
|
21
|
-
- ".rubocop.yml"
|
22
|
-
- LICENSE.txt
|
34
|
+
- Gemfile
|
23
35
|
- README.md
|
24
|
-
-
|
36
|
+
- bin/console
|
37
|
+
- bin/setup
|
25
38
|
- lib/macos.rb
|
39
|
+
- lib/macos/screen.rb
|
26
40
|
- lib/macos/version.rb
|
27
|
-
- sig/macos.rbs
|
28
41
|
homepage: https://github.com/ksylvest/macos
|
29
42
|
licenses:
|
30
43
|
- MIT
|
@@ -40,7 +53,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
40
53
|
requirements:
|
41
54
|
- - ">="
|
42
55
|
- !ruby/object:Gem::Version
|
43
|
-
version: 3.
|
56
|
+
version: 3.2.0
|
44
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
58
|
requirements:
|
46
59
|
- - ">="
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2024 Kevin Sylvestre
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
data/Rakefile
DELETED
data/sig/macos.rbs
DELETED