test-prof-autopilot 0.0.3 → 0.0.4

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: 3c37b0bc8ff4b8b9d57f6405248308a4074ef41cbc18312e92d39fa1e66c91aa
4
- data.tar.gz: 1554c20175211cd795bee741def672410780a30b08f522e286c0565620284f1f
3
+ metadata.gz: d6b29ef753d35ba43c38480f03c1add33a6b13cbd44af7993a2c832fdc112fab
4
+ data.tar.gz: cf9350ecb966825cebcd9c011cfbaddb089b34b8299e038f94b4679eae1a5b8d
5
5
  SHA512:
6
- metadata.gz: 3d29bb47187ee64308a3992fd528f6d2bf5e043bda3579f51756285a455f1be248a98e9c618bb13c47fcc0f61c05a1a4a4fd6a1bec9fbd4abd64449cad78b86c
7
- data.tar.gz: 4cb9e12dd3e0005e29e337f0c15fd150dac1e8fb73a12a3a6599452ca1307bc2d629a4fd421d0bb30de4b538a553925241f468bad245ecbd5414b9bfb2ac7a95
6
+ metadata.gz: cf235d7c96b20d9db4f33c31fcddf11112bc6ecf5ad6e305aa7417c034100e27c0b3c14734b7e04a3324ebcbac102deefc2f303fa7ecda6c9bbda5d4c85c86e0
7
+ data.tar.gz: ab28bcc384705b84f195fa210cad6d7edf995e8273b8ccbc3acc7a7588cb2dcb8402fdf37bfe2e333bbb0d2fe0c91c7be4552d85095b898138fece8cd1264492
@@ -2,18 +2,18 @@
2
2
 
3
3
  module TestProf
4
4
  module Autopilot
5
- # Global configuration
6
- class Configuration
7
- class << self
8
- def config
9
- @config ||= new
10
- end
5
+ class << self
6
+ def config
7
+ @config ||= Configuration.new
8
+ end
11
9
 
12
- def configure
13
- yield config
14
- end
10
+ def configure
11
+ yield config
15
12
  end
13
+ end
16
14
 
15
+ # Global configuration
16
+ class Configuration
17
17
  attr_accessor :output,
18
18
  :tmp_dir,
19
19
  :artifacts_dir,
@@ -4,7 +4,7 @@ module TestProf
4
4
  module Autopilot
5
5
  module Logging
6
6
  def log(message)
7
- Configuration.config.output.puts(message)
7
+ Autopilot.config.output.puts(message)
8
8
  end
9
9
 
10
10
  module_function :log
@@ -36,7 +36,7 @@ module TestProf
36
36
  }
37
37
  end
38
38
 
39
- dir_path = FileUtils.mkdir_p(Configuration.config.tmp_dir)[0]
39
+ dir_path = FileUtils.mkdir_p(Autopilot.config.tmp_dir)[0]
40
40
  file_path = File.join(dir_path, ARTIFACT_FILE)
41
41
 
42
42
  File.write(file_path, JSON.generate(profiler_hash))
@@ -27,7 +27,7 @@ module TestProf
27
27
  }
28
28
  end
29
29
 
30
- dir_path = FileUtils.mkdir_p(Configuration.config.tmp_dir)[0]
30
+ dir_path = FileUtils.mkdir_p(Autopilot.config.tmp_dir)[0]
31
31
  file_path = File.join(dir_path, ARTIFACT_FILE)
32
32
 
33
33
  File.write(file_path, JSON.generate(profiler_hash))
@@ -11,7 +11,7 @@ module TestProf
11
11
  private
12
12
 
13
13
  def self.build_path(_name)
14
- dir_path = FileUtils.mkdir_p(Configuration.config.tmp_dir)[0]
14
+ dir_path = FileUtils.mkdir_p(Autopilot.config.tmp_dir)[0]
15
15
  File.join(dir_path, ARTIFACT_FILE)
16
16
  end
17
17
  end
@@ -47,9 +47,9 @@ module TestProf
47
47
  end
48
48
 
49
49
  def build_command
50
- return Configuration.config.command if @options[:paths].nil?
50
+ return Autopilot.config.command if @options[:paths].nil?
51
51
 
52
- "#{Configuration.config.command} #{@options[:paths]}"
52
+ "#{Autopilot.config.command} #{@options[:paths]}"
53
53
  end
54
54
 
55
55
  def build_report
@@ -15,7 +15,7 @@ module TestProf
15
15
  private
16
16
 
17
17
  def fetch_report
18
- file_path = File.join(Configuration.config.tmp_dir, self::ARTIFACT_FILE)
18
+ file_path = File.join(Autopilot.config.tmp_dir, self::ARTIFACT_FILE)
19
19
  File.read(file_path)
20
20
  rescue Errno::ENOENT => e
21
21
  e.message.prepend(ARTIFACT_MISSING_HINT)
@@ -15,14 +15,14 @@ module TestProf
15
15
 
16
16
  class << self
17
17
  def invoke(plan_path, command)
18
- Configuration.configure do |config|
18
+ Autopilot.configure do |config|
19
19
  config.plan_path = plan_path
20
20
  config.command = command
21
21
  end
22
22
 
23
23
  Logging.log "Reading #{plan_path}..."
24
24
 
25
- new.instance_eval(File.read(Configuration.config.plan_path))
25
+ new.instance_eval(File.read(Autopilot.config.plan_path))
26
26
  end
27
27
  end
28
28
  end
@@ -10,7 +10,7 @@ module TestProf
10
10
  ARTIFACT_FILE = "stack_prof_report"
11
11
 
12
12
  def write_report(report, file_name: ARTIFACT_FILE)
13
- dir_path = FileUtils.mkdir_p(Configuration.config.artifacts_dir)[0]
13
+ dir_path = FileUtils.mkdir_p(Autopilot.config.artifacts_dir)[0]
14
14
  file_path = File.join(dir_path, file_name + ".json")
15
15
 
16
16
  File.write(file_path, JSON.generate(report.data))
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TestProf
4
4
  module Autopilot # :nodoc:
5
- VERSION = "0.0.3"
5
+ VERSION = "0.0.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-prof-autopilot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Shakirov