config_toys 0.3.0 → 0.4.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: 86ca05f24b7305c4e23384e844d08493d2de72d809edc46b8057ceccac6a2e6d
4
- data.tar.gz: f38a2730e2479653cf230d4b2446351cdd3532145ea388421b4b4776d4c98ff5
3
+ metadata.gz: 759ae044052495343ebbb41e29da06d1e3319bc533d8887699d702571969668e
4
+ data.tar.gz: 8adcf33e877ccbd734174afe92bbbaeb5aeb2d2aa4b8ff53680dacd90be50ebf
5
5
  SHA512:
6
- metadata.gz: e39949241f0810eb2b7300ad281dc8edd17a0a440c72d7da74849bc29cadff12c8e9710a3f6d99b380fddd6f1b3db89f58d6c967c23b9d9fade6e661800a0541
7
- data.tar.gz: d3acf8834a09fa8e3520a3e57ae2d903bd2c227aeccdb5c3ce5967b4a71042f11d1ee1aa6141c08f88d9a0df1b579b55d13e4a51ee71a6364518e18c0303e8a7
6
+ metadata.gz: 0f22c6acc2b4ab059b3a3ae3785812c623c282789515e0dca39b1136bae46e148894ab7170775580d9518f289d490d323b2a9e833187c6c5eafb620d66083af9
7
+ data.tar.gz: 8555d5da58b07f181f81870ec152f7b892de037ec6fdaf65f223731c08af8ec127e46d765e8f826f8ce2a6bca7a190e2b2b605e6ea71956df83a0116530ae31a
data/CHANGELOG.md CHANGED
@@ -1,9 +1,21 @@
1
1
  # Changelog
2
2
 
3
- ## master (unreleased)
3
+ ## Unreleased
4
+
5
+ ## 0.4.0 (2021-10-18)
6
+
7
+ * Add default for `:config_dir`.
8
+ * Add `skip` and `quit` answers.
9
+ * Add Ruby 3.0 for CI.
10
+ * Add `bundle-audit` CI task.
11
+ * Update development dependencies.
4
12
 
5
13
  ## 0.3.0 (2020-09-30)
6
14
 
15
+ * Move check for `EDITOR` environment variable inside `example_file`.
16
+ Check only when trying to edit.
17
+ * Update development dependencies.
18
+
7
19
  ## 0.2.0 (2020-08-23)
8
20
 
9
21
  * Update `toys`
data/README.md CHANGED
@@ -36,6 +36,7 @@ gem install config_toys
36
36
  ```ruby
37
37
  ## .toys/.toys.rb
38
38
  require 'config_toys'
39
+ ## `:config_dir` can be a String or a Proc, default is `-> { "#{context_directory}/config" }`
39
40
  expand ConfigToys::Template, config_dir: "#{__dir__}/../config"
40
41
  ```
41
42
 
@@ -9,7 +9,7 @@ module ConfigToys
9
9
 
10
10
  attr_reader :config_dir
11
11
 
12
- def initialize(config_dir:)
12
+ def initialize(config_dir: -> { "#{context_directory}/config" })
13
13
  @config_dir = config_dir
14
14
  end
15
15
 
@@ -18,9 +18,26 @@ module ConfigToys
18
18
  tool :check do
19
19
  desc 'Check config files'
20
20
 
21
+ self::ADDITIONAL_CHOICES = {
22
+ skip: -> { puts "#{@regular_basename} remains unchanged" },
23
+ quit: -> { exit }
24
+ }.freeze
25
+
26
+ self::SEPARATOR = <<~SEPARATOR
27
+
28
+ ---
29
+
30
+ SEPARATOR
31
+
21
32
  to_run do
22
33
  require 'example_file'
23
- ExampleFile.all(template.config_dir).each(&:actualize_regular_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|
37
+ example_file.choices.merge! self.class::ADDITIONAL_CHOICES
38
+ example_file.question_prefix = self.class::SEPARATOR if index.positive?
39
+ example_file.actualize_regular_file
40
+ end
24
41
  end
25
42
  end
26
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConfigToys
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.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.3.0
4
+ version: 0.4.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: 2020-09-30 00:00:00.000000000 Z
11
+ date: 2021-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: example_file
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.0
19
+ version: 0.3.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.2.0
26
+ version: 0.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: toys-core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.11.0
33
+ version: 0.12.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.11.0
40
+ version: 0.12.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry-byebug
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,42 +72,56 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.4.0
75
+ version: 0.10.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.4.0
82
+ version: 0.10.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: toys
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.11.0
89
+ version: 0.12.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.11.0
96
+ version: 0.12.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: bundler-audit
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.9.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.9.0
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: codecov
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - "~>"
102
116
  - !ruby/object:Gem::Version
103
- version: 0.2.2
117
+ version: 0.6.0
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
122
  - - "~>"
109
123
  - !ruby/object:Gem::Version
110
- version: 0.2.2
124
+ version: 0.6.0
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: rspec
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -128,28 +142,28 @@ dependencies:
128
142
  requirements:
129
143
  - - "~>"
130
144
  - !ruby/object:Gem::Version
131
- version: 0.19.0
145
+ version: 0.21.2
132
146
  type: :development
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
150
  - - "~>"
137
151
  - !ruby/object:Gem::Version
138
- version: 0.19.0
152
+ version: 0.21.2
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: rubocop
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
157
  - - "~>"
144
158
  - !ruby/object:Gem::Version
145
- version: 0.92.0
159
+ version: '1.2'
146
160
  type: :development
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
164
  - - "~>"
151
165
  - !ruby/object:Gem::Version
152
- version: 0.92.0
166
+ version: '1.2'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: rubocop-performance
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +184,14 @@ dependencies:
170
184
  requirements:
171
185
  - - "~>"
172
186
  - !ruby/object:Gem::Version
173
- version: '1.0'
187
+ version: '2.0'
174
188
  type: :development
175
189
  prerelease: false
176
190
  version_requirements: !ruby/object:Gem::Requirement
177
191
  requirements:
178
192
  - - "~>"
179
193
  - !ruby/object:Gem::Version
180
- version: '1.0'
194
+ version: '2.0'
181
195
  description: 'Toys template for applications configuration.
182
196
 
183
197
  '
@@ -215,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
229
  - !ruby/object:Gem::Version
216
230
  version: '0'
217
231
  requirements: []
218
- rubygems_version: 3.1.2
232
+ rubygems_version: 3.2.22
219
233
  signing_key:
220
234
  specification_version: 4
221
235
  summary: Toys template for applications configuration.