planter-cli 0.0.4 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.gitmodules +3 -0
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +31 -0
- data/README.md +33 -4
- data/Rakefile +52 -16
- data/bin/plant +2 -2
- data/docker/Dockerfile +2 -4
- data/docker/Dockerfile-2.6 +4 -6
- data/docker/Dockerfile-2.7 +4 -6
- data/docker/Dockerfile-3.0 +4 -5
- data/docker/Dockerfile-3.3 +11 -0
- data/docker/sources.list +11 -0
- data/lib/planter/array.rb +17 -0
- data/lib/planter/fileentry.rb +5 -1
- data/lib/planter/filelist.rb +13 -4
- data/lib/planter/hash.rb +17 -1
- data/lib/planter/plant.rb +5 -3
- data/lib/planter/prompt.rb +5 -5
- data/lib/planter/string.rb +22 -0
- data/lib/planter/tag.rb +91 -0
- data/lib/planter/version.rb +1 -1
- data/lib/planter.rb +34 -18
- data/lib/tty-spinner/.editorconfig +9 -0
- data/lib/tty-spinner/.github/FUNDING.yml +1 -0
- data/lib/tty-spinner/.github/ISSUE_TEMPLATE/BUG_REPORT.md +31 -0
- data/lib/tty-spinner/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +23 -0
- data/lib/tty-spinner/.github/ISSUE_TEMPLATE/config.yml +5 -0
- data/lib/tty-spinner/.github/PULL_REQUEST_TEMPLATE.md +19 -0
- data/lib/tty-spinner/.github/workflows/ci.yml +59 -0
- data/lib/tty-spinner/.gitignore +14 -0
- data/lib/tty-spinner/.rspec +2 -0
- data/lib/tty-spinner/.rubocop.yml +78 -0
- data/lib/tty-spinner/CHANGELOG.md +151 -0
- data/lib/tty-spinner/CODE_OF_CONDUCT.md +132 -0
- data/lib/tty-spinner/Gemfile +17 -0
- data/lib/tty-spinner/LICENSE.txt +22 -0
- data/lib/tty-spinner/README.md +581 -0
- data/lib/tty-spinner/Rakefile +10 -0
- data/lib/tty-spinner/appveyor.yml +33 -0
- data/lib/tty-spinner/bin/console +14 -0
- data/lib/tty-spinner/bin/setup +8 -0
- data/lib/tty-spinner/demo.gif +0 -0
- data/lib/tty-spinner/examples/auto_spin.rb +10 -0
- data/lib/tty-spinner/examples/basic.rb +10 -0
- data/lib/tty-spinner/examples/clear.rb +11 -0
- data/lib/tty-spinner/examples/color.rb +14 -0
- data/lib/tty-spinner/examples/error.rb +11 -0
- data/lib/tty-spinner/examples/formats.rb +13 -0
- data/lib/tty-spinner/examples/hide_cursor.rb +14 -0
- data/lib/tty-spinner/examples/log.rb +13 -0
- data/lib/tty-spinner/examples/multi/basic.rb +15 -0
- data/lib/tty-spinner/examples/multi/basic_top_level.rb +15 -0
- data/lib/tty-spinner/examples/multi/custom_style.rb +28 -0
- data/lib/tty-spinner/examples/multi/files.rb +16 -0
- data/lib/tty-spinner/examples/multi/jobs.rb +11 -0
- data/lib/tty-spinner/examples/multi/multi.rb +19 -0
- data/lib/tty-spinner/examples/multi/multi_top_level.rb +20 -0
- data/lib/tty-spinner/examples/multi/pause.rb +28 -0
- data/lib/tty-spinner/examples/multi/threaded.rb +30 -0
- data/lib/tty-spinner/examples/pause.rb +24 -0
- data/lib/tty-spinner/examples/run.rb +20 -0
- data/lib/tty-spinner/examples/success.rb +11 -0
- data/lib/tty-spinner/examples/threaded.rb +13 -0
- data/lib/tty-spinner/examples/update.rb +13 -0
- data/lib/tty-spinner/lib/tty/spinner/formats.rb +274 -0
- data/lib/tty-spinner/lib/tty/spinner/multi.rb +352 -0
- data/lib/tty-spinner/lib/tty/spinner/version.rb +7 -0
- data/lib/tty-spinner/lib/tty/spinner.rb +604 -0
- data/lib/tty-spinner/lib/tty-spinner.rb +2 -0
- data/lib/tty-spinner/spec/spec_helper.rb +52 -0
- data/lib/tty-spinner/spec/unit/auto_spin_spec.rb +25 -0
- data/lib/tty-spinner/spec/unit/clear_spec.rb +16 -0
- data/lib/tty-spinner/spec/unit/error_spec.rb +53 -0
- data/lib/tty-spinner/spec/unit/events_spec.rb +35 -0
- data/lib/tty-spinner/spec/unit/formats_spec.rb +9 -0
- data/lib/tty-spinner/spec/unit/frames_spec.rb +31 -0
- data/lib/tty-spinner/spec/unit/hide_cursor_spec.rb +51 -0
- data/lib/tty-spinner/spec/unit/job_spec.rb +12 -0
- data/lib/tty-spinner/spec/unit/join_spec.rb +10 -0
- data/lib/tty-spinner/spec/unit/log_spec.rb +60 -0
- data/lib/tty-spinner/spec/unit/multi/auto_spin_spec.rb +32 -0
- data/lib/tty-spinner/spec/unit/multi/error_spec.rb +107 -0
- data/lib/tty-spinner/spec/unit/multi/line_inset_spec.rb +57 -0
- data/lib/tty-spinner/spec/unit/multi/on_spec.rb +11 -0
- data/lib/tty-spinner/spec/unit/multi/register_spec.rb +46 -0
- data/lib/tty-spinner/spec/unit/multi/spin_spec.rb +101 -0
- data/lib/tty-spinner/spec/unit/multi/stop_spec.rb +95 -0
- data/lib/tty-spinner/spec/unit/multi/success_spec.rb +108 -0
- data/lib/tty-spinner/spec/unit/new_spec.rb +25 -0
- data/lib/tty-spinner/spec/unit/pause_spec.rb +43 -0
- data/lib/tty-spinner/spec/unit/reset_spec.rb +19 -0
- data/lib/tty-spinner/spec/unit/run_spec.rb +30 -0
- data/lib/tty-spinner/spec/unit/spin_spec.rb +117 -0
- data/lib/tty-spinner/spec/unit/stop_spec.rb +88 -0
- data/lib/tty-spinner/spec/unit/success_spec.rb +53 -0
- data/lib/tty-spinner/spec/unit/tty_spec.rb +8 -0
- data/lib/tty-spinner/spec/unit/update_spec.rb +85 -0
- data/lib/tty-spinner/tasks/console.rake +11 -0
- data/lib/tty-spinner/tasks/coverage.rake +11 -0
- data/lib/tty-spinner/tasks/spec.rake +29 -0
- data/lib/tty-spinner/tty-spinner.gemspec +36 -0
- data/planter-cli.gemspec +1 -0
- data/scripts/runtests.sh +1 -1
- data/spec/cli_spec.rb +27 -0
- data/spec/planter/hash_spec.rb +27 -0
- data/spec/planter_spec.rb +15 -0
- data/spec/spec_helper.rb +26 -0
- data/spec/templates/test/%%project:snake%%.rtf +10 -0
- data/spec/templates/test/Rakefile +6 -0
- data/spec/templates/test/_planter.yml +3 -6
- data/spec/templates/test/test.rb +5 -0
- data/src/_README.md +20 -3
- metadata +108 -3
data/lib/planter/tag.rb
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Planter
|
|
4
|
+
module Tag
|
|
5
|
+
class << self
|
|
6
|
+
def set(target, tags)
|
|
7
|
+
return false unless TTY::Which.exist?('xattr')
|
|
8
|
+
|
|
9
|
+
tags = [tags] unless tags.is_a?(Array)
|
|
10
|
+
|
|
11
|
+
set_tags(target, tags)
|
|
12
|
+
$? == 0
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Add tags to a directory.
|
|
16
|
+
#
|
|
17
|
+
# @param dir [String] The directory to tag.
|
|
18
|
+
# @param tags [Array<String>] The tags to add.
|
|
19
|
+
def add(target, tags)
|
|
20
|
+
return false unless TTY::Which.exist?('xattr')
|
|
21
|
+
|
|
22
|
+
tags = [tags] unless tags.is_a?(Array)
|
|
23
|
+
existing_tags = get(target)
|
|
24
|
+
tags.concat(existing_tags).uniq!
|
|
25
|
+
|
|
26
|
+
set_tags(target, tags)
|
|
27
|
+
|
|
28
|
+
res = $? == 0
|
|
29
|
+
|
|
30
|
+
if res
|
|
31
|
+
Planter.notify("[Added tags] to #{target}", :debug, above_spinner: true)
|
|
32
|
+
else
|
|
33
|
+
Planter.notify("Failed to add tags to #{target}", :error)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
res
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def get(target)
|
|
40
|
+
return false unless TTY::Which.exist?('xattr')
|
|
41
|
+
|
|
42
|
+
res = `xattr -p com.apple.metadata:_kMDItemUserTags "#{target}" 2>/dev/null`.clean_encode
|
|
43
|
+
return [] if res =~ /no such xattr/ || res.empty?
|
|
44
|
+
|
|
45
|
+
tags = Plist.parse_xml(res)
|
|
46
|
+
|
|
47
|
+
return false if tags.nil?
|
|
48
|
+
|
|
49
|
+
tags
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def copy(source, target)
|
|
53
|
+
return false unless TTY::Which.exist?('xattr')
|
|
54
|
+
|
|
55
|
+
tags = `xattr -px com.apple.metadata:_kMDItemUserTags "#{source}" 2>/dev/null`
|
|
56
|
+
`xattr -wx com.apple.metadata:_kMDItemUserTags "#{tags}" "#{target}"`
|
|
57
|
+
res = $? == 0
|
|
58
|
+
|
|
59
|
+
if res
|
|
60
|
+
Planter.notify("[Copied tags] from #{source} to #{target}", :debug, above_spinner: true)
|
|
61
|
+
else
|
|
62
|
+
Planter.notify("Failed to copy tags from #{source} to #{target}", :error)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
res
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
private
|
|
69
|
+
|
|
70
|
+
def set_tags(target, tags)
|
|
71
|
+
return false unless TTY::Which.exist?('xattr')
|
|
72
|
+
|
|
73
|
+
tags.map! { |tag| "<string>#{tag}</string>" }
|
|
74
|
+
`xattr -w com.apple.metadata:_kMDItemUserTags '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
75
|
+
<plist version="1.0">
|
|
76
|
+
<array>#{tags.join}</array>
|
|
77
|
+
</plist>' "#{target}"`
|
|
78
|
+
|
|
79
|
+
res = $? == 0
|
|
80
|
+
|
|
81
|
+
if res
|
|
82
|
+
Planter.notify("[Set tags] on #{target}", :debug, above_spinner: true)
|
|
83
|
+
else
|
|
84
|
+
Planter.notify("Failed to set tags on #{target}", :error)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
res
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
data/lib/planter/version.rb
CHANGED
data/lib/planter.rb
CHANGED
|
@@ -6,18 +6,21 @@ require 'json'
|
|
|
6
6
|
require 'yaml'
|
|
7
7
|
require 'fileutils'
|
|
8
8
|
require 'open3'
|
|
9
|
+
require 'plist'
|
|
9
10
|
|
|
10
11
|
require 'chronic'
|
|
11
12
|
require 'tty-reader'
|
|
12
13
|
require 'tty-screen'
|
|
13
|
-
require 'tty-spinner'
|
|
14
|
+
# require 'tty-spinner'
|
|
14
15
|
require 'tty-which'
|
|
15
16
|
|
|
17
|
+
require_relative 'tty-spinner/lib/tty-spinner'
|
|
16
18
|
require_relative 'planter/version'
|
|
17
19
|
require_relative 'planter/hash'
|
|
18
20
|
require_relative 'planter/array'
|
|
19
21
|
require_relative 'planter/symbol'
|
|
20
22
|
require_relative 'planter/file'
|
|
23
|
+
require_relative 'planter/tag'
|
|
21
24
|
require_relative 'planter/color'
|
|
22
25
|
require_relative 'planter/errors'
|
|
23
26
|
require_relative 'planter/prompt'
|
|
@@ -70,20 +73,28 @@ module Planter
|
|
|
70
73
|
## @param string [String] The message string
|
|
71
74
|
## @param notification_type [Symbol] The notification type (:debug, :error, :warn, :info)
|
|
72
75
|
## @param exit_code [Integer] If provided, exit with code after delivering message
|
|
76
|
+
## @param newline [Boolean] If true, add a newline to the message
|
|
77
|
+
## @param above_spinner [Boolean] If true, print above the spinner
|
|
73
78
|
##
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
## @return [Boolean] true if message was printed
|
|
80
|
+
def notify(string, notification_type = :info, newline: true, above_spinner: false, exit_code: nil)
|
|
81
|
+
color = case notification_type
|
|
82
|
+
when :debug
|
|
83
|
+
return false unless @debug
|
|
84
|
+
|
|
85
|
+
'{dw}'
|
|
86
|
+
when :error
|
|
87
|
+
'{br}'
|
|
88
|
+
|
|
89
|
+
when :warn
|
|
90
|
+
'{by}'
|
|
91
|
+
else
|
|
92
|
+
'{bw}'
|
|
93
|
+
end
|
|
94
|
+
out = "#{color}#{string}{x}"
|
|
95
|
+
out.gsub!(/\[(.*?)\]/, "{by}\\1{x}#{color}")
|
|
96
|
+
out = "\n#{out}" if newline
|
|
97
|
+
above_spinner ? spinner.log(out.x) : warn(out.x)
|
|
87
98
|
|
|
88
99
|
Process.exit exit_code unless exit_code.nil?
|
|
89
100
|
|
|
@@ -127,7 +138,8 @@ module Planter
|
|
|
127
138
|
defaults: false,
|
|
128
139
|
git_init: false,
|
|
129
140
|
files: { '_planter.yml' => 'ignore' },
|
|
130
|
-
color: true
|
|
141
|
+
color: true,
|
|
142
|
+
preserve_tags: true
|
|
131
143
|
}
|
|
132
144
|
begin
|
|
133
145
|
File.open(base_config, 'w') { |f| f.puts(YAML.dump(default_base_config.stringify_keys)) }
|
|
@@ -194,13 +206,17 @@ module Planter
|
|
|
194
206
|
key: 'var_key',
|
|
195
207
|
prompt: 'CLI Prompt',
|
|
196
208
|
type: '[string, float, integer, number, date]',
|
|
197
|
-
value: '(optional,
|
|
209
|
+
value: '(optional, force value, can include variables. Empty to prompt. For date type: today, now, etc.)',
|
|
198
210
|
default: '(optional default value, leave empty or remove key for no default)',
|
|
199
211
|
min: '(optional, for number type set a minimum value)',
|
|
200
212
|
max: '(optional, for number type set a maximum value)'
|
|
201
213
|
],
|
|
202
214
|
git_init: false,
|
|
203
|
-
files: {
|
|
215
|
+
files: {
|
|
216
|
+
'*.tmp' => 'ignore',
|
|
217
|
+
'*.bak' => 'ignore',
|
|
218
|
+
'.DS_Store' => 'ignore'
|
|
219
|
+
}
|
|
204
220
|
}
|
|
205
221
|
FileUtils.mkdir_p(base_dir)
|
|
206
222
|
File.open(config, 'w') { |f| f.puts(YAML.dump(default_config.stringify_keys)) }
|
|
@@ -235,7 +251,7 @@ module Planter
|
|
|
235
251
|
def process_patterns
|
|
236
252
|
patterns = {}
|
|
237
253
|
@config[:files].each do |file, oper|
|
|
238
|
-
pattern = Regexp.new(".*?/#{file.to_s.sub(%r{^/}, '').
|
|
254
|
+
pattern = Regexp.new(".*?/#{file.to_s.sub(%r{^/}, '').to_rx}$")
|
|
239
255
|
operator = oper.normalize_operator
|
|
240
256
|
patterns[pattern] = operator
|
|
241
257
|
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: piotrmurach
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Report something not working correctly or as expected
|
|
4
|
+
title: ''
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
### Describe the problem
|
|
10
|
+
|
|
11
|
+
A brief description of the issue.
|
|
12
|
+
|
|
13
|
+
### Steps to reproduce the problem
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
Your code here to reproduce the issue
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Actual behaviour
|
|
20
|
+
|
|
21
|
+
What happened? This could be a description, log output, error raised etc.
|
|
22
|
+
|
|
23
|
+
### Expected behaviour
|
|
24
|
+
|
|
25
|
+
What did you expect to happen?
|
|
26
|
+
|
|
27
|
+
### Describe your environment
|
|
28
|
+
|
|
29
|
+
* OS version:
|
|
30
|
+
* Ruby version:
|
|
31
|
+
* TTY::Spinner version:
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest new functionality
|
|
4
|
+
title: ''
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
### Describe the problem
|
|
10
|
+
|
|
11
|
+
A brief description of the problem you're trying to solve.
|
|
12
|
+
|
|
13
|
+
### How would the new feature work?
|
|
14
|
+
|
|
15
|
+
A short explanation of the new feature.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Example code that shows possible usage
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Drawbacks
|
|
22
|
+
|
|
23
|
+
Can you see any potential drawbacks?
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
### Describe the change
|
|
2
|
+
What does this Pull Request do?
|
|
3
|
+
|
|
4
|
+
### Why are we doing this?
|
|
5
|
+
Any related context as to why is this is a desirable change.
|
|
6
|
+
|
|
7
|
+
### Benefits
|
|
8
|
+
How will the library improve?
|
|
9
|
+
|
|
10
|
+
### Drawbacks
|
|
11
|
+
Possible drawbacks applying this change.
|
|
12
|
+
|
|
13
|
+
### Requirements
|
|
14
|
+
<!--- Put an X between brackets on each line if you have done the item: -->
|
|
15
|
+
- [ ] Tests written & passing locally?
|
|
16
|
+
- [ ] Code style checked?
|
|
17
|
+
- [ ] Rebased with `master` branch?
|
|
18
|
+
- [ ] Documentation updated?
|
|
19
|
+
- [ ] Changelog updated?
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: CI
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
paths-ignore:
|
|
8
|
+
- "bin/**"
|
|
9
|
+
- "examples/**"
|
|
10
|
+
- "*.md"
|
|
11
|
+
pull_request:
|
|
12
|
+
branches:
|
|
13
|
+
- master
|
|
14
|
+
paths-ignore:
|
|
15
|
+
- "bin/**"
|
|
16
|
+
- "examples/**"
|
|
17
|
+
- "*.md"
|
|
18
|
+
jobs:
|
|
19
|
+
tests:
|
|
20
|
+
name: Ruby ${{ matrix.ruby }}
|
|
21
|
+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
|
|
22
|
+
strategy:
|
|
23
|
+
fail-fast: false
|
|
24
|
+
matrix:
|
|
25
|
+
ruby:
|
|
26
|
+
- "2.0"
|
|
27
|
+
- "2.1"
|
|
28
|
+
- "2.3"
|
|
29
|
+
- "2.4"
|
|
30
|
+
- "2.5"
|
|
31
|
+
- "2.6"
|
|
32
|
+
- "3.0"
|
|
33
|
+
- "3.1"
|
|
34
|
+
- "3.2"
|
|
35
|
+
- "3.3"
|
|
36
|
+
- ruby-head
|
|
37
|
+
- jruby-9.2
|
|
38
|
+
- jruby-9.3
|
|
39
|
+
- jruby-9.4
|
|
40
|
+
- jruby-head
|
|
41
|
+
- truffleruby-head
|
|
42
|
+
include:
|
|
43
|
+
- ruby: "2.2"
|
|
44
|
+
os: ubuntu-20.04
|
|
45
|
+
- ruby: "2.7"
|
|
46
|
+
coverage: true
|
|
47
|
+
env:
|
|
48
|
+
COVERAGE: ${{ matrix.coverage }}
|
|
49
|
+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
|
50
|
+
continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
|
|
51
|
+
steps:
|
|
52
|
+
- uses: actions/checkout@v4
|
|
53
|
+
- name: Set up Ruby
|
|
54
|
+
uses: ruby/setup-ruby@v1
|
|
55
|
+
with:
|
|
56
|
+
ruby-version: ${{ matrix.ruby }}
|
|
57
|
+
bundler-cache: true
|
|
58
|
+
- name: Run tests
|
|
59
|
+
run: bundle exec rake ci
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
NewCops: enable
|
|
3
|
+
|
|
4
|
+
Layout/FirstArrayElementIndentation:
|
|
5
|
+
Enabled: false
|
|
6
|
+
|
|
7
|
+
Layout/FirstHashElementIndentation:
|
|
8
|
+
Enabled: false
|
|
9
|
+
|
|
10
|
+
Layout/LineLength:
|
|
11
|
+
Max: 82
|
|
12
|
+
|
|
13
|
+
Layout/SpaceInsideHashLiteralBraces:
|
|
14
|
+
EnforcedStyle: no_space
|
|
15
|
+
|
|
16
|
+
Lint/AssignmentInCondition:
|
|
17
|
+
Enabled: false
|
|
18
|
+
|
|
19
|
+
Metrics/AbcSize:
|
|
20
|
+
Max: 30
|
|
21
|
+
|
|
22
|
+
Metrics/BlockLength:
|
|
23
|
+
CountComments: true
|
|
24
|
+
Max: 25
|
|
25
|
+
IgnoredMethods: []
|
|
26
|
+
Exclude:
|
|
27
|
+
- "spec/**/*"
|
|
28
|
+
|
|
29
|
+
Metrics/ClassLength:
|
|
30
|
+
Max: 1500
|
|
31
|
+
|
|
32
|
+
Metrics/CyclomaticComplexity:
|
|
33
|
+
Enabled: false
|
|
34
|
+
|
|
35
|
+
Metrics/MethodLength:
|
|
36
|
+
Max: 20
|
|
37
|
+
|
|
38
|
+
Naming/FileName:
|
|
39
|
+
Exclude:
|
|
40
|
+
- "lib/tty-spinner.rb"
|
|
41
|
+
|
|
42
|
+
Naming/BinaryOperatorParameterName:
|
|
43
|
+
Enabled: false
|
|
44
|
+
|
|
45
|
+
Style/AsciiComments:
|
|
46
|
+
Enabled: false
|
|
47
|
+
|
|
48
|
+
Style/BlockDelimiters:
|
|
49
|
+
Enabled: false
|
|
50
|
+
|
|
51
|
+
Style/CommentedKeyword:
|
|
52
|
+
Enabled: false
|
|
53
|
+
|
|
54
|
+
Style/FrozenStringLiteralComment:
|
|
55
|
+
Exclude:
|
|
56
|
+
- "spec/**/*"
|
|
57
|
+
|
|
58
|
+
Style/LambdaCall:
|
|
59
|
+
SupportedStyles:
|
|
60
|
+
- call
|
|
61
|
+
- braces
|
|
62
|
+
|
|
63
|
+
Style/Semicolon:
|
|
64
|
+
Exclude:
|
|
65
|
+
- "spec/**/*"
|
|
66
|
+
|
|
67
|
+
Style/StringLiterals:
|
|
68
|
+
EnforcedStyle: double_quotes
|
|
69
|
+
|
|
70
|
+
Style/StringLiteralsInInterpolation:
|
|
71
|
+
EnforcedStyle: double_quotes
|
|
72
|
+
|
|
73
|
+
Style/SymbolProc:
|
|
74
|
+
Exclude:
|
|
75
|
+
- "spec/**/*"
|
|
76
|
+
|
|
77
|
+
Style/TrivialAccessors:
|
|
78
|
+
Enabled: false
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Change log
|
|
2
|
+
|
|
3
|
+
## [v0.10.0] - unreleased
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
* Add Spinner#log method for logging messages above the spinner
|
|
7
|
+
* Add new formats (:pulse_4, :toss, :lighthouse, :points, :points_2)
|
|
8
|
+
* Add ability to specify a custom mark for error, pause, success and stop methods
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
* Change gemspec to include rake and rspec as dev dependencies
|
|
12
|
+
* Change all built-in formats to use consistent frames formatting
|
|
13
|
+
|
|
14
|
+
## [v0.9.3] - 2020-01-28
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
* Change gemspec to add metadata, remove test artefacts and load version directly
|
|
18
|
+
|
|
19
|
+
## [v0.9.2] - 2019-12-08
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
* Fix multi spinner cursor hiding by @benklop
|
|
23
|
+
|
|
24
|
+
## [v0.9.1] - 2019-05-29
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
* Change bundler to remove version limit
|
|
28
|
+
* Change to update tty-cursor dependency
|
|
29
|
+
|
|
30
|
+
## [v0.9.0] - 2018-12-01
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
* Change tty-cursor dependency
|
|
34
|
+
* Change to Ruby >= 2.0
|
|
35
|
+
* Change to freeze all string literals
|
|
36
|
+
* Change #execute_job to stop evaluating in spinner context and just execute the job
|
|
37
|
+
* Change #register to accept a spinner instance by Shane Cavanaugh(@shanecav84)
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
* Fix to remove a stray single quote in spin_4 by Kristofer Rye(@rye)
|
|
41
|
+
* Fix Multi#line_inset to correctly assign styling in threaded environment
|
|
42
|
+
* Fix #stop & #auto_spin to always restore hidden cursor if enabled
|
|
43
|
+
* Fix deadlock when registering multi spinners
|
|
44
|
+
|
|
45
|
+
## [v0.8.0] - 2018-01-11
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
* Add new formats :bounce, :burger, :dance, :dot_2, ..., dot_11, :shark, :pong
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
* Change to only output to a console and stop output to a file, pipe etc...
|
|
52
|
+
|
|
53
|
+
### Fixed
|
|
54
|
+
* Fix spinner #stop to clear line before printing final message
|
|
55
|
+
|
|
56
|
+
## [v0.7.0] - 2017-09-11
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
* Add :spin event type and emit from TTY::Spinner#spin
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
* Change to automatically spin top level multi spinner when registered spinners spin
|
|
63
|
+
* Remove unnecessary checks for top spinner in multi spinner #stop, #success, #error
|
|
64
|
+
|
|
65
|
+
### Fixed
|
|
66
|
+
* Fix multi spinner #observe to only listen for events from registered spinners
|
|
67
|
+
|
|
68
|
+
## [v0.6.0] - 2017-09-07
|
|
69
|
+
|
|
70
|
+
### Changed
|
|
71
|
+
* Change TTY::Spinner::Multi to render registered spinners at row
|
|
72
|
+
position at point of rendering and not registration
|
|
73
|
+
|
|
74
|
+
### Fixed
|
|
75
|
+
* Fix handling of multi spinner events
|
|
76
|
+
* Fix multi spinner display for unicode inset characters
|
|
77
|
+
|
|
78
|
+
## [v0.5.0] - 2017-08-09
|
|
79
|
+
|
|
80
|
+
### Added
|
|
81
|
+
* Add TTY::Spinner::Multi to allow for parallel spinners executation by Austin Blatt[@austb]
|
|
82
|
+
* Add formatting for multi spinner display by Austin Blatt[@austb]
|
|
83
|
+
* Add ability to add and execute jobs for single and multi spinners
|
|
84
|
+
* Add abilty to register multi spinners with async jobs
|
|
85
|
+
* Add #pause and #resume for single and multispinner
|
|
86
|
+
|
|
87
|
+
### Changed
|
|
88
|
+
* Change to unify success category to mark spinner as succeded or errored
|
|
89
|
+
* Change Spinner to be thread safe
|
|
90
|
+
|
|
91
|
+
### Fixed
|
|
92
|
+
* Stop firing events when a spinner is stopped
|
|
93
|
+
|
|
94
|
+
## [v0.4.1] - 2016-08-07
|
|
95
|
+
|
|
96
|
+
### Changed
|
|
97
|
+
* Change #update to clear output when in spinning state
|
|
98
|
+
|
|
99
|
+
## [v0.4.0] - 2016-08-07
|
|
100
|
+
|
|
101
|
+
### Added
|
|
102
|
+
* Add #auto_spin to automatically displaying spinning animation
|
|
103
|
+
|
|
104
|
+
### Changed
|
|
105
|
+
* Change #start to setup timer and reset done state
|
|
106
|
+
|
|
107
|
+
## [v0.3.0] - 2016-07-14
|
|
108
|
+
|
|
109
|
+
### Added
|
|
110
|
+
* Add #run to automatically execute job with spinning animation by @Thermatix
|
|
111
|
+
* Add #update to allow for dynamic label name replacement
|
|
112
|
+
|
|
113
|
+
### Fixed
|
|
114
|
+
* Fixed cursor hiding for success and error calls by @m-o-e
|
|
115
|
+
* Fix #join call to define actual error
|
|
116
|
+
* Fix #stop to print only once when finished
|
|
117
|
+
|
|
118
|
+
## [v0.2.0] - 2016-03-13
|
|
119
|
+
|
|
120
|
+
### Added
|
|
121
|
+
* Add new spinner formats by @rlqualls
|
|
122
|
+
* Add ability to specify custom frames through :frames option
|
|
123
|
+
* Add :clear option for removing spinner output when done
|
|
124
|
+
* Add #success and #error calls for stopping spinner
|
|
125
|
+
* Add :done, :success, :error completion events
|
|
126
|
+
* Add :success_mark & :error_mark to allow changing markers
|
|
127
|
+
* Add :interval for automatic spinning duration
|
|
128
|
+
* Add #start, #join and #kill for automatic spinner animation
|
|
129
|
+
|
|
130
|
+
### Changed
|
|
131
|
+
* Change message formatting, use :spinner token to customize message
|
|
132
|
+
* Change format for defining spinner formats and intervals
|
|
133
|
+
|
|
134
|
+
## [v0.1.0] - 2014-11-15
|
|
135
|
+
|
|
136
|
+
* Initial implementation and release
|
|
137
|
+
|
|
138
|
+
[v0.10.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.9.3...v0.10.0
|
|
139
|
+
[v0.9.3]: https://github.com/piotrmurach/tty-spinner/compare/v0.9.2...v0.9.3
|
|
140
|
+
[v0.9.2]: https://github.com/piotrmurach/tty-spinner/compare/v0.9.1...v0.9.2
|
|
141
|
+
[v0.9.1]: https://github.com/piotrmurach/tty-spinner/compare/v0.9.0...v0.9.1
|
|
142
|
+
[v0.9.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.8.0...v0.9.0
|
|
143
|
+
[v0.8.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.7.0...v0.8.0
|
|
144
|
+
[v0.7.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.6.0...v0.7.0
|
|
145
|
+
[v0.6.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.5.0...v0.6.0
|
|
146
|
+
[v0.5.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.4.1...v0.5.0
|
|
147
|
+
[v0.4.1]: https://github.com/piotrmurach/tty-spinner/compare/v0.4.0...v0.4.1
|
|
148
|
+
[v0.4.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.3.0...v0.4.0
|
|
149
|
+
[v0.3.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.2.0...v0.3.0
|
|
150
|
+
[v0.2.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.1.0...v0.2.0
|
|
151
|
+
[v0.1.0]: https://github.com/piotrmurach/tty-spinner/compare/v0.1.0
|