memplify 0.3.0 → 0.3.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: a232f7445fef63517859094db7139df93a6dcb8bd6fb2c8be563eabde71058e2
4
- data.tar.gz: 39c6d0bd5d14322e6e53b4d844bf9bffeda2142fba820059227fa5373843d292
3
+ metadata.gz: f5d319c32ed307483484c7edb9054377da25f5e40b8c7315dfaffc7fc69ca262
4
+ data.tar.gz: 791347aefceff9eea3c2221e151a99f9b5305bc1bad6b6fdb6e2022df7f8bba9
5
5
  SHA512:
6
- metadata.gz: d1a5cc01df2c26113e04b36fa6a509b48669c2f888aa9251cc367642603a3c9c371080d8681ac3e6ef2860bdb0b9a4ebbd1d8c1c551f4ddf8462f40ad86f43c0
7
- data.tar.gz: b9957029d283f1d6cb47175414be764fb4385d04fff0625214692733c0d9323bc1f5508eae04ff3d594481600b63bb6557fdca7461af22015e07a4a8621f4ecc
6
+ metadata.gz: 995d716de3c0eacd703039863f6e98485cd9439f93f64ed772f9bed237691f755a4c1329ab7b59a86302fe6aed4afda359fa1d86e2cc3a0e2c2fdb588e75d527
7
+ data.tar.gz: 1494401aa8537f07c9291aa2427c24b971e7655cca7054a05bd4639fa1b5d0e9e429df6367e41eb68f3b690886f7706096dc1043de7a1c9db70939710d20e2e1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.1] - 2025-03-26
4
+
5
+ - Bump json, rubocop and webmock version due to security issue (https://github.com/tkowalewski/memplify/security/dependabot/1)
6
+
3
7
  ## [0.3.0] - 2025-03-07
4
8
 
5
9
  - Oh, man. You should forward block to MemoryProfiler
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # memplify (Proof of concept)
1
+ # memplify
2
2
 
3
3
  Memplify is a custom reporter ([memplify.com](https://memplify.com)) for [memory_profiler](https://rubygems.org/gems/memory_profiler) gem.
4
4
 
@@ -18,11 +18,12 @@ gem install memplify
18
18
 
19
19
  ## Usage
20
20
 
21
- ### Rails
21
+ ### Rails applications
22
22
 
23
- Create initializer for memplify: `config/initializers/memplify.rb`
23
+ Create initializer for memplify:
24
24
 
25
25
  ```ruby
26
+ # config/initializers/memplify.rb
26
27
  require "memplify"
27
28
 
28
29
  Memplify.configure do |configuration|
@@ -30,19 +31,51 @@ Memplify.configure do |configuration|
30
31
  end
31
32
  ```
32
33
 
33
- For example add memplify middleware for staging environment: `config/environments/staging.rb`
34
+ For example add memplify middleware for staging environment:
34
35
 
35
36
  ```ruby
37
+ # config/environments/staging.rb
36
38
  Rails.application.configure do
37
39
  config.middleware.insert(0, Memplify::Middleware)
38
40
  end
39
41
  ```
40
42
 
43
+ ### Rack applications
44
+
45
+ ```ruby
46
+ # config.ru
47
+ require "memplify"
48
+
49
+ Memplify.configure do |configuration|
50
+ configuration.access_token = "[ACCESS_TOKEN]"
51
+ end
52
+
53
+ class Application
54
+ def call(env)
55
+ status = 200
56
+ headers = { "content-type" => "text/html" }
57
+ body = ["Kaboom!"]
58
+
59
+ [status, headers, body]
60
+ end
61
+ end
62
+
63
+ builder = Rack::Builder.new do
64
+ use Memplify::Middleware if ENV["RACK_ENV"] == "staging"
65
+
66
+ map('/') { run Application.new }
67
+ end
68
+
69
+ run builder
70
+ ```
71
+
72
+ ### Other applications / services
73
+
41
74
  You can use memplify also in background jobs and in any place of your app by using reporter directly.
42
75
  Just provide report identifier and wrap code with:
43
76
 
44
77
  ```ruby
45
- Memplify.report("custom/profile", profile: Rails.env.staging?) do
78
+ Memplify.report("custom/profile", profile: ENV["ENVIRONMENT"] == "staging") do
46
79
  # Your code
47
80
  end
48
81
  ```
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Memplify
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memplify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Kowalewski
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-07 00:00:00.000000000 Z
10
+ date: 2025-03-26 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: base64