Class: Mayday::UserDefinitions
- Inherits:
-
Object
- Object
- Mayday::UserDefinitions
- Defined in:
- lib/mayday/user_definitions.rb
Instance Method Summary collapse
- #benchmark ⇒ Object
- #down ⇒ Object
- #init ⇒ Object
-
#initialize(mayday_file_path) ⇒ UserDefinitions
constructor
A new instance of UserDefinitions.
- #run ⇒ Object
- #up ⇒ Object
Constructor Details
#initialize(mayday_file_path) ⇒ UserDefinitions
Returns a new instance of UserDefinitions.
7 8 9 |
# File 'lib/mayday/user_definitions.rb', line 7 def initialize(mayday_file_path) @mayday_file_path = mayday_file_path end |
Instance Method Details
#benchmark ⇒ Object
39 40 41 42 43 |
# File 'lib/mayday/user_definitions.rb', line 39 def benchmark mayday_file do |file| Reader.new(file).to_target_integrator.benchmark end end |
#down ⇒ Object
33 34 35 36 37 |
# File 'lib/mayday/user_definitions.rb', line 33 def down mayday_file do |file| Reader.new(file).to_target_integrator.deintegrate end end |
#init ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mayday/user_definitions.rb', line 11 def init if File.exist?(@mayday_file_path) puts "#{@mayday_file_path} already exists".red abort else File.open(@mayday_file_path, 'w') do |file| file.write <<-CODE xcode_proj '#{nearby_xcodeproj}' warning_regex 'TODO:', /\\s+\\/\\/\\s?TODO:/ CODE puts "#{@mayday_file_path} created".green end end end |
#run ⇒ Object
45 46 47 48 49 |
# File 'lib/mayday/user_definitions.rb', line 45 def run mayday_file do |file| Reader.new(file).to_target_integrator.run end end |
#up ⇒ Object
27 28 29 30 31 |
# File 'lib/mayday/user_definitions.rb', line 27 def up mayday_file do |file| Reader.new(file).to_target_integrator.integrate end end |