lib/gito/project.rb in gito-0.4.1 vs lib/gito/project.rb in gito-0.4.2
- old
+ new
@@ -1,18 +1,19 @@
require 'tmpdir'
require 'fileutils'
require 'uri'
+require 'open-uri'
require 'json'
require_relative './app_utils'
require 'pry'
class Project
def initialize(url)
@base_url = sanitize_url(url)
@destination_dir = nil
@destination = destination
- @detector_json_path = '../detector.json'
+ @detector_json_path = 'https://raw.githubusercontent.com/cesarferreira/gito/master/detector.json'
end
def sanitize_url(url)
url = url.split('?').first
url.chop! if url.end_with? '/'
@@ -59,10 +60,10 @@
puts "cd #{destination.yellow}"
puts "-------------------------------------------"
end
def install_dependencies
- file = File.read(@detector_json_path)
+ file = open(@detector_json_path) {|f| f.read }
types = JSON.parse(file)
chosen = nil
Dir.chdir(@destination_dir)