Skip to content

Commit

Permalink
more with files properties to generic importer
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed Sep 13, 2024
1 parent 8ebde17 commit 4aedf78
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 49 deletions.
28 changes: 2 additions & 26 deletions src/GitHubHealth-Model-Importer/GHModelImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ Class {
#superclass : 'GPModelImporter',
#instVars : [
'api',
'glhModel',
'withFiles'
'glhModel'
],
#category : 'GitHubHealth-Model-Importer',
#package : 'GitHubHealth-Model-Importer'
Expand All @@ -22,18 +21,6 @@ GHModelImporter >> api: anObject [
api := anObject
]

{ #category : 'accessing' }
GHModelImporter >> beWithFiles [

withFiles := true
]

{ #category : 'accessing' }
GHModelImporter >> beWithoutFiles [

withFiles := false
]

{ #category : 'private' }
GHModelImporter >> convertApiFileAsFile: aAPIFile [

Expand Down Expand Up @@ -161,6 +148,7 @@ GHModelImporter >> importRepositoriesOfGroup: groupResult [

{ #category : 'initialization' }
GHModelImporter >> initialize [

super initialize.
self api: GHApi new.
withFiles := false
Expand Down Expand Up @@ -255,15 +243,3 @@ GHModelImporter >> privateToken [
GHModelImporter >> privateToken: aTokenString [
^ self api privateToken: aTokenString
]

{ #category : 'accessing' }
GHModelImporter >> withFiles [

^ withFiles
]

{ #category : 'accessing' }
GHModelImporter >> withFiles: anObject [

withFiles := anObject
]
25 changes: 2 additions & 23 deletions src/GitLabHealth-Model-Importer/GLHModelImporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Class {
#instVars : [
'glhModel',
'glhApi',
'withFiles',
'withCommitDiffs',
'withInitialCommits',
'withInitialMergeRequest',
Expand Down Expand Up @@ -50,16 +49,6 @@ GLHModelImporter >> addGroupResultToModel: groupResult [
^ group
]

{ #category : 'accessing' }
GLHModelImporter >> beWithFiles [
withFiles := true
]

{ #category : 'accessing' }
GLHModelImporter >> beWithouFiles [
withFiles := false
]

{ #category : 'as yet unclassified' }
GLHModelImporter >> blockEqualityOn: aSymbol [
^ [ :existing :new |
Expand Down Expand Up @@ -788,12 +777,12 @@ GLHModelImporter >> initReader [
{ #category : 'initialization' }
GLHModelImporter >> initialize [

withFiles := false.
super initialize.
withCommitDiffs := false.
withInitialCommits := false.
withInitialMergeRequest := false.
self initReader.
currentImporter := self.
currentImporter := self
]

{ #category : 'importer' }
Expand Down Expand Up @@ -1089,16 +1078,6 @@ GLHModelImporter >> withCommitDiffs: anObject [
withCommitDiffs := anObject
]

{ #category : 'accessing' }
GLHModelImporter >> withFiles [
^ withFiles
]

{ #category : 'accessing' }
GLHModelImporter >> withFiles: aBoolean [
withFiles := aBoolean
]

{ #category : 'accessing' }
GLHModelImporter >> withInitialCommits: boolean [
withInitialCommits := boolean
Expand Down
59 changes: 59 additions & 0 deletions src/GitProjectHealth-Model-Importer/GPModelImporter.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
"
I am a superclass for Model importer.
I am a try of normalization for the different importer.
I also define some contract so it is easier to switch from one importer to another
"
Class {
#name : 'GPModelImporter',
#superclass : 'Object',
#instVars : [
'withCommitsSince',
'withFiles'
],
#category : 'GitProjectHealth-Model-Importer',
#package : 'GitProjectHealth-Model-Importer'
}

{ #category : 'accessing' }
GPModelImporter >> beWithFiles [

withFiles := true
]

{ #category : 'accessing' }
GPModelImporter >> beWithoutFiles [

withFiles := false
]

{ #category : 'initialization' }
GPModelImporter >> initialize [

super initialize.
self withCommitsSince: (Date today - 1 week) asDateAndTime
]

{ #category : 'accessing' }
GPModelImporter >> withCommitsSince [

^ withCommitsSince
]

{ #category : 'accessing' }
GPModelImporter >> withCommitsSince: anObject [

withCommitsSince := anObject
]

{ #category : 'accessing' }
GPModelImporter >> withFiles [

^ withFiles
]

{ #category : 'accessing' }
GPModelImporter >> withFiles: anObject [

withFiles := anObject
]
1 change: 1 addition & 0 deletions src/GitProjectHealth-Model-Importer/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : 'GitProjectHealth-Model-Importer' }

0 comments on commit 4aedf78

Please sign in to comment.