ruby_smart-support 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ffa7fb2389de19763b239f720ab830e97178f07ab582168d3bff000f08061fe
4
- data.tar.gz: 0d9e1695e4558759194c2b22d8f6a88e4e5cf91f0b527de9ab96c1e5a1799a95
3
+ metadata.gz: fd347393200ee92556b1d3ea0c6c364d5da5a13be34100fda90056005ac22adf
4
+ data.tar.gz: 92bf3aae8deda45cc40b2aa7eb77d5e8774e9ae46320246642e6ea1c8ba3102a
5
5
  SHA512:
6
- metadata.gz: 3868c6da69ac5a9a11357812cd2d5eb4ecdaba21ca3b805d90389068d52c6518f330da21873332f6e67207fa34d6eb536c307957ed2ed0249e7309fc9604c3a4
7
- data.tar.gz: b72bbf4e9b768fa99af1245943a3ba1bd8e5302e790a316c4a5fcc9c17de9dafda83e5ef4b98a369cc28bc52b8b2cf7251abe935b3256f5cc7b8dc31999aa1e7
6
+ metadata.gz: aec073cf8aece0a5930fe22f83365fe804bc589b40b84b7524f5b21edaf4053df678b59968f9c1f1222b7773ec228b3cda5343d9d8c99fb7f7eddc79ab7d869e
7
+ data.tar.gz: fdc642a6c32398c676e353599d61855390999eca7aea52a3c5a51a0a9c0fc7e3c28ea3c264fc75ac5112e3b30bd8dc97ebea664b819016b160567e854e6be90a
data/.gitignore CHANGED
@@ -17,3 +17,6 @@
17
17
 
18
18
  # Github testing
19
19
  Gemfile.lock
20
+
21
+ # builds
22
+ /*.gem
data/Rakefile CHANGED
@@ -6,3 +6,11 @@ require "rspec/core/rake_task"
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
8
  task default: :spec
9
+
10
+ # ----- Documentation tasks ---------------------------------------------------
11
+
12
+ require 'yard'
13
+ YARD::Rake::YardocTask.new(:doc) do |t|
14
+ t.options = %w| --embed-mixins --markup=markdown|
15
+ t.files = ['lib/**/*.rb','-','docs/*.*']
16
+ end
data/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # RubySmart::Support - CHANGELOG
2
2
 
3
+ ## [1.1.1] - 2022-11-15
4
+ * **[fix]** `GemInfo` & `ThreadInfo` not being included on require 'ruby_smart-support'
5
+ * **[fix]** yard comments
6
+ * **[add]** `yard` gem for documentation
7
+
3
8
  ## [1.1.0] - 2022-11-12
4
9
  * **[ref]** `GemInfo.match?` method to provide method parameters more intuitive like `.match?('3.4.0', '>', '3.1.0')`
5
10
  * **[fix]** README
@@ -8,12 +8,13 @@ unless Hash.method_defined? "only!"
8
8
  # Replaces the hash with only the given keys (if exists),
9
9
  # but returns the same hash (not the removed keys - this differs to *Hash#slice!*)
10
10
  #
11
+ # @example
11
12
  # hsh = {a: 1, b: 2, c: 3}
12
13
  # hsh.only!(:a, :d)
13
14
  # > {a: 1}
14
15
  # > hsh == {a: 1}
15
16
  #
16
- # @param [Object] *keys
17
+ # @param [Array] keys
17
18
  # @return [Hash] self
18
19
  def only!(*keys)
19
20
  slice!(*keys)
@@ -27,15 +28,16 @@ unless Hash.method_defined? "without!"
27
28
  # removes the given keys from hash and returns those key => value pairs
28
29
  # (this differs to *Hash#except!*)
29
30
  #
31
+ # @example
30
32
  # hsh = {a: 1, b: 2, c: 3}
31
33
  # hsh.without!(:a, :d)
32
34
  # > {a: 1}
33
35
  # > hsh == {b: 2, c: 3}
34
36
  #
35
- # @param [Object] *keys
37
+ # @param [Array] keys
36
38
  # @return [Hash] self
37
39
  def without!(*keys)
38
- Hash[self.to_a - self.except!(*keys).to_a]
40
+ Hash[to_a - except!(*keys).to_a]
39
41
  end
40
42
  end
41
43
  end
@@ -44,12 +46,13 @@ unless Hash.method_defined? "deep_reject"
44
46
  class Hash
45
47
  # returns a new Hash with items that the block evaluates to true removed, also to deep Hashes.
46
48
  def deep_reject(&blk)
47
- self.deep_dup.deep_reject!(&blk)
49
+ deep_dup.deep_reject!(&blk)
48
50
  end
49
51
 
50
52
  # deep reject by provided block
51
53
  # deep remove keys that the block evaluates to true
52
54
  #
55
+ # @example
53
56
  # hsh = {a: 1, b: 2, c: 3, d: {a: 1, b: 2, c: 3}}
54
57
  # hsh.deep_reject! {|_k,v| v.is_a?(Numeric) && v > 2}
55
58
  # > hsh == {a: 1, b: 2, d: {a: 1, b: 2}}
@@ -58,13 +61,13 @@ unless Hash.method_defined? "deep_reject"
58
61
  # hsh.deep_reject! {|k,v| k == :d || v == 2}
59
62
  # > hsh == {a: 1, c: 3}
60
63
  def deep_reject!(&blk)
61
- self.each do |k, v|
64
+ each do |k, v|
62
65
  if blk.(k, v)
63
- self.delete(k)
66
+ delete(k)
64
67
  elsif v.is_a?(Hash)
65
68
  v.deep_reject!(&blk)
66
69
  end
67
70
  end
68
71
  end
69
72
  end
70
- end
73
+ end
@@ -9,10 +9,10 @@ unless Array.method_defined? :only!
9
9
  # ary.only!(:bar, :moon)
10
10
  # > ary == [:bar]
11
11
  #
12
- # @param [Object] *values
12
+ # @param [Array] values
13
13
  # @return [Array] self
14
14
  def only!(*values)
15
- reject! {|value| !values.include?(value)}
15
+ reject! { |value| !values.include?(value) }
16
16
  self
17
17
  end
18
18
  end
@@ -27,7 +27,7 @@ unless Array.method_defined? :only
27
27
  # ary.only(:bar, :bat, :moon)
28
28
  # > [:bar, :bat]
29
29
  #
30
- # @param [Object] *values
30
+ # @param [Array] values
31
31
  # @return [Array] ary
32
32
  def only(*values)
33
33
  dup.only!(*values)
@@ -10,7 +10,7 @@ module RubySmart
10
10
  module VERSION
11
11
  MAJOR = 1
12
12
  MINOR = 1
13
- TINY = 0
13
+ TINY = 1
14
14
  PRE = nil
15
15
 
16
16
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -1,3 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ruby_smart/support'
3
+ require 'ruby_smart/support'
4
+ require 'gem_info'
5
+ require 'thread_info'
@@ -1,27 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/ruby_smart/support/version"
3
+ require_relative 'lib/ruby_smart/support/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = "ruby_smart-support"
7
- spec.version = RubySmart::Support.version
8
- spec.authors = ["Tobias Gonsior"]
9
- spec.email = ["info@ruby-smart.org"]
6
+ spec.name = 'ruby_smart-support'
7
+ spec.version = RubySmart::Support.version
8
+ spec.authors = ['Tobias Gonsior']
9
+ spec.email = ['info@ruby-smart.org']
10
10
 
11
- spec.summary = "A toolkit of support libraries including GemInfo, ThreadInfo, Ruby core extensions & optionally activesupport extensions"
12
- spec.description = <<DESC
13
- RubySmart::Support is a toolkit of support libraries for Ruby - major features includes GemInfo & ThreadInfo, as well core extensions for Ruby & activesupport (if installed).
14
- DESC
11
+ spec.summary = 'A toolkit of support libraries including GemInfo, ThreadInfo, Ruby core extensions & optionally activesupport extensions'
12
+ spec.description = <<~DESC
13
+ RubySmart::Support is a toolkit of support libraries for Ruby - major features includes GemInfo & ThreadInfo, as well core extensions for Ruby & activesupport (if installed).
14
+ DESC
15
15
 
16
- spec.homepage = "https://github.com/ruby-smart/support"
17
- spec.license = "MIT"
18
- spec.required_ruby_version = ">= 2.6.0"
16
+ spec.homepage = 'https://github.com/ruby-smart/support'
17
+ spec.license = 'MIT'
18
+ spec.required_ruby_version = '>= 2.6.0'
19
19
 
20
- spec.metadata["homepage_uri"] = spec.homepage
21
- spec.metadata["source_code_uri"] = "https://github.com/ruby-smart/support"
22
- spec.metadata["changelog_uri"] = "#{spec.metadata["source_code_uri"]}/blob/main/docs/CHANGELOG.md"
20
+ spec.metadata['homepage_uri'] = spec.homepage
21
+ spec.metadata['source_code_uri'] = 'https://github.com/ruby-smart/support'
22
+ spec.metadata['changelog_uri'] = "#{spec.metadata["source_code_uri"]}/blob/main/docs/CHANGELOG.md"
23
23
 
24
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
24
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
25
25
 
26
26
  # Specify which files should be added to the gem when it is released.
27
27
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -29,10 +29,11 @@ DESC
29
29
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
30
30
  end
31
31
 
32
- spec.require_paths = ["lib"]
32
+ spec.require_paths = ['lib']
33
33
 
34
- spec.add_development_dependency 'activesupport', ">= 4.0"
35
- spec.add_development_dependency 'rspec', "~> 3.0"
36
- spec.add_development_dependency 'rake', "~> 13.0"
37
- spec.add_development_dependency 'simplecov', '~> 0.21'
34
+ spec.add_development_dependency 'activesupport', '>= 4.0'
35
+ spec.add_development_dependency 'rake', '~> 13.0'
36
+ spec.add_development_dependency 'rspec', '~> 3.0'
37
+ spec.add_development_dependency 'simplecov', '~> 0.21'
38
+ spec.add_development_dependency 'yard', '~> 0.9'
38
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_smart-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Gonsior
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-12 00:00:00.000000000 Z
11
+ date: 2022-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -25,33 +25,33 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '13.0'
47
+ version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '13.0'
54
+ version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: simplecov
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,11 +66,25 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.21'
69
+ - !ruby/object:Gem::Dependency
70
+ name: yard
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.9'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.9'
69
83
  description: 'RubySmart::Support is a toolkit of support libraries for Ruby - major
70
84
  features includes GemInfo & ThreadInfo, as well core extensions for Ruby & activesupport
71
85
  (if installed).
72
86
 
73
- '
87
+ '
74
88
  email:
75
89
  - info@ruby-smart.org
76
90
  executables: []
@@ -114,7 +128,7 @@ metadata:
114
128
  source_code_uri: https://github.com/ruby-smart/support
115
129
  changelog_uri: https://github.com/ruby-smart/support/blob/main/docs/CHANGELOG.md
116
130
  allowed_push_host: https://rubygems.org
117
- post_install_message:
131
+ post_install_message:
118
132
  rdoc_options: []
119
133
  require_paths:
120
134
  - lib
@@ -130,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
144
  version: '0'
131
145
  requirements: []
132
146
  rubygems_version: 3.3.22
133
- signing_key:
147
+ signing_key:
134
148
  specification_version: 4
135
149
  summary: A toolkit of support libraries including GemInfo, ThreadInfo, Ruby core extensions
136
150
  & optionally activesupport extensions