debian-mirror-gitlab/lib/gitlab/fogbugz_import/repository.rb

34 lines
500 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2015-09-25 12:07:36 +05:30
module Gitlab
module FogbugzImport
class Repository
attr_accessor :raw_data
def initialize(raw_data)
@raw_data = raw_data
end
def valid?
raw_data.is_a?(Hash)
end
def id
raw_data['ixProject']
end
def name
raw_data['sProject']
end
def safe_name
name.gsub(/[^\s\w.-]/, '')
end
def path
2021-06-08 01:23:25 +05:30
safe_name.gsub(/\s/, '_')
2015-09-25 12:07:36 +05:30
end
end
end
end