spek 1.0.2 → 1.1.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: 32c1608bf5bd19319dbc3955dfe12187bb3f1f912d3cee1197aaceaae2b381e2
4
- data.tar.gz: e6766e3b085ea8a7169fa162a930f8ebd8ecdcbfe868dd3292913ad33b412586
3
+ metadata.gz: b5d6d86a874f194f11de1408c57154289d07cd0f2f513aa7d278f3c29423fc75
4
+ data.tar.gz: 3580affeff063da8346709d3eeec1c4ddc1ec0d800e685646a343befc636b830
5
5
  SHA512:
6
- metadata.gz: a105a71f4e62a5a25afd4ee76a51b0a769b4876945bbcb25b5e1a235a92c7ceb961934d22f2137a76f6bc0fe7b2faf303cf11544592f9de63c4298b12b5c9fe9
7
- data.tar.gz: 4eba2c2e76295181f98a21a80e2d3527ad4d80542e307eec1d5dd1e327deee33987beb37ed53b3fd3e11c84eb2c9a5ef7e6367bca562ae16ba090913bd6e8063
6
+ metadata.gz: 4d5a7ed6ba4f28bcc302ecb403c8546ef8891b3060df12b55e60a8cc9ffb4f8b86840d868d4f795c52dde6b038d6f932eb453d0d175e3bb7dac4d8bed902265b
7
+ data.tar.gz: aea7398514bf1f7cae4bee7a5b9e1f853858bccd12a257d3804b02aad601066b90ba3ed83f4e09c4cd6d0235d54d4bea964ee31d2d38aafe62088e1a7b04969e
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -40,20 +40,58 @@ gem if you need working example.
40
40
 
41
41
  === Presenter
42
42
 
43
- This object wraps a `Gem::Specification` for presentation, provides semantic versioning, direct
44
- access to metadata information, pathnames, and other enriched information. You can obtain an
45
- instance via the following code:
43
+ This object wraps the `Gem::Specification` for presentation purposes, provides semantic versioning, direct access to metadata information, pathnames, and other enriched information. You can obtain an
44
+ instance using the following code, for example:
46
45
 
47
46
  [source,ruby]
48
47
  ----
49
48
  specification = Gem::Specification.new do |spec|
50
- spec.name = "test"
49
+ spec.name = "demo"
51
50
  spec.version = "0.0.0"
52
- spec.authors = "Jill Smith"
53
- spec.summary = "A test summary."
51
+ spec.authors = ["Jill Smith"]
52
+ spec.email = ["demo@alchemists.io"]
53
+ spec.homepage = "https://alchemists.io/projects/demo"
54
+ spec.summary = "A demo summary."
55
+ spec.license = "Hippocratic-2.1"
56
+
57
+ spec.signing_key = Gem.default_key_path
58
+ spec.cert_chain = [Gem.default_cert_path]
59
+
60
+ spec.metadata = {
61
+ "bug_tracker_uri" => "https://github.com/bkuhlmann/demo/issues",
62
+ "changelog_uri" => "https://alchemists.io/projects/demo/versions",
63
+ "documentation_uri" => "https://alchemists.io/projects/demo",
64
+ "funding_uri" => "https://github.com/sponsors/bkuhlmann",
65
+ "label" => "Demo",
66
+ "rubygems_mfa_required" => "true",
67
+ "source_code_uri" => "https://github.com/bkuhlmann/demo"
68
+ }
54
69
  end
55
70
 
56
71
  presenter = Spek::Presenter.new specification
72
+
73
+ presenter.allowed_push_host # "https://rubygems.org"
74
+ presenter.allowed_push_key # "rubygems_api_key"
75
+ presenter.authors # ["Jill Smith"]
76
+ presenter.banner # "Demo 0.0.0: A demo summary."
77
+ presenter.certificate_chain # [#<Pathname:~/.gem/gem-public_cert.pem>]
78
+ presenter.documentation_url # "https://alchemists.io/projects/demo"
79
+ presenter.emails # ["demo@alchemists.io"]
80
+ presenter.funding_url # "https://github.com/sponsors/bkuhlmann"
81
+ presenter.homepage_url # "https://alchemists.io/projects/demo"
82
+ presenter.issues_url # "https://github.com/bkuhlmann/demo/issues"
83
+ presenter.label # "Demo"
84
+ presenter.labeled_summary # "Demo: A demo summary."
85
+ presenter.labeled_version # "Demo 0.0.0"
86
+ presenter.named_version # "demo 0.0.0"
87
+ presenter.package_name # "demo-0.0.0.gem"
88
+ presenter.package_path # #<Pathname:tmp/demo-0.0.0.gem>
89
+ presenter.rubygems_mfa? # true
90
+ presenter.signing_key # #<Pathname:~/.gem/gem-private_key.pem>
91
+ presenter.source_path # #<Pathname:~/.cache/.../3.2.0/gems/demo-0.0.0>
92
+ presenter.source_url # "https://github.com/bkuhlmann/demo"
93
+ presenter.version # #<struct Versionaire::Version major=0, minor=0, patch=0>
94
+ presenter.versions_url # "https://alchemists.io/projects/demo/versions"
57
95
  ----
58
96
 
59
97
  The presenter is a read-only object so you'll only have access to _getter_ methods which are mostly
@@ -99,7 +137,7 @@ end
99
137
  ----
100
138
 
101
139
  The picker always answers a link:https://dry-rb.org/gems/dry-monads[monad] so you can quickly
102
- pattern match for further action.
140
+ link:https://alchemists.io/articles/ruby_pattern_matching[pattern match] for further action.
103
141
 
104
142
  === Versioner
105
143
 
@@ -45,6 +45,8 @@ module Spek
45
45
 
46
46
  def authors = Array record.author
47
47
 
48
+ def banner(delimiter: ": ") = [labeled_version, summary].tap(&:compress!).join delimiter
49
+
48
50
  def certificate_chain = Array(record.cert_chain).map { |path| Pathname path.to_s }
49
51
 
50
52
  def documentation_url = metadata.fetch "documentation_uri", ""
@@ -59,13 +61,13 @@ module Spek
59
61
 
60
62
  def label = metadata.fetch "label", "Undefined"
61
63
 
62
- def labeled_summary(delimiter: " - ") = [label, summary].compress.join delimiter
64
+ def labeled_summary(delimiter: ": ") = [label, summary].tap(&:compress!).join delimiter
63
65
 
64
- def labeled_version = [label, version].compress.join " "
66
+ def labeled_version = [label, version].tap(&:compress!).join " "
65
67
 
66
- def named_version = [name, version].compress.join " "
68
+ def named_version = [name, version].tap(&:compress!).join " "
67
69
 
68
- def package_name = %(#{[name, version].compress.join "-"}.gem)
70
+ def package_name = %(#{[name, version].tap(&:compress!).join "-"}.gem)
69
71
 
70
72
  def package_path = Pathname("tmp").join package_name
71
73
 
data/spek.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "spek"
5
- spec.version = "1.0.2"
5
+ spec.version = "1.1.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/spek"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spek
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2023-03-22 00:00:00.000000000 Z
38
+ date: 2023-04-18 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: dry-monads
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  requirements: []
140
- rubygems_version: 3.4.9
140
+ rubygems_version: 3.4.12
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: Enhances gem specifications with additional information and tooling.
metadata.gz.sig CHANGED
Binary file