u-struct 0.3.0 → 0.6.0

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: ac25a5ecc24b0ec3a473cec8bda658ac62916f70540d434f2c1cc3acc36e4fe9
4
- data.tar.gz: 6a05a56bbd76a567f14dcea7a712133c47abb57d476eba4a815e35d55af26d2c
3
+ metadata.gz: 52450d53b7accc5aa4c83682dfc6557d3f5fa4d7879648c189701198548e0ace
4
+ data.tar.gz: 4a25f913523f7aa9e79e96e49cafd33cff2ec748dac79d0bca611cd67aa304e3
5
5
  SHA512:
6
- metadata.gz: ee96de60c2975e14fd4c25816a565e4cd91fd8987116e5feb823330bbb67d2bc272c32e86a4a6a5fce8357e96a8d703d59442e58ef08b30191b96fee08146ce0
7
- data.tar.gz: 2a0d48a7b150b691049053f5b7c6e343902492ddfb976034a88e993fbaecfb2bdcabed0a60de7dc4847a67d48eb7848f133be223440ee9c182257d6d9751fd26
6
+ metadata.gz: 1bd5940255d259aeebbe5207a0a397bfade550bbc0e4bf719233ef18c2ba8f3fb483b96fb932fd775f7b98c35af184292b5f7392b32ebf0456888379b13c857c
7
+ data.tar.gz: 0ca2437cf6a48c090cc176324477b579c394b11c8c451a14a11c62a9509e5b3f6f722f1318d777e4db610cf4ab004b7f820dba169544fca0c31fb6033d03cf76
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/CHANGELOG.md ADDED
@@ -0,0 +1,29 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.6.0] - 2021-12-03
4
+
5
+ - To-do
6
+
7
+ ## [0.5.0] - 2021-12-03
8
+
9
+ - To-do
10
+
11
+ ## [0.4.0] - 2021-12-03
12
+
13
+ - To-do
14
+
15
+ ## [0.3.1] - 2021-12-02
16
+
17
+ - To-do
18
+
19
+ ## [0.3.0] - 2021-12-02
20
+
21
+ - To-do
22
+
23
+ ## [0.2.0] - 2021-12-02
24
+
25
+ - To-do
26
+
27
+ ## [0.1.0] - 2021-12-02
28
+
29
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at rodrigo.serradura@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in micro-struct.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "minitest", "~> 5.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,22 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ u-struct (0.6.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ minitest (5.14.4)
10
+ rake (13.0.6)
11
+
12
+ PLATFORMS
13
+ x86_64-darwin-19
14
+
15
+ DEPENDENCIES
16
+ bundler
17
+ minitest (~> 5.0)
18
+ rake (~> 13.0)
19
+ u-struct!
20
+
21
+ BUNDLED WITH
22
+ 2.2.32
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Rodrigo Serradura
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # Micro::Struct
2
+
3
+ Create powered Ruby structs.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'u-struct'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install u-struct
20
+
21
+ ## Usage
22
+
23
+ ```ruby
24
+ # Like in a regular Struct, you can define one or many attributes.
25
+ # But all of will be required by default.
26
+
27
+ Micro::Struct.new(:first_name, :last_name, ...)
28
+
29
+ # Use the `_optional:` arg if you want some optional attributes.
30
+
31
+ Micro::Struct.new(:first_name, :last_name, _optional: :gender)
32
+
33
+ # Using `_optional:` to define all attributes are optional.
34
+
35
+ Micro::Struct.new(_optional: [:first_name, :last_name])
36
+
37
+ # You can also pass a block to define custom methods.
38
+
39
+ Micro::Struct.new(:name) {}
40
+
41
+ # Available features (use one, many, or all) to create Structs with a special behavior:
42
+ # .with(:to_ary, :to_hash, :to_proc, :readonly, :instance_copy)
43
+
44
+ Micro::Struct.with(:to_ary).new(:name)
45
+ Micro::Struct.with(:to_ary, :to_hash).new(:name)
46
+ Micro::Struct.with(:to_ary, :to_hash, :to_proc).new(:name)
47
+ Micro::Struct.with(:to_ary, :to_hash, :to_proc, :readonly).new(:name)
48
+ Micro::Struct.with(:to_ary, :to_hash, :to_proc, :readonly, :instance_copy).new(:name)
49
+
50
+ # All of the possible combinations to create a Ruby Struct. ;)
51
+
52
+ Micro::Struct.new(*required)
53
+ Micro::Struct.new(*required) {}
54
+
55
+ Micro::Struct.new(_optional: *)
56
+ Micro::Struct.new(_optional: *) {}
57
+
58
+ Micro::Struct.new(*required, _optional: *)
59
+ Micro::Struct.new(*required, _optional: *) {}
60
+
61
+ # Any options above can be used by the `.new()` method of the struct creator returned by the `.with()` method.
62
+
63
+ Micro::Struct.with(*features).new(...) {}
64
+ ```
65
+
66
+ ## Development
67
+
68
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
69
+
70
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
71
+
72
+ ## Contributing
73
+
74
+ Bug reports and pull requests are welcome on GitHub at https://github.com/serradura/u-struct. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/serradura/u-struct/blob/master/CODE_OF_CONDUCT.md).
75
+
76
+ ## License
77
+
78
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
79
+
80
+ ## Code of Conduct
81
+
82
+ Everyone interacting in the Micro::Struct project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/serradura/u-struct/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/*_test.rb"]
10
+ end
11
+
12
+ task default: :test
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "micro/struct"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Micro::Struct::Creator
4
+ module CreateModule
5
+ extend self
6
+
7
+ def with(required_members, optional_members, features)
8
+ container = Module.new
9
+
10
+ def_initialize_and_members(container, required_members, optional_members)
11
+
12
+ def_to_proc(container) if features[:to_proc]
13
+
14
+ container
15
+ end
16
+
17
+ private
18
+
19
+ def def_initialize_and_members(container, required_members, optional_members)
20
+ required = "#{required_members.join(':, ')}#{':' unless required_members.empty?}"
21
+ optional = "#{optional_members.join(': nil, ')}#{': nil' unless optional_members.empty?}"
22
+
23
+ method_arguments = [required, optional].reject(&:empty?).join(', ')
24
+ struct_arguments = (required_members + optional_members).join(', ')
25
+
26
+ container.module_eval(<<~RUBY, __FILE__, __LINE__ + 1)
27
+ # The .new() method will require all required keyword arguments.
28
+ # We are doing this because the Struct constructor keyword init option treats everything as optional.
29
+ #
30
+ def self.new(#{method_arguments}) # def self.new(a:, b:) do
31
+ Struct.send(:new, #{struct_arguments}) # Struct.send(:new, a, b)
32
+ end # end
33
+
34
+ def self.members
35
+ Struct.members
36
+ end
37
+ RUBY
38
+ end
39
+
40
+ def def_to_proc(container)
41
+ container.module_eval(<<~RUBY, __FILE__, __LINE__ + 1)
42
+ def self.to_proc
43
+ ->(hash) { new(**hash) }
44
+ end
45
+ RUBY
46
+ end
47
+ end
48
+
49
+ private_constant :CreateModule
50
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Micro::Struct::Creator
4
+ module CreateStruct
5
+ extend self
6
+
7
+ def with(required_members, optional_members, features, &block)
8
+ struct = ::Struct.new(*(required_members + optional_members), &block)
9
+ struct.send(:private_class_method, :new)
10
+
11
+ def_to_ary(struct) if features[:to_ary]
12
+ def_to_hash(struct) if features[:to_hash]
13
+ def_readonly(struct) if features[:readonly]
14
+ def_instance_copy(struct) if features[:readonly] || features[:instance_copy]
15
+
16
+ struct
17
+ end
18
+
19
+ private
20
+
21
+ def def_to_ary(struct)
22
+ struct.send(:alias_method, :to_ary, :to_a)
23
+ end
24
+
25
+ def def_to_hash(struct)
26
+ struct.send(:alias_method, :to_hash, :to_h)
27
+ end
28
+
29
+ def def_readonly(struct)
30
+ struct.send(:private, *struct.members.map { |member| "#{member}=" })
31
+ end
32
+
33
+ def def_instance_copy(struct)
34
+ struct.class_eval(<<~RUBY, __FILE__, __LINE__ + 1)
35
+ def with(**members)
36
+ self.class.const_get(:Container, false).new(**to_h.merge(members))
37
+ end
38
+ RUBY
39
+ end
40
+ end
41
+
42
+ private_constant :CreateStruct
43
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Micro::Struct
4
+ class Creator
5
+ require_relative 'creator/create_module'
6
+ require_relative 'creator/create_struct'
7
+
8
+ def initialize(features)
9
+ @features = Features.require(features)
10
+ end
11
+
12
+ ValidateMemberNames = ->(values) do
13
+ Validate::Names.(values, label: 'member')
14
+ end
15
+
16
+ def new(*members, _optional: nil, &block)
17
+ required_members = ValidateMemberNames[members]
18
+ optional_members = ValidateMemberNames[_optional]
19
+
20
+ container = CreateModule.with(required_members, optional_members, @features)
21
+ struct = CreateStruct.with(required_members, optional_members, @features, &block)
22
+
23
+ container.const_set(:Struct, struct)
24
+ struct.const_set(:Container, container)
25
+ end
26
+ end
27
+
28
+ private_constant :Creator
29
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Micro::Struct
4
+ module Features
5
+ DISABLED =
6
+ { to_ary: false,
7
+ to_hash: false,
8
+ to_proc: false,
9
+ readonly: false,
10
+ instance_copy: false
11
+ }.freeze
12
+
13
+ Check = ->(to_ary:, to_hash:, to_proc:, readonly:, instance_copy:) do
14
+ { to_ary: to_ary,
15
+ to_hash: to_hash,
16
+ to_proc: to_proc,
17
+ readonly: readonly,
18
+ instance_copy: instance_copy }
19
+ end
20
+
21
+ ValidateFeatureNames = ->(values) do
22
+ Validate::Names.(values, label: 'feature')
23
+ end
24
+
25
+ def self.require(names)
26
+ features_to_enable =
27
+ ValidateFeatureNames[names].each_with_object({}) { |name, memo| memo[name] = true }
28
+
29
+ Check.(**DISABLED.merge(features_to_enable))
30
+ end
31
+ end
32
+
33
+ private_constant :Features
34
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Micro::Struct
4
+ module Validate
5
+ module Names
6
+ REGEXP = /\A[_A-Za-z]\w*\z/.freeze
7
+ Invalid = ->(label, val) { raise NameError.new("invalid #{label} name: #{val}") }
8
+ AsSymbol = ->(label, val) { REGEXP =~ val ? val.to_sym : Invalid[label, val] }.curry
9
+
10
+ def self.call(values, label:)
11
+ Array(values).map(&Names::AsSymbol[label])
12
+ end
13
+ end
14
+ end
15
+
16
+ private_constant :Validate
17
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Micro
4
+ module Struct
5
+ VERSION = '0.6.0'
6
+ end
7
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'struct/version'
4
+ require_relative 'struct/features'
5
+ require_relative 'struct/creator'
6
+ require_relative 'struct/validate'
7
+
8
+ module Micro
9
+ # Like in a regular Struct, you can define one or many attributes.
10
+ # But all of will be required by default.
11
+ #
12
+ # Micro::Struct.new(:first_name, :last_name, ...)
13
+ #
14
+ # Use the `_optional:` arg if you want some optional attributes.
15
+ #
16
+ # Micro::Struct.new(:first_name, :last_name, _optional: :gender)
17
+ #
18
+ # Using `_optional:` to define all attributes are optional.
19
+ #
20
+ # Micro::Struct.new(_optional: [:first_name, :last_name])
21
+ #
22
+ # You can also pass a block to define custom methods.
23
+ #
24
+ # Micro::Struct.new(:name) {}
25
+ #
26
+ # Available features (use one, many, or all) to create Structs with a special behavior:
27
+ # .with(:to_ary, :to_hash, :to_proc, :readonly, :instance_copy)
28
+ #
29
+ # Micro::Struct.with(:to_ary).new(:name)
30
+ # Micro::Struct.with(:to_ary, :to_hash).new(:name)
31
+ # Micro::Struct.with(:to_ary, :to_hash, :to_proc).new(:name)
32
+ # Micro::Struct.with(:to_ary, :to_hash, :to_proc, :readonly).new(:name)
33
+ # Micro::Struct.with(:to_ary, :to_hash, :to_proc, :readonly, :instance_copy).new(:name)
34
+ #
35
+ # All of the possible combinations to create a Ruby Struct. ;)
36
+ #
37
+ # Micro::Struct.new(*required)
38
+ # Micro::Struct.new(*required) {}
39
+ #
40
+ # Micro::Struct.new(_optional: *)
41
+ # Micro::Struct.new(_optional: *) {}
42
+ #
43
+ # Micro::Struct.new(*required, _optional: *)
44
+ # Micro::Struct.new(*required, _optional: *) {}
45
+ #
46
+ # Any options above can be used by the `.new()` method of the struct creator returned by the `.with()` method.
47
+ #
48
+ # Micro::Struct.with(*features).new(...) {}
49
+ module Struct
50
+ def self.new(*members, _optional: nil, &block)
51
+ with.new(*members, _optional: _optional, &block)
52
+ end
53
+
54
+ def self.with(*features)
55
+ Creator.new(features)
56
+ end
57
+ end
58
+ end
data/lib/u-struct.rb ADDED
@@ -0,0 +1 @@
1
+ require 'micro/struct'
data/u-struct.gemspec ADDED
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/micro/struct/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'u-struct'
7
+ spec.version = Micro::Struct::VERSION
8
+ spec.authors = ['Rodrigo Serradura']
9
+ spec.email = ['rodrigo.serradura@gmail.com']
10
+
11
+ spec.summary = %q{Create powered Ruby structs.}
12
+ spec.description = %q{Create powered Ruby structs.}
13
+ spec.homepage = 'https://github.com/serradura/u-struct'
14
+ spec.license = 'MIT'
15
+ spec.required_ruby_version = '>= 2.4.0'
16
+
17
+ spec.metadata['homepage_uri'] = spec.homepage
18
+ spec.metadata['source_code_uri'] = 'https://github.com/serradura/u-struct'
19
+ spec.metadata['changelog_uri'] = 'https://github.com/serradura/u-struct/blob/main/CHANGELOG.md'
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ end
26
+ spec.bindir = 'exe'
27
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ['lib']
29
+
30
+ # Uncomment to register a new dependency of your gem
31
+
32
+ # For more information and examples about making a new gem, checkout our
33
+ # guide at: https://bundler.io/guides/creating_gem.html
34
+ spec.add_development_dependency 'bundler'
35
+ spec.add_development_dependency 'rake', '~> 13.0'
36
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: u-struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Serradura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-02 00:00:00.000000000 Z
11
+ date: 2021-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,7 +44,26 @@ email:
44
44
  executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
- files: []
47
+ files:
48
+ - ".gitignore"
49
+ - CHANGELOG.md
50
+ - CODE_OF_CONDUCT.md
51
+ - Gemfile
52
+ - Gemfile.lock
53
+ - LICENSE.txt
54
+ - README.md
55
+ - Rakefile
56
+ - bin/console
57
+ - bin/setup
58
+ - lib/micro/struct.rb
59
+ - lib/micro/struct/creator.rb
60
+ - lib/micro/struct/creator/create_module.rb
61
+ - lib/micro/struct/creator/create_struct.rb
62
+ - lib/micro/struct/features.rb
63
+ - lib/micro/struct/validate.rb
64
+ - lib/micro/struct/version.rb
65
+ - lib/u-struct.rb
66
+ - u-struct.gemspec
48
67
  homepage: https://github.com/serradura/u-struct
49
68
  licenses:
50
69
  - MIT
@@ -67,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
86
  - !ruby/object:Gem::Version
68
87
  version: '0'
69
88
  requirements: []
70
- rubygems_version: 3.2.17
89
+ rubygems_version: 3.2.21
71
90
  signing_key:
72
91
  specification_version: 4
73
92
  summary: Create powered Ruby structs.