minecraft_items 0.1.4 → 0.1.6

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: 41511a9b8e715a1cf1e4fdb1892bc5a46696eeb9323fb315843bbd5b113f32c1
4
- data.tar.gz: 14f194c56b4e37b08814e6032d52a00c9089f2d5eb4a4cf1adf0cf747e759fd8
3
+ metadata.gz: f8cedc213741996459a366fd3734af6e7371035e80a1d0abbbce798b95af8275
4
+ data.tar.gz: ac0dd90c1a540bd19597c4c6c6e2857d778277151d76e028aec27db9db4a3d8a
5
5
  SHA512:
6
- metadata.gz: d1257c21053b9fe531f73b587f7d6276700114851f64fe17a08bf5fcd6b957d883fc940fc570e3f94c5cbcd7016d142b66af141e44260aae26e192e867c41f8f
7
- data.tar.gz: 0f2c08f7dc3bf386fad3eb04015f8fc2ddf68f6a9c04ecfd2e50e45e6ac9a3cd6214aa06f30c38f21409ef5c819211725d0806beff9315ebed29ab5ecd5574ae
6
+ metadata.gz: b0faf77913a2252bd7b2aea95c07cdb704e40e147d2d3e0ba111dba6228dd797803d83500eb0c84dec9cd1d56ea1c8450018de9fd07ee5c483a3e028671db8d2
7
+ data.tar.gz: 460f03d3fb798e51cccace74ade255700741e0db356d027ecf2abd5970c51ec59bd9bbb33ee25d99e02322d83355b5c9a56f37028066a60c076976a77360c009
@@ -1,4 +1,5 @@
1
1
  require 'active_support/core_ext/hash/indifferent_access'
2
+ require 'active_support/core_ext/string/inflections'
2
3
  require 'block_types'
3
4
 
4
5
  class MinecraftItems
@@ -6,10 +7,12 @@ class MinecraftItems
6
7
  include BlockTypes
7
8
 
8
9
  def method_missing(method_name)
9
- if method_name.to_s.include?("all_types")
10
+ if method_name.to_s.include?("all_variants_and_types")
11
+ (minecraft_variants.values + minecraft_types.values).flatten.map { |type_or_variant| type_or_variant.titleize}.sort
12
+ elsif method_name.to_s.include?("all_types")
10
13
  minecraft_types
11
14
  elsif method_name.to_s.include?("all_variants")
12
- minecraft_variants
15
+ minecraft_variants.values.flatten.map { |variants| variants.titleize }.sort
13
16
  elsif method_name.to_s.include?("_variants")
14
17
  minecraft_variants[method_name]
15
18
  elsif method_name.to_s.include?("_types")
@@ -20,3 +23,4 @@ class MinecraftItems
20
23
  end
21
24
  end
22
25
  end
26
+
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'minecraft_items'
3
- s.version = '0.1.4'
3
+ s.version = '0.1.6'
4
4
  s.licenses = ['MIT']
5
5
  s.summary = "A list of most minecraft items"
6
6
  s.description = "With a few simple commands return all the types of blocks as well as each types variant."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minecraft_items
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maximilian Alexander
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-03-20 00:00:00.000000000 Z
12
+ date: 2023-03-27 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: With a few simple commands return all the types of blocks as well as
15
15
  each types variant.