ssmd 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1ffe3b65bc7397e1f4138e801428aa8c456c2ed
4
- data.tar.gz: 9f8276cc70d5a50606d1a0f009a9c1f11819e739
3
+ metadata.gz: ca958be00bb04e7af41269615ad89353790aff56
4
+ data.tar.gz: f97eaddda402d1ab60c1e5b30b72495d7cdfbc61
5
5
  SHA512:
6
- metadata.gz: a68f17a706a90a8f534030c58ac41c00d12eb1bef1bc1eb7a057fb100b09e8d4a7dae9e3faa0ad4f5097951a5b6fb7d4212c36c96e1e1ae1af4eead95721f1bd
7
- data.tar.gz: 9f0e8a1c837c1f2b0602bada363fb01061c24248e7b3faacb71d36c2ac43747aa0e97dd18686211faf7ce939bdcf062a0929f22d4d4017a894f1481ec0a0bad3
6
+ metadata.gz: 9a59de6e3c716e227e08b1c5804c57f149ef320dad4b4cc00582bc65a7a1642ec3ad93e9642e1289bac8723a92151c984a433ed43c74ac285ae85e71d43e361b
7
+ data.tar.gz: a368ceb07a06342ffa5a92b3d44ed77d078d943064dc51a825ff3064d32f2b4b123a46000033711a7822a70b0d9ac9dc64ffe0670dac6b42065cd4cca745d23f
@@ -57,43 +57,66 @@ module SSMD::Processors
57
57
  }x
58
58
  end
59
59
 
60
+ ##
61
+ # Match example: ~silent~
60
62
  def silent_volume
61
- /~#{content('silent')}~/
63
+ /#{ws_start}~#{content('silent')}~#{ws_end}/
62
64
  end
63
65
 
66
+ ##
67
+ # Match example: --extra soft-- or -soft-
64
68
  def soft_volume
65
69
  /(?:#{ws_start}--#{content('x-soft')}--#{ws_end})|(?:#{ws_start}-#{content('soft')}-#{ws_end})/
66
70
  end
67
71
 
72
+ ##
73
+ # Match example: ++extra loud or +loud+
68
74
  def loud_volume
69
75
  /(?:#{ws_start}\+\+#{content('x-loud')}\+\+#{ws_end})|(?:#{ws_start}\+#{content('loud')}\+#{ws_end})/
70
76
  end
71
77
 
78
+ ##
79
+ # Match example: <<extra slow<< or <slow<
72
80
  def slow_rate
73
81
  /(?:#{ws_start}&lt;&lt;#{content('x-slow')}&lt;&lt;#{ws_end})|(?:#{ws_start}&lt;#{content('slow')}&lt;#{ws_end})/
74
82
  end
75
83
 
84
+ ##
85
+ # Match example: >>extra fast>> or >fast>
76
86
  def fast_rate
77
87
  /(?:#{ws_start}&gt;&gt;#{content('x-fast')}&gt;&gt;#{ws_end})|(?:#{ws_start}&gt;#{content('fast')}&gt;#{ws_end})/
78
88
  end
79
89
 
90
+ ##
91
+ # Match example: __extra low__ or _low_
80
92
  def low_pitch
81
93
  /(?:#{ws_start}__#{content('x-low')}__#{ws_end})|(?:#{ws_start}_#{content('low')}_#{ws_end})/
82
94
  end
83
95
 
96
+ ##
97
+ # Match example: ^^extra high^^ or ^high^
84
98
  def high_pitch
85
99
  /(?:#{ws_start}\^\^#{content('x-high')}\^\^#{ws_end})|(?:#{ws_start}\^#{content('high')}\^#{ws_end})/
86
100
  end
87
101
 
102
+ ##
103
+ # Matches either a single char or a longer string starting and ending
104
+ # with a non-whitespace char.
88
105
  def content(name = nil)
89
106
  id = name ? "?<#{name}>" : ""
90
107
  /(#{id}(?:[^\s])|(?:[^\s].*[^\s]))/
91
108
  end
92
109
 
110
+ ##
111
+ # Matches the beginning of the input or a whitespace char via lookbehind,
112
+ # meaning it's excluded from the match result.
93
113
  def ws_start
94
114
  /(?<=(\A)|(?:\s))/
95
115
  end
96
116
 
117
+ ##
118
+ # Matches the end of the input or a whitespace char via lookahead,
119
+ # meaning it's excluded from the match result.
97
120
  def ws_end
98
121
  /(?=(\Z)|(?:\s))/
99
122
  end
data/lib/ssmd/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SSMD
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Kahl