shufu 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: cb8875c20791059866fce8a4ffca83b5e6e072561200bd585b89a0124ebd7373
4
- data.tar.gz: 583e2f2195d76d16144c2aa49d9914f2a6bd2557a7638114b67e2ef08ef1c267
3
+ metadata.gz: 2b858f08ebaa7dcca08a410c5352d5ad773485b71aeb07b4078f883d5bb2eb2b
4
+ data.tar.gz: f469e1608aee7b62c8e934ebcaae0f5ce5d81b26fd1dce051da290f30253ee43
5
5
  SHA512:
6
- metadata.gz: cd87095644fce9a66bd244ea53835313134528c3ac68a97a6516a8991abd26c5c2a4b26651cd3d4c5baa72ca78ceb7e1262a2c799e816c36e7f37bc81b2ae35f
7
- data.tar.gz: 13fa0f03aaaf03a8b3313224eede86df53c6b05d1ccbf534d66d47e506d8d7fb10fe11c36ac2f746c4853a2707bc65162928b16afb26febc9f605dfffbd909ad
6
+ metadata.gz: 403fff19b0e2d2f76ff27eb5d2dd367562cd689c7be74a63bc9965ff03173235e9e7d5d6611bb3f8583b19c32ffce5e3e6872d61d05c3ea3f50a4ac82320c039
7
+ data.tar.gz: 2274385325d2f3e43e8133933c9aa0b4ea0420f4786ebf2653adc120363f7c0084321dfa62a88c33b67bea414e2b0ed5257ed69ff63e8cd08f55395ca2224898
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shufu (0.1.1)
4
+ shufu (0.1.2)
5
5
  dry-schema
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -23,18 +23,16 @@ Or install it yourself as:
23
23
  ```ruby
24
24
  require "shufu"
25
25
 
26
- schema = {
27
- schema: [
28
- { name: "amend", type: option, flag: true },
29
- { name: "author", type: option, equal: true }
30
- ]
31
- }
26
+ schema = [
27
+ { name: "amend", type: option, flag: true },
28
+ { name: "author", type: option, equal: true }
29
+ ]
32
30
 
33
31
  command = Shufu::Command.new("git commit", schema)
34
32
 
35
33
  p command.line({ amend: true, author: "cc-kawakami" })
36
34
 
37
- # git commit --amend --author=cc-kawakami
35
+ # => "git commit --amend --author=cc-kawakami"
38
36
  ```
39
37
 
40
38
  ## Development
data/lib/shufu/command.rb CHANGED
@@ -4,11 +4,11 @@ module Shufu
4
4
  class Command
5
5
  def initialize(base, schema)
6
6
  @base = base
7
- schema = Shufu::Schema.call(schema)
7
+ schema = Shufu::Schema.call({ schema: schema })
8
8
  if schema.failure?
9
9
  raise Shufu::InvalidSchemaError, schema.errors(full: true).to_h
10
10
  end
11
- @schema = schema
11
+ @schema = schema.to_h[:schema]
12
12
  end
13
13
 
14
14
  def line(values)
data/lib/shufu/item.rb CHANGED
@@ -7,7 +7,7 @@ module Shufu
7
7
  end
8
8
 
9
9
  def schema
10
- @all_schema[:schema].find { |s| s[:name] == @name.to_s }
10
+ @all_schema.find { |s| s[:name] == @name.to_s }
11
11
  end
12
12
 
13
13
 
data/lib/shufu/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shufu
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shufu
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
  - cc-kawakami