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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d25abaf682c6ddb3d984177e43820aca4b4686ce
4
- data.tar.gz: '0249910218e7fb23298ff359dbf3a07af636e779'
3
+ metadata.gz: 6473d2d034efcd895c6b90c17272b4eb9b8dbc36
4
+ data.tar.gz: 1aeb56de31d85efc78f34d95527c977381acc74d
5
5
  SHA512:
6
- metadata.gz: 137f9ce035805d0e50634c7c8fbb2927d827ba84d1ef3c72e587a5d765230064284e0653eaf58e37b67b7fdd391271a16b0d3e9bcbfdabe7c0e4ad3497977f33
7
- data.tar.gz: 80645e413c7deb0077bf88132bd7e8209e8fc02b5872e423883f069cfcede7e5379dbcb0ebed1a751dd16c89e80a4ed1a7fb378f1a34f03e5f6dad0fdae56491
6
+ metadata.gz: e53d77fa8b32725d0dec292e77d872eee206f64f247dc35861e17e6249d4d6b017fcc7a951d4f1d3396c384a81d43f43b2f114298ad18c7f6e999527044092ed
7
+ data.tar.gz: 900bcd68d671cffa21a2dc810e4e5e334d98168bf57f609ef02e90d4f732d3db6d21d5faca4fd498d09f6bebffb37d98b2dfb2269a261e35ce5b53af6488d9a2
@@ -0,0 +1,2 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.3
data/README.md CHANGED
@@ -1,36 +1,59 @@
1
- # Stackprof::Run
1
+ # stackprof-run
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/stackprof/run`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- Add this line to your application's Gemfile:
7
+ ```sh
8
+ $ gem install stackprof-run
9
+ ```
10
+
11
+ ## Basic Usage
10
12
 
11
- ```ruby
12
- gem 'stackprof-run'
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
- And then execute:
23
+ ## Advanced Usage
24
+
25
+ ### Specify output filename
16
26
 
17
- $ bundle
27
+ `stackprof-run` puts result to `./stackprof-out` in default. You can specify the filename by an environment variable.
18
28
 
19
- Or install it yourself as:
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
- $ gem install stackprof-run
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
- ## Development
45
+ ## Known issue
28
46
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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/[USERNAME]/stackprof-run.
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)
@@ -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: :cpu, out: 'stackprof-out') do
14
+ StackProf.run(mode: mode, out: out) do
10
15
  begin
11
16
  load path
12
- rescue Exception => e
13
- ex = e
17
+ rescue Exception => ex
14
18
  end
15
19
  end
16
20
 
@@ -1,5 +1,5 @@
1
1
  module Stackprof
2
2
  module Run
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -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.1.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: '0'
86
+ version: 2.3.0
85
87
  required_rubygems_version: !ruby/object:Gem::Requirement
86
88
  requirements:
87
89
  - - ">="