shiyo 0.1.0 → 0.1.1

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: 01a8618ea358901acad9f198594959ce443730b01447cf5e47ceca99aaa695cf
4
- data.tar.gz: 3e6685943a96003656e015de60ca82bcd38b055380bf20fabf5bfc81953cff62
3
+ metadata.gz: d3cac64b3952eb7ca2cbc28c4c28bc0be7abad2dcab019e880f0dbd995191151
4
+ data.tar.gz: 867b20167b0327492d8011a6e90388683b7c0dae3ae22edba9b2b2e7f81a60c0
5
5
  SHA512:
6
- metadata.gz: 9a1483a64c112872659b413ba762ad9b3f8d68a74ee390820d2c1a566d54479d47aa05e4ccc6ab73908fe163b51f91e00add1443fe859889041bdd75ea6fc525
7
- data.tar.gz: 80c7ea2aa246bb9482c961cf10cbcfa957e4b86c088f3f34668e8315a42aad23b65fe4322077229cba271c8a1b05adb9512c8d35b371bd89e970083b83952dd5
6
+ metadata.gz: 78bdf7228c8377b54675046eaaa650183f147974bd56e429422bf0ddf44c1e3241ed2cc7fb17c1c7944584b3b12673f6a545659d29f88575333311b1fc2bf774
7
+ data.tar.gz: df0044517dd0589b2b476b645d2c3dce47eec94d6239f001a71cfdf0e8362c795ecd6b67d242e8725c6b8a0aa3d7570f6dddceeb6bb9e6469e11e7170cc1a7a5
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
1
  ## [Unreleased]
2
+ ## [0.1.1] - 2022-03-15
3
+
4
+ - Install `bump` gem
5
+ - Trivial refactorings
2
6
 
3
7
  ## [0.1.0] - 2022-03-12
4
8
 
data/Gemfile CHANGED
@@ -14,3 +14,5 @@ gem "rubocop", "~> 1.21"
14
14
  gem "rubocop-rspec", "~> 2.9"
15
15
 
16
16
  gem "yard", "~> 0.9"
17
+
18
+ gem "bump", "~> 0.10"
data/README.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # Shiyo
2
2
  [![johnny-miyake](https://circleci.com/gh/johnny-miyake/shiyo.svg?style=svg)](https://github.com/johnny-miyake/shiyo)
3
3
 
4
- Shiyo is a minimal framework that supports writing your business rules using the Specification pattern.
5
- It enables to build composite specifications by method chaining like;
4
+ Shiyo is a minimal framework that supports writing your business rules using the [Specification pattern](https://en.wikipedia.org/wiki/Specification_pattern).
5
+ It helps you to build a composite specification by method chaining like;
6
6
  ```ruby
7
7
  spec1.and(spec2.or(spec3)).satisfied_by?(candidate)
8
8
  ```
9
9
 
10
+ [API documentation](https://www.rubydoc.info/gems/shiyo)
11
+
10
12
  ## Installation
11
13
 
12
14
  Add this line to your application's Gemfile:
@@ -24,7 +26,12 @@ Or install it yourself as:
24
26
  $ gem install shiyo
25
27
 
26
28
  ## Usage
29
+ You can create your own Shiyo specification as following steps;
30
+ 1. Include `Shiyo::Specification` module into your class.
31
+ 2. Implement `#satisfied_by?`.
32
+ 3. (optional) Implement `#initialize` if needed.
27
33
 
34
+ For example;
28
35
  ```ruby
29
36
  # A specification class
30
37
  class ContainerFeatureSpec
data/lib/shiyo/and.rb CHANGED
@@ -10,7 +10,6 @@ module Shiyo
10
10
  # @param one [Shiyo::Specification] A specification object.
11
11
  # @param other [Shiyo::Specification] The other specification object.
12
12
  def initialize(one, other)
13
- super()
14
13
  @one = Shiyo::Specification(one)
15
14
  @other = Shiyo::Specification(other)
16
15
  end
data/lib/shiyo/not.rb CHANGED
@@ -9,7 +9,6 @@ module Shiyo
9
9
  #
10
10
  # @param wrapped [Shiyo::Specification] A specification object.
11
11
  def initialize(wrapped)
12
- super()
13
12
  @wrapped = Shiyo::Specification(wrapped)
14
13
  end
15
14
 
data/lib/shiyo/or.rb CHANGED
@@ -10,7 +10,6 @@ module Shiyo
10
10
  # @param one [Shiyo::Specification] A specification object.
11
11
  # @param other [Shiyo::Specification] The other specification object.
12
12
  def initialize(one, other)
13
- super()
14
13
  @one = Shiyo::Specification(one)
15
14
  @other = Shiyo::Specification(other)
16
15
  end
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shiyo
4
- # The module to provide syntax suggers.
5
- module SyntaxSugger
4
+ # The module to provide syntax sugars.
5
+ module SyntaxSugar
6
6
  # rubocop:disable Naming/MethodName
7
7
 
8
- # The syntax sugger for `Shiyo::Not.new`
8
+ # The syntax sugar for `Shiyo::Not.new`
9
9
  # @param object Any object.
10
10
  # @return [Shiyo::Not]
11
11
  def Not(object)
data/lib/shiyo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shiyo
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/shiyo.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require_relative "shiyo/error"
4
4
  require_relative "shiyo/version"
5
5
  require_relative "shiyo/conversion"
6
- require_relative "shiyo/syntax_sugger"
6
+ require_relative "shiyo/syntax_sugar"
7
7
  require_relative "shiyo/specification"
8
8
  require_relative "shiyo/and"
9
9
  require_relative "shiyo/or"
@@ -12,5 +12,5 @@ require_relative "shiyo/not"
12
12
  # The top module of Shiyo
13
13
  module Shiyo
14
14
  extend Shiyo::Conversion
15
- extend Shiyo::SyntaxSugger
15
+ extend Shiyo::SyntaxSugar
16
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shiyo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takuma Miyake
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-13 00:00:00.000000000 Z
11
+ date: 2022-03-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: " Shiyo is a minimal framework that supports writing your business
14
14
  rules using the Specification pattern.\n"
@@ -33,7 +33,7 @@ files:
33
33
  - lib/shiyo/not.rb
34
34
  - lib/shiyo/or.rb
35
35
  - lib/shiyo/specification.rb
36
- - lib/shiyo/syntax_sugger.rb
36
+ - lib/shiyo/syntax_sugar.rb
37
37
  - lib/shiyo/version.rb
38
38
  - sig/shiyo.rbs
39
39
  homepage: https://github.com/johnny-miyake/shiyo