Class: Zewo::App
- Inherits:
-
Thor
- Object
- Thor
- Zewo::App
- Defined in:
- lib/zewo.rb
Defined Under Namespace
Classes: Repo
Instance Attribute Summary collapse
-
#top_node ⇒ Object
readonly
Returns the value of attribute top_node.
Instance Method Summary collapse
- #init ⇒ Object
-
#initialize(*args) ⇒ App
constructor
A new instance of App.
- #pull ⇒ Object
- #rebuild_projects ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(*args) ⇒ App
Returns a new instance of App.
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/zewo.rb', line 315 def initialize(*args) super @top_node = Repo.new('Flux', 'Zewo') Repo.repos['Zewo/Flux'] = @top_node command_name = nil args.each do |a| next unless a.is_a? Hash if a.key? :current_command command_name = a[:current_command].name break end end if !command_name.nil? && command_name.to_sym != :init unless has_dotfile puts 'zewodev has not been initialized in this directory. Run `zewodev init` do to so.'.red exit end end top_node.clone_dependencies end |
Instance Attribute Details
#top_node ⇒ Object (readonly)
Returns the value of attribute top_node.
313 314 315 |
# File 'lib/zewo.rb', line 313 def top_node @top_node end |
Instance Method Details
#init ⇒ Object
342 343 344 345 |
# File 'lib/zewo.rb', line 342 def init create_dotfile invoke :rebuild_projects end |
#pull ⇒ Object
369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/zewo.rb', line 369 def pull puts "Pulling changes for all repositories..." each_repo_async(false) do |key, repo| begin output = repo.pull str = "#{key}:\n".green str += output str += "\n\n" puts str rescue Exception => e puts "#{key}: #{e..red}" end end end |
#rebuild_projects ⇒ Object
348 349 350 351 |
# File 'lib/zewo.rb', line 348 def rebuild_projects top_node.setup_xcode_projects top_node.configure_xcode_projects end |
#status ⇒ Object
354 355 356 357 358 359 360 361 362 363 364 365 366 |
# File 'lib/zewo.rb', line 354 def status each_repo do |key, repo| str = key branch = repo.branch str += " (#{repo.tag}) - #{repo.uncommited_changes? ? branch.red : branch.green}" if repo.tag_lock str += " Locked to #{repo.tag_lock}".yellow end puts str end end |