Class: Appraisal::Platform
- Inherits:
-
Object
- Object
- Appraisal::Platform
- Defined in:
- lib/appraisal/platform.rb
Instance Method Summary collapse
- #gem(name, *requirements) ⇒ Object
-
#initialize(platform_names) ⇒ Platform
constructor
A new instance of Platform.
- #run(&block) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(platform_names) ⇒ Platform
Returns a new instance of Platform.
6 7 8 9 |
# File 'lib/appraisal/platform.rb', line 6 def initialize(platform_names) @dependencies = DependencyList.new @platform_names = platform_names end |
Instance Method Details
#gem(name, *requirements) ⇒ Object
11 12 13 |
# File 'lib/appraisal/platform.rb', line 11 def gem(name, *requirements) @dependencies.add(name, requirements) end |
#run(&block) ⇒ Object
15 16 17 |
# File 'lib/appraisal/platform.rb', line 15 def run(&block) instance_exec(&block) end |
#to_s ⇒ Object
19 20 21 22 23 |
# File 'lib/appraisal/platform.rb', line 19 def to_s "platforms #{Utils.format_arguments(@platform_names)} do\n" + @dependencies.to_s.strip.gsub(/^/, ' ') + "\nend" end |