rexer 0.10.0 → 0.11.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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +49 -0
  3. data/bin/dev +36 -1
  4. data/lib/rexer/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35c79e74d0ffb8e149f5d608a67bd6c9fa709bb5da7d4442e6851453e5a66a43
4
- data.tar.gz: f216971952e8e873e7959f8861fc55c674e0e22765cc2e12cd485793b6d65c8e
3
+ metadata.gz: b367d481c9b2b2c3acee47b4070f5f65b014c0de97841b556d40edf1ca5626c7
4
+ data.tar.gz: fce6d233a643fa0779e03a11f2a37de8781bcb1bfbaf44a7d33a85103d5033fb
5
5
  SHA512:
6
- metadata.gz: 52467965bc3cdfe91c72af5ea5504681e2fc12d2be7179309d464e131e7b766fc0efc6aeea7affcda9c287af129550828cf64ec5cd3b94c38deb1b880cf5d7e1
7
- data.tar.gz: bcbffc9a28d139cf185cd068bed5ca594a163d97d054c33b62463794aec39f453d162e9e9f1abf071d7f2d81efcd910aa6a25c765cb185a653234ff7c666f0e0
6
+ metadata.gz: c2577989d226043cdf48d55f4ef3ecfdfc02b030723ec449a5d27d78501a6ade52dee4bd61ddcc0fba67e1e741167bac698cde9333cd985e34196a8891791b67
7
+ data.tar.gz: f5c069c050a4dc5f260c3949af7d5db1cdb47136bf4f19848d0c70302a4a96565303a260e43c066218e051c5040f862d8932ef29b5f7a8470553bece488e0900
data/README.md CHANGED
@@ -204,6 +204,25 @@ In the above case, the `bin/rails redmine:plugins:migrate` command is executed a
204
204
 
205
205
  ## Developing
206
206
 
207
+ ### Running the command
208
+
209
+ You can run the command in your local environment without installing the gem as follows.
210
+
211
+ Setting up the development environment.
212
+
213
+ ```
214
+ $ git clone <this repository>
215
+ $ cd rexer
216
+ $ bundle install
217
+ ```
218
+
219
+ Running the command.
220
+
221
+ ```
222
+ $ cd /path/to/your-local-redmine-source
223
+ $ /your-local-rexer-source/bin/dev state
224
+ ```
225
+
207
226
  ### Running tests
208
227
 
209
228
  First, you need to build the docker image for the integration tests.
@@ -233,6 +252,36 @@ rake standard
233
252
  rake standard:fix
234
253
  ```
235
254
 
255
+ ### Profiling
256
+
257
+ Print the call-stack profile.
258
+
259
+ ```
260
+ $ PROFILE=s /your-local-rexer-source/bin/dev state
261
+ ...
262
+
263
+ == Profile ==
264
+ ==================================
265
+ Mode: wall(1000)
266
+ Samples: 298 (1.97% miss rate)
267
+ GC: 36 (12.08%)
268
+ ==================================
269
+ TOTAL (pct) SAMPLES (pct) FRAME
270
+ 261 (87.6%) 147 (49.3%) Kernel#require
271
+ ...
272
+ ```
273
+
274
+ Print the benchmark.
275
+
276
+ ```
277
+ $ PROFILE=b /your-local-rexer-source/bin/dev state
278
+ ...
279
+
280
+ == Benchmark ==
281
+ user system total real
282
+ 0.253115 0.030599 0.283714 ( 0.283681)
283
+ ```
284
+
236
285
  ## Contributing
237
286
 
238
287
  Bug reports and pull requests are welcome on GitHub at https://github.com/hidakatsuya/rexer.
data/bin/dev CHANGED
@@ -2,4 +2,39 @@
2
2
 
3
3
  require_relative "../lib/rexer"
4
4
 
5
- Rexer::Cli.start(ARGV)
5
+ def with_profiling(profile = false)
6
+ case ENV["PROFILE"]
7
+
8
+ # PROFILE=s dev state
9
+ when "s", "stack"
10
+ require "stackprof"
11
+
12
+ profile = StackProf.run(mode: :wall, interval: 1000) do
13
+ yield
14
+ end
15
+
16
+ puts
17
+ puts "== Profile =="
18
+ StackProf::Report.new(profile).print_text
19
+
20
+ # PROFILE=b dev state
21
+ when "b", "bench"
22
+ require "benchmark"
23
+
24
+ bench = Benchmark.measure do
25
+ yield
26
+ end
27
+
28
+ puts
29
+ puts "== Benchmark =="
30
+ puts Benchmark::CAPTION
31
+ puts bench
32
+
33
+ else
34
+ yield
35
+ end
36
+ end
37
+
38
+ with_profiling(ENV["PROFILE"]) do
39
+ Rexer::Cli.start(ARGV)
40
+ end
data/lib/rexer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rexer
2
- VERSION = "0.10.0"
2
+ VERSION = "0.11.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rexer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katsuya Hidaka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-05 00:00:00.000000000 Z
11
+ date: 2024-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor