tone 0.0.0 → 0.1.0

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: 0d3017ae0f1faf02c19825100422d443e068b901b29e6568c0b07d912452970f
4
- data.tar.gz: 4d86df41de0b4f81cfac5924e065f7f17fa5e73e484e86c7071fcc5218fcb906
3
+ metadata.gz: 803a8df0924e05ab33d732bdcedcec8cec4a76c31fb5613127f2849425c8026b
4
+ data.tar.gz: d0247c2613d4ee0dcd776e829541b8af737b720ae3bc41bb3c2470df38544e5b
5
5
  SHA512:
6
- metadata.gz: b5701133e078fa303fdeb3fa3be36a2b7e0059fe0f0b42f7dae2a5320ed6744dc51021ea19d0d2ec107ed15e312a0c1a8c0e0a8eef295f84afa600941e1a972d
7
- data.tar.gz: 2f18052fcd993427dd8e0accf3df23ca0cfbfdb59b38c29f72930864025bb01c2837c9c7401312d69759a32235c536f5ccfaa4eaeea574a37b9245e6fa669582
6
+ metadata.gz: a78cc339e5100a10fddc26d41f56550cc0961b2ee6f5c1da42d1ce2c3d5204be4ca0d1816657cc360c087e75dc6bd994f8db164da8073217e550d07eaa31c527
7
+ data.tar.gz: 2c5881cda025ebb59298c7e28a1ab108b14a00f38f025e8838f35881561ae1ce30ba2d9fa59e4a51a5430d8c741a0e891a03f2aa244bfc2a61051e2584d5bb79
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -18,31 +18,45 @@ toc::[]
18
18
  * Provides aliasing of color configurations.
19
19
  * Provides quick access to default and aliased styles.
20
20
 
21
+ == Screenshots
22
+
23
+ image::https://alchemists.io/images/projects/tone/screenshot.png[A screenshot of colors,width=200,height=900,role=focal_point]
24
+
21
25
  == Requirements
22
26
 
23
27
  . link:https://www.ruby-lang.org[Ruby].
24
28
 
25
29
  == Setup
26
30
 
27
- To install, run:
31
+ To install _with_ security, run:
28
32
 
29
- [source,ruby]
33
+ [source,bash]
34
+ ----
35
+ # 💡 Skip this line if you already have the public certificate installed.
36
+ gem cert --add <(curl --compressed --location https://alchemists.io/gems.pem)
37
+ gem install tone --trust-policy HighSecurity
38
+ ----
39
+
40
+ To install _without_ security, run:
41
+
42
+ [source,bash]
30
43
  ----
31
44
  gem install tone
32
45
  ----
33
46
 
34
- You can also add the gem directly to your project (preferred):
47
+ You can also add the gem directly to your project:
35
48
 
36
- [source,ruby]
49
+ [source,bash]
37
50
  ----
38
51
  bundle add tone
39
52
  ----
40
53
 
41
54
  Once the gem is installed, you only need to require it:
42
55
 
43
- ```
56
+ [source,ruby]
57
+ ----
44
58
  require "tone"
45
- ```
59
+ ----
46
60
 
47
61
  == Usage
48
62
 
@@ -419,7 +433,7 @@ You use the IRB console for direct access to all objects:
419
433
  bin/console
420
434
  ----
421
435
 
422
- Lastly, there is a `bin/show` script which can be run to display all default styles for quick visual convenience:
436
+ Lastly, there is a `bin/show` script which will display all default styles for quick visual convenience. This is the same script that was used to generate the screenshot you saw at the top of this document.
423
437
 
424
438
  [source,bash]
425
439
  ----
data/lib/tone/aliaser.rb CHANGED
@@ -46,10 +46,7 @@ module Tone
46
46
  end
47
47
 
48
48
  def check_duplicate key
49
- kind = key.inspect
50
-
51
- fail Error, "Duplicate alias detected (already exists): #{kind}." if custom.key? key
52
- fail Error, "Alias mustn't duplicate (override) default: #{kind}." if defaults.key? key
49
+ fail Error, "Alias mustn't duplicate (override) default: #{key.inspect}." if defaults.key? key
53
50
  end
54
51
 
55
52
  def check_style key, style
data/lib/tone/client.rb CHANGED
@@ -34,6 +34,8 @@ module Tone
34
34
 
35
35
  def find_symbols(*codes) = defaults.invert.values_at(*codes)
36
36
 
37
+ def inspect = %(#<#{self.class} @encoder=#{encoder} @decoder=#{decoder} @aliaser=#{aliaser})
38
+
37
39
  private
38
40
 
39
41
  attr_reader :aliaser, :encoder, :decoder
@@ -1,16 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "pathname"
3
4
  require "yaml"
4
5
 
5
6
  module Tone
6
7
  module Configuration
7
8
  # Loads the default configuration into memory as a frozen hash.
8
9
  class Loader
9
- def initialize path: Pathname("#{__dir__}/defaults.yml")
10
+ def initialize path = Pathname("#{__dir__}/defaults.yml")
10
11
  @path = path
11
12
  end
12
13
 
13
- def call = YAML.safe_load(path.read, symbolize_names: true).freeze
14
+ def call = YAML.safe_load_file path, symbolize_names: true, freeze: true
14
15
 
15
16
  private
16
17
 
data/tone.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "tone"
5
- spec.version = "0.0.0"
5
+ spec.version = "0.1.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/tone"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2023-04-01 00:00:00.000000000 Z
38
+ date: 2023-04-10 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: refinements
metadata.gz.sig CHANGED
Binary file