Class: Steep::Project::DSL::TargetDSL
- Inherits:
-
Object
- Object
- Steep::Project::DSL::TargetDSL
- Defined in:
- lib/steep/project/dsl.rb
Instance Attribute Summary collapse
-
#ignored_sources ⇒ Object
readonly
Returns the value of attribute ignored_sources.
-
#libraries ⇒ Object
readonly
Returns the value of attribute libraries.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#no_builtin ⇒ Object
readonly
Returns the value of attribute no_builtin.
-
#signatures ⇒ Object
readonly
Returns the value of attribute signatures.
-
#sources ⇒ Object
readonly
Returns the value of attribute sources.
-
#strictness_level ⇒ Object
readonly
Returns the value of attribute strictness_level.
-
#vendor_dir ⇒ Object
readonly
Returns the value of attribute vendor_dir.
Instance Method Summary collapse
- #check(*args) ⇒ Object
- #ignore(*args) ⇒ Object
-
#initialize(name, sources: [], libraries: [], signatures: [], ignored_sources: []) ⇒ TargetDSL
constructor
A new instance of TargetDSL.
- #initialize_copy(other) ⇒ Object
- #library(*args) ⇒ Object
- #no_builtin!(value = true) ⇒ Object
- #signature(*args) ⇒ Object
- #typing_options(level) ⇒ Object
- #update(name: self.name, sources: self.sources, libraries: self.libraries, ignored_sources: self.ignored_sources, signatures: self.signatures) ⇒ Object
- #vendor(dir = "vendor/sigs", stdlib: nil, gems: nil) ⇒ Object
Constructor Details
#initialize(name, sources: [], libraries: [], signatures: [], ignored_sources: []) ⇒ TargetDSL
Returns a new instance of TargetDSL.
14 15 16 17 18 19 20 21 22 |
# File 'lib/steep/project/dsl.rb', line 14 def initialize(name, sources: [], libraries: [], signatures: [], ignored_sources: []) @name = name @sources = sources @libraries = libraries @signatures = signatures @ignored_sources = ignored_sources @vendor_dir = nil @strictness_level = :default end |
Instance Attribute Details
#ignored_sources ⇒ Object (readonly)
Returns the value of attribute ignored_sources.
9 10 11 |
# File 'lib/steep/project/dsl.rb', line 9 def ignored_sources @ignored_sources end |
#libraries ⇒ Object (readonly)
Returns the value of attribute libraries.
7 8 9 |
# File 'lib/steep/project/dsl.rb', line 7 def libraries @libraries end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/steep/project/dsl.rb', line 5 def name @name end |
#no_builtin ⇒ Object (readonly)
Returns the value of attribute no_builtin.
10 11 12 |
# File 'lib/steep/project/dsl.rb', line 10 def no_builtin @no_builtin end |
#signatures ⇒ Object (readonly)
Returns the value of attribute signatures.
8 9 10 |
# File 'lib/steep/project/dsl.rb', line 8 def signatures @signatures end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
6 7 8 |
# File 'lib/steep/project/dsl.rb', line 6 def sources @sources end |
#strictness_level ⇒ Object (readonly)
Returns the value of attribute strictness_level.
12 13 14 |
# File 'lib/steep/project/dsl.rb', line 12 def strictness_level @strictness_level end |
#vendor_dir ⇒ Object (readonly)
Returns the value of attribute vendor_dir.
11 12 13 |
# File 'lib/steep/project/dsl.rb', line 11 def vendor_dir @vendor_dir end |
Instance Method Details
#check(*args) ⇒ Object
34 35 36 |
# File 'lib/steep/project/dsl.rb', line 34 def check(*args) sources.push(*args) end |
#ignore(*args) ⇒ Object
38 39 40 |
# File 'lib/steep/project/dsl.rb', line 38 def ignore(*args) ignored_sources.push(*args) end |
#initialize_copy(other) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/steep/project/dsl.rb', line 24 def initialize_copy(other) @name = other.name @sources = other.sources.dup @libraries = other.libraries.dup @signatures = other.signatures.dup @ignored_sources = other.ignored_sources.dup @vendor_dir = other.vendor_dir @strictness_level = other.strictness_level end |
#library(*args) ⇒ Object
42 43 44 |
# File 'lib/steep/project/dsl.rb', line 42 def library(*args) libraries.push(*args) end |
#no_builtin!(value = true) ⇒ Object
64 65 66 |
# File 'lib/steep/project/dsl.rb', line 64 def no_builtin!(value = true) Steep.logger.error "`no_builtin!` in Steepfile is deprecated and ignored. Use `vendor` instead." end |
#signature(*args) ⇒ Object
50 51 52 |
# File 'lib/steep/project/dsl.rb', line 50 def signature(*args) signatures.push(*args) end |
#typing_options(level) ⇒ Object
46 47 48 |
# File 'lib/steep/project/dsl.rb', line 46 def (level) @strictness_level = level end |
#update(name: self.name, sources: self.sources, libraries: self.libraries, ignored_sources: self.ignored_sources, signatures: self.signatures) ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/steep/project/dsl.rb', line 54 def update(name: self.name, sources: self.sources, libraries: self.libraries, ignored_sources: self.ignored_sources, signatures: self.signatures) self.class.new( name, sources: sources, libraries: libraries, signatures: signatures, ignored_sources: ignored_sources ) end |
#vendor(dir = "vendor/sigs", stdlib: nil, gems: nil) ⇒ Object
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/steep/project/dsl.rb', line 68 def vendor(dir = "vendor/sigs", stdlib: nil, gems: nil) if stdlib || gems @vendor_dir = [ stdlib&.yield_self {|x| Pathname(x) }, gems&.yield_self {|x| Pathname(x) } ] else @vendor_dir = Pathname(dir) end end |