nanoc-cli 4.11.13

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.
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nanoc
4
+ module CLI
5
+ module StreamCleaners
6
+ # Superclass for all stream cleaners. Stream cleaners have a single method,
7
+ # {#clean}, that takes a string and returns a cleaned string. Stream cleaners
8
+ # can have state, so they can act as a FSM.
9
+ #
10
+ # @abstract Subclasses must implement {#clean}
11
+ class Abstract
12
+ # Returns a cleaned version of the given string.
13
+ #
14
+ # @param [String] str The string to clean
15
+ #
16
+ # @return [String] The cleaned string
17
+ def clean(str) # rubocop:disable Lint/UnusedMethodArgument
18
+ raise NotImplementedError, 'Subclasses of Nanoc::CLI::StreamCleaners::Abstract must implement #clean'
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nanoc
4
+ module CLI
5
+ module StreamCleaners
6
+ # Removes ANSI color escape sequences.
7
+ class ANSIColors < Abstract
8
+ # @see Nanoc::CLI::StreamCleaners::Abstract#clean
9
+ def clean(str)
10
+ str.gsub(/\e\[.+?m/, '')
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nanoc
4
+ module CLI
5
+ module StreamCleaners
6
+ # Simplifies output by replacing UTF-8 characters with their ASCII decompositions.
7
+ #
8
+ class UTF8 < Abstract
9
+ # @see Nanoc::CLI::StreamCleaners::Abstract#clean
10
+ def clean(str)
11
+ # FIXME: this decomposition is not generally usable
12
+ str
13
+ .unicode_normalize(:nfkd)
14
+ .tr('─┼“”‘’', '-+""\'\'')
15
+ .gsub('©', '(c)')
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nanoc
4
+ module CLI
5
+ # @api private
6
+ module Transform
7
+ module Port
8
+ RANGE = (0x0001..0xffff).freeze
9
+
10
+ def self.call(data)
11
+ Integer(data).tap do |int|
12
+ raise 'not a valid port' unless RANGE.cover?(int)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nanoc
4
+ module CLI
5
+ VERSION = '4.11.13'
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,127 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nanoc-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 4.11.13
5
+ platform: ruby
6
+ authors:
7
+ - Denis Defreyne
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-11-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: cri
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.15'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: diff-lcs
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nanoc-core
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 4.11.13
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 4.11.13
55
+ - !ruby/object:Gem::Dependency
56
+ name: zeitwerk
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.1'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.1'
69
+ description: Provides the CLI for Nanoc
70
+ email: denis+rubygems@denis.ws
71
+ executables: []
72
+ extensions: []
73
+ extra_rdoc_files: []
74
+ files:
75
+ - NEWS.md
76
+ - README.md
77
+ - lib/nanoc-cli.rb
78
+ - lib/nanoc/cli.rb
79
+ - lib/nanoc/cli/ansi_string_colorizer.rb
80
+ - lib/nanoc/cli/cleaning_stream.rb
81
+ - lib/nanoc/cli/command_runner.rb
82
+ - lib/nanoc/cli/commands/compile.rb
83
+ - lib/nanoc/cli/commands/create-site.rb
84
+ - lib/nanoc/cli/commands/nanoc.rb
85
+ - lib/nanoc/cli/commands/prune.rb
86
+ - lib/nanoc/cli/commands/shell.rb
87
+ - lib/nanoc/cli/commands/show-data.rb
88
+ - lib/nanoc/cli/commands/show-plugins.rb
89
+ - lib/nanoc/cli/commands/view.rb
90
+ - lib/nanoc/cli/compile_listeners/abstract.rb
91
+ - lib/nanoc/cli/compile_listeners/aggregate.rb
92
+ - lib/nanoc/cli/compile_listeners/debug_printer.rb
93
+ - lib/nanoc/cli/compile_listeners/diff_generator.rb
94
+ - lib/nanoc/cli/compile_listeners/file_action_printer.rb
95
+ - lib/nanoc/cli/compile_listeners/timing_recorder.rb
96
+ - lib/nanoc/cli/error_handler.rb
97
+ - lib/nanoc/cli/logger.rb
98
+ - lib/nanoc/cli/stack_trace_writer.rb
99
+ - lib/nanoc/cli/stream_cleaners/abstract.rb
100
+ - lib/nanoc/cli/stream_cleaners/ansi_colors.rb
101
+ - lib/nanoc/cli/stream_cleaners/utf8.rb
102
+ - lib/nanoc/cli/transform.rb
103
+ - lib/nanoc/cli/version.rb
104
+ homepage: https://nanoc.ws/
105
+ licenses:
106
+ - MIT
107
+ metadata: {}
108
+ post_install_message:
109
+ rdoc_options: []
110
+ require_paths:
111
+ - lib
112
+ required_ruby_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '2.4'
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ requirements: []
123
+ rubygems_version: 3.0.6
124
+ signing_key:
125
+ specification_version: 4
126
+ summary: CLI for Nanoc
127
+ test_files: []