lib/repositories.rb in forj-0.0.24 vs lib/repositories.rb in forj-0.0.25
- old
+ new
@@ -13,10 +13,11 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+require 'rubygems'
require 'git'
require 'fileutils'
require 'require_relative'
require_relative 'yaml_parse.rb'
@@ -26,19 +27,13 @@
#
# Repositories module
#
module Repositories
- def clone_repo
-
+ def clone_repo(maestro_url)
current_dir = Dir.pwd
- forj_dir = File.expand_path(File.dirname(__FILE__))
- Dir.chdir(forj_dir)
- definitions = YamlParse::get_values('../lib/catalog.yaml')
- maestro_url = definitions['default']['maestro']
-
home = File.expand_path('~')
path = home + '/.forj/'
begin
if File.directory?(path)
@@ -47,10 +42,10 @@
end
Logging.info('cloning the maestro repo')
Git.clone(maestro_url, 'maestro', :path => path)
end
rescue => e
- puts format('Error while cloning the repo from %{maestro_url}', maestro_url: maestro_url)
+ puts 'Error while cloning the repo from %s' % [maestro_url]
puts 'If this error persist you could clone the repo manually in ~/.forj/'
Logging.error(e.message)
end
Dir.chdir(current_dir)
end
\ No newline at end of file