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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e57ccde4764a60cb95d02db81cb77b9020fc9a49485ceb9cd072372b83a49771
4
- data.tar.gz: 35fa614ea29cbd22514e399421e020bd31b53684ff873557b2c473997f138622
3
+ metadata.gz: bd5cbbc912f0fab0192641cb14735ebbd151c1db00381dc1f837174a2dc2bff2
4
+ data.tar.gz: 30c5de93807739ead6fc84a5fdc899bf6041b5c9946f6b4f21961704d808ecda
5
5
  SHA512:
6
- metadata.gz: bd6b361dc972f420b4dddd63e26a6526c613c958e2e4d7468968ad1aeb14f9040582b60e8d63ddf7b0b8b4d26f785279882b0df7dfbe472ceeb95fbd152c6f00
7
- data.tar.gz: 95cb05ce401e150b188bbd5fa5dc1201b298d27fbeaa3d10b0ae3de4d46bbc8072f6cd4412f2f1ffe2303a47918b302207d407287047e0ba4ba4d74ddc283239
6
+ metadata.gz: 974a5ed9a34e8a890179836a5ad80d2fe584b5218d948d390d586fd8fd7df04d9bd303e248e30020f893675236b4f94ab53697f3faebd0a8ca64a6c02dbd0621
7
+ data.tar.gz: 766c1ea410a4f9e7ca8e7d05b2e5eddb115932c41356c8dfce44020558a68d3ede27cd9237449173b2a1e87656e8d3f12d18100f57d5c90e6a4c69a604b52b7e
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in macos.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
data/README.md CHANGED
@@ -1,39 +1,22 @@
1
- # Macos
1
+ # MacOS.rb
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
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
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
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
- TODO: Write usage instructions here
13
+ ### Screen
26
14
 
27
- ## Development
15
+ ```ruby
16
+ require 'macos'
28
17
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
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
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "macos"
6
+
7
+ require "irb"
8
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Macos
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/macos.rb CHANGED
@@ -1,8 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "macos/version"
3
+ require 'zeitwerk'
4
4
 
5
- module Macos
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
- # Your code goes here...
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre
8
8
  autorequire:
9
- bindir: exe
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
- - ".rspec"
21
- - ".rubocop.yml"
22
- - LICENSE.txt
34
+ - Gemfile
23
35
  - README.md
24
- - Rakefile
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.0.0
56
+ version: 3.2.0
44
57
  required_rubygems_version: !ruby/object:Gem::Requirement
45
58
  requirements:
46
59
  - - ">="
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,8 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 3.0
3
-
4
- Style/StringLiterals:
5
- EnforcedStyle: double_quotes
6
-
7
- Style/StringLiteralsInInterpolation:
8
- EnforcedStyle: double_quotes
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
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require "rubocop/rake_task"
9
-
10
- RuboCop::RakeTask.new
11
-
12
- task default: %i[spec rubocop]
data/sig/macos.rbs DELETED
@@ -1,4 +0,0 @@
1
- module Macos
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end