howzit 2.0.13 → 2.0.16
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/.travis.yml +3 -0
- data/CHANGELOG.md +37 -0
- data/bin/howzit +8 -2
- data/lib/howzit/buildnote.rb +272 -155
- data/lib/howzit/colors.rb +9 -0
- data/lib/howzit/config.rb +1 -0
- data/lib/howzit/prompt.rb +20 -4
- data/lib/howzit/stringutils.rb +18 -2
- data/lib/howzit/task.rb +161 -5
- data/lib/howzit/topic.rb +6 -96
- data/lib/howzit/util.rb +8 -3
- data/lib/howzit/version.rb +1 -1
- data/lib/howzit.rb +12 -0
- data/spec/prompt_spec.rb +37 -0
- data/spec/spec_helper.rb +7 -9
- data/spec/task_spec.rb +7 -2
- data/spec/topic_spec.rb +45 -15
- data/spec/util_spec.rb +52 -0
- metadata +6 -2
data/spec/util_spec.rb
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Howzit::Util do
|
6
|
+
subject(:util) { Howzit::Util }
|
7
|
+
|
8
|
+
describe '.read_file' do
|
9
|
+
it 'reads file to a string' do
|
10
|
+
buildnote = util.read_file('builda.md')
|
11
|
+
expect(buildnote).not_to be_empty
|
12
|
+
expect(buildnote).to be_a String
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe '.valid_command?' do
|
17
|
+
it 'finds a command' do
|
18
|
+
expect(util.command_exist?('ls')).to be_truthy
|
19
|
+
end
|
20
|
+
it 'validates a command' do
|
21
|
+
expect(util.valid_command?('ls -1')).to be_truthy
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe '.which_highlighter' do
|
26
|
+
it 'finds mdless' do
|
27
|
+
Howzit.options[:highlighter] = 'mdless'
|
28
|
+
expect(util.which_highlighter).to eq 'mdless'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe '.which_pager' do
|
33
|
+
it 'finds the more utility' do
|
34
|
+
Howzit.options[:pager] = 'more'
|
35
|
+
expect(util.which_pager).to eq 'more'
|
36
|
+
Howzit.options[:pager] = 'auto'
|
37
|
+
expect(util.which_pager).to_not eq 'more'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe '.show' do
|
42
|
+
it 'prints output' do
|
43
|
+
buildnote = util.read_file('builda.md')
|
44
|
+
expect { util.show(buildnote) }.to output(/Balogna/).to_stdout
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'pages output' do
|
48
|
+
buildnote = util.read_file('builda.md')
|
49
|
+
expect { util.page(buildnote) }.to output(/Balogna/).to_stdout
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
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.0.
|
4
|
+
version: 2.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -331,10 +331,12 @@ files:
|
|
331
331
|
- spec/.rubocop.yml
|
332
332
|
- spec/buildnote_spec.rb
|
333
333
|
- spec/cli_spec.rb
|
334
|
+
- spec/prompt_spec.rb
|
334
335
|
- spec/ruby_gem_spec.rb
|
335
336
|
- spec/spec_helper.rb
|
336
337
|
- spec/task_spec.rb
|
337
338
|
- spec/topic_spec.rb
|
339
|
+
- spec/util_spec.rb
|
338
340
|
- update_readmes.rb
|
339
341
|
homepage: https://github.com/ttscoff/howzit
|
340
342
|
licenses:
|
@@ -364,7 +366,9 @@ test_files:
|
|
364
366
|
- spec/.rubocop.yml
|
365
367
|
- spec/buildnote_spec.rb
|
366
368
|
- spec/cli_spec.rb
|
369
|
+
- spec/prompt_spec.rb
|
367
370
|
- spec/ruby_gem_spec.rb
|
368
371
|
- spec/spec_helper.rb
|
369
372
|
- spec/task_spec.rb
|
370
373
|
- spec/topic_spec.rb
|
374
|
+
- spec/util_spec.rb
|