utils 0.72.1 → 0.73.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
  SHA256:
3
- metadata.gz: e1835a4c42a7c669a3cfad1b8f59f0a75156546ea37ec8cafdbcdb5f2a017ce6
4
- data.tar.gz: 488a2b40f219435b3efe047af54d14ece783ae732284739908207cd2f3c497d0
3
+ metadata.gz: eeb8c50e8895ed05192b62c4c7c86d0f5eccd34234e6878233c5324542c2c5ef
4
+ data.tar.gz: f0c4adb49862333e4c85fba3ccde54c1a899dffb23a0cd846123d4bcc6ee7fa8
5
5
  SHA512:
6
- metadata.gz: 89fec0a6a86855afe02376d5aac7a707a90cca84df69c9117a7c1e4aa2720b9fba98883cce357d7ec8c319306c9c71af3ce403d68ba51b23847981ab4a7898a4
7
- data.tar.gz: 652cfc708a0b0cf7e225b5bcd2eb040acf461932154af2539d432ae70b918752cb3858984a746f6feb704b2a8e497ff21f80cffc6507046a7b02306a8b7be363
6
+ metadata.gz: 18e205eb300082bdd1341083a63ac508c80e3af31faabcbe4675ec4c2c7c3c7b5975e1479ec426aba98ebadad3dc2d8e66b0b351aeae092eb525a1caf23ff1a7
7
+ data.tar.gz: 8c3f8ec933935f36b4d79e5224dd49e71f5839bc152969f528b459f19240e743089ff7234e17eb644d6e19dda511eb8fdcf1a58e05cb4278752f831a9d87e5dd
data/Rakefile CHANGED
@@ -28,7 +28,7 @@ GemHadar do
28
28
  dependency 'mize', '~> 0.6'
29
29
  dependency 'search_ui', '~> 0.0'
30
30
  dependency 'all_images', '~> 0.5.0'
31
- dependency 'ollama-ruby', '~> 1.5.0'
31
+ dependency 'ollama-ruby', '~> 1.6'
32
32
  dependency 'kramdown-ansi', '~> 0.1'
33
33
  dependency 'figlet', '~> 1.0'
34
34
  dependency 'context_spook', '~> 0.2'
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.1'
3
+ VERSION = '0.73.1'
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.1 ruby lib
2
+ # stub: utils 0.73.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "utils".freeze
6
- s.version = "0.72.1".freeze
6
+ s.version = "0.73.1".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]
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.add_runtime_dependency(%q<mize>.freeze, ["~> 0.6".freeze])
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
- s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.5.0".freeze])
37
+ s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.6".freeze])
38
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])
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.1
4
+ version: 0.73.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -169,14 +169,14 @@ dependencies:
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: 1.5.0
172
+ version: '1.6'
173
173
  type: :runtime
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: 1.5.0
179
+ version: '1.6'
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: kramdown-ansi
182
182
  requirement: !ruby/object:Gem::Requirement