mustermann-contrib 1.0.3 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +2 -2
- data/lib/mustermann/visualizer/highlight.rb +5 -5
- data/lib/mustermann/visualizer/highlighter/ad_hoc.rb +2 -2
- data/lib/mustermann/visualizer/highlighter.rb +2 -2
- data/lib/mustermann/visualizer/pattern_extension.rb +1 -1
- data/lib/mustermann/visualizer/renderer/hansi_template.rb +1 -1
- data/spec/file_utils_spec.rb +8 -8
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c202a9ceee82599ed40c6b8581a1e83a4ba1d546578d2b859dea2152123403d2
|
4
|
+
data.tar.gz: b6ed465401e12a37e5b1ea6a089f9ffdd0da52a0e3078bcfb09287beb359ca7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80b722c5b8cac5953cdf6a3c6de73242026a6ad84f771fe34c855d8799830e0dbe2f98dea84f9f5588ed08e6b0de8fc79a638f7476c5949f008076be9fcfe88a
|
7
|
+
data.tar.gz: 9ebce6ebcac6f15ed21a589006a1f492756df6e3d9a2d22a188c6901baee4f87f3ba8d6ae174df913f34ec05992b7d48e36e8164b35b450de27fd2e7b47e35dc
|
data/README.md
CHANGED
@@ -579,7 +579,7 @@ pattern.to_templates # => ['/{name}']
|
|
579
579
|
<a name="-mustermann-rails"></a>
|
580
580
|
# Rails Syntax for Mustermann
|
581
581
|
|
582
|
-
This gem implements the `rails` pattern type for Mustermann. It is compatible with [Ruby on Rails](http://rubyonrails.org/), [Journey](https://github.com/rails/journey), the [http_router gem](https://github.com/joshbuddy/http_router), [Lotus](http://lotusrb.org/) and [Scalatra](http://
|
582
|
+
This gem implements the `rails` pattern type for Mustermann. It is compatible with [Ruby on Rails](http://rubyonrails.org/), [Journey](https://github.com/rails/journey), the [http_router gem](https://github.com/joshbuddy/http_router), [Lotus](http://lotusrb.org/) and [Scalatra](http://scalatra.org/) (if [configured](http://scalatra.org/2.3/guides/http/routes.html#toc_248))</td>
|
583
583
|
|
584
584
|
## Overview
|
585
585
|
|
@@ -751,7 +751,7 @@ pattern === "/baz" # => false
|
|
751
751
|
<a name="-mustermann-simple"></a>
|
752
752
|
# Simple Syntax for Mustermann
|
753
753
|
|
754
|
-
This gem implements the `simple` pattern type for Mustermann. It is compatible with [Sinatra](http://www.sinatrarb.com/) (1.x), [Scalatra](http://
|
754
|
+
This gem implements the `simple` pattern type for Mustermann. It is compatible with [Sinatra](http://www.sinatrarb.com/) (1.x), [Scalatra](http://scalatra.org/) and [Dancer](http://perldancer.org/).
|
755
755
|
|
756
756
|
## Overview
|
757
757
|
|
@@ -16,7 +16,7 @@ module Mustermann
|
|
16
16
|
attr_reader :pattern, :theme
|
17
17
|
|
18
18
|
# @!visibility private
|
19
|
-
DEFAULT_THEME = Hansi::Theme.new(:solarized,
|
19
|
+
DEFAULT_THEME = Hansi::Theme.new(:solarized,
|
20
20
|
default: :base0,
|
21
21
|
separator: :base1,
|
22
22
|
escaped: :base1,
|
@@ -25,10 +25,10 @@ module Mustermann
|
|
25
25
|
special: :blue,
|
26
26
|
quote: :red,
|
27
27
|
illegal: :darkred
|
28
|
-
|
28
|
+
)
|
29
29
|
|
30
30
|
# @!visibility private
|
31
|
-
BASE_THEME = Hansi::Theme.new(
|
31
|
+
BASE_THEME = Hansi::Theme.new(
|
32
32
|
special: :default,
|
33
33
|
capture: :special,
|
34
34
|
char: :default,
|
@@ -46,13 +46,13 @@ module Mustermann
|
|
46
46
|
quote: :special,
|
47
47
|
type: :special,
|
48
48
|
illegal: :special
|
49
|
-
|
49
|
+
)
|
50
50
|
|
51
51
|
# @!visibility private
|
52
52
|
def initialize(pattern, type: nil, inspect: nil, **theme)
|
53
53
|
@pattern = Mustermann.new(pattern, type: type)
|
54
54
|
@inspect = inspect.nil? ? pattern.is_a?(Mustermann::Composite) : inspect
|
55
|
-
theme = theme.any? ? Hansi::Theme.new(theme) : DEFAULT_THEME
|
55
|
+
theme = theme.any? ? Hansi::Theme.new(**theme) : DEFAULT_THEME
|
56
56
|
@theme = BASE_THEME.merge(theme)
|
57
57
|
end
|
58
58
|
|
@@ -6,8 +6,8 @@ module Mustermann
|
|
6
6
|
# @!visibility private
|
7
7
|
module Highlighter
|
8
8
|
# Used to generate highlighting rules on the fly.
|
9
|
-
# @see
|
10
|
-
# @see
|
9
|
+
# @see Mustermann::Shell#highlighter
|
10
|
+
# @see Mustermann::Simple#highlighter}
|
11
11
|
# @!visibility private
|
12
12
|
class AdHoc
|
13
13
|
# @!visibility private
|
@@ -27,8 +27,8 @@ module Mustermann
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# Used to generate highlighting rules on the fly.
|
30
|
-
# @see
|
31
|
-
# @see
|
30
|
+
# @see Mustermann::Shell#highlighter
|
31
|
+
# @see Mustermann::Simple#highlighter
|
32
32
|
# @!visibility private
|
33
33
|
def create(&block)
|
34
34
|
Class.new(AdHoc, &block)
|
@@ -53,7 +53,7 @@ module Mustermann
|
|
53
53
|
def color_inspect(base_color = nil, **theme)
|
54
54
|
base_color ||= Highlight::DEFAULT_THEME[:base01]
|
55
55
|
template = is_a?(Composite) ? "*#<%p:(*%s*)>*" : "*#<%p:*%s*>*"
|
56
|
-
Hansi.render(template, self.class, to_ansi(inspect: true, **theme), "*" => base_color)
|
56
|
+
Hansi.render(template, self.class, to_ansi(inspect: true, **theme), {"*" => base_color})
|
57
57
|
end
|
58
58
|
|
59
59
|
# If invoked directly by IRB, same as {#color_inspect}, otherwise same as Object#pretty_print.
|
data/spec/file_utils_spec.rb
CHANGED
@@ -53,7 +53,7 @@ describe Mustermann::FileUtils do
|
|
53
53
|
|
54
54
|
describe :glob_map do
|
55
55
|
example do
|
56
|
-
utils.glob_map(':name.rb' => ':name/init.rb').should be == {
|
56
|
+
utils.glob_map({':name.rb' => ':name/init.rb'}).should be == {
|
57
57
|
"bar.rb" => "bar/init.rb",
|
58
58
|
"foo.rb" => "foo/init.rb"
|
59
59
|
}
|
@@ -61,7 +61,7 @@ describe Mustermann::FileUtils do
|
|
61
61
|
|
62
62
|
example do
|
63
63
|
result = {}
|
64
|
-
returned = utils.glob_map(':name.rb' => ':name/init.rb') { |k, v| result[v] = k.upcase }
|
64
|
+
returned = utils.glob_map({':name.rb' => ':name/init.rb'}) { |k, v| result[v] = k.upcase }
|
65
65
|
returned.sort .should be == ["BAR.RB", "FOO.RB"]
|
66
66
|
result["bar/init.rb"] .should be == "BAR.RB"
|
67
67
|
end
|
@@ -69,7 +69,7 @@ describe Mustermann::FileUtils do
|
|
69
69
|
|
70
70
|
describe :cp do
|
71
71
|
example do
|
72
|
-
utils.cp(':name.rb' => ':name.ruby', ':name.txt' => ':name.md')
|
72
|
+
utils.cp({':name.rb' => ':name.ruby', ':name.txt' => ':name.md'})
|
73
73
|
File.should be_exist('foo.ruby')
|
74
74
|
File.should be_exist('bar.md')
|
75
75
|
File.should be_exist('bar.txt')
|
@@ -79,14 +79,14 @@ describe Mustermann::FileUtils do
|
|
79
79
|
describe :cp_r do
|
80
80
|
example do
|
81
81
|
mkdir_p "foo/bar"
|
82
|
-
utils.cp_r('foo/:name' => :name)
|
82
|
+
utils.cp_r({'foo/:name' => :name})
|
83
83
|
File.should be_directory('bar')
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
87
|
describe :mv do
|
88
88
|
example do
|
89
|
-
utils.mv(':name.rb' => ':name.ruby', ':name.txt' => ':name.md')
|
89
|
+
utils.mv({':name.rb' => ':name.ruby', ':name.txt' => ':name.md'})
|
90
90
|
File.should be_exist('foo.ruby')
|
91
91
|
File.should be_exist('bar.md')
|
92
92
|
File.should_not be_exist('bar.txt')
|
@@ -95,7 +95,7 @@ describe Mustermann::FileUtils do
|
|
95
95
|
|
96
96
|
describe :ln do
|
97
97
|
example do
|
98
|
-
utils.ln(':name.rb' => ':name.ruby', ':name.txt' => ':name.md')
|
98
|
+
utils.ln({':name.rb' => ':name.ruby', ':name.txt' => ':name.md'})
|
99
99
|
File.should be_exist('foo.ruby')
|
100
100
|
File.should be_exist('bar.md')
|
101
101
|
File.should be_exist('bar.txt')
|
@@ -104,7 +104,7 @@ describe Mustermann::FileUtils do
|
|
104
104
|
|
105
105
|
describe :ln_s do
|
106
106
|
example do
|
107
|
-
utils.ln_s(':name.rb' => ':name.ruby', ':name.txt' => ':name.md')
|
107
|
+
utils.ln_s({':name.rb' => ':name.ruby', ':name.txt' => ':name.md'})
|
108
108
|
File.should be_symlink('foo.ruby')
|
109
109
|
File.should be_symlink('bar.md')
|
110
110
|
File.should be_exist('bar.txt')
|
@@ -113,7 +113,7 @@ describe Mustermann::FileUtils do
|
|
113
113
|
|
114
114
|
describe :ln_sf do
|
115
115
|
example do
|
116
|
-
utils.ln_sf(':name.rb' => ':name.txt')
|
116
|
+
utils.ln_sf({':name.rb' => ':name.txt'})
|
117
117
|
File.should be_symlink('foo.txt')
|
118
118
|
end
|
119
119
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mustermann-contrib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
8
8
|
- Zachary Scott
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-07-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mustermann
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1.
|
20
|
+
version: 1.1.2
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 1.
|
27
|
+
version: 1.1.2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: hansi
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,7 +101,7 @@ homepage: https://github.com/sinatra/mustermann
|
|
101
101
|
licenses:
|
102
102
|
- MIT
|
103
103
|
metadata: {}
|
104
|
-
post_install_message:
|
104
|
+
post_install_message:
|
105
105
|
rdoc_options: []
|
106
106
|
require_paths:
|
107
107
|
- lib
|
@@ -116,9 +116,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
|
-
|
120
|
-
|
121
|
-
signing_key:
|
119
|
+
rubygems_version: 3.2.3
|
120
|
+
signing_key:
|
122
121
|
specification_version: 4
|
123
122
|
summary: Collection of extensions for Mustermann
|
124
123
|
test_files:
|