xcprofiler 0.2.3 → 0.3.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: 6002ff4060c6755639eba67827b54654e14189a6
4
- data.tar.gz: aabc2538e822a3078fd4ad822beb5bc447b085a7
3
+ metadata.gz: 103fbbc4b903014e4d52e1b7eddf59998944cd6e
4
+ data.tar.gz: 4d13c190c9cb6cd0247be41ba5700475f3e29726
5
5
  SHA512:
6
- metadata.gz: b50556716d4175bb716101d902987e500b7bc955a99de30c6979e5ce953bba14f96f21a6968aea7c7454e6e9032bcc8a85d62da499ffb516a35262bb107df2b3
7
- data.tar.gz: a5d27b07f198116903d7d0f3533f7b4c2939bac33eef1e9b6129b49b41f9af5f9d7c3b8a6d950ecce3bbf3e1b45d5719709c673901924c5dfef18da4eaf86f75
6
+ metadata.gz: 7128ac3b10ea54dfc77fba6a05b697645ceafc4177126072a787b42b5bb0a56d16c9b65e2d6c29cc06a89e2948274d68d979c8c0e904415161d0de0e7c0e8aca
7
+ data.tar.gz: b55c3b8fd6794e52fe47913741eddfe2c852c39989ad5541c3980558eaec800c480cd937cce1f813103c013316df120dc1be97cbcc902982853e2f54b9535a86
data/README.md CHANGED
@@ -74,6 +74,7 @@ Sample output is here
74
74
  |--threshold||Threshold of time to display (ms)|
75
75
  |--show-invalids||Show invalid location results|
76
76
  |--order|-o|Sort order (default,time,file)|
77
+ |--derived_data_path||Root path of DerivedData directory|
77
78
 
78
79
  ## Use custom reporters
79
80
 
@@ -3,13 +3,15 @@ require 'zlib'
3
3
  module Xcprofiler
4
4
  class DerivedData
5
5
  class << self
6
- def all
7
- pattern = File.join(derived_data_root, "**", "Logs", "Build", "*.xcactivitylog")
6
+ def all(root = nil)
7
+ root ||= default_derived_data_root
8
+ pattern = File.join(root, "**", "Logs", "Build", "*.xcactivitylog")
8
9
  by_pattern(pattern)
9
10
  end
10
11
 
11
- def by_product_name(product_name)
12
- pattern = File.join(derived_data_root, "#{product_name}-*", "Logs", "Build", "*.xcactivitylog")
12
+ def by_product_name(product_name, root = nil)
13
+ root ||= default_derived_data_root
14
+ pattern = File.join(root, "#{product_name}-*", "Logs", "Build", "*.xcactivitylog")
13
15
  by_pattern(pattern)
14
16
  end
15
17
 
@@ -27,7 +29,7 @@ module Xcprofiler
27
29
  derived_data.max_by { |data| data.updated_at }
28
30
  end
29
31
 
30
- def derived_data_root
32
+ def default_derived_data_root
31
33
  File.expand_path('~/Library/Developer/Xcode/DerivedData')
32
34
  end
33
35
  end
@@ -11,8 +11,8 @@ module Xcprofiler
11
11
  Profiler.new(derived_data)
12
12
  end
13
13
 
14
- def self.by_product_name(product_name)
15
- derived_data = DerivedData.by_product_name(product_name)
14
+ def self.by_product_name(product_name, default_derived_data_root = nil)
15
+ derived_data = DerivedData.by_product_name(product_name, default_derived_data_root)
16
16
  Profiler.new(derived_data)
17
17
  end
18
18
 
@@ -1,3 +1,3 @@
1
1
  module Xcprofiler
2
- VERSION = "0.2.3"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/xcprofiler.rb CHANGED
@@ -24,6 +24,7 @@ module Xcprofiler
24
24
  opts.on("-o [ORDER]", [:default, :time, :file], "Sort order") { |v| options.order = v }
25
25
  opts.on("-l", "--limit [LIMIT]", Integer, "Limit for display") { |v| options.limit = v }
26
26
  opts.on("--threshold [THRESHOLD]", Integer, "Threshold of time to display(ms)") { |v| options.threshold = v }
27
+ opts.on("--derived_data_path", String, "Root path of DerivedData") { |v| options.derived_data_path = v }
27
28
  opts.on_tail("-h", "--help", "Show this message") do
28
29
  puts opts
29
30
  exit
@@ -43,7 +44,8 @@ module Xcprofiler
43
44
  if target.end_with?('.xcactivitylog')
44
45
  profiler = Profiler.by_path(target)
45
46
  else
46
- profiler = Profiler.by_product_name(target)
47
+ derived_data_path = options[:derived_data_path]
48
+ profiler = Profiler.by_product_name(target, derived_data_path)
47
49
  end
48
50
  profiler.reporters = [
49
51
  StandardOutputReporter.new(limit: options[:limit],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcprofiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - giginet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-07 00:00:00.000000000 Z
11
+ date: 2017-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler