filewatcher-spinner 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8942601b1ad6aa0aba32edbbedc6f96ee425055b50790f12ddffd4b9d8f553c6
4
+ data.tar.gz: 1feac6f8910cafb760552c7eec0afb8045078c150bba544dc6bf175365fddfb4
5
+ SHA512:
6
+ metadata.gz: 5cc0569e88cfa583726d65ccd5064245b30cf1c717770314e93b985863ce15f9b61e41fb593654915209938750b9323ba7efa535c4e6364eed98ac2c641453da
7
+ data.tar.gz: 9ff83ed8dc524aea6af769d220d809ff6965b8354b338c435502b30978c34e28c5a21b06845943e91f3b82307fd3998fabd06e564ef3ec27918bc79a106f39ed
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 1.0.0.beta1 (2022-06-25)
6
+
7
+ * Initial release.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Alexander Popov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # Filewatcher Spinner
2
+
3
+ [![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/filewatcher/filewatcher-spinner?style=flat-square)](https://cirrus-ci.com/github/filewatcher/filewatcher-spinner)
4
+ [![Codecov branch](https://img.shields.io/codecov/c/github/filewatcher/filewatcher-spinner/master.svg?style=flat-square)](https://codecov.io/gh/filewatcher/filewatcher-spinner)
5
+ [![Code Climate](https://img.shields.io/codeclimate/maintainability/filewatcher/filewatcher-spinner.svg?style=flat-square)](https://codeclimate.com/github/filewatcher/filewatcher-spinner)
6
+ [![Depfu](https://img.shields.io/depfu/filewatcher/filewatcher-spinner?style=flat-square)](https://depfu.com/repos/github/filewatcher/filewatcher-spinner)
7
+ [![Inline docs](https://inch-ci.org/github/filewatcher/filewatcher-spinner.svg?branch=master)](https://inch-ci.org/github/filewatcher/filewatcher-spinner)
8
+ [![License](https://img.shields.io/github/license/filewatcher/filewatcher-spinner.svg?style=flat-square)](LICENSE.txt)
9
+ [![Gem](https://img.shields.io/gem/v/filewatcher-spinner.svg?style=flat-square)](https://rubygems.org/gems/filewatcher-spinner)
10
+
11
+ An ASCII spinner in console for [Filewatcher](https://github.com/filewatcher/filewatcher).
12
+
13
+ ![Demonstration](https://i.imgur.com/2dzqw8e.gif)
14
+
15
+ ## Installation
16
+
17
+ Add this line to your application's Gemfile:
18
+
19
+ ```ruby
20
+ gem 'filewatcher-spinner'
21
+ ```
22
+
23
+ And then execute:
24
+
25
+ ```shell
26
+ bundle install
27
+ ```
28
+
29
+ Or install it yourself as:
30
+
31
+ ```shell
32
+ gem install filewatcher-spinner
33
+ ```
34
+
35
+ ## Usage
36
+
37
+ ```ruby
38
+ require 'filewatcher'
39
+ require 'filewatcher-spinner'
40
+
41
+ Filewatcher.new('lib/', spinner: true).watch do |filename, event|
42
+ # ...
43
+ end
44
+ ```
45
+
46
+ Also you can use it with [CLI](https://github.com/filewatcher/filewatcher-cli):
47
+
48
+ ```sh
49
+ $ filewatcher -p spinner --spinner '**/*'
50
+ ```
51
+
52
+ ## Development
53
+
54
+ After checking out the repo, run `bundle install` to install dependencies.
55
+
56
+ Then, run `toys rspec` to run the tests.
57
+
58
+ To install this gem onto your local machine, run `toys gem install`.
59
+
60
+ To release a new version, run `toys gem release %version%`.
61
+ See how it works [here](https://github.com/AlexWayfer/gem_toys#release).
62
+
63
+ ## Contributing
64
+
65
+ Bug reports and pull requests are welcome on [GitHub](https://github.com/filewatcher/filewatcher-spinner).
66
+
67
+ ## License
68
+
69
+ The gem is available as open source under the terms of the
70
+ [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Filewatcher
4
+ module Spinner
5
+ VERSION = '1.0.0.beta1'
6
+ end
7
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'spinner/version'
4
+
5
+ ## Include Spinner module into Filewatcher
6
+ class Filewatcher
7
+ ## Module for the `spinner` option
8
+ module Spinner
9
+ ## Class methods with which `Filewatcher` will be extended below
10
+ module ClassMethods
11
+ def print_version
12
+ super if defined? super
13
+
14
+ puts "Filewatcher Spinner #{Filewatcher::Spinner::VERSION}"
15
+ end
16
+ end
17
+
18
+ private
19
+
20
+ def after_initialize(unexpanded_filenames, options)
21
+ super if defined? super
22
+
23
+ @show_spinner = options[:spinner]
24
+ end
25
+
26
+ def before_pause_sleep
27
+ super
28
+ update_spinner('Paused')
29
+ end
30
+
31
+ def before_resume_sleep
32
+ super
33
+ update_spinner('Resumed')
34
+ end
35
+
36
+ def after_stop
37
+ super
38
+ update_spinner('Stopped')
39
+ end
40
+
41
+ def finalizing
42
+ super
43
+ update_spinner('Finalizing')
44
+ end
45
+
46
+ def before_pausing_sleep
47
+ super
48
+ update_spinner('Pausing')
49
+ end
50
+
51
+ def before_watching_sleep
52
+ super
53
+ update_spinner('Watching')
54
+ end
55
+
56
+ def update_spinner(label)
57
+ return unless @show_spinner
58
+
59
+ @spinner ||= %w[\\ | / -]
60
+ print "#{' ' * 30}\r#{label} #{@spinner.rotate!.first}\r"
61
+ end
62
+ end
63
+
64
+ include Spinner
65
+ extend Spinner::ClassMethods
66
+ end
67
+
68
+ if Filewatcher.const_defined?(:CLI, false)
69
+ Filewatcher::CLI::Command.option %w[-s --spinner], :flag, 'show an ASCII spinner', default: false
70
+ end
metadata ADDED
@@ -0,0 +1,234 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: filewatcher-spinner
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0.beta1
5
+ platform: ruby
6
+ authors:
7
+ - Alexander Popov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-06-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: filewatcher
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.0.beta3
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 2.0.0.beta3
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
33
+ - !ruby/object:Gem::Dependency
34
+ name: pry-byebug
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '3.9'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '3.9'
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '2.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '2.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: bundler-audit
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: 0.9.0
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: 0.9.0
75
+ - !ruby/object:Gem::Dependency
76
+ name: gem_toys
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 0.12.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.12.1
89
+ - !ruby/object:Gem::Dependency
90
+ name: toys
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: 0.13.0
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: 0.13.0
103
+ - !ruby/object:Gem::Dependency
104
+ name: codecov
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: 0.6.0
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: 0.6.0
117
+ - !ruby/object:Gem::Dependency
118
+ name: rspec
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '3.9'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '3.9'
131
+ - !ruby/object:Gem::Dependency
132
+ name: simplecov
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: 0.21.2
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: 0.21.2
145
+ - !ruby/object:Gem::Dependency
146
+ name: rubocop
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: 1.30.0
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: 1.30.0
159
+ - !ruby/object:Gem::Dependency
160
+ name: rubocop-performance
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: '1.0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: '1.0'
173
+ - !ruby/object:Gem::Dependency
174
+ name: rubocop-rspec
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '2.0'
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - "~>"
185
+ - !ruby/object:Gem::Version
186
+ version: '2.0'
187
+ description: 'An ASCII spinner in console for Filewatcher.
188
+
189
+ '
190
+ email:
191
+ - alex.wayfer@gmail.com
192
+ executables: []
193
+ extensions: []
194
+ extra_rdoc_files: []
195
+ files:
196
+ - CHANGELOG.md
197
+ - LICENSE.txt
198
+ - README.md
199
+ - lib/filewatcher/spinner.rb
200
+ - lib/filewatcher/spinner/version.rb
201
+ homepage: https://github.com/filewatcher/filewatcher-spinner
202
+ licenses:
203
+ - MIT
204
+ metadata:
205
+ bug_tracker_uri: https://github.com/filewatcher/filewatcher-spinner/issues
206
+ changelog_uri: https://github.com/filewatcher/filewatcher-spinner/blob/v1.0.0.beta1/CHANGELOG.md
207
+ documentation_uri: http://www.rubydoc.info/gems/filewatcher-spinner/1.0.0.beta1
208
+ homepage_uri: https://github.com/filewatcher/filewatcher-spinner
209
+ rubygems_mfa_required: 'true'
210
+ source_code_uri: https://github.com/filewatcher/filewatcher-spinner
211
+ wiki_uri: https://github.com/filewatcher/filewatcher-spinner/wiki
212
+ post_install_message:
213
+ rdoc_options: []
214
+ require_paths:
215
+ - lib
216
+ required_ruby_version: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: '2.6'
221
+ - - "<"
222
+ - !ruby/object:Gem::Version
223
+ version: '4'
224
+ required_rubygems_version: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - ">"
227
+ - !ruby/object:Gem::Version
228
+ version: 1.3.1
229
+ requirements: []
230
+ rubygems_version: 3.3.7
231
+ signing_key:
232
+ specification_version: 4
233
+ summary: An ASCII spinner in console for Filewatcher
234
+ test_files: []