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 +4 -4
- data/CHANGES.md +2 -0
- data/README.md +2 -2
- data/VERSION +1 -1
- data/lib/codify/rust/type_alias.rb +29 -0
- data/lib/codify/rust.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 976aa2cb68736d757fe17521a6bf9dbfb059880802d79d28d668da85887599a5
|
4
|
+
data.tar.gz: c586733769830e10780861290ab637e02d076f00ddb7d74d68a776e845ec9d6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
[](https://unlicense.org)
|
4
4
|
[](https://rubyreferences.github.io/rubychanges/3.0.html)
|
5
5
|
[](https://rubygems.org/gems/codify.rb)
|
6
|
-
[](https://rubydoc.info/
|
6
|
+
[](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/
|
36
|
+
https://rubydoc.info/github/dryruby/codify.rb
|
37
37
|
|
38
38
|
## 👨💻 Development
|
39
39
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.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
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.
|
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-
|
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
|