Sha256: 4ae5387db3ccc9513e9335be76d5a9154c33b6b2e9875041c1340e2e2b0225e3

Contents?: true

Size: 978 Bytes

Versions: 6

Compression:

Stored size: 978 Bytes

Contents

require 'colorize'
require 'tmpdir'
require 'fileutils'
require 'dryrun/github'
require 'dryrun/android_project'

module DryRun

  class MainApp

    def self.is_ANDROID_HOME_defined
      return true
    end


    def self.initialize(url)

      if !is_ANDROID_HOME_defined
        # TODO missing warning
      end

      github = Github.new(url)

      if !github.is_valid
        puts "#{url.red} is not a valid github url"
        exit 1
      end

      # clone the repository
      clonable = github.clonable_url

      repository = github.clone

      Dir.chdir repository

      project = AndroidProject.new(repository)

      # is a valid android project?
      if !project.is_valid
        puts "#{url.red} is not a valid android project"
        exit 1
      end

      # clean and install the apk
      project.clean_install

      puts "\n> If you want to remove the app you just installed, execute:\n#{project.get_uninstall_command.yellow}\n\n"

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dryrun-0.3.6 lib/dryrun.rb
dryrun-0.3.5 lib/dryrun.rb
dryrun-0.3.4 lib/dryrun.rb
dryrun-0.3.3 lib/dryrun.rb
dryrun-0.3.2 lib/dryrun.rb
dryrun-0.3.1 lib/dryrun.rb