diogenes 0.1.3 → 0.1.4

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: 23508c589817a7a8faac15185d7c803745553d4d7789ba279de8c871a6103336
4
- data.tar.gz: 21405f813bf767dd43f88bfb554d611201480f1de7f75d73868e0ce65a02d419
3
+ metadata.gz: ed59a2db9702739e79ab10146a799260ff41fbbe85c0178d9fd5c0976bd4621f
4
+ data.tar.gz: 2ca1bf8250b1753b059b48ee226eb8b20c122c2adce7ada559bb1047b5c5a03f
5
5
  SHA512:
6
- metadata.gz: c66d6ecd7165e10aad7db8e036d74060d9e8d32dbaa627711fbd3bcbc490768e074da7042d42dc3dfb6bbe9a7f14d2b874780863ffd57a27d6a2a99d79ab6ac0
7
- data.tar.gz: 6be0cb67ee1592d32ff288acf254c7521562c45e860fdd0dd87da5b2ab86b940565810ef30d31d9522b10c09366e81ea552ccff1efad814d18f40406e4fc0b72
6
+ metadata.gz: 84d21f0c4cf3817bafa44054a479f0c8d91e4a26b19d6835313511c1e5108e0e49f96316391d5b58f5c1f6a569e1432f0481e07b50d59b2fe6401c52d8871f4e
7
+ data.tar.gz: 2e5a9956eb13f0e19bd86cb71a333822771d4edd302e93c6000981b59ea9c67622a36702b9aee8f4e42b3f848b882b3ed44bcca3500fe2d38137ac4a47322ce6
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.1.3"
2
+ ".": "0.1.4"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.4](https://github.com/meaganewaller/diogenes/compare/diogenes/v0.1.3...diogenes/v0.1.4) (2026-06-27)
4
+
5
+
6
+ ### Features
7
+
8
+ * **dsl:** implement canonical source format DSL :sparkles: ([#7](https://github.com/meaganewaller/diogenes/issues/7)) ([e8a8f15](https://github.com/meaganewaller/diogenes/commit/e8a8f154a00fa4849d6a8f9b816cc037ad17e63d))
9
+
3
10
  ## [0.1.3](https://github.com/meaganewaller/diogenes/compare/diogenes/v0.1.2...diogenes/v0.1.3) (2026-06-27)
4
11
 
5
12
 
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+ # rbs_inline: enabled
3
+
4
+ module Diogenes
5
+ module DSL
6
+ class Artifact
7
+ attr_reader :name #: String
8
+
9
+ #: (String, ?Proc) -> void
10
+ def initialize(name, &block)
11
+ @name = name #: String
12
+ instance_eval(&block) if block_given?
13
+ validate!
14
+ end
15
+
16
+ #: (?String?) -> String?
17
+ def description(value = nil)
18
+ @description = value unless value.nil?
19
+ @description
20
+ end
21
+
22
+ #: (?String?) -> String?
23
+ def template(value = nil)
24
+ @template = value unless value.nil?
25
+ @template
26
+ end
27
+
28
+ private
29
+
30
+ #: () -> void
31
+ def validate!
32
+ missing = %i[description template].reject { |f| instance_variable_get(:"@#{f}") }
33
+ return if missing.empty?
34
+
35
+ raise Diogenes::ConfigurationError,
36
+ "Artifact #{@name.inspect} is missing required " \
37
+ "field#{"s" if missing.size > 1}: #{missing.join(", ")}. " \
38
+ "An artifact requires: description and template."
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+ # rbs_inline: enabled
3
+
4
+ module Diogenes
5
+ module DSL
6
+ class Hook
7
+ attr_reader :name #: String
8
+
9
+ #: (String, ?Proc) -> void
10
+ def initialize(name, &block)
11
+ @name = name #: String
12
+ instance_eval(&block) if block_given?
13
+ validate!
14
+ end
15
+
16
+ #: (?String?) -> String?
17
+ def trigger(value = nil)
18
+ @trigger = value unless value.nil?
19
+ @trigger
20
+ end
21
+
22
+ #: (?String?) -> String?
23
+ def prompt(value = nil)
24
+ @prompt = value unless value.nil?
25
+ @prompt
26
+ end
27
+
28
+ private
29
+
30
+ #: () -> void
31
+ def validate!
32
+ missing = %i[trigger prompt].reject { |f| instance_variable_get(:"@#{f}") }
33
+ return if missing.empty?
34
+
35
+ raise Diogenes::ConfigurationError,
36
+ "Hook #{@name.inspect} is missing required " \
37
+ "field#{"s" if missing.size > 1}: #{missing.join(", ")}. " \
38
+ "A hook requires: trigger and prompt."
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+ # rbs_inline: enabled
3
+
4
+ module Diogenes
5
+ module DSL
6
+ class Rule
7
+ attr_reader :name #: String
8
+
9
+ #: (String, ?Proc) -> void
10
+ def initialize(name, &block)
11
+ @name = name #: String
12
+ instance_eval(&block) if block_given?
13
+ validate!
14
+ end
15
+
16
+ #: (?String?) -> String?
17
+ def description(value = nil)
18
+ @description = value unless value.nil?
19
+ @description
20
+ end
21
+
22
+ #: (?String?) -> String?
23
+ def content(value = nil)
24
+ @content = value unless value.nil?
25
+ @content
26
+ end
27
+
28
+ private
29
+
30
+ #: () -> void
31
+ def validate!
32
+ missing = %i[description content].reject { |f| instance_variable_get(:"@#{f}") }
33
+ return if missing.empty?
34
+
35
+ raise Diogenes::ConfigurationError,
36
+ "Rule #{@name.inspect} is missing required " \
37
+ "field#{"s" if missing.size > 1}: #{missing.join(", ")}. " \
38
+ "A rule requires: description and content."
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+ # rbs_inline: enabled
3
+
4
+ module Diogenes
5
+ module DSL
6
+ class Skill
7
+ attr_reader :name #: String
8
+
9
+ #: (String, ?Proc) -> void
10
+ def initialize(name, &block)
11
+ @name = name #: String
12
+ instance_eval(&block) if block_given?
13
+ validate!
14
+ end
15
+
16
+ #: (?String?) -> String?
17
+ def command(value = nil)
18
+ @command = value unless value.nil?
19
+ @command
20
+ end
21
+
22
+ #: (?String?) -> String?
23
+ def description(value = nil)
24
+ @description = value unless value.nil?
25
+ @description
26
+ end
27
+
28
+ #: (?String?) -> String?
29
+ def prompt(value = nil)
30
+ @prompt = value unless value.nil?
31
+ @prompt
32
+ end
33
+
34
+ private
35
+
36
+ #: () -> void
37
+ def validate!
38
+ missing = %i[command description prompt].reject { |f| instance_variable_get(:"@#{f}") }
39
+ return if missing.empty?
40
+
41
+ raise Diogenes::ConfigurationError,
42
+ "Skill #{@name.inspect} is missing required " \
43
+ "field#{"s" if missing.size > 1}: #{missing.join(", ")}. " \
44
+ "A skill requires: command, description, and prompt."
45
+ end
46
+ end
47
+ end
48
+ end
@@ -2,5 +2,5 @@
2
2
  # rbs_inline: enabled
3
3
 
4
4
  module Diogenes
5
- VERSION = "0.1.3" #: String
5
+ VERSION = "0.1.4" #: String
6
6
  end
data/lib/diogenes.rb CHANGED
@@ -7,6 +7,7 @@ require "zeitwerk"
7
7
  #
8
8
  # Provides configuration, CLI, and runtime library for the Diogenes gem.
9
9
  loader = Zeitwerk::Loader.for_gem
10
+ loader.inflector.inflect("dsl" => "DSL")
10
11
  loader.setup
11
12
 
12
13
  module Diogenes
@@ -22,12 +23,58 @@ module Diogenes
22
23
  # Raised when the user provides invalid arguments to the CLI.
23
24
  class UserError < Error; end
24
25
 
25
- # Returns the version of the Diogenes gem.
26
- #
27
- # This is managed by the release-please workflow.
28
- # --
29
- #: () -> String
30
- def self.version
31
- VERSION
26
+ # Raised when a DSL definition is missing required fields.
27
+ class ConfigurationError < Error; end
28
+
29
+ @skills = {} #: Hash[String, DSL::Skill]
30
+ @rules = {} #: Hash[String, DSL::Rule]
31
+ @hooks = {} #: Hash[String, DSL::Hook]
32
+ @artifacts = {} #: Hash[String, DSL::Artifact]
33
+
34
+ class << self
35
+ #: () -> String
36
+ def version
37
+ VERSION
38
+ end
39
+
40
+ #: (String) { () -> void } -> DSL::Skill
41
+ def skill(name, &block)
42
+ @skills[name] = DSL::Skill.new(name, &block)
43
+ end
44
+
45
+ #: (String) { () -> void } -> DSL::Rule
46
+ def rule(name, &block)
47
+ @rules[name] = DSL::Rule.new(name, &block)
48
+ end
49
+
50
+ #: (String) { () -> void } -> DSL::Hook
51
+ def hook(name, &block)
52
+ @hooks[name] = DSL::Hook.new(name, &block)
53
+ end
54
+
55
+ #: (String) { () -> void } -> DSL::Artifact
56
+ def artifact(name, &block)
57
+ @artifacts[name] = DSL::Artifact.new(name, &block)
58
+ end
59
+
60
+ #: () -> Array[DSL::Skill]
61
+ def skills = @skills.values
62
+
63
+ #: () -> Array[DSL::Rule]
64
+ def rules = @rules.values
65
+
66
+ #: () -> Array[DSL::Hook]
67
+ def hooks = @hooks.values
68
+
69
+ #: () -> Array[DSL::Artifact]
70
+ def artifacts = @artifacts.values
71
+
72
+ #: () -> void
73
+ def reset!
74
+ @skills = {}
75
+ @rules = {}
76
+ @hooks = {}
77
+ @artifacts = {}
78
+ end
32
79
  end
33
80
  end
@@ -0,0 +1,23 @@
1
+ # Generated from lib/diogenes/dsl/artifact.rb with RBS::Inline
2
+
3
+ module Diogenes
4
+ module DSL
5
+ class Artifact
6
+ attr_reader name: String
7
+
8
+ # : (String, ?Proc) -> void
9
+ def initialize: (String, ?Proc) -> void
10
+
11
+ # : (?String?) -> String?
12
+ def description: (?String?) -> String?
13
+
14
+ # : (?String?) -> String?
15
+ def template: (?String?) -> String?
16
+
17
+ private
18
+
19
+ # : () -> void
20
+ def validate!: () -> void
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # Generated from lib/diogenes/dsl/hook.rb with RBS::Inline
2
+
3
+ module Diogenes
4
+ module DSL
5
+ class Hook
6
+ attr_reader name: String
7
+
8
+ # : (String, ?Proc) -> void
9
+ def initialize: (String, ?Proc) -> void
10
+
11
+ # : (?String?) -> String?
12
+ def trigger: (?String?) -> String?
13
+
14
+ # : (?String?) -> String?
15
+ def prompt: (?String?) -> String?
16
+
17
+ private
18
+
19
+ # : () -> void
20
+ def validate!: () -> void
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # Generated from lib/diogenes/dsl/rule.rb with RBS::Inline
2
+
3
+ module Diogenes
4
+ module DSL
5
+ class Rule
6
+ attr_reader name: String
7
+
8
+ # : (String, ?Proc) -> void
9
+ def initialize: (String, ?Proc) -> void
10
+
11
+ # : (?String?) -> String?
12
+ def description: (?String?) -> String?
13
+
14
+ # : (?String?) -> String?
15
+ def content: (?String?) -> String?
16
+
17
+ private
18
+
19
+ # : () -> void
20
+ def validate!: () -> void
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,26 @@
1
+ # Generated from lib/diogenes/dsl/skill.rb with RBS::Inline
2
+
3
+ module Diogenes
4
+ module DSL
5
+ class Skill
6
+ attr_reader name: String
7
+
8
+ # : (String, ?Proc) -> void
9
+ def initialize: (String, ?Proc) -> void
10
+
11
+ # : (?String?) -> String?
12
+ def command: (?String?) -> String?
13
+
14
+ # : (?String?) -> String?
15
+ def description: (?String?) -> String?
16
+
17
+ # : (?String?) -> String?
18
+ def prompt: (?String?) -> String?
19
+
20
+ private
21
+
22
+ # : () -> void
23
+ def validate!: () -> void
24
+ end
25
+ end
26
+ end
@@ -17,10 +17,37 @@ module Diogenes
17
17
  class UserError < Error
18
18
  end
19
19
 
20
- # Returns the version of the Diogenes gem.
21
- #
22
- # This is managed by the release-please workflow.
23
- # --
20
+ # Raised when a DSL definition is missing required fields.
21
+ class ConfigurationError < Error
22
+ end
23
+
24
24
  # : () -> String
25
25
  def self.version: () -> String
26
+
27
+ # : (String) { () -> void } -> DSL::Skill
28
+ def self.skill: (String) { () -> void } -> DSL::Skill
29
+
30
+ # : (String) { () -> void } -> DSL::Rule
31
+ def self.rule: (String) { () -> void } -> DSL::Rule
32
+
33
+ # : (String) { () -> void } -> DSL::Hook
34
+ def self.hook: (String) { () -> void } -> DSL::Hook
35
+
36
+ # : (String) { () -> void } -> DSL::Artifact
37
+ def self.artifact: (String) { () -> void } -> DSL::Artifact
38
+
39
+ # : () -> Array[DSL::Skill]
40
+ def self.skills: () -> Array[DSL::Skill]
41
+
42
+ # : () -> Array[DSL::Rule]
43
+ def self.rules: () -> Array[DSL::Rule]
44
+
45
+ # : () -> Array[DSL::Hook]
46
+ def self.hooks: () -> Array[DSL::Hook]
47
+
48
+ # : () -> Array[DSL::Artifact]
49
+ def self.artifacts: () -> Array[DSL::Artifact]
50
+
51
+ # : () -> void
52
+ def self.reset!: () -> void
26
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diogenes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meagan Waller
@@ -56,6 +56,10 @@ files:
56
56
  - lib/diogenes.rb
57
57
  - lib/diogenes/cli.rb
58
58
  - lib/diogenes/cli/init.rb
59
+ - lib/diogenes/dsl/artifact.rb
60
+ - lib/diogenes/dsl/hook.rb
61
+ - lib/diogenes/dsl/rule.rb
62
+ - lib/diogenes/dsl/skill.rb
59
63
  - lib/diogenes/templates/init/artifacts/decision_record.md.erb
60
64
  - lib/diogenes/templates/init/diogenes.rb
61
65
  - lib/diogenes/templates/init/hooks/README.md
@@ -66,6 +70,10 @@ files:
66
70
  - sig/generated/diogenes.rbs
67
71
  - sig/generated/diogenes/cli.rbs
68
72
  - sig/generated/diogenes/cli/init.rbs
73
+ - sig/generated/diogenes/dsl/artifact.rbs
74
+ - sig/generated/diogenes/dsl/hook.rbs
75
+ - sig/generated/diogenes/dsl/rule.rbs
76
+ - sig/generated/diogenes/dsl/skill.rbs
69
77
  - sig/generated/diogenes/version.rbs
70
78
  homepage: https://github.com/meaganewaller/diogenes/tree/main/diogenes
71
79
  licenses: