kirei 0.9.1 → 0.9.3

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: 40d71e88615c0277afc708e0a86ea9a3db2f6b436d1dcef96c110c84f0c7a010
4
- data.tar.gz: 8adc8f4eaf7ed6a923c6214d7a448207fda016fb2a836a208b6f48a7e3c7f790
3
+ metadata.gz: e4a3c571b78f3b40e68be644fd1600d01e4d4cc6d4801ff391bd19d2f4c9b309
4
+ data.tar.gz: 38e2ebe1345eea2e527f9538627436d1aa15970ccf4cc2531d0a18a371589bd9
5
5
  SHA512:
6
- metadata.gz: d35dac9da2d4071a132219cda89ec197a66c221c046f8d0605f2df6746a8f8d4cc04ff68b7b2cb528f73ec3a5502ac7a0a80c7e1c076eb9764e3b826c8c22a9d
7
- data.tar.gz: 9195031d9649330d144c3e36906394d60d8af1fa677a8317a429a8c993e6dd34ed08a8bf60a06a90bd68a3e7fb1c2dc79e3273d57e6e257ba3e68bd709c66dd3
6
+ metadata.gz: b9f0950c53791800f8815ea62c7b5f3f97697b9f6f8095070f49d80a35dfccee84d5b47ab6d5ec34864f9d25bc7c542b9e2cf9ebfd61bc6d9b84d5ad2dee7bf2
7
+ data.tar.gz: c842729e9d31eceff4e4c50d592ed592658156632b7353707030c7e07064b216d3530116405f957b16ce00f9ea9be24ae4b8edeb28c1bfe9b7924e3ac7b69a2d
data/README.md CHANGED
@@ -6,7 +6,7 @@ Kirei's main advantages over other frameworks are its strict typing, low memory
6
6
 
7
7
  > Kirei (きれい) is a Japanese adjective that primarily means "beautiful" or "pretty." It can also be used to describe something that is "clean" or "neat."
8
8
 
9
- 👉 AI-generated wiki available on [DeepWiki.com](https://deepwiki.com/swiknaba/kirei).
9
+ 👉 AI-generated wiki available on [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/swiknaba/kirei)
10
10
 
11
11
  ## Why another Ruby framework?
12
12
 
@@ -166,8 +166,8 @@ module Cli
166
166
  db = #{app_name}.raw_db_connection
167
167
  model_file_name = args[:model_file_name]&.to_s
168
168
 
169
- app_root_dir = TestApp.root
170
- app_dir = File.join(TestApp.root, "app")
169
+ app_root_dir = #{app_name}.root
170
+ app_dir = File.join(app_root_dir, "app")
171
171
 
172
172
  Dir.glob("app/**/*.rb").each do |model_file|
173
173
  next if !model_file_name.nil? && model_file == model_file_name
@@ -17,7 +17,8 @@ module Cli
17
17
  require "rake"
18
18
  require_relative "app"
19
19
 
20
- Dir.glob("#{Kirei::GEM_ROOT}/lib/tasks/**/*.rake").each { import(_1) }
20
+ kirei_gem_path = Gem::Specification.find_by_name("kirei").gem_dir
21
+ Dir.glob("\#{kirei_gem_path}/lib/tasks/**/*.rake").each { import(_1) }
21
22
 
22
23
  Dir.glob("lib/tasks/**/*.rake").each { import(_1) }
23
24
 
@@ -23,6 +23,7 @@ module Kirei
23
23
 
24
24
  sig { params(env: RackEnvType).returns(RackResponseType) }
25
25
  def call(env)
26
+ statsd_timing_tags = T.let({}, T::Hash[String, T.untyped])
26
27
  start = Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond)
27
28
  status = 500 # we use it in the "ensure" block, so we need to define early (Sorbet doesn't like `status ||= 418`)
28
29
 
@@ -90,11 +91,8 @@ module Kirei
90
91
  },
91
92
  )
92
93
 
93
- statsd_timing_tags = {
94
- "controller" => controller.name,
95
- "route" => route.action,
96
- }
97
- Logging::Metric.inject_defaults(statsd_timing_tags)
94
+ statsd_timing_tags["controller"] = controller.name
95
+ statsd_timing_tags["route"] = route.action
98
96
 
99
97
  status, headers, response_body = case http_verb
100
98
  when Verb::HEAD, Verb::OPTIONS, Verb::TRACE, Verb::CONNECT
@@ -126,8 +124,9 @@ module Kirei
126
124
  ]
127
125
  ensure
128
126
  stop = Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond)
129
- if start # early return for 404
127
+ if start && statsd_timing_tags # early return for 404
130
128
  latency_in_ms = stop - start
129
+ Logging::Metric.inject_defaults(statsd_timing_tags)
131
130
  App.config.metrics_backend.measure("request", latency_in_ms, tags: statsd_timing_tags)
132
131
 
133
132
  Kirei::Logging::Logger.call(
data/lib/kirei/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Kirei
5
- VERSION = "0.9.1"
5
+ VERSION = "0.9.3"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kirei
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ludwig Reinmiedl