Sha256: 370176b623c3f6c7fd53da8808686d589dddc712fc892eb093c0d3286c379b3e

Contents?: true

Size: 650 Bytes

Versions: 13

Compression:

Stored size: 650 Bytes

Contents

require 'apidragon' # require the gem. you can use any gems you like!

class MyClass < ArgBucket # inherit from the ArgBucket class for the 'get' and 'set' methods on @arg_bucket
  def initialize(args)
    @arg_bucket = args
    puts @arg_bucket
  end

  def run
    directory = get 'directory'
    repo_name = get 'repo'
    repo = 'http://github.com/isand3r' << repo_name
    puts repo
    puts directory
    if Dir.exist?(directory) && Dir.exist?("#{directory}/#{repo_name}/.git")
      `cd #{directory}/#{repo_name}; git pull`
    else
      puts "cloning #{repo}"
      `mkdir #{directory}; cd #{directory}; git clone #{repo}`
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
apidragon-1.6.1 plugin_examples/gitclone.rb
apidragon-1.6.0 plugin_examples/gitclone.rb
apidragon-1.5.4 plugin_examples/gitclone.rb
apidragon-1.5.3 plugin_examples/gitclone.rb
apidragon-1.5.2 plugin_examples/gitclone.rb
apidragon-1.5.1 plugin_examples/gitclone.rb
apidragon-1.5.0 plugin_examples/gitclone.rb
apidragon-1.4.6 plugin_examples/gitclone.rb
apidragon-1.4.5 plugin_examples/gitclone.rb
apidragon-1.4.4 plugin_examples/gitclone.rb
apidragon-1.4.3 plugin_examples/gitclone.rb
apidragon-1.4.1 plugin_examples/gitclone.rb
apidragon-1.4.0 plugin_examples/gitclone.rb