Skip to content

Commit

Permalink
Small cleanups
Browse files Browse the repository at this point in the history
- MetacelloPharoPlatform got deprecated: fix IceMetacelloPharoPlatform
- Remove dead code marking lot of classes as abstract wrongly :(
  • Loading branch information
jecisc committed Nov 13, 2023
1 parent 622e4bb commit 48291cd
Show file tree
Hide file tree
Showing 19 changed files with 133 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
I resolve Bitbucket repositories
"
Class {
#name : #IceBitbucketRepositoryType,
#superclass : #IceProviderRepositoryType,
#category : #'Iceberg-Metacello-Integration-RepoTypes'
#name : 'IceBitbucketRepositoryType',
#superclass : 'IceProviderRepositoryType',
#category : 'Iceberg-Metacello-Integration-RepoTypes',
#package : 'Iceberg-Metacello-Integration',
#tag : 'RepoTypes'
}

{ #category : #accessing }
{ #category : 'accessing' }
IceBitbucketRepositoryType class >> type [
^ 'bitbucket'
]
16 changes: 9 additions & 7 deletions Iceberg-Metacello-Integration/IceGitLocalRepositoryType.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@ Metacello new
"
Class {
#name : #IceGitLocalRepositoryType,
#superclass : #IceMetacelloRepositoryType,
#category : #'Iceberg-Metacello-Integration-RepoTypes'
#name : 'IceGitLocalRepositoryType',
#superclass : 'IceMetacelloRepositoryType',
#category : 'Iceberg-Metacello-Integration-RepoTypes',
#package : 'Iceberg-Metacello-Integration',
#tag : 'RepoTypes'
}

{ #category : #accessing }
{ #category : 'accessing' }
IceGitLocalRepositoryType class >> type [
^ 'gitlocal'
]

{ #category : #testing }
{ #category : 'testing' }
IceGitLocalRepositoryType >> isGitRoot: aReference [
^ IceRepositoryCreator isGitRoot: aReference
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGitLocalRepositoryType >> mcRepository [

| repository tuple extractedLocation |
Expand All @@ -57,7 +59,7 @@ IceGitLocalRepositoryType >> mcRepository [
^ repository metacelloAdapter: repository head description.
]

{ #category : #private }
{ #category : 'private' }
IceGitLocalRepositoryType >> splitRootAndSubdirectoryFromLocation [
| root subDir |
(self location beginsWith: (self class type, '://'))
Expand Down
12 changes: 7 additions & 5 deletions Iceberg-Metacello-Integration/IceGitRepositoryType.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ git:https://github.com/user/project.git
git:[email protected]:user/project.git
"
Class {
#name : #IceGitRepositoryType,
#superclass : #IceProviderRepositoryType,
#category : #'Iceberg-Metacello-Integration-RepoTypes'
#name : 'IceGitRepositoryType',
#superclass : 'IceProviderRepositoryType',
#category : 'Iceberg-Metacello-Integration-RepoTypes',
#package : 'Iceberg-Metacello-Integration',
#tag : 'RepoTypes'
}

{ #category : #accessing }
{ #category : 'accessing' }
IceGitRepositoryType class >> type [

^ 'git'
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGitRepositoryType >> mcRepositoryClass [

^ MCGitRemoteRepository
Expand Down
12 changes: 7 additions & 5 deletions Iceberg-Metacello-Integration/IceGithubRepositoryType.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
I resolve Github repositories
"
Class {
#name : #IceGithubRepositoryType,
#superclass : #IceProviderRepositoryType,
#category : #'Iceberg-Metacello-Integration-RepoTypes'
#name : 'IceGithubRepositoryType',
#superclass : 'IceProviderRepositoryType',
#category : 'Iceberg-Metacello-Integration-RepoTypes',
#package : 'Iceberg-Metacello-Integration',
#tag : 'RepoTypes'
}

{ #category : #accessing }
{ #category : 'accessing' }
IceGithubRepositoryType class >> type [
^ 'github'
]

{ #category : #accessing }
{ #category : 'accessing' }
IceGithubRepositoryType >> mcRepository [
| baseRepo |

Expand Down
10 changes: 6 additions & 4 deletions Iceberg-Metacello-Integration/IceGitlabRepositoryType.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
I resolve Gilab repositories
"
Class {
#name : #IceGitlabRepositoryType,
#superclass : #IceProviderRepositoryType,
#category : #'Iceberg-Metacello-Integration-RepoTypes'
#name : 'IceGitlabRepositoryType',
#superclass : 'IceProviderRepositoryType',
#category : 'Iceberg-Metacello-Integration-RepoTypes',
#package : 'Iceberg-Metacello-Integration',
#tag : 'RepoTypes'
}

{ #category : #accessing }
{ #category : 'accessing' }
IceGitlabRepositoryType class >> type [
^ 'gitlab'
]
26 changes: 14 additions & 12 deletions Iceberg-Metacello-Integration/IceMetacelloLoadChoice.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,62 @@ I'm a recorded choice when installing a metacello baseline/configuration.
A choice is created whenever there is a conflict between two project versions (loaded and incomming). Due the nature of Matacello, this choice can be asked several times... A choice keeps track of what user selected to avoid asking him every time.
"
Class {
#name : #IceMetacelloLoadChoice,
#superclass : #Object,
#name : 'IceMetacelloLoadChoice',
#superclass : 'Object',
#instVars : [
'projectName',
'optionA',
'optionB',
'choosen'
],
#category : #'Iceberg-Metacello-Integration-Session'
#category : 'Iceberg-Metacello-Integration-Session',
#package : 'Iceberg-Metacello-Integration',
#tag : 'Session'
}

{ #category : #accessing }
{ #category : 'accessing' }
IceMetacelloLoadChoice >> choosen [
^ choosen
]

{ #category : #accessing }
{ #category : 'accessing' }
IceMetacelloLoadChoice >> choosen: anObject [
choosen := anObject
]

{ #category : #testing }
{ #category : 'testing' }
IceMetacelloLoadChoice >> isChoiceBetween: firstOption and: secondOption [

^ (self optionA = firstOption)
and: [ self optionB = secondOption ]
]

{ #category : #accessing }
{ #category : 'accessing' }
IceMetacelloLoadChoice >> optionA [
^ optionA
]

{ #category : #accessing }
{ #category : 'accessing' }
IceMetacelloLoadChoice >> optionA: anObject [
optionA := anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
IceMetacelloLoadChoice >> optionB [
^ optionB
]

{ #category : #accessing }
{ #category : 'accessing' }
IceMetacelloLoadChoice >> optionB: anObject [
optionB := anObject
]

{ #category : #accessing }
{ #category : 'accessing' }
IceMetacelloLoadChoice >> projectName [
^ projectName
]

{ #category : #accessing }
{ #category : 'accessing' }
IceMetacelloLoadChoice >> projectName: anObject [
projectName := anObject
]
14 changes: 8 additions & 6 deletions Iceberg-Metacello-Integration/IceMetacelloLoadSession.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,30 @@ I will be active during the context of a ""metacello load"" command, and it will
Tipically, I will be used to keep some state needed during the full execution, like a choice of what whas selected when conflicting or upgraded versions acts.
"
Class {
#name : #IceMetacelloLoadSession,
#superclass : #Object,
#name : 'IceMetacelloLoadSession',
#superclass : 'Object',
#instVars : [
'choices'
],
#category : #'Iceberg-Metacello-Integration-Session'
#category : 'Iceberg-Metacello-Integration-Session',
#package : 'Iceberg-Metacello-Integration',
#tag : 'Session'
}

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

super initialize.
choices := Set new
]

{ #category : #accessing }
{ #category : 'accessing' }
IceMetacelloLoadSession >> recordChoice: anIceMetacelloLoadChoice [

^ choices add: anIceMetacelloLoadChoice
]

{ #category : #accessing }
{ #category : 'accessing' }
IceMetacelloLoadSession >> recordChoiceProject: projectName optionA: optionA optionB: optionB ifAbsentAnswer: aBlock [

^ choices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
I'm a dynamic variable to keep a load session.
"
Class {
#name : #IceMetacelloLoadSessionContext,
#superclass : #DynamicVariable,
#category : #'Iceberg-Metacello-Integration-Session'
#name : 'IceMetacelloLoadSessionContext',
#superclass : 'DynamicVariable',
#category : 'Iceberg-Metacello-Integration-Session',
#package : 'Iceberg-Metacello-Integration',
#tag : 'Session'
}
18 changes: 10 additions & 8 deletions Iceberg-Metacello-Integration/IceMetacelloPharoPlatform.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,33 @@
I'm a class to add support for iceberg to metacello.
"
Class {
#name : #IceMetacelloPharoPlatform,
#superclass : #MetacelloPharoPlatform,
#category : #'Iceberg-Metacello-Integration-Platform'
#name : 'IceMetacelloPharoPlatform',
#superclass : 'MetacelloPlatform',
#category : 'Iceberg-Metacello-Integration-Platform',
#package : 'Iceberg-Metacello-Integration',
#tag : 'Platform'
}

{ #category : #'class initialization' }
{ #category : 'class initialization' }
IceMetacelloPharoPlatform class >> initialize [
self select
]

{ #category : #testing }
{ #category : 'testing' }
IceMetacelloPharoPlatform >> canHandleType: type [
^ Iceberg enableMetacelloIntegration
and: [ IceMetacelloRepositoryType canHandleType: type ]
]

{ #category : #'repository creation' }
{ #category : 'repository creation' }
IceMetacelloPharoPlatform >> createRepository: aRepositorySpec [
(self canHandleType: aRepositorySpec type)
ifTrue: [ ^ Iceberg mcRepositoryFor: aRepositorySpec description ].

^ super createRepository: aRepositorySpec
]

{ #category : #'repository creation' }
{ #category : 'repository creation' }
IceMetacelloPharoPlatform >> extractTypeFromDescription: description [

(description beginsWith: 'ftp://') ifTrue: [ ^'ftp' ].
Expand All @@ -36,7 +38,7 @@ IceMetacelloPharoPlatform >> extractTypeFromDescription: description [
^ super extractTypeFromDescription: description
]

{ #category : #enumerating }
{ #category : 'enumerating' }
IceMetacelloPharoPlatform >> withMetacelloLoadSessionDo: aBlock [
| context |

Expand Down
Loading

0 comments on commit 48291cd

Please sign in to comment.