rstructural 0.1.1 → 0.1.2

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: eaeeb6fd3715a08c65d789c7c7566bd01cdf85889c2f75e3680c147899d1f35c
4
- data.tar.gz: 77219c7fdcba9a170bb8e89150ea15b52fed139132c856503a2209cfb1356fd6
3
+ metadata.gz: fc8f95857064c7ea8117d34867bf68c59162e2e6315b3961fdc7f7ec62aeba03
4
+ data.tar.gz: 794a7abee762cdf543bc05782185ac81e7664355f74113a47525f8ea6e459216
5
5
  SHA512:
6
- metadata.gz: 5a81b38f7fa790f0a11b96c8d5dd0b85d8a30a812c34948c46027c75b5a8109b45411a636a708d2b36b8bb19e9271e48c923134199ca02776bd2eb5248d43435
7
- data.tar.gz: 77fe704bffc450ec21394ad2f098a5f6911b5132546c55d60e390bd803764930485679bf743bef918464981efa133e16f7c8fc473d578a1e225bcba00629b6ab
6
+ metadata.gz: 627653a650eb6431832554f1dba31535bbeeb7fa9dea2c8d3f71d8e02e838a50a52c199f3e6239ad2da86c5f29e2c8fd39428f003b68ba2b100091ecb30d1bdd
7
+ data.tar.gz: 78a6133b2a328d78375eaf1eb84f2502049dcf9f2b2408a49cff6647aafd4d1ae1512cba26730c959c565f096be5fd395448b3b0bed91497c126a9f4ad602f50
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rstructural (0.1.0)
4
+ rstructural (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
- # Ruby structual types
1
+ # Rstructural - Ruby structural types
2
+
3
+ [![rstructural](https://badge.fury.io/rb/rstructural.svg)](https://badge.fury.io/rb/rstructural)
4
+ [![Actions Status](https://github.com/petitviolet/rstructural/workflows/test/badge.svg)](https://github.com/petitviolet/rstructural/actions)
2
5
 
3
6
  - Rstruct
4
7
  - Struct implemented with Ruby
@@ -13,7 +16,7 @@
13
16
  Add this line to your application's Gemfile:
14
17
 
15
18
  ```ruby
16
- gem 'rstruct'
19
+ gem 'rstructural'
17
20
  ```
18
21
 
19
22
  And then execute:
@@ -22,10 +25,31 @@ And then execute:
22
25
 
23
26
  Or install it yourself as:
24
27
 
25
- $ gem install rstruct
28
+ $ gem install rstructural
26
29
 
27
30
  ## Usage
28
31
 
32
+ ### require
33
+
34
+ ```ruby
35
+ require 'rstructural'
36
+ # Imported these types
37
+ # - Rstruct
38
+ # - Enum
39
+ # - ADT
40
+ ```
41
+
42
+ or, require each modules with namespace `Rstructural`
43
+
44
+ ```ruby
45
+ require 'rstructural/struct'
46
+ # - Rstructural::Struct
47
+ require 'rstructural/enum'
48
+ # - Rstructural::Enum
49
+ require 'rstructural/adt'
50
+ # - Rstructural::ADT
51
+ ```
52
+
29
53
  ### Rstruct
30
54
 
31
55
  ```ruby
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "rstruct"
4
+ require "rstructural"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -30,7 +30,7 @@ module Rstructural
30
30
 
31
31
  def ==(other)
32
32
  return false if other.class != self.class
33
- #{attributes.map { |attr| "other.#{attr} == self.#{attr}" }.join(" && ")}
33
+ #{attributes.empty? ? true : attributes.map { |attr| "other.#{attr} == self.#{attr}" }.join(" && ")}
34
34
  end
35
35
 
36
36
  def inspect
data/rstructural.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "rstructural"
3
- spec.version = "0.1.1"
3
+ spec.version = "0.1.2"
4
4
  spec.authors = ["petitviolet"]
5
5
  spec.email = ["violethero0820@gmail.com"]
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rstructural
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
  - petitviolet