stackprof-run 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/README.md +40 -17
- data/exe/stackprof-run +7 -3
- data/lib/stackprof/run/version.rb +1 -1
- data/stackprof-run.gemspec +3 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6473d2d034efcd895c6b90c17272b4eb9b8dbc36
|
4
|
+
data.tar.gz: 1aeb56de31d85efc78f34d95527c977381acc74d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e53d77fa8b32725d0dec292e77d872eee206f64f247dc35861e17e6249d4d6b017fcc7a951d4f1d3396c384a81d43f43b2f114298ad18c7f6e999527044092ed
|
7
|
+
data.tar.gz: 900bcd68d671cffa21a2dc810e4e5e334d98168bf57f609ef02e90d4f732d3db6d21d5faca4fd498d09f6bebffb37d98b2dfb2269a261e35ce5b53af6488d9a2
|
data/.rubocop.yml
ADDED
data/README.md
CHANGED
@@ -1,36 +1,59 @@
|
|
1
|
-
#
|
1
|
+
# stackprof-run
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Run a ruby script with [stackprof](https://github.com/tmm1/stackprof).
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
9
|
-
|
7
|
+
```sh
|
8
|
+
$ gem install stackprof-run
|
9
|
+
```
|
10
|
+
|
11
|
+
## Basic Usage
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
+
`stackprof-run` executes received command with stackprof.
|
14
|
+
|
15
|
+
```sh
|
16
|
+
# Run RuboCop with stackprof
|
17
|
+
$ stackprof-run rubocop some_ruby_file.rb
|
18
|
+
|
19
|
+
# Run a rake task
|
20
|
+
$ stackprof-run bin/rake some_task
|
13
21
|
```
|
14
22
|
|
15
|
-
|
23
|
+
## Advanced Usage
|
24
|
+
|
25
|
+
### Specify output filename
|
16
26
|
|
17
|
-
|
27
|
+
`stackprof-run` puts result to `./stackprof-out` in default. You can specify the filename by an environment variable.
|
18
28
|
|
19
|
-
|
29
|
+
```sh
|
30
|
+
$ STACKPROF_OUT=stackprof_result stackprof-run some_ruby_command
|
31
|
+
$ file stackprof_result
|
32
|
+
stackprof_result: data
|
33
|
+
```
|
34
|
+
|
35
|
+
### Specify stackprof mode
|
36
|
+
|
37
|
+
`stackprof-run` executes stackprof with `cpu` mode in default. You can specify the mode by an environment variable.
|
20
38
|
|
21
|
-
|
39
|
+
```sh
|
40
|
+
$ STACKPROF_MODE=wall stackprof-run some_ruby_command
|
41
|
+
```
|
22
42
|
|
23
|
-
## Usage
|
24
43
|
|
25
|
-
TODO: Write usage instructions here
|
26
44
|
|
27
|
-
##
|
45
|
+
## Known issue
|
28
46
|
|
29
|
-
|
47
|
+
This gem dependents `which` command, so, it does not work in Windows.
|
30
48
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
49
|
|
33
50
|
## Contributing
|
34
51
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
52
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/pocke/stackprof-run.
|
53
|
+
|
54
|
+
License
|
55
|
+
-------
|
56
|
+
|
57
|
+
These codes are licensed under CC0.
|
36
58
|
|
59
|
+
[![CC0](http://i.creativecommons.org/p/zero/1.0/88x31.png "CC0")](http://creativecommons.org/publicdomain/zero/1.0/deed.en)
|
data/exe/stackprof-run
CHANGED
@@ -4,13 +4,17 @@ cmd = ARGV.shift
|
|
4
4
|
|
5
5
|
path = `which #{cmd}`.chomp
|
6
6
|
|
7
|
+
$PROGRAM_NAME = cmd
|
8
|
+
|
9
|
+
mode = ENV['STACKPROF_MODE']&.to_sym || :cpu
|
10
|
+
out = ENV['STACKPROF_OUT'] || 'stackprof-out'
|
11
|
+
|
7
12
|
require 'stackprof'
|
8
13
|
ex = nil
|
9
|
-
StackProf.run(mode:
|
14
|
+
StackProf.run(mode: mode, out: out) do
|
10
15
|
begin
|
11
16
|
load path
|
12
|
-
rescue Exception =>
|
13
|
-
ex = e
|
17
|
+
rescue Exception => ex
|
14
18
|
end
|
15
19
|
end
|
16
20
|
|
data/stackprof-run.gemspec
CHANGED
@@ -19,6 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.bindir = "exe"
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
|
+
spec.licenses = ['CC0-1.0']
|
23
|
+
|
24
|
+
spec.required_ruby_version = '>= 2.3.0'
|
22
25
|
|
23
26
|
spec.add_runtime_dependency 'stackprof', ' >= 0.2.10'
|
24
27
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stackprof-run
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Kuwabara
|
@@ -61,6 +61,7 @@ extensions: []
|
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
63
|
- ".gitignore"
|
64
|
+
- ".rubocop.yml"
|
64
65
|
- Gemfile
|
65
66
|
- README.md
|
66
67
|
- Rakefile
|
@@ -71,7 +72,8 @@ files:
|
|
71
72
|
- lib/stackprof/run/version.rb
|
72
73
|
- stackprof-run.gemspec
|
73
74
|
homepage: https://github.com/pocke/stackprof-run
|
74
|
-
licenses:
|
75
|
+
licenses:
|
76
|
+
- CC0-1.0
|
75
77
|
metadata: {}
|
76
78
|
post_install_message:
|
77
79
|
rdoc_options: []
|
@@ -81,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
83
|
requirements:
|
82
84
|
- - ">="
|
83
85
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
86
|
+
version: 2.3.0
|
85
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
88
|
requirements:
|
87
89
|
- - ">="
|