albacore 2.3.6 → 2.3.7

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: ed4fdb27d392bf16eca6d48d8a1d98e2380316c7
4
- data.tar.gz: b576fd55285d187a6ebe73e7503c41ff65cac2c6
3
+ metadata.gz: 6bc15d7c32f051866b973d2e66c39a3548a98d23
4
+ data.tar.gz: 4a222f833a8e5d952e760a266d5427510332d89a
5
5
  SHA512:
6
- metadata.gz: 52de081a6d2011cf23a3074e92965e0a665be7ca538bc947a978a19be7207dc83aa933d2d4e82da1c465541b7cb03ebbe2109b369e20e721841699448959d99f
7
- data.tar.gz: 01eae97ffbda667f1fe71c7abcd486bcae34537063a998d9b522db72bd99e33eb07b28cf78ffe29b688c95d3f158ffb1a5510494f0ab985f21731245ca68f2fd
6
+ metadata.gz: b1da42489a9ce91d28938b74345cc2c72ee3c83d95670e8bba9d0537de9b27ff5eeee77e6cb045bfc295790abf36434cad6e4b4effb22f0d49b74c79cae28dd1
7
+ data.tar.gz: 672d2aa7f7c909b198c7eeb51e0cd63fdb034cc1d7983c632deb51433a3f2070900810c0d555ee081cc61bb232ede4afe04520debb978ad15856bbbbd7bf1692
@@ -65,19 +65,24 @@ module Albacore
65
65
  @file_path, @namespace, @attributes = file_path, namespace, attributes
66
66
  end
67
67
 
68
- # the hash of attributes to write to the assembly info file
68
+ # Call with to get the opportunity to change the attributes hash
69
+ def change_attributes &block
70
+ yield @attributes if block
71
+ end
72
+
73
+ # Give the hash of attributes to write to the assembly info file
69
74
  def attributes attrs
70
75
  @attributes = attrs
71
76
  end
72
-
77
+
73
78
  def opts
74
79
  raise Error, "#file_path is not set" unless (file_path or out)
75
80
  ns = @namespace || '' # defaults to empty namespace if not set.
76
81
  lang = lang_for file_path
77
82
  m = Map.new attributes: @attributes,
78
- namespace: ns,
79
- file_path: @file_path,
80
- language: lang
83
+ namespace: ns,
84
+ file_path: @file_path,
85
+ language: lang
81
86
  m[:out] = @out if @out
82
87
  m
83
88
  end
@@ -87,6 +92,7 @@ module Albacore
87
92
  end
88
93
 
89
94
  private
95
+
90
96
  def lang_for path
91
97
  mk = lambda { |lang| "Albacore::Asmver::#{lang}".split('::').inject(Object) { |o, c| o.const_get c }.new }
92
98
  case File.extname path
@@ -97,6 +103,7 @@ module Albacore
97
103
  end
98
104
  end
99
105
  end
106
+
100
107
  class Task
101
108
  include Logging
102
109
  def initialize opts
@@ -1,3 +1,3 @@
1
1
  module Albacore
2
- VERSION = "2.3.6"
2
+ VERSION = "2.3.7"
3
3
  end
@@ -28,5 +28,15 @@ describe ::Albacore::Asmver::Config, 'when setting attributes and out' do
28
28
  it 'should write AssemblyVersion' do
29
29
  strio.string.should include('[<assembly: AssemblyVersion("0.1.2")>]')
30
30
  end
31
+ it 'should allow changing attributes' do
32
+ expect(subject).to respond_to :change_attributes
33
+ end
34
+
35
+ it 'should allow getting and setting attributes' do
36
+ subject.change_attributes do |as|
37
+ as[:a_key] = '123'
38
+ end
39
+ expect(subject.change_attributes { |a| a[:a_key] }).to eq '123'
40
+ end
31
41
  end
32
42
 
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.3.6
4
+ version: 2.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrik Feldt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-16 00:00:00.000000000 Z
12
+ date: 2014-12-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake