codify.rb 0.1.1 → 0.1.2

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: 4a2fc0cfdae5034fbbd99aff7da00a1b8d985c751c902a81c109fefdb1b60955
4
- data.tar.gz: fc8b11f52952a04cb4c672656c881df181eb5d854990a627bfc50ee544f75f36
3
+ metadata.gz: 976aa2cb68736d757fe17521a6bf9dbfb059880802d79d28d668da85887599a5
4
+ data.tar.gz: c586733769830e10780861290ab637e02d076f00ddb7d74d68a776e845ec9d6e
5
5
  SHA512:
6
- metadata.gz: 5ccea702e716c28ebcda7051bcfdb296c9d16feb0f0b1b045f6472c2e5b7355b89e711d6683c58c927e9b15bee717053f0de1b902d75240b3e372116878fda88
7
- data.tar.gz: cc5573697695713655bf15db4f8e65032b9f8ca912475734e3c8a3d864cc9c827c4b5d8b3bbeb2d658f8c22e474a63d3b4da573ccf2a3060d20d101f8d46d528
6
+ metadata.gz: 7e98452a1cfc0521d87cb79a390e2631aed6c8149e923732b1404d69886fd8900d89644bc817ce03204e31c253e3988179fdd6711a91c208db1965582c7cf7d5
7
+ data.tar.gz: c05557e20ba4374996727fe471e64b74c97c1a7218f799296667a3bacf7384f152e20c73d50625bdcb082a0c7c2d81d357ab80f1705637e7318173255fbf4ef9
data/CHANGES.md CHANGED
@@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 0.1.2 - 2025-05-14
9
+
8
10
  ## 0.1.1 - 2025-05-13
9
11
 
10
12
  ## 0.1.0 - 2025-05-12
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![License](https://img.shields.io/badge/license-Public%20Domain-blue.svg)](https://unlicense.org)
4
4
  [![Compatibility](https://img.shields.io/badge/ruby-3.0%2B-blue)](https://rubyreferences.github.io/rubychanges/3.0.html)
5
5
  [![Package](https://img.shields.io/gem/v/codify.rb)](https://rubygems.org/gems/codify.rb)
6
- [![Documentation](https://img.shields.io/badge/rubydoc-latest-blue)](https://rubydoc.info/gems/codify.rb)
6
+ [![Documentation](https://img.shields.io/badge/rubydoc-latest-blue)](https://rubydoc.info/github/dryruby/codify.rb)
7
7
 
8
8
  **Codify.rb** is a [Ruby] library for code generation.
9
9
 
@@ -33,7 +33,7 @@ require 'codify'
33
33
 
34
34
  ## 📚 Reference
35
35
 
36
- https://rubydoc.info/gems/codify.rb
36
+ https://rubydoc.info/github/dryruby/codify.rb
37
37
 
38
38
  ## 👨‍💻 Development
39
39
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -0,0 +1,29 @@
1
+ # This is free and unencumbered software released into the public domain.
2
+
3
+ require_relative 'definition'
4
+
5
+ class Codify::Rust::TypeAlias < Codify::Rust::Definition
6
+ ##
7
+ # @param [String, #to_s] name
8
+ # @param [Type] type
9
+ # @param [String, #to_s] comment
10
+ # @param [Proc] block
11
+ def initialize(name, type, **kwargs, &block)
12
+ super(name, **kwargs, derives: [], cfg_derives: [])
13
+ raise ArgumentError, "#{type.inspect}" unless type.is_a?(Type)
14
+ @type = type
15
+ block.call(self) if block_given?
16
+ end
17
+
18
+ ##
19
+ # @return [Array<Type>]
20
+ def types() [@type] end
21
+
22
+ ##
23
+ # @param [IO] out
24
+ # @return [void]
25
+ def write(out)
26
+ super(out)
27
+ out.puts "pub type #{@name} = #{@type};"
28
+ end
29
+ end # Codify::Rust::TypeAlias
data/lib/codify/rust.rb CHANGED
@@ -10,4 +10,5 @@ require_relative 'rust/newtype'
10
10
  require_relative 'rust/struct'
11
11
  require_relative 'rust/struct_field'
12
12
  require_relative 'rust/type'
13
+ require_relative 'rust/type_alias'
13
14
  require_relative 'rust/types'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codify.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arto Bendiken
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-13 00:00:00.000000000 Z
10
+ date: 2025-05-14 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rspec
@@ -57,6 +57,7 @@ files:
57
57
  - lib/codify/rust/struct.rb
58
58
  - lib/codify/rust/struct_field.rb
59
59
  - lib/codify/rust/type.rb
60
+ - lib/codify/rust/type_alias.rb
60
61
  - lib/codify/rust/types.rb
61
62
  - lib/codify/version.rb
62
63
  homepage: https://github.com/dryruby/codify.rb