speckle 0.1.24 → 0.1.25

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmM1YmNmZDcxYjQ4Njk1MjYxN2U5OTI4ZDk1NjVlODBjYTE2ZmZiYg==
4
+ NWRlOTc3OThlNDE0NzViYzlmNjE5NjkyYzMxMTFiN2M5OWVlNWE3NA==
5
5
  data.tar.gz: !binary |-
6
- MWQ1MzUzM2EwNjM2NzYyYzc5NTNmMjJjZDk5ZDM3YzFiNTRhYWQwYw==
6
+ ZGM5MmFkMGNhYTRmMzg0MWMxMTk4NjM5NDI3OWE1YjU0MjAwZGI2Zg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NmEyM2E5ZDJkZTY1ZGQ5ZjFkMmM4NTFlNThlOTMwZTc1NjIzMWQ2OGM2OThl
10
- Zjg3Y2NmNjI2NDdiYjE5ZWMwYTFjZjMyMjEwZDg4OWM3OWY4NzBjZjU5NjAz
11
- ZjBiZDZjZjMzZTY3NTRkMTI1ZTIyYmQ4MGRmOTc5NWU2MDBiNzA=
9
+ YjUzMzQwMWI4ZmU5OThlMmM1ZTQ5MTA5YjRmMzlmMGE3MjEyYzY5Y2Y3ZGEy
10
+ YjlhMzk3OWRhYTJhYjBhYjhiYTY4YWYyYTc4OTIzNzU2ZWNhYWI5ODcyN2Vh
11
+ YmQ0NzhmOTJhODM0YjhhYjk4Y2ZhNGFjNjk2OTQ3MjIzOGM3NmM=
12
12
  data.tar.gz: !binary |-
13
- OGY4ZGY4MDdjOGU1MTBiMjUyOTVjNjliN2I0YzViZDIyMDZlMTVkZDU2MzFl
14
- YWY5NmE5NWYyNjcxMTMzZmVhOGRkYWM3ZjExZmI1MmRkODgzNDZhNDFmNzcx
15
- ODQ3MGZlZGRjYmNmMWVjNWZhMWQwZmVkYzc1NGYxMjE2OWU0ZTY=
13
+ ZDJhZjIzZDJlNWY1NDVjZjg1ZDU4MTU4MmQ4NTY4NDQxYTY0ZjUwMjU3NGZl
14
+ MjE1ZWNmMDM2MDdiYmZiN2JkYTU2N2Q5ZDA0YWViMzUwNDc3NzI0NmVjYjAw
15
+ MWRjMTBhZDdhMTE5ZjEzZDNjNzAyNTFkYjNmMWE2MTU1YjUxMzA=
data/.editorconfig ADDED
@@ -0,0 +1,8 @@
1
+ [*]
2
+ end_of_line = LF
3
+ charset = utf-8
4
+ indent_style = space
5
+ indent_size = 2
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ max_line_length = 80
data/Rakefile CHANGED
@@ -103,6 +103,9 @@ namespace :speckle do
103
103
  end
104
104
  end
105
105
 
106
+ PROFILE = ENV.has_key?('PROFILE')
107
+ PROFILE_PATH = "#{BUILD_DIR}/speckle.profile"
108
+
106
109
  desc 'All tasks'
107
110
  task :all => [:clean, :compile, :compile_tests, :test]
108
111
 
@@ -220,11 +223,20 @@ namespace :speckle do
220
223
  launch_file = get_launch_cmd_file()
221
224
  File.delete(TEST_LOG) if File.exist?(TEST_LOG)
222
225
  File.delete(TEST_EXIT_FILE) if File.exist?(TEST_EXIT_FILE)
226
+ File.delete(PROFILE_PATH) if File.exist?(PROFILE_PATH)
223
227
 
224
228
  sh "#{TEST_VIM} #{get_vim_options()} -S #{launch_file.path}"
225
229
  launch_file.unlink
226
230
  if File.exist?(TEST_EXIT_FILE)
227
231
  sh "cat #{TEST_LOG}"
232
+ if PROFILE
233
+ puts ''
234
+ puts '------------------------------------------------------------------------------'
235
+ puts "PROFILE SUMMARY"
236
+ puts '------------------------------------------------------------------------------'
237
+ puts ''
238
+ print_profile
239
+ end
228
240
  exit_code = File.read(TEST_EXIT_FILE)[0].to_i
229
241
  exit!(exit_code)
230
242
  else
@@ -241,14 +253,17 @@ namespace :speckle do
241
253
 
242
254
  # utils
243
255
  def get_launch_cmd_source
244
- launch_cmd = <<CMD
245
- source #{SPECKLE_OUTPUT}
246
- CMD
256
+ launch_cmd = "source #{SPECKLE_OUTPUT}\n"
257
+
258
+ if PROFILE
259
+ launch_cmd += "profile start #{PROFILE_PATH}\n"
260
+ end
247
261
 
248
262
  TEST_COMPILED.each do |t|
249
- launch_cmd += <<CMD
250
- source #{t}
251
- CMD
263
+ if PROFILE
264
+ launch_cmd += "profile! file #{t}\n"
265
+ end
266
+ launch_cmd += "source #{t}\n"
252
267
  end
253
268
 
254
269
  launch_cmd += <<CMD
@@ -260,10 +275,13 @@ CMD
260
275
  let g:speckle_colorize = #{COLORIZE}
261
276
  let g:speckle_bail = #{BAIL}
262
277
  CMD
278
+
263
279
  if TAG
264
- launch_cmd += <<CMD
265
- let g:speckle_tag = '#{TAG}'
266
- CMD
280
+ launch_cmd += "let g:speckle_tag = '#{TAG}'\n"
281
+ end
282
+
283
+ if PROFILE
284
+ launch_cmd += "let g:speckle_profile = 1\n"
267
285
  end
268
286
 
269
287
  launch_cmd += <<CMD
@@ -287,5 +305,21 @@ CMD
287
305
  file
288
306
  end
289
307
 
308
+ def print_profile
309
+ can_print = false
310
+
311
+ f = File.open(PROFILE_PATH)
312
+ f.each do |line|
313
+ if !can_print && line =~ /FUNCTIONS SORTED ON TOTAL TIME/
314
+ can_print = true
315
+ end
316
+ if can_print
317
+ puts line
318
+ end
319
+ end
320
+
321
+ f.close
322
+ end
323
+
290
324
  end
291
325
 
@@ -27,6 +27,7 @@ module Speckle
27
27
  options.colorize = true
28
28
  options.bail = false
29
29
  options.tag = nil
30
+ options.profile = false
30
31
 
31
32
  parser = OptionParser.new do |opts|
32
33
  options.opts = opts
@@ -84,6 +85,10 @@ module Speckle
84
85
  options.slow_threshold = ms
85
86
  end
86
87
 
88
+ opts.on('-p', '--profile', 'Profiles the tests run') do
89
+ options.profile = true
90
+ end
91
+
87
92
  opts.on('-k', '--skip-vimrc', 'Does not load ~/.vimrc file') do
88
93
  options.skip_vimrc = true
89
94
  end
@@ -24,7 +24,7 @@ module Speckle
24
24
 
25
25
  def debug
26
26
  @options.debug
27
- end
27
+ end
28
28
 
29
29
  def rake
30
30
  if @rake_app
@@ -53,7 +53,7 @@ module Speckle
53
53
  ENV[key] = if value.is_a?(Array) then value.join(';') else value end
54
54
  puts "rake_env: #{key} = #{ENV[key]}" if debug
55
55
  end
56
- end
56
+ end
57
57
 
58
58
  def configure_rake
59
59
  rake_env('TEST_SOURCES', test_sources)
@@ -68,6 +68,10 @@ module Speckle
68
68
  rake_env('BAIL', to_int(@options.bail))
69
69
  rake_env('TAG', @options.tag)
70
70
 
71
+ if @options.profile
72
+ rake_env('PROFILE', 'yes')
73
+ end
74
+
71
75
  if @options.verbose
72
76
  rake_env('VERBOSE', 'yes')
73
77
  end
@@ -1,3 +1,3 @@
1
1
  module Speckle
2
- VERSION = "0.1.24"
2
+ VERSION = "0.1.25"
3
3
  end
data/portkey.json CHANGED
@@ -17,7 +17,8 @@
17
17
  "type": "utility"
18
18
  },
19
19
  "lib/speckle/cli/*.rb": {
20
- "type": "cli"
20
+ "type": "cli",
21
+ "test": "spec/speckle/cli/%s_spec.rb"
21
22
  },
22
23
  "lib/speckle/list/*.rb": {
23
24
  "type": "list"
@@ -29,5 +30,9 @@
29
30
  },
30
31
  "spec/*_spec.riml": {
31
32
  "type": "spec"
33
+ },
34
+ "spec/speckle/cli/*_spec.rb": {
35
+ "type": "spec",
36
+ "alternate": "lib/speckle/cli/%s.rb"
32
37
  }
33
38
  }
@@ -282,6 +282,18 @@ module Speckle
282
282
  expect(opts.inputs.length).to eq(1)
283
283
  end
284
284
 
285
+ it 'does not have profile option by default' do
286
+ expect([]).to_not have_default_option('profile')
287
+ end
288
+
289
+ it 'has profile option when specified' do
290
+ expect(['-p']).to yield_option_value('profile', true)
291
+ end
292
+
293
+ it 'has profile option with long switch' do
294
+ expect(['--profile']).to yield_option_value('profile', true)
295
+ end
296
+
285
297
  end
286
298
 
287
299
  describe 'Complete CLI options' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: speckle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darshan Sawardekar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-17 00:00:00.000000000 Z
11
+ date: 2013-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: riml
@@ -101,6 +101,7 @@ executables:
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
+ - .editorconfig
104
105
  - .gitignore
105
106
  - .travis.yml
106
107
  - Gemfile