Class: Albacore::Asmver::Config
- Inherits:
-
Object
- Object
- Albacore::Asmver::Config
- Extended by:
- ConfigDSL
- Includes:
- CmdConfig
- Defined in:
- lib/albacore/task_types/asmver.rb
Instance Attribute Summary collapse
-
#namespace ⇒ Object
the namespace to output into the version file.
-
#out ⇒ Object
(optional) output stream.
-
#usings ⇒ Object
the array-like thing of using namespaces.
Instance Method Summary collapse
-
#attributes(attrs) ⇒ Object
Give the hash of attributes to write to the assembly info file.
-
#change_attributes {|@attributes| ... } ⇒ Object
Call with to get the opportunity to change the attributes hash.
-
#initialize(file_path = nil, namespace = nil, attributes = nil) ⇒ Config
constructor
creates a new config with some pre-existing data.
-
#opts ⇒ Object
Map object.
- #to_s ⇒ Object
- #using(ns) ⇒ Object
Methods included from ConfigDSL
Methods included from CmdConfig
Methods included from Logging
#debug, #err, #error, #fatal, #info, #puts, #trace, #warn
Constructor Details
#initialize(file_path = nil, namespace = nil, attributes = nil) ⇒ Config
creates a new config with some pre-existing data
81 82 83 84 |
# File 'lib/albacore/task_types/asmver.rb', line 81 def initialize file_path = nil, namespace = nil, attributes = nil @file_path, @namespace, @attributes = file_path, namespace, attributes @usings = [] end |
Instance Attribute Details
#namespace ⇒ Object
the namespace to output into the version file
72 73 74 |
# File 'lib/albacore/task_types/asmver.rb', line 72 def namespace @namespace end |
#out ⇒ Object
(optional) output stream
75 76 77 |
# File 'lib/albacore/task_types/asmver.rb', line 75 def out @out end |
#usings ⇒ Object
the array-like thing of using namespaces
78 79 80 |
# File 'lib/albacore/task_types/asmver.rb', line 78 def usings @usings end |
Instance Method Details
#attributes(attrs) ⇒ Object
Give the hash of attributes to write to the assembly info file
92 93 94 |
# File 'lib/albacore/task_types/asmver.rb', line 92 def attributes attrs @attributes = attrs end |
#change_attributes {|@attributes| ... } ⇒ Object
Call with to get the opportunity to change the attributes hash
87 88 89 |
# File 'lib/albacore/task_types/asmver.rb', line 87 def change_attributes &block yield @attributes if block end |
#opts ⇒ Object
Returns Map object.
102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/albacore/task_types/asmver.rb', line 102 def opts raise MissingOutputError, "#file_path or #out is not set" unless (file_path or out) ns = @namespace || '' # defaults to empty namespace if not set. lang = lang_for file_path m = Map.new attributes: @attributes, namespace: ns, file_path: @file_path, language: lang, usings: usings m[:out] = out if out m end |
#to_s ⇒ Object
115 116 117 |
# File 'lib/albacore/task_types/asmver.rb', line 115 def to_s "AsmVer::Config[#{file_path}]" end |
#using(ns) ⇒ Object
96 97 98 99 |
# File 'lib/albacore/task_types/asmver.rb', line 96 def using ns debug { "adding namespace #{ns} [Asmver::Config using]" } usings << ns end |