howzit 2.1.14 → 2.1.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +10 -0
- data/README.rdoc +6 -0
- data/Rakefile +15 -5
- data/bin/howzit +2 -4
- data/docker/Dockerfile-2.6 +1 -1
- data/docker/Dockerfile-2.7 +1 -1
- data/docker/Dockerfile-3.0 +1 -1
- data/docker/Dockerfile-3.2 +11 -0
- data/docker/bash_profile +1 -0
- data/lib/howzit/buildnote.rb +6 -2
- data/lib/howzit/config.rb +28 -1
- data/lib/howzit/prompt.rb +16 -0
- data/lib/howzit/version.rb +1 -1
- data/lib/howzit.rb +2 -2
- data/scripts/runtests.sh +3 -1
- data/spec/buildnote_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/topic_spec.rb +4 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 801a2edf83210d0abd3cf17ab9c9259469429478c48b8245df7475bde19c6676
|
4
|
+
data.tar.gz: c47dd24e16f255fcbbd0ac5acadb3c57f423bda0237bbbb85b43f8c82e08b0db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8ea4385da70cb5cf7e8d66b5352f164d7cee71b050cf47a544539bf61d0ffd95b4c46f77347b8cf016fd50bd9edf6f7fe1b088fb4f8d324af9343c833334204
|
7
|
+
data.tar.gz: 7bc8190df842331c74ab4dc0146262b886c1174d3fcf2faef35dc536d0622fe29c2868c4db6e2067e1198c801116d8b67bb0272214cfe8a75dd210a86ec8db66
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/README.rdoc
ADDED
data/Rakefile
CHANGED
@@ -6,6 +6,13 @@ require 'rspec/core/rake_task'
|
|
6
6
|
require 'rubocop/rake_task'
|
7
7
|
require 'yard'
|
8
8
|
require 'tty-spinner'
|
9
|
+
require 'rdoc/task'
|
10
|
+
|
11
|
+
Rake::RDocTask.new do |rd|
|
12
|
+
rd.main = 'README.rdoc'
|
13
|
+
rd.rdoc_files.include('README.rdoc', 'lib/**/*.rb', 'bin/**/*')
|
14
|
+
rd.title = 'Howzit'
|
15
|
+
end
|
9
16
|
|
10
17
|
task default: %i[test yard]
|
11
18
|
|
@@ -41,17 +48,20 @@ task :dockertest, :version, :login do |_, args|
|
|
41
48
|
args.with_defaults(version: 'all', login: false)
|
42
49
|
case args[:version]
|
43
50
|
when /^a/
|
44
|
-
%w[
|
51
|
+
%w[2 3 32].each do |v|
|
45
52
|
Rake::Task['dockertest'].reenable
|
46
53
|
Rake::Task['dockertest'].invoke(v, false)
|
47
54
|
end
|
48
55
|
Process.exit 0
|
56
|
+
when /^32/
|
57
|
+
img = 'howzittest32'
|
58
|
+
file = 'docker/Dockerfile-3.2'
|
49
59
|
when /^3/
|
50
60
|
img = 'howzittest3'
|
51
61
|
file = 'docker/Dockerfile-3.0'
|
52
|
-
when /6$/
|
53
|
-
|
54
|
-
|
62
|
+
# when /6$/
|
63
|
+
# img = 'howzittest26'
|
64
|
+
# file = 'docker/Dockerfile-2.6'
|
55
65
|
when /(^2|7$)/
|
56
66
|
img = 'howzittest27'
|
57
67
|
file = 'docker/Dockerfile-2.7'
|
@@ -64,7 +74,7 @@ task :dockertest, :version, :login do |_, args|
|
|
64
74
|
|
65
75
|
exec "docker run -v #{File.dirname(__FILE__)}:/howzit -it #{img} /bin/bash -l" if args[:login]
|
66
76
|
|
67
|
-
spinner = TTY::Spinner.new(
|
77
|
+
spinner = TTY::Spinner.new("[:spinner] Running tests #{img}", hide_cursor: true)
|
68
78
|
|
69
79
|
spinner.auto_spin
|
70
80
|
res = `docker run --rm -v #{File.dirname(__FILE__)}:/howzit -it #{img}`
|
data/bin/howzit
CHANGED
@@ -159,15 +159,13 @@ OptionParser.new do |opts|
|
|
159
159
|
Process.exit 0
|
160
160
|
end
|
161
161
|
|
162
|
-
|
163
|
-
desc = %(Edit buildnotes file in current working directory using editor (#{editor}))
|
162
|
+
desc = %(Edit buildnotes file in current working directory using default editor)
|
164
163
|
opts.on('-e', '--edit', desc) do
|
165
164
|
Howzit.buildnote.edit
|
166
165
|
Process.exit 0
|
167
166
|
end
|
168
167
|
|
169
|
-
|
170
|
-
opts.on('--edit-config', "Edit configuration file using editor (#{config_editor})") do
|
168
|
+
opts.on('--edit-config', "Edit configuration file using default editor") do
|
171
169
|
Howzit.config.editor
|
172
170
|
Process.exit 0
|
173
171
|
end
|
data/docker/Dockerfile-2.6
CHANGED
data/docker/Dockerfile-2.7
CHANGED
data/docker/Dockerfile-3.0
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
FROM ruby:3.2.0
|
2
|
+
# RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
3
|
+
RUN mkdir /howzit
|
4
|
+
WORKDIR /howzit
|
5
|
+
# COPY ./ /howzit/
|
6
|
+
RUN gem install bundler:2.2.29
|
7
|
+
RUN apt-get update -y
|
8
|
+
RUN apt-get install -y less vim
|
9
|
+
COPY ./docker/inputrc /root/.inputrc
|
10
|
+
COPY ./docker/bash_profile /root/.bash_profile
|
11
|
+
CMD ["scripts/runtests.sh"]
|
data/docker/bash_profile
CHANGED
data/lib/howzit/buildnote.rb
CHANGED
@@ -499,7 +499,7 @@ module Howzit
|
|
499
499
|
## @return [String] file path
|
500
500
|
##
|
501
501
|
def glob_note
|
502
|
-
Dir.glob('*.{txt,md,markdown}').select(&:build_note?)[0]
|
502
|
+
Dir.glob('*.{txt,md,markdown}').select(&:build_note?).sort[0]
|
503
503
|
end
|
504
504
|
|
505
505
|
##
|
@@ -655,12 +655,14 @@ module Howzit
|
|
655
655
|
def edit_note
|
656
656
|
editor = Howzit.options.fetch(:editor, ENV['EDITOR'])
|
657
657
|
|
658
|
+
editor = Howzit.config.update_editor if editor.nil?
|
659
|
+
|
658
660
|
raise 'No editor defined' if editor.nil?
|
659
661
|
|
660
662
|
raise "Invalid editor (#{editor})" unless Util.valid_command?(editor)
|
661
663
|
|
662
664
|
create_note(prompt: true) if note_file.nil?
|
663
|
-
|
665
|
+
exec %(#{editor} "#{note_file}")
|
664
666
|
end
|
665
667
|
|
666
668
|
##
|
@@ -680,6 +682,8 @@ module Howzit
|
|
680
682
|
def edit_template_file(file)
|
681
683
|
editor = Howzit.options.fetch(:editor, ENV['EDITOR'])
|
682
684
|
|
685
|
+
editor = Howzit.config.update_editor if editor.nil?
|
686
|
+
|
683
687
|
raise 'No editor defined' if editor.nil?
|
684
688
|
|
685
689
|
raise "Invalid editor (#{editor})" unless Util.valid_command?(editor)
|
data/lib/howzit/config.rb
CHANGED
@@ -127,6 +127,31 @@ module Howzit
|
|
127
127
|
edit_config
|
128
128
|
end
|
129
129
|
|
130
|
+
## Update editor config
|
131
|
+
def update_editor
|
132
|
+
puts 'No $EDITOR defined, no value in config'
|
133
|
+
editor = Prompt.read_editor
|
134
|
+
if editor.nil?
|
135
|
+
'Cancelled, no editor stored.'
|
136
|
+
Process.exit 1
|
137
|
+
end
|
138
|
+
update_config_option({ config_editor: editor, editor: editor })
|
139
|
+
puts "Default editor set to #{editor}, modify in config file"
|
140
|
+
editor
|
141
|
+
end
|
142
|
+
|
143
|
+
##
|
144
|
+
## Update a config option and resave config file
|
145
|
+
##
|
146
|
+
## @param options [Hash] key value pairs
|
147
|
+
##
|
148
|
+
def update_config_option(options)
|
149
|
+
options.each do |key, value|
|
150
|
+
Howzit.options[key] = value
|
151
|
+
end
|
152
|
+
write_config(Howzit.options)
|
153
|
+
end
|
154
|
+
|
130
155
|
private
|
131
156
|
|
132
157
|
##
|
@@ -263,13 +288,15 @@ module Howzit
|
|
263
288
|
def edit_config
|
264
289
|
editor = Howzit.options.fetch(:config_editor, ENV['EDITOR'])
|
265
290
|
|
291
|
+
editor = update_editor if editor.nil?
|
292
|
+
|
266
293
|
raise 'No config_editor defined' if editor.nil?
|
267
294
|
|
268
295
|
# raise "Invalid editor (#{editor})" unless Util.valid_command?(editor)
|
269
296
|
|
270
297
|
load_config
|
271
298
|
if Util.valid_command?(editor.split(/ /).first)
|
272
|
-
|
299
|
+
exec %(#{editor} "#{config_file}")
|
273
300
|
else
|
274
301
|
`open -a "#{editor}" "#{config_file}"`
|
275
302
|
end
|
data/lib/howzit/prompt.rb
CHANGED
@@ -159,6 +159,22 @@ module Howzit
|
|
159
159
|
system('stty', @stty_save)
|
160
160
|
end
|
161
161
|
|
162
|
+
##
|
163
|
+
## Request editor
|
164
|
+
##
|
165
|
+
def read_editor(default = nil)
|
166
|
+
@stty_save = `stty -g`.chomp
|
167
|
+
|
168
|
+
default ||= 'vim'
|
169
|
+
prompt = "Define a default editor command (default #{default}): "
|
170
|
+
res = Readline.readline(prompt, true).squeeze(' ').strip
|
171
|
+
res = default if res.empty?
|
172
|
+
|
173
|
+
Util.valid_command?(res) ? res : default
|
174
|
+
ensure
|
175
|
+
system('stty', @stty_save)
|
176
|
+
end
|
177
|
+
|
162
178
|
##
|
163
179
|
## Convert a response to an Integer
|
164
180
|
##
|
data/lib/howzit/version.rb
CHANGED
data/lib/howzit.rb
CHANGED
data/scripts/runtests.sh
CHANGED
data/spec/buildnote_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/spec/topic_spec.rb
CHANGED
@@ -21,7 +21,10 @@ describe Howzit::Topic do
|
|
21
21
|
end
|
22
22
|
|
23
23
|
describe Howzit::Topic do
|
24
|
-
subject(:topic) {
|
24
|
+
subject(:topic) {
|
25
|
+
bn = Howzit.buildnote
|
26
|
+
bn.find_topic('Topic Balogna')[0]
|
27
|
+
}
|
25
28
|
|
26
29
|
describe '.title' do
|
27
30
|
it 'has the correct title' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: howzit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -304,12 +304,14 @@ files:
|
|
304
304
|
- Guardfile
|
305
305
|
- LICENSE.txt
|
306
306
|
- README.md
|
307
|
+
- README.rdoc
|
307
308
|
- Rakefile
|
308
309
|
- bin/howzit
|
309
310
|
- docker/Dockerfile
|
310
311
|
- docker/Dockerfile-2.6
|
311
312
|
- docker/Dockerfile-2.7
|
312
313
|
- docker/Dockerfile-3.0
|
314
|
+
- docker/Dockerfile-3.2
|
313
315
|
- docker/bash_profile
|
314
316
|
- docker/inputrc
|
315
317
|
- fish/completions/bld.fish
|