albacore 2.0.15 → 2.0.16

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: d652382ec8cc7fceda047d9d6fc256bb0b1320f4
4
- data.tar.gz: a8d0f033e45efb7955f75a87f33cbb2145fd4ed3
3
+ metadata.gz: 560c9fa28236e37df5b2efdf8085cfe7bcd068fd
4
+ data.tar.gz: 8fd54f812d717c6a0037d5793f2206619f94bb08
5
5
  SHA512:
6
- metadata.gz: e989a37a6b7689464fa9b7b8de221d3077a628dd471bcb4912b2d2533f0b274796ad0a7327e00d5a72341ba4bb9ceede9ce88f098f62f7b7f39f8f1a23178088
7
- data.tar.gz: 884c905b0327ebfc8ab6db60a2ab5eb16cfd7eb6e4c6b41c16b4f816f93c62d2b354c8c368843cba48044e56f7fbfbe6dc13d53ad6d2254b658008b122c61288
6
+ metadata.gz: ba75ed679a1dbb9312b2a47f868495c477886bf454589cf93ec678f2f11028f8edb67a6d2191aa6839f61f2592fdb34b55a4b6a552099b98553928d360d4ad91
7
+ data.tar.gz: 62c2660a8ee8cfb735bc8a078f528a476c7bd937d8b4f4217ced87631637ccf2b19c579d4f05346e4b0f5257673f8f35ff0d29b8f6b9887f4dbbad90bbdccd9e
@@ -107,7 +107,8 @@ module Albacore
107
107
  debug 'waiting for process completion'
108
108
  _, status = Process.wait2 @pid
109
109
 
110
- return block.call(status.success? && inmem.string, status, inmem.string)
110
+ ret_str = inmem.string.encode 'utf-8', invalid: :replace, undef: :replace, replace: ''
111
+ return block.call(status.success? && ret_str, status, ret_str)
111
112
  end
112
113
  end
113
114
 
@@ -1,6 +1,8 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'rake'
2
4
  require 'nokogiri'
3
- require 'fileutils'
5
+ require 'fileutils'
4
6
  require 'albacore'
5
7
  require 'albacore/paths'
6
8
  require 'albacore/cmd_config'
@@ -70,11 +72,11 @@ module Albacore
70
72
  # regexpes the package path from the output
71
73
  def get_nuget_path_of
72
74
  out = yield
73
- out.match /Successfully created package '([:\s\w\\\/\d\.\-]+\.symbols\.nupkg)'./i if out.respond_to? :match
75
+ out.match /Successfully created package '([:\s\p{Word}\\\/\d\.\-]+\.symbols\.nupkg)'./iu if out.respond_to? :match
74
76
  trace "Got symbols return value: '#{out}', matched: '#{$1}'" if $1
75
77
  return $1 if $1
76
78
 
77
- out.match /Successfully created package '([:\s\w\\\/\d\.\-]+\.nupkg)'./i if out.respond_to? :match
79
+ out.match /Successfully created package '([:\s\p{Word}\\\/\d\.\-]+\.nupkg)'./iu if out.respond_to? :match
78
80
  trace "Got NOT-symbols return value: '#{out}', matched: '#{$1}'"
79
81
 
80
82
  unless $1
@@ -1,3 +1,3 @@
1
1
  module Albacore
2
- VERSION = "2.0.15"
2
+ VERSION = "2.0.16"
3
3
  end
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
  require 'shared_contexts'
3
5
  require 'support/sh_interceptor'
@@ -153,6 +155,13 @@ Successfully created package '/home/xyz/Shared/build/pkg/MyNuget.Package.1.0.0-a
153
155
  EXAMPLE_OUTPUT
154
156
  end
155
157
 
158
+ let :sample5 do
159
+ <<EXAMPLE_OUTPUT
160
+ Attempting to build package from 'Fröken.nuspec'.
161
+ Successfully created package '/home/xyz/Shared/build/pkg/Fröken.1.0.0-alpha.nupkg'.
162
+ EXAMPLE_OUTPUT
163
+ end
164
+
156
165
  it "should match sample1 with last nupkg mentioned" do
157
166
  match = subject.send(:get_nuget_path_of) { sample1 }
158
167
  match.should eq('Y:\\Shared\\build\\pkg\\MyNuget.Package.1.0.0.symbols.nupkg')
@@ -172,6 +181,11 @@ EXAMPLE_OUTPUT
172
181
  match = subject.send(:get_nuget_path_of) { sample4 }
173
182
  match.should eq('/home/xyz/Shared/build/pkg/MyNuget.Package.1.0.0-alpha.nupkg')
174
183
  end
184
+
185
+ it 'should match sample5 despite non-ASCII' do
186
+ match = subject.send(:get_nuget_path_of) { sample5 }
187
+ match.should eq('/home/xyz/Shared/build/pkg/Fröken.1.0.0-alpha.nupkg')
188
+ end
175
189
  end
176
190
 
177
191
  # testing nuspec task
@@ -282,3 +296,21 @@ describe ProjectTask, "creating nuget from proj file" do
282
296
  end
283
297
  end
284
298
  end
299
+
300
+ describe 'encoding functions' do
301
+ it 'should throw InvalidByteSequenceError by default' do
302
+ # http://www.ruby-doc.org/core-2.1.3/String.html#method-i-encode
303
+ begin
304
+ # it's "valid US-ASCII" from the POV of #encode unless
305
+ # #force_encoding is used
306
+ [0xef].pack('C*').force_encoding('US-ASCII').encode 'utf-8'
307
+ fail 'should throw invalid byte sequence error, because it\'s NOT US-ASCII'
308
+ rescue Encoding::InvalidByteSequenceError
309
+ # yep
310
+ end
311
+ end
312
+ it 'should be replaceable' do
313
+ subj = [0xef].pack('C*').encode 'utf-8', undef: :replace, invalid: :replace, replace: ''
314
+ expect(subj).to eq ''
315
+ end
316
+ end
@@ -51,7 +51,8 @@ module ShInterceptor
51
51
  @executable = args[0] || ''
52
52
  @parameters = args[1..-1].flatten || []
53
53
  @system_calls = system_calls + 1
54
- add_invocation(OpenStruct.new({ :executable => @executable, :parameters => @parameters, :options => @options}))
54
+ add_invocation(OpenStruct.new({ :executable => @executable, :parameters => @parameters, :options => @options }))
55
+ "".force_encoding 'utf-8' # expecting string output in utf-8 (hopefully)
55
56
  end
56
57
 
57
58
  # gets the invocations given to #system, with readers:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: albacore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.15
4
+ version: 2.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrik Feldt
@@ -381,7 +381,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
381
  version: '0'
382
382
  requirements: []
383
383
  rubyforge_project: albacore
384
- rubygems_version: 2.4.1
384
+ rubygems_version: 2.2.2
385
385
  signing_key:
386
386
  specification_version: 4
387
387
  summary: Dolphin-safe and awesome Mono and .Net Rake-tasks