config_toys 0.5.0 → 0.6.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: 8c7f4ade68c51e37c6edb420134c8f2cdf8b59abe1197d5a710dec1ca265884a
4
- data.tar.gz: ece87c1444e79fcc880c853e182493be078a1776841ee329d353ddc46d33fa59
3
+ metadata.gz: 83017b128ee5510c999ebf9ac854c70f222e59bb4248a1eee57c91b59dd1e701
4
+ data.tar.gz: e394c7d0582ce2ead313190050005c12ce5735ec7773c06646672297ac4e9d28
5
5
  SHA512:
6
- metadata.gz: e785742b18d6fa463037cd5ab882ee3112208ded73f21488c6c375874932ad854c34656d3842ccaed8c2b93b4920750db3f9ce284c58afc5410f043d63f9d9ae
7
- data.tar.gz: e6954db527e249ea9753563b3bd51be225ce2ea0d4e6a812ccd2ceff598f556c85d52c19c21c6fc7d5bad87d196d060a05a3e2291be2b991d87237404484a4f8
6
+ metadata.gz: 1e20fe4fa988dd6abceaa7c910eae1ce50eab2a4c5f91c858b50beaa9c26fe70afc07a378a16f5811115cb80f6ec58d4a53335eef3220b3799029706d71c606b
7
+ data.tar.gz: 10071130da74011017c5c0864186d9c858038effc23e4c40bf97688a8f936fbcb2d3995af7ffc3acba20ec658c21b59895e1480cd4480b5f809e066a50c11849
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.6.0 (2022-09-29)
6
+
7
+ * Add `initialize` (`init`) toy.
8
+ Useful for initial project generation.
9
+ * Update development dependencies.
10
+ * Improve CI.
11
+
5
12
  ## 0.5.0 (2022-03-03)
6
13
 
7
14
  * Drop Ruby 2.5 support.
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Config Toys
2
2
 
3
3
  ![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/AlexWayfer/config_toys?style=flat-square)
4
- [![Codecov branch](https://img.shields.io/codecov/c/github/AlexWayfer/config_toys/master.svg?style=flat-square)](https://codecov.io/gh/AlexWayfer/config_toys)
4
+ [![Codecov branch](https://img.shields.io/codecov/c/github/AlexWayfer/config_toys/main.svg?style=flat-square)](https://codecov.io/gh/AlexWayfer/config_toys)
5
5
  [![Code Climate](https://img.shields.io/codeclimate/maintainability/AlexWayfer/config_toys.svg?style=flat-square)](https://codeclimate.com/github/AlexWayfer/config_toys)
6
6
  ![Depfu](https://img.shields.io/depfu/AlexWayfer/config_toys?style=flat-square)
7
- [![Inline docs](https://inch-ci.org/github/AlexWayfer/config_toys.svg?branch=master)](https://inch-ci.org/github/AlexWayfer/config_toys)
8
- [![license](https://img.shields.io/github/license/AlexWayfer/config_toys.svg?style=flat-square)](https://github.com/AlexWayfer/config_toys/blob/master/LICENSE.txt)
7
+ [![Inline docs](https://inch-ci.org/github/AlexWayfer/config_toys.svg?branch=main)](https://inch-ci.org/github/AlexWayfer/config_toys)
9
8
  [![Gem](https://img.shields.io/gem/v/config_toys.svg?style=flat-square)](https://rubygems.org/gems/config_toys)
9
+ [![License](https://img.shields.io/github/license/AlexWayfer/config_toys.svg?style=flat-square)](LICENSE.txt)
10
10
 
11
11
  Toys template for applications configuration,
12
12
  like [Flame](https://github.com/AlexWayfer/flame), but not necessarily.
@@ -2,6 +2,8 @@
2
2
 
3
3
  require 'toys-core'
4
4
 
5
+ require 'example_file'
6
+
5
7
  module ConfigToys
6
8
  ## Define toys for benchmark
7
9
  class Template
@@ -10,11 +12,21 @@ module ConfigToys
10
12
  attr_reader :config_dir
11
13
 
12
14
  def initialize(config_dir: -> { "#{context_directory}/config" })
13
- @config_dir = config_dir
15
+ @config_dir = config_dir.is_a?(Proc) ? instance_exec(&config_dir) : config_dir
14
16
  end
15
17
 
16
18
  on_expand do |template|
17
19
  tool :config do
20
+ tool :initialize do
21
+ desc 'Initialize config files'
22
+
23
+ to_run do
24
+ ExampleFile.all(template.config_dir).each(&:initialize_regular_file)
25
+ end
26
+ end
27
+
28
+ alias_tool :init, :initialize
29
+
18
30
  tool :check do
19
31
  desc 'Check config files'
20
32
 
@@ -30,10 +42,7 @@ module ConfigToys
30
42
  SEPARATOR
31
43
 
32
44
  to_run do
33
- require 'example_file'
34
- config_dir = template.config_dir
35
- config_dir = instance_exec(&config_dir) if config_dir.is_a? Proc
36
- ExampleFile.all(config_dir).each_with_index do |example_file, index|
45
+ ExampleFile.all(template.config_dir).each_with_index do |example_file, index|
37
46
  example_file.choices.merge! self.class::ADDITIONAL_CHOICES
38
47
  example_file.question_prefix = self.class::SEPARATOR if index.positive?
39
48
  example_file.actualize_regular_file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConfigToys
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_toys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-03 00:00:00.000000000 Z
11
+ date: 2022-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: example_file
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.0
19
+ version: 0.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.0
26
+ version: 0.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: toys-core
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -109,61 +109,61 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: 0.9.0
111
111
  - !ruby/object:Gem::Dependency
112
- name: codecov
112
+ name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.6.0
117
+ version: '3.9'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.6.0
124
+ version: '3.9'
125
125
  - !ruby/object:Gem::Dependency
126
- name: rspec
126
+ name: simplecov
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '3.9'
131
+ version: 0.21.2
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '3.9'
138
+ version: 0.21.2
139
139
  - !ruby/object:Gem::Dependency
140
- name: simplecov
140
+ name: simplecov-cobertura
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.21.2
145
+ version: '2.1'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.21.2
152
+ version: '2.1'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rubocop
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.25.1
159
+ version: 1.36.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.25.1
166
+ version: 1.36.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rubocop-performance
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -212,8 +212,8 @@ licenses:
212
212
  - MIT
213
213
  metadata:
214
214
  bug_tracker_uri: https://github.com/AlexWayfer/config_toys/issues
215
- changelog_uri: https://github.com/AlexWayfer/config_toys/blob/v0.5.0/CHANGELOG.md
216
- documentation_uri: http://www.rubydoc.info/gems/config_toys/0.5.0
215
+ changelog_uri: https://github.com/AlexWayfer/config_toys/blob/v0.6.0/CHANGELOG.md
216
+ documentation_uri: http://www.rubydoc.info/gems/config_toys/0.6.0
217
217
  homepage_uri: https://github.com/AlexWayfer/config_toys
218
218
  rubygems_mfa_required: 'true'
219
219
  source_code_uri: https://github.com/AlexWayfer/config_toys