abr 0.1.5 → 0.1.7

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
  SHA1:
3
- metadata.gz: 44e5b3e03e9d693cb1b44b5e35c730b4066bc575
4
- data.tar.gz: 2a50a60a52b1e50310a2c355160367dd8af7c60b
3
+ metadata.gz: 18826ccfbd3040bfdb2e7b298e33eb5284d349b7
4
+ data.tar.gz: 7713777802896a457e8967e8b7b64c1d11659c64
5
5
  SHA512:
6
- metadata.gz: 4935f9c8c1fc0a4b4ccad40760cf7d06fba77093cc833164b6dbcb3c3d9896943ca0f5645ea0d6ea93a0d684dc66be35dbcc1eb592ce864dfcbd97ff38f1bfd7
7
- data.tar.gz: 831efc67884fd66dadb5bb529fac69605957452a1cd021f80d007898eaabbd399e52e28c6faccefcce49e800f5d2b408afa6607a7d2623a13ba4b452731cdd44
6
+ metadata.gz: 30b6be3adb53f468db645aa39b0c9c7caa152cbf518a4cc8125dd22899fdf870212781a40c9ff337ff4b9036da7e12cd63ded7d9dd19f0c001ae2afce13690ca
7
+ data.tar.gz: 5e1314a102f4111d6bf70056502d8ad00e9ec94b719b6e22cab13cbcfb758bc5b97038655e8adc628298109920e574fa8efa9d676e0e0db14547e9ed43f33f94
data/README.md CHANGED
@@ -1,43 +1,36 @@
1
1
  # Abr
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/abr`. 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
+ Abr is a gem for performance test with ab (apache bench).
6
4
 
7
5
  ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'abr'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
6
+ Install it yourself as:
20
7
 
21
8
  $ gem install abr
22
9
 
23
- ## Usage
10
+ ## Usage
11
+ Make text and write ab command into it.
24
12
 
25
- TODO: Write usage instructions here
13
+ input_file.txt
14
+ ```$xslt
15
+ ab -n 1 -c 1 https://google.com/
16
+ ```
26
17
 
27
- ## Development
18
+ And then, pass as an option to this abr command.
28
19
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
20
+ ```
21
+ abr test -i=input_file.txt
22
+ ```
30
23
 
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).
24
+ Finally, you got a result file which name is `result.csv`.
32
25
 
33
- ## Contributing
26
+ Or, you can specify result file name using `-o` option.
34
27
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/abr. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
28
+
29
+ ```
30
+ abr test -i=input_file.txt -o=specified_result_file.csv
31
+ ```
36
32
 
37
33
  ## License
38
34
 
39
35
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
36
 
41
- ## Code of Conduct
42
-
43
- Everyone interacting in the Abr project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/abr/blob/master/CODE_OF_CONDUCT.md).
data/abr-0.1.5.gem ADDED
Binary file
data/exe/abr CHANGED
File without changes
data/lib/abr/command.rb CHANGED
@@ -6,9 +6,11 @@ module Abr
6
6
  desc "test -i=[input file path] -o=[output file path]", "performance tests using apache bench"
7
7
  option :input_file, aliases: 'i', required: true
8
8
  option :output_file, aliases: 'o'
9
+ option :interval, type: :numeric
9
10
  def test
10
11
  Abr.test(options)
11
12
  end
12
13
  end
13
14
  end
14
15
 
16
+ Abr::Command.start(ARGV)
data/lib/abr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Abr
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.7"
3
3
  end
data/lib/abr.rb CHANGED
@@ -7,6 +7,7 @@ module Abr
7
7
  def self.test(options)
8
8
  input_file = options[:input_file]
9
9
  output_file = options[:output_file] || 'ab_result.csv'
10
+ interval = options[:interval]&.to_i || 10
10
11
 
11
12
  result = open(input_file).map do |line|
12
13
  next unless line[0..1] == 'ab'
@@ -33,6 +34,7 @@ module Abr
33
34
  end
34
35
  end
35
36
  end
37
+ sleep interval
36
38
  result
37
39
  end
38
40
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - nyaahara
@@ -111,6 +111,7 @@ files:
111
111
  - LICENSE.txt
112
112
  - README.md
113
113
  - Rakefile
114
+ - abr-0.1.5.gem
114
115
  - abr.gemspec
115
116
  - bin/console
116
117
  - bin/setup