utils 0.72.0 → 0.73.0

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
  SHA256:
3
- metadata.gz: '0669343d477b3b469c0856cf988d9526677ba181ef5d8786b7291fb8ec21da46'
4
- data.tar.gz: cc6c96962eb22d3f6469aaa93bf092ebbddfc7ba7f30afb42e277b3c2cd142c0
3
+ metadata.gz: 73c5e8bc5534a979765da614e9cd17d41b671c26afcfb9c076e905c5c1be9c47
4
+ data.tar.gz: d33ed0e92ece3d6d2ba1612857f7caf9a69014f95d6f1646b768421a503985c1
5
5
  SHA512:
6
- metadata.gz: 9c88255d58409d2f1b6cd881d4d9164e6ab8ce7c3d6b6e52b8160e5d9cdfac5ba2a3a2a5f70ba1821c20a41b620e2249a4412bb36b3659b61ca0b407fc57ab8f
7
- data.tar.gz: b805d2d08627a97127ff115e75a990384866c473695fc26178367e60b1f2b030947d5ae247f5fbcf809d4ccc2cc149b5339937fa534b33c48fabb42b55046d3d
6
+ metadata.gz: 470d6b5f8f769b8489c540b904f0679a2862cb5b78d46a56af353e3d2bdb39e7c2b54edaa5e0e2e11532f5aa05f8f42c823db31e15eafd624ca89be1dcff3cea
7
+ data.tar.gz: 5bc7f3d4881245c01d19595dbf9afd89735d22ec3f6e69daa6d33230c41ac724dcd32889e9eda573bc3e281d713cbc4f41c95a7ab6d84c2e00d9bd53d8092a39
data/Rakefile CHANGED
@@ -29,7 +29,7 @@ GemHadar do
29
29
  dependency 'search_ui', '~> 0.0'
30
30
  dependency 'all_images', '~> 0.5.0'
31
31
  dependency 'ollama-ruby', '~> 1.5.0'
32
- dependency 'kramdown-ansi', '~> 0.0.1'
32
+ dependency 'kramdown-ansi', '~> 0.1'
33
33
  dependency 'figlet', '~> 1.0'
34
34
  dependency 'context_spook', '~> 0.2'
35
35
  dependency 'simplecov'
data/bin/classify CHANGED
@@ -53,7 +53,8 @@ end
53
53
  def underscore(string)
54
54
  string = path_shifter(string, n: $opts[?n], separator: '::')
55
55
  string = Tins::StringUnderscore.instance_method(:underscore).bind(string).()
56
- $opts[?s] and string.sub!(/(\.rb)?\z/, '.rb')
56
+ $opts[?S] and string = string.sub(/_spec\z/, '')
57
+ $opts[?s] and string = string.sub(/(\.rb)?\z/, '.rb')
57
58
  string
58
59
  end
59
60
 
@@ -83,7 +84,8 @@ end
83
84
  # @return [ String ] the camelized string result
84
85
  def camelize(string)
85
86
  string = path_shifter(string, n: $opts[?n])
86
- string = string.gsub(/#{Regexp.quote(File.extname(string))}\Z/, '')
87
+ string = string.sub(/#{Regexp.quote(File.extname(string))}\z/, '')
88
+ $opts[?S] and string = string.sub(/_spec\z/, '')
87
89
  string.camelize
88
90
  end
89
91
 
@@ -153,6 +155,7 @@ def usage
153
155
  -n NUMBER the number of module namespaces to skip from the left
154
156
  -b return right most module namespace
155
157
  -s adds .rb suffix to foo/bar_baz.rb if necessary
158
+ -S remove _spec / Spec suffixes if applicable
156
159
  -p SEPARATOR used for declassification
157
160
  -h display this help
158
161
 
@@ -169,6 +172,10 @@ def usage
169
172
  classify -p . -d Foo::Bar::Baz ⇢ foo.bar.baz
170
173
  classify -p : -d Foo::Bar::Baz ⇢ foo:bar:baz
171
174
  classify -n 1 lib/foo/bar ⇢ Foo::Bar
175
+ classify -S foo/bar_spec.rb ⇢ Foo::Bar
176
+ classify -S Foo::BarBazSpec ⇢ Foo::BarBaz
177
+ classify -d -S Foo::BarSpec ⇢ foo/bar
178
+
172
179
 
173
180
  With this configuration in .utilsrc:
174
181
  classify do
@@ -186,11 +193,12 @@ def usage
186
193
  exit 0
187
194
  end
188
195
 
189
- $opts = go 'dtn:bsp:h'
196
+ $opts = go 'dtn:bsSp:h'
190
197
 
191
198
  $opts[?h] and usage
192
199
  string = ARGV.shift or fail "need a class/filepath/filename"
193
200
  string = Term::ANSIColor.uncolor string
201
+ string = string.chomp
194
202
 
195
203
  config = Utils::ConfigFile.new
196
204
  config.configure_from_paths
@@ -221,7 +229,9 @@ print(
221
229
  end
222
230
  else
223
231
  if camelcase?(string)
224
- path_shifter(string, separator: '::', n: $opts[?n])
232
+ string = path_shifter(string, separator: '::', n: $opts[?n])
233
+ $opts[?S] and string = string.sub(/Spec\z/, '')
234
+ string
225
235
  else
226
236
  camelize string
227
237
  end
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.72.0'
3
+ VERSION = '0.73.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/utils.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: utils 0.72.0 ruby lib
2
+ # stub: utils 0.73.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "utils".freeze
6
- s.version = "0.72.0".freeze
6
+ s.version = "0.73.0".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
35
35
  s.add_runtime_dependency(%q<search_ui>.freeze, ["~> 0.0".freeze])
36
36
  s.add_runtime_dependency(%q<all_images>.freeze, ["~> 0.5.0".freeze])
37
37
  s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.5.0".freeze])
38
- s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.0.1".freeze])
38
+ s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.1".freeze])
39
39
  s.add_runtime_dependency(%q<figlet>.freeze, ["~> 1.0".freeze])
40
40
  s.add_runtime_dependency(%q<context_spook>.freeze, ["~> 0.2".freeze])
41
41
  s.add_runtime_dependency(%q<simplecov>.freeze, [">= 0".freeze])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.72.0
4
+ version: 0.73.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -183,14 +183,14 @@ dependencies:
183
183
  requirements:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
- version: 0.0.1
186
+ version: '0.1'
187
187
  type: :runtime
188
188
  prerelease: false
189
189
  version_requirements: !ruby/object:Gem::Requirement
190
190
  requirements:
191
191
  - - "~>"
192
192
  - !ruby/object:Gem::Version
193
- version: 0.0.1
193
+ version: '0.1'
194
194
  - !ruby/object:Gem::Dependency
195
195
  name: figlet
196
196
  requirement: !ruby/object:Gem::Requirement