runcom 5.0.2 → 5.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: 1671907158971dc091f2a33af0f631a7820a97c6d471516611e3a2220bb8fc77
4
- data.tar.gz: 494525badf66b208f4769a76bdf07b7afdfffb7a1ae8bd9c71ea11ef7fe11720
3
+ metadata.gz: 17c7986ba58baa811d2d3d679cf76f4593e423ea473ca1a2e73e87f52e0f65f5
4
+ data.tar.gz: 6b46d51115e6ec117c9b824e2aa5aba5c048f84291a40e5f90a5dc7a6d025e84
5
5
  SHA512:
6
- metadata.gz: b606a3ed967ccc38c10dbb511fd41e2419916d6299f677710782452355b29938be3b0f2b75008ca305ae07d596e1b345bb31ddbc430e9aad8585c1b1d14ac9fc
7
- data.tar.gz: 7af6eb343d65305af582632eb3539a8bbcfa54fd149c4c9da21c1c23ccaa186e216aaefa85b745ce893650915126f2b55cb74ed53b60d594323d3fb8c06d8b21
6
+ metadata.gz: 5feb51c506a5a9d8e2685d5486baf36695c09b1ed6db364bac36194b3acc72ab8d69a90f853b5e79e205df63aed86a57ac9e7baab42c67b6557a4de829d54a58
7
+ data.tar.gz: 349661bf5d6752b8096201e6bb6cc68a5eebf6eca8b6b27e426ec2bfc394e3f606e02c0b26f3275e34ca3170ee617c427e09dce3c25db3f283ab1950fc63f70b
@@ -1,3 +1 @@
1
- U��ۚ����9'P ) �ْ<��ú-Ч�]Rg ��@ȟ|f �&�pbMO��'PW)-�~d
2
- �M-���x��uŇ��3�l�K��HE��:��4��$��X������n�ϖC�Tn�%^��
3
- ��Q�}?���Ɣ�\l�+HZ���I�I_`���Y�(4s�V5� X�X��!�P�_R� ���g"o��X�-+=\PԬ��P�
1
+ �!�r��HsMp���� q �?.oL���'Dm�)MI�"�S_�Ӷ P!�oRX��W��frÎd�A��4G�.A�zSJ`3� }`�h�c&�bG�m6�y�a��^cð�5"�A�u�P��W�ht�;Z��E��xB� 2B"�&cR,+�
data.tar.gz.sig CHANGED
Binary file
@@ -3,11 +3,16 @@
3
3
  module Runcom
4
4
  # A developer friendly wrapper of XDG cache.
5
5
  Cache = Struct.new :name, :home, :environment, keyword_init: true do
6
+ extend Forwardable
7
+
8
+ delegate %i[inspect] => :cache
9
+
6
10
  def initialize *arguments
7
11
  super
8
12
 
9
13
  self[:home] ||= Runcom::Paths::Friendly
10
14
  self[:environment] ||= ENV
15
+ @cache = XDG::Cache.new home: home, environment: environment
11
16
  freeze
12
17
  end
13
18
 
@@ -16,7 +21,11 @@ module Runcom
16
21
  end
17
22
 
18
23
  def paths
19
- XDG::Cache.new(home: home, environment: environment).all
24
+ cache.all
20
25
  end
26
+
27
+ private
28
+
29
+ attr_reader :cache
21
30
  end
22
31
  end
@@ -4,28 +4,35 @@ require "pathname"
4
4
  require "yaml"
5
5
  require "refinements/hashes"
6
6
 
7
+ # :reek:TooManyInstanceVariables
7
8
  module Runcom
8
9
  # A developer friendly wrapper of XDG config.
9
10
  class Config
11
+ extend Forwardable
10
12
  using Refinements::Hashes
11
13
 
12
14
  DEFAULT_FILE_NAME = "configuration.yml"
13
15
 
14
- def initialize name, file_name: DEFAULT_FILE_NAME, defaults: {}
16
+ delegate %i[inspect] => :config
17
+
18
+ # rubocop:disable Metrics/ParameterLists
19
+ def initialize name, environment: ENV, file_name: DEFAULT_FILE_NAME, defaults: {}
15
20
  @name = name
21
+ @environment = environment
16
22
  @file_name = file_name
17
23
  @defaults = defaults
24
+ @config = XDG::Config.new home: Runcom::Paths::Friendly, environment: environment
18
25
  @settings = defaults.deep_merge process_settings
26
+ freeze
19
27
  end
28
+ # rubocop:enable Metrics/ParameterLists
20
29
 
21
30
  def path
22
31
  paths.find(&:exist?)
23
32
  end
24
33
 
25
34
  def paths
26
- XDG::Config.new(home: Runcom::Paths::Friendly).all.map do |root|
27
- Pathname "#{root}/#{name}/#{file_name}"
28
- end
35
+ config.all.map { |root| Pathname "#{root}/#{name}/#{file_name}" }
29
36
  end
30
37
 
31
38
  def merge other
@@ -49,7 +56,7 @@ module Runcom
49
56
 
50
57
  private
51
58
 
52
- attr_reader :name, :file_name, :defaults, :settings
59
+ attr_reader :name, :environment, :file_name, :defaults, :settings, :config
53
60
 
54
61
  def process_settings
55
62
  load_settings
@@ -5,11 +5,16 @@ require "pathname"
5
5
  module Runcom
6
6
  # A developer friendly wrapper of XDG data.
7
7
  Data = Struct.new :name, :home, :environment, keyword_init: true do
8
+ extend Forwardable
9
+
10
+ delegate %i[inspect] => :data
11
+
8
12
  def initialize *arguments
9
13
  super
10
14
 
11
15
  self[:home] ||= Runcom::Paths::Friendly
12
16
  self[:environment] ||= ENV
17
+ @data = XDG::Data.new home: home, environment: environment
13
18
  freeze
14
19
  end
15
20
 
@@ -18,9 +23,11 @@ module Runcom
18
23
  end
19
24
 
20
25
  def paths
21
- XDG::Data.new(home: home, environment: environment).all.map do |root|
22
- Pathname "#{root}/#{name}"
23
- end
26
+ data.all.map { |root| Pathname "#{root}/#{name}" }
24
27
  end
28
+
29
+ private
30
+
31
+ attr_reader :data
25
32
  end
26
33
  end
@@ -12,7 +12,7 @@ module Runcom
12
12
  end
13
13
 
14
14
  def self.version
15
- "5.0.2"
15
+ "5.1.0"
16
16
  end
17
17
 
18
18
  def self.version_label
@@ -21,6 +21,10 @@ module Runcom
21
21
  end
22
22
  end
23
23
 
24
+ def inspect
25
+ [standard.key, dynamic].compact.join XDG::PAIR_DELIMITER
26
+ end
27
+
24
28
  private
25
29
 
26
30
  attr_reader :standard
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runcom
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.2
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,7 +28,7 @@ cert_chain:
28
28
  dKvURM+1PwDCzC5tvRwjhUJIizau6+MtkFCvJHmaAj1aZL3odcPejHj5Hxt/0CUW
29
29
  y84=
30
30
  -----END CERTIFICATE-----
31
- date: 2019-09-01 00:00:00.000000000 Z
31
+ date: 2019-10-01 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: refinements
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '3.0'
53
+ version: '3.1'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '3.0'
60
+ version: '3.1'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: bundler-audit
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -72,20 +72,6 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0.6'
75
- - !ruby/object:Gem::Dependency
76
- name: climate_control
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '0.1'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '0.1'
89
75
  - !ruby/object:Gem::Dependency
90
76
  name: gemsmith
91
77
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file