Sha256: b832a60773b619bac66498d98f2f97a9c841b646791252ae02fda434038df926

Contents?: true

Size: 820 Bytes

Versions: 1

Compression:

Stored size: 820 Bytes

Contents

class Bit

	def insert_new
		@project_id = insert_new_project unless @project_id

		data = { :name => @name, :project => @project_id, :root => @root, :commit => nil, :commit_time => nil }
		@@db.insert_info :bits, data
	end

	def insert_new_project

		fail DuplicateAttr if @@db.select_info_by_name :projects, [ :name ], @project_name

		data = { :project => @project_name, :git => @git }
		@@db.insert_info :projects, data
	end

	def load_info

		info = @@db.select_info_by_id :bits, @@info[:bits], @id

		@name = info[:name]
		@project_id = info[:project]

		project_info = @@db.select_info_by_id :projects, @@info[:projects], @project_id
		info.merge! project_info

		@project_name = info[:name]
		@root = info[:root]
		@git = info[:git]
		@commit = { :name => info[:commit], :time => info[:commit_time] }

	end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kit-0.0.5 kits/my_kit/bit.rb