lib/gitwakatime.rb in gitwakatime-0.2.2 vs lib/gitwakatime.rb in gitwakatime-0.4.0
- old
+ new
@@ -1,22 +1,26 @@
require 'sequel'
+
if ENV['thor_env'] != 'test'
DB = Sequel.connect("sqlite://#{File.join(Dir.home, '.wakatime.sqlite')}")
else
# Use a in memory db to have a nice clean testing bed.
DB = Sequel.sqlite
end
Sequel::Model.plugin :json_serializer
+Sequel.default_timezone = :utc
DB.use_timestamp_timezones = false
require 'gitwakatime/version'
-require 'gitwakatime/durations'
+require 'gitwakatime/durations_calculator'
require 'gitwakatime/heartbeat'
require 'gitwakatime/commit'
require 'gitwakatime/mapper'
require 'gitwakatime/query'
+require 'gitwakatime/request'
+require 'gitwakatime/request_builder'
require 'gitwakatime/timer'
require 'gitwakatime/log'
require 'gitwakatime/commited_file'
require 'gitwakatime/controller'
require 'gitwakatime/cli'
@@ -70,10 +74,11 @@
String :dependent_sha
DateTime :dependent_date
integer :time_in_seconds, default: 0
String :sha
String :name
+ String :entity
String :project
index :dependent_sha
index :sha
end
end
@@ -82,19 +87,20 @@
DB.create_table? :heartbeats do
primary_key :id
String :uuid
DateTime :time
integer :duration, default: 0
- String :file
+ String :entity
+ String :type
String :branch
String :project
index :uuid, unique: true
end
end
end
def self.config
- @configuration ||= Configuration.new
+ @configuration ||= Configuration.new
end
def self.configure
yield(configuration) if block_given?
end