profilizer 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
  SHA256:
3
- metadata.gz: bd6e4cb9fd428cdeb8fd286926b4755b2fe92963551f067dbeb39c4ea6039f34
4
- data.tar.gz: 6cec08e96bc08e68ac506a8273abeb6a54dba4ebdbc13eb719b2cc992fa083ef
3
+ metadata.gz: 354fa8a4552906d853ea248c1c2609182f42e5c0750da9f11501cc7dd69a42db
4
+ data.tar.gz: dab51934bc6f00d1b4be972463380a70cc077825e11559319b1238bf71b65485
5
5
  SHA512:
6
- metadata.gz: e6d8f8283746df3b427d5c8dc8ecb54fa53ae3f341a4f1ee61b3a47379d0bfec1e685e15384e1dd9554933167a7852f47cefed873536c3bd9e3c11eae4e9b5e1
7
- data.tar.gz: 24ea81e36e5d27ed89efc988e7f8dff35b2cd1342d83c60ea4750338c620665454902018bb71cba452710c79ed027fb2f5192907def70ea510db1ddbd0c5d258
6
+ metadata.gz: 95ad5334e76bfb66ce1bec3ddb015372e8f965f777163f00d44ec6e2bb96960ffa2ecb7ee2b9a29570feea60484fef39a2aa520529e87d0765ab94469a3f65ff
7
+ data.tar.gz: 7b1ce0f6b5b3d36a5c9f05e6895035fbe0b52d9d22e617b40443a3b70d8e69a33e8671ee62c20cb765e6ca15089b2aaff5dbce82c35aad29bb314a87efbd38a2
@@ -0,0 +1,40 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ branches: [ release ]
6
+
7
+ jobs:
8
+ build:
9
+ name: Build + Publish
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Set up Ruby 2.6
15
+ uses: actions/setup-ruby@v1
16
+ with:
17
+ version: 2.6.x
18
+
19
+ - name: Publish to GPR
20
+ run: |
21
+ mkdir -p $HOME/.gem
22
+ touch $HOME/.gem/credentials
23
+ chmod 0600 $HOME/.gem/credentials
24
+ printf -- "---\n:github: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
25
+ gem build *.gemspec
26
+ gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
27
+ env:
28
+ GEM_HOST_API_KEY: ${{secrets.GPR_AUTH_TOKEN}}
29
+ OWNER: dkremez
30
+
31
+ - name: Publish to RubyGems
32
+ run: |
33
+ mkdir -p $HOME/.gem
34
+ touch $HOME/.gem/credentials
35
+ chmod 0600 $HOME/.gem/credentials
36
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
37
+ gem build *.gemspec
38
+ gem push *.gem
39
+ env:
40
+ GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
@@ -0,0 +1,22 @@
1
+ # .github/workflows/rubocop.yml
2
+
3
+ name: Rubocop
4
+
5
+ on: [push]
6
+
7
+ jobs:
8
+ build:
9
+
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Set up Ruby 2.6
15
+ uses: actions/setup-ruby@v1
16
+ with:
17
+ ruby-version: 2.6.x
18
+ - name: Build and lint with Rubocop
19
+ run: |
20
+ gem install bundler
21
+ bundle install --jobs 4 --retry 3
22
+ bundle exec rubocop
@@ -0,0 +1,20 @@
1
+ name: Ruby
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ - name: Set up Ruby 2.6
13
+ uses: actions/setup-ruby@v1
14
+ with:
15
+ ruby-version: 2.6.x
16
+ - name: Build and test with Rake
17
+ run: |
18
+ gem install bundler
19
+ bundle install --jobs 4 --retry 3
20
+ bundle exec rake
data/.gitignore CHANGED
@@ -6,6 +6,8 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /.gem/
10
+ /.vscode/
9
11
 
10
12
  # rspec failure tracking
11
13
  .rspec_status
data/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ ![Ruby](https://github.com/dkremez/profilizer/workflows/Ruby/badge.svg?branch=master)
2
+ ![Rubocop](https://github.com/dkremez/profilizer/workflows/Rubocop/badge.svg?branch=master)
3
+
1
4
  # Profilizer
2
5
 
3
6
  Profilizer is a Ruby gem for easy profile of methods. It helps you to track how fast you methods are, how much memory the consume and how much objects were allocated.
@@ -8,14 +11,12 @@ The normal hand on profiling in Ruby doesn't require any gems and looks like thi
8
11
  def profile
9
12
  start = Time.now
10
13
  yield if block_given?
11
- end = Time.now
12
- puts "Duration: #{end - start}"
14
+ finish = Time.now
15
+ puts "Duration: #{finish - start}"
13
16
  end
14
17
  ```
15
18
 
16
- However, it is not handy in case you want more options of you just need to repeat this code many time in different application.
17
-
18
- Here is what is gem propose instead:
19
+ However, it is not handy in case you want more options. What if you can do the following?
19
20
 
20
21
  ```ruby
21
22
  class A
@@ -84,8 +85,8 @@ Memory usage: 2.05 MB
84
85
 
85
86
  ### Configuration
86
87
 
87
- What if you only want to profile time or just used memory or objects allocations only.
88
- Here is how you could config
88
+ What if you only want to profile time, used memory, or objects allocations only.
89
+ Here is how you could config it:
89
90
 
90
91
  ```ruby
91
92
  class A
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'pry'
3
+ # require 'pry'
4
4
  require 'ruby2_keywords'
5
5
 
6
6
  require 'profilizer/profiler'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Profilizer
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
@@ -19,9 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.homepage = 'https://github.com/dkremez/profilizer'
20
20
  spec.license = 'MIT'
21
21
  spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
22
-
23
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
24
-
25
22
  spec.metadata['homepage_uri'] = spec.homepage
26
23
  spec.metadata['source_code_uri'] = spec.homepage
27
24
  spec.metadata['changelog_uri'] = spec.homepage
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: profilizer
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
  - Dzmitry Kremez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-02 00:00:00.000000000 Z
11
+ date: 2020-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby2_keywords
@@ -36,6 +36,9 @@ executables: []
36
36
  extensions: []
37
37
  extra_rdoc_files: []
38
38
  files:
39
+ - ".github/workflows/gempush.yml"
40
+ - ".github/workflows/rubocop.yml"
41
+ - ".github/workflows/ruby.yml"
39
42
  - ".gitignore"
40
43
  - ".rspec"
41
44
  - ".rubocop.yml"
@@ -54,7 +57,6 @@ homepage: https://github.com/dkremez/profilizer
54
57
  licenses:
55
58
  - MIT
56
59
  metadata:
57
- allowed_push_host: https://rubygems.org
58
60
  homepage_uri: https://github.com/dkremez/profilizer
59
61
  source_code_uri: https://github.com/dkremez/profilizer
60
62
  changelog_uri: https://github.com/dkremez/profilizer