geewiz 0.1.1 → 0.1.2

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: d1f5049589b6ab231bba0aab5d7d437da6240845b83d92e2af6e4ad2930d8105
4
- data.tar.gz: dd0b70dcf9b924f46d595bd19bba021dabc5b407f6024f7f009b91d00a4cb2ea
3
+ metadata.gz: 014b8d7b3b4e8e467174f86e1784dbba0b1d83affbe0b19fa3c9cc6368c6573b
4
+ data.tar.gz: 0d503a8c1e3c3a0d3810728c9fb1d9d18e03530f6c39563e3b9e4548dd19aedc
5
5
  SHA512:
6
- metadata.gz: 862ddeb1f9b44362af4761bd23796a23aa623ae681a8d44c4e494385ff45d9fd497dfea448d77127aea30716aea66749629281975f4bd7e4d4be7e6254e86d8a
7
- data.tar.gz: ba0beadf1268fe38d63227a8286fc7a9d9d1dbe00cc41790ca2ca1a31f334169ff4bd86dab7a1c48c2b80dac73c24055d72f04e4f08f995a5b1f39079e18c304
6
+ metadata.gz: c98200cb66fc440a00d1af44c539719b54f72ca3d8a4c96283bb566d93f617588cef237b9ad80001b8e4280cc0a1abbc2cc64e63bd5b39c0b72bfd5122f6962c
7
+ data.tar.gz: 905180bc3a49a60aa8b104e267432ec71bb0eebd8fe847463a9af30219b69783c450364f211b51e74934e8cd7c0f14e2b6eb4fcde885faafdad7bfc03e0e7cda
data/geewiz.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.description = "Geewiz SDK for Ruby"
11
11
  # spec.homepage = "TODO: Put your gem's website or public repo URL here."
12
12
  spec.license = "MIT"
13
- spec.required_ruby_version = ">= 3.1.0"
13
+ spec.required_ruby_version = ">= 2.6.0"
14
14
 
15
15
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
16
16
  spec.metadata["rubygems_mfa_required"] = "true"
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  `git ls-files -z`.split("\x0").reject do |f|
26
26
  (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
27
27
  end
28
- end - %w[.rspec .rubocop.yml .rubocop_todo.yml Gemfile Gemfile.lock Rakefile]
28
+ end - %w[.rspec .rubocop.yml .rubocop_todo.yml Gemfile Gemfile.lock Rakefile .tool-versions]
29
29
  spec.bindir = "exe"
30
30
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
data/lib/geewiz/client.rb CHANGED
@@ -10,27 +10,35 @@ module Geewiz
10
10
  @vars = VarCache.new(self)
11
11
  end
12
12
 
13
- def command(type, **params) = @output.print "@#{[type, params].to_json}\n"
13
+ def command(type, **params)
14
+ @output.print "@#{[type, params].to_json}\n"
15
+ end
14
16
 
15
- def read = @input.readline
17
+ def read
18
+ @input.readline
19
+ end
16
20
 
17
- def read_response = JSON.parse(read)
21
+ def read_response
22
+ JSON.parse(read)
23
+ end
18
24
 
19
- def set(**options) = command("set", **options)
25
+ def set(**options)
26
+ command("set", **options)
27
+ end
20
28
 
21
29
  def card(id = nil, vars: {}, **params)
22
30
  vars.each { |name, value| var(name, value) }
23
- command "card", **params, **(id ? { id: } : {}), responseFormat: "json"
31
+ command "card", **params, **(id ? { id: id } : {}), responseFormat: "json"
24
32
  read_response
25
33
  end
26
34
 
27
35
  def get_user_config(key)
28
- command "get-user-config", key:, responseFormat: "json"
36
+ command "get-user-config", key: key, responseFormat: "json"
29
37
  read_response
30
38
  end
31
39
 
32
40
  def var(name, value)
33
- command("var", name:, value:)
41
+ command("var", name: name, value: value)
34
42
  vars.store name, value
35
43
  end
36
44
  end
@@ -6,7 +6,9 @@ module Geewiz
6
6
  @vars = {}
7
7
  end
8
8
 
9
- def [](name) = @vars[name.to_s]
9
+ def [](name)
10
+ @vars[name.to_s]
11
+ end
10
12
 
11
13
  def []=(*args)
12
14
  @client.var(*args)
@@ -1,3 +1,3 @@
1
1
  module Geewiz
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.1.2".freeze
3
3
  end
data/lib/geewiz.rb CHANGED
@@ -11,17 +11,31 @@ module Geewiz
11
11
 
12
12
  module_function
13
13
 
14
- def initialize_client(...)
15
- @client = Client.new(...)
14
+ def initialize_client(*args, **options)
15
+ @client = Client.new(*args, **options)
16
16
  end
17
17
 
18
- def client(...)
19
- @client ||= initialize_client(...)
18
+ def client(*args, **options)
19
+ @client ||= initialize_client(*args, **options)
20
20
  end
21
21
 
22
- def set(...) = client.set(...)
23
- def card(...) = client.card(...)
24
- def get_user_config(...) = client.get_user_config(...)
25
- def var(...) = client.var(...)
26
- def vars(...) = client.vars(...)
22
+ def set(*args, **options)
23
+ client.set(*args, **options)
24
+ end
25
+
26
+ def card(*args, **options)
27
+ client.card(*args, **options)
28
+ end
29
+
30
+ def get_user_config(*args, **options)
31
+ client.get_user_config(*args, **options)
32
+ end
33
+
34
+ def var(*args, **options)
35
+ client.var(*args, **options)
36
+ end
37
+
38
+ def vars
39
+ client.vars
40
+ end
27
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geewiz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Nicholaides
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-10 00:00:00.000000000 Z
11
+ date: 2024-08-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Geewiz SDK for Ruby
14
14
  email:
@@ -39,14 +39,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 3.1.0
42
+ version: 2.6.0
43
43
  required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  requirements: []
49
- rubygems_version: 3.3.27
49
+ rubygems_version: 3.5.11
50
50
  signing_key:
51
51
  specification_version: 4
52
52
  summary: Geewiz SDK for Ruby