diff --git a/BaselineOfIceberg.package/.filetree b/BaselineOfIceberg.package/.filetree index 57a6797370..8998102c27 100644 --- a/BaselineOfIceberg.package/.filetree +++ b/BaselineOfIceberg.package/.filetree @@ -1,5 +1,4 @@ { - "separateMethodMetaAndSource" : false, "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file + "separateMethodMetaAndSource" : false, + "useCypressPropertiesFile" : true } diff --git a/BaselineOfIceberg.package/BaselineOfIceberg.class/instance/baseline..st b/BaselineOfIceberg.package/BaselineOfIceberg.class/instance/baseline..st index 11a30268a0..b2789c7487 100644 --- a/BaselineOfIceberg.package/BaselineOfIceberg.class/instance/baseline..st +++ b/BaselineOfIceberg.package/BaselineOfIceberg.class/instance/baseline..st @@ -30,15 +30,16 @@ baseline: spec with: [ spec requires: #('ProcessWrapper') ] ]; package: 'Iceberg'; - package: 'Iceberg-Metacello-Integration' with: [ spec requires: #(Iceberg)]; - package: 'Iceberg-UI' with: [ spec requires: #(Iceberg) ]; - package: 'Iceberg-Tests' with: [ spec requires: #(Iceberg 'Iceberg-GitCommand') ]; + package: 'Iceberg-Plugin'; + package: 'Iceberg-Metacello-Integration' with: [ spec requires: #('Iceberg')]; + package: 'Iceberg-UI' with: [ spec requires: #('Iceberg' 'Iceberg-Plugin') ]; + package: 'Iceberg-Tests' with: [ spec requires: #('Iceberg' 'Iceberg-GitCommand') ]; package: 'Iceberg-UI-Tests' with: [ spec requires: #('Iceberg-UI' 'Iceberg-Tests')]; - package: 'Iceberg-GitFileTree' with: [ spec requires: #(Iceberg FileTree) ]; + package: 'Iceberg-GitFileTree' with: [ spec requires: #('Iceberg' 'FileTree') ]; package: 'Iceberg-GitFileTree-Tests' with: [ spec requires: #('Iceberg-GitFileTree' 'Iceberg-Tests') ]; - package: 'Iceberg-Libgit' with: [ spec requires: #(Iceberg LibGit) ]; + package: 'Iceberg-Libgit' with: [ spec requires: #('Iceberg' 'LibGit') ]; - group: 'minimal' with: #(Iceberg 'Iceberg-Libgit'); + group: 'minimal' with: #('Iceberg' 'Iceberg-Libgit'); group: 'default' with: #(minimal 'Iceberg-Metacello-Integration' 'Iceberg-UI'); group: 'allTests' with: #('Iceberg-Tests' 'LibGit-Tests' 'Iceberg-GitFileTree-Tests' 'Iceberg-UI-Tests' ); group: 'development' with: #(default 'Iceberg-GitFileTree' allTests) diff --git a/BaselineOfIceberg.package/BaselineOfIceberg.class/methodProperties.json b/BaselineOfIceberg.package/BaselineOfIceberg.class/methodProperties.json deleted file mode 100644 index d5e13e7dfa..0000000000 --- a/BaselineOfIceberg.package/BaselineOfIceberg.class/methodProperties.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "instance" : { - "baseline:" : "NicoPasserini 12/8/2016 12:00", - "customProjectAttributes" : "NicoPasserini 12/2/2016 17:12" } } diff --git a/BaselineOfIceberg.package/BaselineOfIceberg.class/properties.json b/BaselineOfIceberg.package/BaselineOfIceberg.class/properties.json index 82b4fa75ae..277600fafb 100644 --- a/BaselineOfIceberg.package/BaselineOfIceberg.class/properties.json +++ b/BaselineOfIceberg.package/BaselineOfIceberg.class/properties.json @@ -1,11 +1,14 @@ { - "commentStamp" : "", - "super" : "BaselineOf", "category" : "BaselineOfIceberg", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], "name" : "BaselineOfIceberg", - "type" : "normal" -} \ No newline at end of file + "pools" : [ + ], + "super" : "BaselineOf", + "type" : "normal" } diff --git a/BaselineOfIceberg.package/properties.json b/BaselineOfIceberg.package/properties.json index 6f31cf5a2e..f037444a7c 100644 --- a/BaselineOfIceberg.package/properties.json +++ b/BaselineOfIceberg.package/properties.json @@ -1 +1,2 @@ -{ } \ No newline at end of file +{ + } diff --git a/Iceberg-Plugin.package/.filetree b/Iceberg-Plugin.package/.filetree new file mode 100644 index 0000000000..8998102c27 --- /dev/null +++ b/Iceberg-Plugin.package/.filetree @@ -0,0 +1,4 @@ +{ + "noMethodMetaData" : true, + "separateMethodMetaAndSource" : false, + "useCypressPropertiesFile" : true } diff --git a/Iceberg-Plugin.package/IceGitHubAPI.class/README.md b/Iceberg-Plugin.package/IceGitHubAPI.class/README.md new file mode 100644 index 0000000000..5379eb0c77 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubAPI.class/README.md @@ -0,0 +1,2 @@ +I represent an access point to the GitHub API. +I provide different high level abstractions to interact with GitHub, following the speciphications you can find here: https://developer.github.com/v3/ \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubAPI.class/instance/credentials..st b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/credentials..st new file mode 100644 index 0000000000..dacc410c57 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/credentials..st @@ -0,0 +1,3 @@ +accessing +credentials: anObject + credentials := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubAPI.class/instance/credentials.st b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/credentials.st new file mode 100644 index 0000000000..848618a3db --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/credentials.st @@ -0,0 +1,3 @@ +accessing +credentials + ^ credentials \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubAPI.class/instance/get..st b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/get..st new file mode 100644 index 0000000000..107496248d --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/get..st @@ -0,0 +1,6 @@ +private requesting +get: aString + ^ self withResponseValidationDo: [ + (self newRequestTo: aString) + get; + response ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubAPI.class/instance/newRequestTo..st b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/newRequestTo..st new file mode 100644 index 0000000000..ddbf3d1184 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/newRequestTo..st @@ -0,0 +1,7 @@ +private factory +newRequestTo: aString + ^ ZnClient new + username: self credentials username password: self credentials password; + headerAt: 'Accept' put: 'application/vnd.github.v3+json'; + url: 'https://api.github.com/', aString; + yourself \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubAPI.class/instance/post.with..st b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/post.with..st new file mode 100644 index 0000000000..b7f8425627 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/post.with..st @@ -0,0 +1,7 @@ +private requesting +post: aString with: aBlock + ^ self withResponseValidationDo: [ + (self newRequestTo: aString) + in: aBlock; + post; + response ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubAPI.class/instance/postPullRequestTo.project.data..st b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/postPullRequestTo.project.data..st new file mode 100644 index 0000000000..9ceb3a9c50 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/postPullRequestTo.project.data..st @@ -0,0 +1,8 @@ +requesting +postPullRequestTo: owner project: projectName data: aDictionary + ^ self + post: 'repos/', owner, '/', projectName, '/pulls' + with: [ :client | + client + entity: (ZnEntity text: (STON toJsonString: aDictionary)); + contentType: ZnMimeType applicationJson ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubAPI.class/instance/requestBranchesFrom.project..st b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/requestBranchesFrom.project..st new file mode 100644 index 0000000000..865e5ed1f4 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/requestBranchesFrom.project..st @@ -0,0 +1,3 @@ +requesting +requestBranchesFrom: owner project: projectName + ^ self get: 'repos/', owner,'/', projectName, '/branches' \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubAPI.class/instance/requestRepositoryFrom.project..st b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/requestRepositoryFrom.project..st new file mode 100644 index 0000000000..fdabd5008a --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/requestRepositoryFrom.project..st @@ -0,0 +1,3 @@ +requesting +requestRepositoryFrom: owner project: projectName + ^ self get: 'repos/', owner,'/', projectName \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubAPI.class/instance/withResponseValidationDo..st b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/withResponseValidationDo..st new file mode 100644 index 0000000000..1e71b665c8 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubAPI.class/instance/withResponseValidationDo..st @@ -0,0 +1,8 @@ +private requesting +withResponseValidationDo: aBlock + | response | + + response := aBlock value. + response isSuccess + ifFalse: [ IceGitHubError signalFor: response ]. + ^ response contents \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubAPI.class/properties.json b/Iceberg-Plugin.package/IceGitHubAPI.class/properties.json new file mode 100644 index 0000000000..0a1ce93532 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubAPI.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "Iceberg-Plugin-GitHub", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + "credentials" ], + "name" : "IceGitHubAPI", + "pools" : [ + ], + "super" : "Object", + "type" : "normal" } diff --git a/Iceberg-Plugin.package/IceGitHubBadCredentialsError.class/README.md b/Iceberg-Plugin.package/IceGitHubBadCredentialsError.class/README.md new file mode 100644 index 0000000000..049950593c --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubBadCredentialsError.class/README.md @@ -0,0 +1 @@ +I'm an error that happens when credentials are bad. \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubBadCredentialsError.class/class/isAppropriateFor..st b/Iceberg-Plugin.package/IceGitHubBadCredentialsError.class/class/isAppropriateFor..st new file mode 100644 index 0000000000..7e2958b78d --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubBadCredentialsError.class/class/isAppropriateFor..st @@ -0,0 +1,3 @@ +testing +isAppropriateFor: aResponse + ^ aResponse status = 401 \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubBadCredentialsError.class/instance/messageBody.st b/Iceberg-Plugin.package/IceGitHubBadCredentialsError.class/instance/messageBody.st new file mode 100644 index 0000000000..940158d137 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubBadCredentialsError.class/instance/messageBody.st @@ -0,0 +1,3 @@ +accessing +messageBody + ^ 'Credentials provided are wrong' \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubBadCredentialsError.class/properties.json b/Iceberg-Plugin.package/IceGitHubBadCredentialsError.class/properties.json new file mode 100644 index 0000000000..0ca5f0da28 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubBadCredentialsError.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "Iceberg-Plugin-GitHub", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "IceGitHubBadCredentialsError", + "pools" : [ + ], + "super" : "IceGitHubError", + "type" : "normal" } diff --git a/Iceberg-Plugin.package/IceGitHubError.class/README.md b/Iceberg-Plugin.package/IceGitHubError.class/README.md new file mode 100644 index 0000000000..32a770eaf1 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/README.md @@ -0,0 +1 @@ +I'm an error that happens when something fails when performing a GitHub action. \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/class/errorClassFor..st b/Iceberg-Plugin.package/IceGitHubError.class/class/errorClassFor..st new file mode 100644 index 0000000000..44e73e8439 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/class/errorClassFor..st @@ -0,0 +1,5 @@ +private +errorClassFor: aResponse + ^ self allSubclasses + detect: [ :each | each isAppropriateFor: aResponse ] + ifNone: [ self ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/class/for..st b/Iceberg-Plugin.package/IceGitHubError.class/class/for..st new file mode 100644 index 0000000000..627d8fc9c3 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/class/for..st @@ -0,0 +1,5 @@ +instance creation +for: aResponse + ^ (self errorClassFor: aResponse) new + response: aResponse; + yourself \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/class/isAppropriateFor..st b/Iceberg-Plugin.package/IceGitHubError.class/class/isAppropriateFor..st new file mode 100644 index 0000000000..57622fb30c --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/class/isAppropriateFor..st @@ -0,0 +1,3 @@ +testing +isAppropriateFor: aResponse + ^ false \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/class/signalFor..st b/Iceberg-Plugin.package/IceGitHubError.class/class/signalFor..st new file mode 100644 index 0000000000..653b1a4faf --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/class/signalFor..st @@ -0,0 +1,3 @@ +instance creation +signalFor: aResponse + ^ (self for: aResponse) signal \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/instance/code.st b/Iceberg-Plugin.package/IceGitHubError.class/instance/code.st new file mode 100644 index 0000000000..3a56d9da70 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/instance/code.st @@ -0,0 +1,3 @@ +accessing +code + ^ self response status \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/instance/contents.st b/Iceberg-Plugin.package/IceGitHubError.class/instance/contents.st new file mode 100644 index 0000000000..b6371cfc1a --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/instance/contents.st @@ -0,0 +1,3 @@ +accessing +contents + ^ self response contents \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/instance/customError..st b/Iceberg-Plugin.package/IceGitHubError.class/instance/customError..st new file mode 100644 index 0000000000..12dd2a8001 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/instance/customError..st @@ -0,0 +1,4 @@ +private +customError: aDictionary + ^ aDictionary at: #message + \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/instance/errorToString..st b/Iceberg-Plugin.package/IceGitHubError.class/instance/errorToString..st new file mode 100644 index 0000000000..c59dd271c4 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/instance/errorToString..st @@ -0,0 +1,6 @@ +private +errorToString: aDictionary + (aDictionary at: #code) = 'custom' ifTrue: [ ^ self customError: aDictionary ]. + (aDictionary at: #code) = 'invalid' ifTrue: [ ^ self invalidError: aDictionary ]. + + ^ self unknownError: aDictionary \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/instance/invalidError..st b/Iceberg-Plugin.package/IceGitHubError.class/instance/invalidError..st new file mode 100644 index 0000000000..581715be43 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/instance/invalidError..st @@ -0,0 +1,5 @@ +private +invalidError: aDictionary + ^ 'Invalid field: ', (aDictionary at: #field) + + \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/instance/jsonContents.st b/Iceberg-Plugin.package/IceGitHubError.class/instance/jsonContents.st new file mode 100644 index 0000000000..244ba6054d --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/instance/jsonContents.st @@ -0,0 +1,4 @@ +accessing +jsonContents + ^ jsonContents ifNil: [ jsonContents := STON fromString: self contents ] + \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/instance/messageBody.st b/Iceberg-Plugin.package/IceGitHubError.class/instance/messageBody.st new file mode 100644 index 0000000000..1ae47614f6 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/instance/messageBody.st @@ -0,0 +1,8 @@ +accessing +messageBody + | errors | + errors := self jsonContents at: #errors ifAbsent: [ ^ '' ]. + ^ String streamContents: [ :stream | + errors + do: [ :each | stream << (self errorToString: each) ] + separatedBy: [ stream cr ] ]. \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/instance/messageText.st b/Iceberg-Plugin.package/IceGitHubError.class/instance/messageText.st new file mode 100644 index 0000000000..a433b52c03 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/instance/messageText.st @@ -0,0 +1,3 @@ +accessing +messageText + ^ self jsonContents at: #message \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/instance/response..st b/Iceberg-Plugin.package/IceGitHubError.class/instance/response..st new file mode 100644 index 0000000000..714bc54225 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/instance/response..st @@ -0,0 +1,3 @@ +accessing +response: anObject + response := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/instance/response.st b/Iceberg-Plugin.package/IceGitHubError.class/instance/response.st new file mode 100644 index 0000000000..d7f1df5c25 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/instance/response.st @@ -0,0 +1,3 @@ +accessing +response + ^ response \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/instance/unknownError..st b/Iceberg-Plugin.package/IceGitHubError.class/instance/unknownError..st new file mode 100644 index 0000000000..e2a21be9d2 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/instance/unknownError..st @@ -0,0 +1,6 @@ +private +unknownError: aDictionary + ^ String streamContents: [ :stream | + (aDictionary associations sorted: [ :a :b | a key < b key ]) + do: [ :each | stream << each key << ': ' << each value ] + separatedBy: [ stream << ', ' ] ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubError.class/properties.json b/Iceberg-Plugin.package/IceGitHubError.class/properties.json new file mode 100644 index 0000000000..485de6d0ea --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubError.class/properties.json @@ -0,0 +1,15 @@ +{ + "category" : "Iceberg-Plugin-GitHub", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "EstebanLorenzano 2/1/2017 17:15", + "instvars" : [ + "response", + "jsonContents" ], + "name" : "IceGitHubError", + "pools" : [ + ], + "super" : "Error", + "type" : "normal" } diff --git a/Iceberg-Plugin.package/IceGitHubGenericError.class/README.md b/Iceberg-Plugin.package/IceGitHubGenericError.class/README.md new file mode 100644 index 0000000000..a4c092dad0 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubGenericError.class/README.md @@ -0,0 +1 @@ +I'm an error that happens when something went wrong on GitHub API operations. \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubGenericError.class/class/isAppropriateFor..st b/Iceberg-Plugin.package/IceGitHubGenericError.class/class/isAppropriateFor..st new file mode 100644 index 0000000000..7fb692d732 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubGenericError.class/class/isAppropriateFor..st @@ -0,0 +1,3 @@ +testing +isAppropriateFor: aResponse + ^ aResponse status = 422 \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubGenericError.class/properties.json b/Iceberg-Plugin.package/IceGitHubGenericError.class/properties.json new file mode 100644 index 0000000000..40909fc3fb --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubGenericError.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "Iceberg-Plugin-GitHub", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "IceGitHubGenericError", + "pools" : [ + ], + "super" : "IceGitHubError", + "type" : "normal" } diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/README.md b/Iceberg-Plugin.package/IceGitHubPullRequest.class/README.md new file mode 100644 index 0000000000..6f48f08c04 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/README.md @@ -0,0 +1,2 @@ +I am a pull request. +I can be sent using ==#sendWithCredentials:== protocol. \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/baseBranchName..st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/baseBranchName..st new file mode 100644 index 0000000000..365e8e048e --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/baseBranchName..st @@ -0,0 +1,3 @@ +accessing +baseBranchName: anObject + baseBranchName := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/baseBranchName.st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/baseBranchName.st new file mode 100644 index 0000000000..7aa86f5f0a --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/baseBranchName.st @@ -0,0 +1,3 @@ +accessing +baseBranchName + ^ baseBranchName \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/baseRemote..st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/baseRemote..st new file mode 100644 index 0000000000..b20e872a2d --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/baseRemote..st @@ -0,0 +1,3 @@ +accessing +baseRemote: anObject + baseRemote := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/baseRemote.st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/baseRemote.st new file mode 100644 index 0000000000..523ba4c340 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/baseRemote.st @@ -0,0 +1,3 @@ +accessing +baseRemote + ^ baseRemote \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/body..st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/body..st new file mode 100644 index 0000000000..7bb57622e6 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/body..st @@ -0,0 +1,3 @@ +accessing +body: anObject + body := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/body.st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/body.st new file mode 100644 index 0000000000..38c957815a --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/body.st @@ -0,0 +1,3 @@ +accessing +body + ^ body \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/credentials..st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/credentials..st new file mode 100644 index 0000000000..dacc410c57 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/credentials..st @@ -0,0 +1,3 @@ +accessing +credentials: anObject + credentials := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/credentials.st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/credentials.st new file mode 100644 index 0000000000..848618a3db --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/credentials.st @@ -0,0 +1,3 @@ +accessing +credentials + ^ credentials \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/headBranchName..st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/headBranchName..st new file mode 100644 index 0000000000..423688d7b3 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/headBranchName..st @@ -0,0 +1,3 @@ +accessing +headBranchName: anObject + headBranchName := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/headBranchName.st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/headBranchName.st new file mode 100644 index 0000000000..6677c275e1 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/headBranchName.st @@ -0,0 +1,3 @@ +accessing +headBranchName + ^ headBranchName \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/headRemote..st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/headRemote..st new file mode 100644 index 0000000000..7cf361dbe7 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/headRemote..st @@ -0,0 +1,3 @@ +accessing +headRemote: anObject + headRemote := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/headRemote.st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/headRemote.st new file mode 100644 index 0000000000..ab2ef9090d --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/headRemote.st @@ -0,0 +1,3 @@ +accessing +headRemote + ^ headRemote \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/send.st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/send.st new file mode 100644 index 0000000000..19fc2a7c36 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/send.st @@ -0,0 +1,17 @@ +actions +send + | pullRequestData | + + pullRequestData := { + 'title' -> self title. + 'head' -> (self headRemote owner, ':', self headBranchName). + 'base' -> self baseBranchName. + 'body' -> self body. + } asDictionary. + + IceGitHubAPI new + credentials: self credentials; + postPullRequestTo: self baseRemote owner + project: self baseRemote projectName + data: pullRequestData + \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/title..st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/title..st new file mode 100644 index 0000000000..67bb44d77f --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/title..st @@ -0,0 +1,3 @@ +accessing +title: anObject + title := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/title.st b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/title.st new file mode 100644 index 0000000000..fc1a896a1d --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/instance/title.st @@ -0,0 +1,3 @@ +accessing +title + ^ title \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequest.class/properties.json b/Iceberg-Plugin.package/IceGitHubPullRequest.class/properties.json new file mode 100644 index 0000000000..5e27718a0b --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequest.class/properties.json @@ -0,0 +1,20 @@ +{ + "category" : "Iceberg-Plugin-GitHub", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + "credentials", + "title", + "baseRemote", + "headRemote", + "baseBranchName", + "headBranchName", + "body" ], + "name" : "IceGitHubPullRequest", + "pools" : [ + ], + "super" : "Object", + "type" : "normal" } diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/README.md b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/README.md new file mode 100644 index 0000000000..a64f198300 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/README.md @@ -0,0 +1 @@ +I'm a dialog to ask for data relevant to create a pull request. \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/class/defaultSpec.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/class/defaultSpec.st new file mode 100644 index 0000000000..93f2aeeef5 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/class/defaultSpec.st @@ -0,0 +1,27 @@ +specs +defaultSpec + + + ^ SpecLayout composed + newColumn: [ :col | + col + newRow: [:row | row add: #titleLabel width: 80; add: #titlePanel ] height: 25; + newRow: [:row | + row + newColumn: #headLabel width: 80; + newColumn: [ :col2 | + col2 newRow: [ :row2 | + row2 + add: #headForkList; + add: #headBranchList ] ] ] height: 25; + newRow: [:row | + row + newColumn: #baseLabel width: 80; + newColumn: [ :col2 | + col2 newRow: [ :row2 | + row2 + add: #baseForkList; + add: #baseBranchList ] ] ] height: 25; + newRow: [:row | row add: #bodyLabel width: 80; add: #bodyPanel ]; + add: #addButton height: self buttonHeight ]; + yourself \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/class/for..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/class/for..st new file mode 100644 index 0000000000..832b7bb8b1 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/class/for..st @@ -0,0 +1,5 @@ +instance creation +for: aRepository + ^ self basicNew + initializeRepository: aRepository; + yourself \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/class/new.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/class/new.st new file mode 100644 index 0000000000..fff5b20bea --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/class/new.st @@ -0,0 +1,3 @@ +instance creation +new + self error: 'Use #repository:' \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/class/title.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/class/title.st new file mode 100644 index 0000000000..8611d2b684 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/class/title.st @@ -0,0 +1,3 @@ +specs +title + ^ 'New pull request' \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/accept.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/accept.st new file mode 100644 index 0000000000..a2caeb3016 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/accept.st @@ -0,0 +1,13 @@ +actions +accept + | title | + + title := self titlePanel text trim. + title ifEmpty: [ + UIManager default alert: 'You need to specify a title for the pull request.' title: 'Error'. + ^ self ]. + + acceptBlock ifNotNil: [ + acceptBlock cull: self createPullRequest ]. + + self window delete. \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/addButton..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/addButton..st new file mode 100644 index 0000000000..3fc9e53279 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/addButton..st @@ -0,0 +1,3 @@ +accessing ui +addButton: anObject + addButton := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/addButton.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/addButton.st new file mode 100644 index 0000000000..3d9dad4d72 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/addButton.st @@ -0,0 +1,3 @@ +accessing ui +addButton + ^ addButton \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/availableBranchNames.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/availableBranchNames.st new file mode 100644 index 0000000000..674b732bb9 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/availableBranchNames.st @@ -0,0 +1,3 @@ +accessing +availableBranchNames + ^ availableBranchNames ifNil: [ availableBranchNames := self obtainAvailableBranchNames ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/availableRemotes.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/availableRemotes.st new file mode 100644 index 0000000000..a5356ff015 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/availableRemotes.st @@ -0,0 +1,4 @@ +accessing +availableRemotes + "retrieves available remotes to perform the PR" + ^ availableRemotes ifNil: [ availableRemotes := self obtainAvailableRemotes ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseBranchList..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseBranchList..st new file mode 100644 index 0000000000..8a66c2d18e --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseBranchList..st @@ -0,0 +1,3 @@ +accessing ui +baseBranchList: anObject + baseBranchList := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseBranchList.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseBranchList.st new file mode 100644 index 0000000000..0400e3d90d --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseBranchList.st @@ -0,0 +1,3 @@ +accessing ui +baseBranchList + ^ baseBranchList \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseBranchNames.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseBranchNames.st new file mode 100644 index 0000000000..4ff9ca6a61 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseBranchNames.st @@ -0,0 +1,3 @@ +private +baseBranchNames + ^ self baseBranches collect: [ :each | each at: #name ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseBranches.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseBranches.st new file mode 100644 index 0000000000..abd6660d65 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseBranches.st @@ -0,0 +1,4 @@ +private +baseBranches + ^ baseBranches ifNil: [ + baseBranches := STON fromString: self requestBaseBranches ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseDefaultBranchName.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseDefaultBranchName.st new file mode 100644 index 0000000000..b2e28e5029 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseDefaultBranchName.st @@ -0,0 +1,3 @@ +accessing +baseDefaultBranchName + ^ self gitBase at: #'default_branch' \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseForkList..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseForkList..st new file mode 100644 index 0000000000..ac83e9b6d8 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseForkList..st @@ -0,0 +1,3 @@ +accessing ui +baseForkList: anObject + baseForkList := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseForkList.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseForkList.st new file mode 100644 index 0000000000..54e8a71693 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseForkList.st @@ -0,0 +1,3 @@ +accessing ui +baseForkList + ^ baseForkList \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseLabel..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseLabel..st new file mode 100644 index 0000000000..f80f5ebba1 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseLabel..st @@ -0,0 +1,3 @@ +accessing ui +baseLabel: anObject + baseLabel := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseLabel.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseLabel.st new file mode 100644 index 0000000000..eb1565e97c --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseLabel.st @@ -0,0 +1,3 @@ +accessing ui +baseLabel + ^ baseLabel \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseRemote.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseRemote.st new file mode 100644 index 0000000000..debac99bfd --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/baseRemote.st @@ -0,0 +1,5 @@ +accessing +baseRemote + "This is the 'base' remote (the place where the repository is forked). This is used to + suggest fork PR destination (base)" + ^ baseRemote ifNil: [ baseRemote := self obtainBaseRemote ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/bodyLabel..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/bodyLabel..st new file mode 100644 index 0000000000..37aa481471 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/bodyLabel..st @@ -0,0 +1,3 @@ +accessing ui +bodyLabel: anObject + bodyLabel := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/bodyLabel.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/bodyLabel.st new file mode 100644 index 0000000000..1cc61fd299 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/bodyLabel.st @@ -0,0 +1,3 @@ +accessing ui +bodyLabel + ^ bodyLabel \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/bodyPanel..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/bodyPanel..st new file mode 100644 index 0000000000..822e588378 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/bodyPanel..st @@ -0,0 +1,3 @@ +accessing ui +bodyPanel: anObject + bodyPanel := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/bodyPanel.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/bodyPanel.st new file mode 100644 index 0000000000..f498151884 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/bodyPanel.st @@ -0,0 +1,3 @@ +accessing ui +bodyPanel + ^ bodyPanel \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/createPullRequest.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/createPullRequest.st new file mode 100644 index 0000000000..0906076c27 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/createPullRequest.st @@ -0,0 +1,11 @@ +private +createPullRequest + ^ IceGitHubPullRequest new + credentials: self credentials; + title: self titlePanel text trim; + headRemote: self headForkList selectedItem; + headBranchName: self headBranchList selectedItem; + baseRemote: self baseForkList selectedItem; + baseBranchName: self baseBranchList selectedItem; + body: self bodyPanel text asString trim; + yourself \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/credentials.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/credentials.st new file mode 100644 index 0000000000..2088e54cd5 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/credentials.st @@ -0,0 +1,3 @@ +accessing +credentials + ^ credentials ifNil: [ credentials := self obtainCredentials ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/currentBranch.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/currentBranch.st new file mode 100644 index 0000000000..d4fd470d3b --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/currentBranch.st @@ -0,0 +1,3 @@ +accessing +currentBranch + ^ self repository currentBranch \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/defaultBaseBranchName.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/defaultBaseBranchName.st new file mode 100644 index 0000000000..1107016531 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/defaultBaseBranchName.st @@ -0,0 +1,6 @@ +accessing +defaultBaseBranchName + self hasParent ifFalse: [ ^ self baseDefaultBranchName ]. + ^ self baseBranchNames + detect: [ :each | each = self currentBranch basename ] + ifNone: [ self baseDefaultBranchName ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/defaultHeadBranchName.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/defaultHeadBranchName.st new file mode 100644 index 0000000000..45a04b82dc --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/defaultHeadBranchName.st @@ -0,0 +1,3 @@ +accessing +defaultHeadBranchName + ^ self currentBranch basename \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/gitBase.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/gitBase.st new file mode 100644 index 0000000000..60a0348d3d --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/gitBase.st @@ -0,0 +1,6 @@ +private +gitBase + | info | + ^ (info := self gitRepositoryInfo) + at: #parent + ifAbsent: [ info ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/gitRepositoryInfo.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/gitRepositoryInfo.st new file mode 100644 index 0000000000..712da608d8 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/gitRepositoryInfo.st @@ -0,0 +1,4 @@ +private +gitRepositoryInfo + ^ gitRepositoryInfo ifNil: [ + gitRepositoryInfo := STON fromString: self requestGitRepositoryInfo ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/hasParent.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/hasParent.st new file mode 100644 index 0000000000..2770574835 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/hasParent.st @@ -0,0 +1,3 @@ +private +hasParent + ^ self gitRepositoryInfo includesKey: #parent \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headBranchList..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headBranchList..st new file mode 100644 index 0000000000..e8d7f97519 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headBranchList..st @@ -0,0 +1,3 @@ +accessing ui +headBranchList: anObject + headBranchList := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headBranchList.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headBranchList.st new file mode 100644 index 0000000000..003a60340c --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headBranchList.st @@ -0,0 +1,3 @@ +accessing ui +headBranchList + ^ headBranchList \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headForkList..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headForkList..st new file mode 100644 index 0000000000..e6b73c2f0c --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headForkList..st @@ -0,0 +1,3 @@ +accessing ui +headForkList: anObject + headForkList := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headForkList.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headForkList.st new file mode 100644 index 0000000000..1abe31fb8f --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headForkList.st @@ -0,0 +1,3 @@ +accessing ui +headForkList + ^ headForkList \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headLabel..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headLabel..st new file mode 100644 index 0000000000..553384cf10 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headLabel..st @@ -0,0 +1,3 @@ +accessing ui +headLabel: anObject + headLabel := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headLabel.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headLabel.st new file mode 100644 index 0000000000..64e97d71de --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/headLabel.st @@ -0,0 +1,3 @@ +accessing ui +headLabel + ^ headLabel \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/initialExtent.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/initialExtent.st new file mode 100644 index 0000000000..f9a68abe38 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/initialExtent.st @@ -0,0 +1,3 @@ +api +initialExtent + ^ 500@300 \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/initializePresenter.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/initializePresenter.st new file mode 100644 index 0000000000..10fe2dc74b --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/initializePresenter.st @@ -0,0 +1,20 @@ +initialization +initializePresenter + super initializePresenter. + self titlePanel text: self currentBranch basename. + self headForkList + items: self availableRemotes; + displayBlock: [ :each | each owner, '/', each projectName ]; + setSelectedItem: self repository pushRemote. + self headBranchList + items: self availableBranchNames; + displayBlock: [ :each | each ]; + setSelectedItem: self defaultHeadBranchName. + self baseForkList + items: self availableRemotes; + displayBlock: [ :each | each owner, '/', each projectName ]; + setSelectedItem: self baseRemote. + self baseBranchList + items: self availableBranchNames; + displayBlock: [ :each | each ]; + setSelectedItem: self defaultBaseBranchName \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/initializeRepository..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/initializeRepository..st new file mode 100644 index 0000000000..4e6ac5961f --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/initializeRepository..st @@ -0,0 +1,4 @@ +initialization +initializeRepository: aRepository + repository := aRepository. + self initialize \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/initializeWidgets.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/initializeWidgets.st new file mode 100644 index 0000000000..567f5aebea --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/initializeWidgets.st @@ -0,0 +1,29 @@ +initialization +initializeWidgets + titleLabel := self newLabel. + titlePanel := self newTextInput autoAccept: true. + headLabel := self newLabel. + headForkList := self newDropList. + headBranchList := self newDropList. + baseLabel := self newLabel. + baseForkList := self newDropList. + baseBranchList := self newDropList. + bodyLabel := self newLabel. + bodyPanel := self newText autoAccept: true. + addButton := self newButton. + + titleLabel label: 'Title'. + headLabel label: 'From (Head)'. + baseLabel label: 'To (Base)'. + bodyLabel label: 'Comment'. + addButton label: 'Create pull request'. + addButton action: [ self accept ]. + + self focusOrder + add: titlePanel; + add: headForkList; + add: headBranchList; + add: baseForkList; + add: baseBranchList; + add: bodyPanel; + add: addButton \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/obtainAvailableBranchNames.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/obtainAvailableBranchNames.st new file mode 100644 index 0000000000..2639ba6065 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/obtainAvailableBranchNames.st @@ -0,0 +1,8 @@ +private +obtainAvailableBranchNames + ^ ((self repository allBranches + collect: #basename as: Set) + addAll: self baseBranchNames; + asArray) + sort. + \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/obtainAvailableRemotes.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/obtainAvailableRemotes.st new file mode 100644 index 0000000000..234ab1c01e --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/obtainAvailableRemotes.st @@ -0,0 +1,8 @@ +private +obtainAvailableRemotes + | remotes | + + remotes := self repository remotes. + (remotes includes: self baseRemote) + ifFalse: [ remotes := remotes copyWith: self baseRemote ]. + ^ remotes diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/obtainBaseRemote.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/obtainBaseRemote.st new file mode 100644 index 0000000000..b28819a380 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/obtainBaseRemote.st @@ -0,0 +1,5 @@ +private +obtainBaseRemote + | base | + base := self gitBase. + ^ IceRemote url: ((base at: #'git_url') copyReplaceAll: 'git://' with: 'https://') \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/obtainCredentials.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/obtainCredentials.st new file mode 100644 index 0000000000..51e685db69 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/obtainCredentials.st @@ -0,0 +1,9 @@ +private +obtainCredentials + | newCredentials provider | + + provider := IceCredentialsProvider default. + newCredentials := IcePlaintextCredentials new. + IceCredentialsProvider default providePlaintextCredentialsTo: newCredentials. + ^ newCredentials + diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/onAccept..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/onAccept..st new file mode 100644 index 0000000000..eec240e707 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/onAccept..st @@ -0,0 +1,3 @@ +events +onAccept: aBlock + acceptBlock := aBlock \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/repository.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/repository.st new file mode 100644 index 0000000000..5be9763862 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/repository.st @@ -0,0 +1,3 @@ +accessing +repository + ^ repository \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/requestBaseBranches.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/requestBaseBranches.st new file mode 100644 index 0000000000..270c9a77d4 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/requestBaseBranches.st @@ -0,0 +1,5 @@ +private request +requestBaseBranches + ^ IceGitHubAPI new + credentials: self credentials; + requestBranchesFrom: self baseRemote owner project: self baseRemote projectName \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/requestGitRepositoryInfo.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/requestGitRepositoryInfo.st new file mode 100644 index 0000000000..9a2286b797 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/requestGitRepositoryInfo.st @@ -0,0 +1,7 @@ +private request +requestGitRepositoryInfo + | remote | + remote := self repository pushRemote. + ^ IceGitHubAPI new + credentials: self credentials; + requestRepositoryFrom: remote owner project: remote projectName diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/titleLabel..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/titleLabel..st new file mode 100644 index 0000000000..3fff719343 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/titleLabel..st @@ -0,0 +1,3 @@ +accessing ui +titleLabel: anObject + titleLabel := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/titleLabel.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/titleLabel.st new file mode 100644 index 0000000000..a06fd05d1f --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/titleLabel.st @@ -0,0 +1,3 @@ +accessing ui +titleLabel + ^ titleLabel \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/titlePanel..st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/titlePanel..st new file mode 100644 index 0000000000..3f4ff8e24b --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/titlePanel..st @@ -0,0 +1,3 @@ +accessing ui +titlePanel: anObject + titlePanel := anObject \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/titlePanel.st b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/titlePanel.st new file mode 100644 index 0000000000..2dd88fa10c --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/instance/titlePanel.st @@ -0,0 +1,3 @@ +accessing ui +titlePanel + ^ titlePanel \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/properties.json b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/properties.json new file mode 100644 index 0000000000..4d5aa09002 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestModel.class/properties.json @@ -0,0 +1,32 @@ +{ + "category" : "Iceberg-Plugin-GitHub", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + "repository", + "titleLabel", + "titlePanel", + "headLabel", + "headForkList", + "headBranchList", + "baseLabel", + "baseForkList", + "baseBranchList", + "bodyLabel", + "bodyPanel", + "addButton", + "acceptBlock", + "availableRemotes", + "availableBranchNames", + "baseRemote", + "gitRepositoryInfo", + "credentials", + "baseBranches" ], + "name" : "IceGitHubPullRequestModel", + "pools" : [ + ], + "super" : "ComposableModel", + "type" : "normal" } diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/README.md b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/README.md new file mode 100644 index 0000000000..3855754ab8 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/README.md @@ -0,0 +1 @@ +I define the plugin GitHub - Pull Request \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/class/isAvailableFor..st b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/class/isAvailableFor..st new file mode 100644 index 0000000000..b3504e969e --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/class/isAvailableFor..st @@ -0,0 +1,4 @@ +testing +isAvailableFor: aRepository + "validate if this is a github repository" + ^ aRepository origin host = 'github.com' \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/newPullRequestAction.st b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/newPullRequestAction.st new file mode 100644 index 0000000000..e657e2c328 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/newPullRequestAction.st @@ -0,0 +1,7 @@ +accessing +newPullRequestAction + ^ GLMGenericAction new + action: [ :presenter | self newPullRequestFor: presenter selection repository ]; + category: 'GitHub'; + showTitle: 'Create pull request...'; + yourself diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/newPullRequestFor..st b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/newPullRequestFor..st new file mode 100644 index 0000000000..5f9f885fd4 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/newPullRequestFor..st @@ -0,0 +1,12 @@ +actions +newPullRequestFor: aRepository + (self validateMakePullRequestOn: aRepository) ifFalse: [ ^ #() ]. + + (IceGitHubPullRequestModel for: aRepository) + setModal: true; + onAccept: [ :pullRequest | + [ + pullRequest send. + UIManager default inform: 'Pull request created.' ] + on: IceGitHubError do: [ :e | self reportError: e ] ]; + openWithSpec \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/plaintextCredentials.st b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/plaintextCredentials.st new file mode 100644 index 0000000000..f38f0de841 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/plaintextCredentials.st @@ -0,0 +1,7 @@ +private +plaintextCredentials + | credentials | + + credentials := IcePlaintextCredentials new. + IceCredentialsProvider default providePlaintextCredentialsTo: credentials. + ^ credentials diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/reportError..st b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/reportError..st new file mode 100644 index 0000000000..1ddf6acee5 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/reportError..st @@ -0,0 +1,5 @@ +private +reportError: error + UIManager default + alert: error messageBody + title: 'Error creating pull request: ', error messageText \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/repositoryActions.st b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/repositoryActions.st new file mode 100644 index 0000000000..5c5938f692 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/repositoryActions.st @@ -0,0 +1,3 @@ +accessing +repositoryActions + ^ { self newPullRequestAction } \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/validateMakePullRequestOn..st b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/validateMakePullRequestOn..st new file mode 100644 index 0000000000..99bf094f61 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/instance/validateMakePullRequestOn..st @@ -0,0 +1,14 @@ +private +validateMakePullRequestOn: aRepository + | status | + + status := OrderedCollection new: 2. + aRepository isModified + ifTrue: [ status add: 'Uncommited changes' ]. + (aRepository outgoingCommitsTo: (aRepository pushRemote)) + ifNotEmpty: [ :commits | '{1} not published' format: { commits size } ]. + status ifEmpty: [ ^ true ]. + + ^ UIManager default + confirm: (('{1} has ongoing modifications ({2}). +Do you want to continue anyway?') format: { aRepository name. status asCommaString }) \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/properties.json b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/properties.json new file mode 100644 index 0000000000..1733a8d619 --- /dev/null +++ b/Iceberg-Plugin.package/IceGitHubPullRequestPlugin.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "Iceberg-Plugin-GitHub", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "IceGitHubPullRequestPlugin", + "pools" : [ + ], + "super" : "IcePlugin", + "type" : "normal" } diff --git a/Iceberg-Plugin.package/IcePlugin.class/README.md b/Iceberg-Plugin.package/IcePlugin.class/README.md new file mode 100644 index 0000000000..5724a129af --- /dev/null +++ b/Iceberg-Plugin.package/IcePlugin.class/README.md @@ -0,0 +1,5 @@ +I'm a base for all kind of plugins. +I can define + +- repositoryActions (actions that will be added to IceRepositoriesBrowser, repositories section) +- ... (TBD) \ No newline at end of file diff --git a/Iceberg-Plugin.package/IcePlugin.class/class/allAvailableFor..st b/Iceberg-Plugin.package/IcePlugin.class/class/allAvailableFor..st new file mode 100644 index 0000000000..023d3fc70f --- /dev/null +++ b/Iceberg-Plugin.package/IcePlugin.class/class/allAvailableFor..st @@ -0,0 +1,3 @@ +as yet unclassified +allAvailableFor: aRepository + ^ self allSubclasses select: [ :each | each isAvailableFor: aRepository ] diff --git a/Iceberg-Plugin.package/IcePlugin.class/class/isAvailableFor..st b/Iceberg-Plugin.package/IcePlugin.class/class/isAvailableFor..st new file mode 100644 index 0000000000..a124dc9f97 --- /dev/null +++ b/Iceberg-Plugin.package/IcePlugin.class/class/isAvailableFor..st @@ -0,0 +1,3 @@ +testing +isAvailableFor: aRepository + ^ self subclassResponsibility \ No newline at end of file diff --git a/Iceberg-Plugin.package/IcePlugin.class/instance/repositoryActions.st b/Iceberg-Plugin.package/IcePlugin.class/instance/repositoryActions.st new file mode 100644 index 0000000000..1095dccf2c --- /dev/null +++ b/Iceberg-Plugin.package/IcePlugin.class/instance/repositoryActions.st @@ -0,0 +1,5 @@ +accessing +repositoryActions + "answer a list of glamour actions (GLMAction) that defines operations in the repository panel + (in IceRepositoriesBrowser)" + ^ #() \ No newline at end of file diff --git a/Iceberg-Plugin.package/IcePlugin.class/properties.json b/Iceberg-Plugin.package/IcePlugin.class/properties.json new file mode 100644 index 0000000000..784a080e34 --- /dev/null +++ b/Iceberg-Plugin.package/IcePlugin.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "Iceberg-Plugin-Base", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + ], + "name" : "IcePlugin", + "pools" : [ + ], + "super" : "Object", + "type" : "normal" } diff --git a/Iceberg-Plugin.package/IcePluginManager.class/README.md b/Iceberg-Plugin.package/IcePluginManager.class/README.md new file mode 100644 index 0000000000..4df6a8e61d --- /dev/null +++ b/Iceberg-Plugin.package/IcePluginManager.class/README.md @@ -0,0 +1,4 @@ +I keep plugins configured for a repository. + +WARNING: Managers are kept in a week dictionary with Repository as a key, reason why plugins can't have any kind of reference that could cause a memory leak. +Consider using stateless plugins or instance copies of relevant information instead. \ No newline at end of file diff --git a/Iceberg-Plugin.package/IcePluginManager.class/class/managerFor..st b/Iceberg-Plugin.package/IcePluginManager.class/class/managerFor..st new file mode 100644 index 0000000000..f9e0990743 --- /dev/null +++ b/Iceberg-Plugin.package/IcePluginManager.class/class/managerFor..st @@ -0,0 +1,5 @@ +instance creation +managerFor: aRepository + ^ self managers + at: aRepository + ifAbsentPut: [ self basicNew initializeRepository: aRepository ]. diff --git a/Iceberg-Plugin.package/IcePluginManager.class/class/managers.st b/Iceberg-Plugin.package/IcePluginManager.class/class/managers.st new file mode 100644 index 0000000000..d7125367ce --- /dev/null +++ b/Iceberg-Plugin.package/IcePluginManager.class/class/managers.st @@ -0,0 +1,3 @@ +private +managers + ^ Managers ifNil: [ Managers := WeakKeyDictionary new ] \ No newline at end of file diff --git a/Iceberg-Plugin.package/IcePluginManager.class/class/new.st b/Iceberg-Plugin.package/IcePluginManager.class/class/new.st new file mode 100644 index 0000000000..6ac899a5e4 --- /dev/null +++ b/Iceberg-Plugin.package/IcePluginManager.class/class/new.st @@ -0,0 +1,3 @@ +instance creation +new + self error: 'Use #managerFor:' \ No newline at end of file diff --git a/Iceberg-Plugin.package/IcePluginManager.class/instance/addPlugin..st b/Iceberg-Plugin.package/IcePluginManager.class/instance/addPlugin..st new file mode 100644 index 0000000000..f4330d5fea --- /dev/null +++ b/Iceberg-Plugin.package/IcePluginManager.class/instance/addPlugin..st @@ -0,0 +1,3 @@ +accessing +addPlugin: aPlugin + plugins := plugins copyWith: aPlugin \ No newline at end of file diff --git a/Iceberg-Plugin.package/IcePluginManager.class/instance/initializeRepository..st b/Iceberg-Plugin.package/IcePluginManager.class/instance/initializeRepository..st new file mode 100644 index 0000000000..f133eb16f6 --- /dev/null +++ b/Iceberg-Plugin.package/IcePluginManager.class/instance/initializeRepository..st @@ -0,0 +1,10 @@ +initialization +initializeRepository: aRepository. + self initialize. + "plugins := #()" + self flag: #todo. "I need a way to define this... + 1) in repository (.iceberg.ston)? + 2) in image (a plugins manager) " + plugins := (IcePlugin allAvailableFor: aRepository) + collect: #new + as: Array \ No newline at end of file diff --git a/Iceberg-Plugin.package/IcePluginManager.class/instance/plugins.st b/Iceberg-Plugin.package/IcePluginManager.class/instance/plugins.st new file mode 100644 index 0000000000..12a61cacd8 --- /dev/null +++ b/Iceberg-Plugin.package/IcePluginManager.class/instance/plugins.st @@ -0,0 +1,3 @@ +accessing +plugins + ^ plugins \ No newline at end of file diff --git a/Iceberg-Plugin.package/IcePluginManager.class/instance/repositoryActions.st b/Iceberg-Plugin.package/IcePluginManager.class/instance/repositoryActions.st new file mode 100644 index 0000000000..fb0aa57753 --- /dev/null +++ b/Iceberg-Plugin.package/IcePluginManager.class/instance/repositoryActions.st @@ -0,0 +1,6 @@ +accessing ui +repositoryActions + ^ self plugins + inject: #() + into: [ :all :each | all, (each repositoryActions) ] + \ No newline at end of file diff --git a/Iceberg-Plugin.package/IcePluginManager.class/properties.json b/Iceberg-Plugin.package/IcePluginManager.class/properties.json new file mode 100644 index 0000000000..64d8bbbc17 --- /dev/null +++ b/Iceberg-Plugin.package/IcePluginManager.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "Iceberg-Plugin-Base", + "classinstvars" : [ + ], + "classvars" : [ + "Managers" ], + "commentStamp" : "", + "instvars" : [ + "plugins" ], + "name" : "IcePluginManager", + "pools" : [ + ], + "super" : "Object", + "type" : "normal" } diff --git a/Iceberg-Plugin.package/IceRepository.extension/instance/pluginManager.st b/Iceberg-Plugin.package/IceRepository.extension/instance/pluginManager.st new file mode 100644 index 0000000000..3368537f9c --- /dev/null +++ b/Iceberg-Plugin.package/IceRepository.extension/instance/pluginManager.st @@ -0,0 +1,3 @@ +*Iceberg-Plugin +pluginManager + ^ IcePluginManager managerFor: self \ No newline at end of file diff --git a/Iceberg-Plugin.package/IceRepository.extension/properties.json b/Iceberg-Plugin.package/IceRepository.extension/properties.json new file mode 100644 index 0000000000..800b93814c --- /dev/null +++ b/Iceberg-Plugin.package/IceRepository.extension/properties.json @@ -0,0 +1,2 @@ +{ + "name" : "IceRepository" } diff --git a/Iceberg-Plugin.package/monticello.meta/categories.st b/Iceberg-Plugin.package/monticello.meta/categories.st new file mode 100644 index 0000000000..bee7baad20 --- /dev/null +++ b/Iceberg-Plugin.package/monticello.meta/categories.st @@ -0,0 +1,3 @@ +SystemOrganization addCategory: #'Iceberg-Plugin'! +SystemOrganization addCategory: 'Iceberg-Plugin-Base'! +SystemOrganization addCategory: 'Iceberg-Plugin-GitHub'! diff --git a/Iceberg-UI.package/IceGlamourChangesTree.class/README.md b/Iceberg-Plugin.package/monticello.meta/initializers.st similarity index 100% rename from Iceberg-UI.package/IceGlamourChangesTree.class/README.md rename to Iceberg-Plugin.package/monticello.meta/initializers.st diff --git a/Iceberg-Plugin.package/monticello.meta/package b/Iceberg-Plugin.package/monticello.meta/package new file mode 100644 index 0000000000..06b3b56bc2 --- /dev/null +++ b/Iceberg-Plugin.package/monticello.meta/package @@ -0,0 +1 @@ +(name 'Iceberg-Plugin') \ No newline at end of file diff --git a/Iceberg-Plugin.package/properties.json b/Iceberg-Plugin.package/properties.json new file mode 100644 index 0000000000..f037444a7c --- /dev/null +++ b/Iceberg-Plugin.package/properties.json @@ -0,0 +1,2 @@ +{ + } diff --git a/Iceberg-UI.package/IceGlamourChangesTree.class/class/withTitle..st b/Iceberg-UI.package/IceGlamourChangesTree.class/class/withTitle..st deleted file mode 100644 index cde5aced0a..0000000000 --- a/Iceberg-UI.package/IceGlamourChangesTree.class/class/withTitle..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -withTitle: treeTitle - ^ self basicNew - treeTitle: treeTitle; - initialize; - yourself \ No newline at end of file diff --git a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/browseAction.st b/Iceberg-UI.package/IceGlamourChangesTree.class/instance/browseAction.st deleted file mode 100644 index 46853a2601..0000000000 --- a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/browseAction.st +++ /dev/null @@ -1,11 +0,0 @@ -action creators -browseAction - ^ GLMGenericAction new - action: [ :presentation | presentation selection browse ]; - condition: [ :presentation :entity | - presentation selection notNil - and: [ presentation selection canBeBrowsed ]]; - icon: (Smalltalk ui icons iconNamed: #nautilus); - shortcut: $b; - title: 'Browse'; - showTitle \ No newline at end of file diff --git a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/browseReferencesAction.st b/Iceberg-UI.package/IceGlamourChangesTree.class/instance/browseReferencesAction.st deleted file mode 100644 index 6160b8cdf0..0000000000 --- a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/browseReferencesAction.st +++ /dev/null @@ -1,10 +0,0 @@ -action creators -browseReferencesAction - ^ GLMGenericAction new - action: [ :presentation | presentation selection browseReferences ]; - condition: [ :presentation | - presentation selection notNil - and: [ presentation selection canBrowseReferences ]]; - shortcut: $n; - title: 'Browse references'; - showTitle \ No newline at end of file diff --git a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/compose.st b/Iceberg-UI.package/IceGlamourChangesTree.class/instance/compose.st deleted file mode 100644 index d7232340d5..0000000000 --- a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/compose.st +++ /dev/null @@ -1,20 +0,0 @@ -building -compose - self fastTree - title: self treeTitle; - allExpanded; - children: #elements; - icon: #icon; - format: #description; - display: #elements; - updateOn: IceChangeSetChanged from: #announcer; - addAction: self refreshTreeAction; - addSelectionAction: self browseAction; - addSelectionAction: self browseReferencesAction; - addSelectionAction: self revertChangeAction; - onChangeOfPort: #entity act: [ :presentation :diff | - diff ifNotNil: [ - diff announcer weak - subscribe: IceChangeSetChanged - send: #execute: - to: (IceChangesTreeResetSelectionHelper for: presentation) ] ] diff --git a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/refreshTreeAction.st b/Iceberg-UI.package/IceGlamourChangesTree.class/instance/refreshTreeAction.st deleted file mode 100644 index 63f736602a..0000000000 --- a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/refreshTreeAction.st +++ /dev/null @@ -1,7 +0,0 @@ -action creators -refreshTreeAction - ^ GLMGenericAction new - action: [ :presentation :entity | entity refresh ]; - icon: GLMUIThemeExtraIcons glamorousRefresh; - shortcut: $r; - title: 'Refresh tree'; showTitle \ No newline at end of file diff --git a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/revertChangeAction.st b/Iceberg-UI.package/IceGlamourChangesTree.class/instance/revertChangeAction.st deleted file mode 100644 index b793c4acf3..0000000000 --- a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/revertChangeAction.st +++ /dev/null @@ -1,8 +0,0 @@ -action creators -revertChangeAction - ^ GLMGenericAction new - action: [ :presentation :entity | entity revertChange: presentation selection ]; - condition: [ :presentation :entity | entity canRevertChanges ]; - icon: GLMUIThemeExtraIcons glamorousUndo; - title: 'Revert change'; - showTitle \ No newline at end of file diff --git a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/treeTitle..st b/Iceberg-UI.package/IceGlamourChangesTree.class/instance/treeTitle..st deleted file mode 100644 index a5f09757ef..0000000000 --- a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/treeTitle..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -treeTitle: anObject - treeTitle := anObject \ No newline at end of file diff --git a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/treeTitle.st b/Iceberg-UI.package/IceGlamourChangesTree.class/instance/treeTitle.st deleted file mode 100644 index a29fa003d1..0000000000 --- a/Iceberg-UI.package/IceGlamourChangesTree.class/instance/treeTitle.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -treeTitle - ^ treeTitle \ No newline at end of file diff --git a/Iceberg-UI.package/IceGlamourChangesTree.class/properties.json b/Iceberg-UI.package/IceGlamourChangesTree.class/properties.json deleted file mode 100644 index 211b520bd2..0000000000 --- a/Iceberg-UI.package/IceGlamourChangesTree.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "Iceberg-UI-View", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "treeTitle" ], - "name" : "IceGlamourChangesTree", - "pools" : [ - ], - "super" : "GLMCompositePresentation", - "type" : "normal" } diff --git a/Iceberg-UI.package/IceGlamourSynchronizer.class/README.md b/Iceberg-UI.package/IceGlamourSynchronizer.class/README.md index e69de29bb2..8d125804a6 100644 --- a/Iceberg-UI.package/IceGlamourSynchronizer.class/README.md +++ b/Iceberg-UI.package/IceGlamourSynchronizer.class/README.md @@ -0,0 +1,8 @@ +I am the syncronizer window. +I am called to perform any of the basic operations of iceberg: + +- commit (save changes) +- update (load new changes from incomming commit versions) +- publish (send to central repository local commits) + +usually I'm called from the repositories browser, when selecting the "syncronize" option from contextual menu. \ No newline at end of file diff --git a/Iceberg-UI.package/IceGlamourSynchronizer.class/properties.json b/Iceberg-UI.package/IceGlamourSynchronizer.class/properties.json index 466985ed11..38844f1af0 100644 --- a/Iceberg-UI.package/IceGlamourSynchronizer.class/properties.json +++ b/Iceberg-UI.package/IceGlamourSynchronizer.class/properties.json @@ -4,7 +4,7 @@ ], "classvars" : [ ], - "commentStamp" : "", + "commentStamp" : "EstebanLorenzano 2/2/2017 16:22", "instvars" : [ "remote" ], "name" : "IceGlamourSynchronizer", diff --git a/Iceberg-UI.package/IceHistoryBrowser.class/instance/addChangesTreesTo..st b/Iceberg-UI.package/IceHistoryBrowser.class/instance/addChangesTreesTo..st index ccf6a6875f..ddf52d8ba6 100644 --- a/Iceberg-UI.package/IceHistoryBrowser.class/instance/addChangesTreesTo..st +++ b/Iceberg-UI.package/IceHistoryBrowser.class/instance/addChangesTreesTo..st @@ -4,7 +4,13 @@ addChangesTreesTo: browser from: #commits; to: #changes; andShow: [ :a :commitInfo | - (IceDiffChangeTreeBuilder diff: commitInfo diffFromHead buildOn: a) + (IceDiffChangeTreeBuilder new + entity: commitInfo; + diff: (commitInfo ifNotNil: [ commitInfo diffFromHead ]); + buildOn: a) title: 'Changes since selection'. - (IceDiffChangeTreeBuilder diff: commitInfo diffToParent buildOn: a) + (IceDiffChangeTreeBuilder new + entity: commitInfo; + diff: (commitInfo ifNotNil: [ commitInfo diffToParent ]); + buildOn: a) title: 'Changes vs. parent' ]. \ No newline at end of file diff --git a/Iceberg-UI.package/IceRemoteModel.class/instance/accept.st b/Iceberg-UI.package/IceRemoteModel.class/instance/accept.st index ec19e2f750..486acc5a0b 100644 --- a/Iceberg-UI.package/IceRemoteModel.class/instance/accept.st +++ b/Iceberg-UI.package/IceRemoteModel.class/instance/accept.st @@ -1,6 +1,6 @@ actions accept - | remoteName remoteUrl remote | + | remoteName remoteUrl | remoteName := self namePanel text trim. remoteName ifEmpty: [ diff --git a/Iceberg-UI.package/IceRepositoriesBrowser.class/instance/composeRepositories.in..st b/Iceberg-UI.package/IceRepositoriesBrowser.class/instance/composeRepositories.in..st index 82839e95c7..128d7c5a3b 100644 --- a/Iceberg-UI.package/IceRepositoriesBrowser.class/instance/composeRepositories.in..st +++ b/Iceberg-UI.package/IceRepositoriesBrowser.class/instance/composeRepositories.in..st @@ -40,6 +40,9 @@ composeRepositories: repositories in: composite addSelectionAction: self refreshRepository; addSelectionAction: self inspectRepository; addSelectionAction: self forgetRepository; + "Plugin actions" + dynamicActionsOnSelection: [ :presentation | + presentation selection pluginActions ]; "Double click action" onChangeOfPort: #strongSelection act: [ :presentation | self synchronize: presentation selection repository ] \ No newline at end of file diff --git a/Iceberg-UI.package/IceRepositoryModel.class/instance/pluginActions.st b/Iceberg-UI.package/IceRepositoryModel.class/instance/pluginActions.st new file mode 100644 index 0000000000..44aa9e020e --- /dev/null +++ b/Iceberg-UI.package/IceRepositoryModel.class/instance/pluginActions.st @@ -0,0 +1,3 @@ +accessing plugins +pluginActions + ^ self repository pluginManager repositoryActions \ No newline at end of file diff --git a/Iceberg.package/IceCommitInfo.class/instance/diffToParent.st b/Iceberg.package/IceCommitInfo.class/instance/diffToParent.st index 8c2df6197d..29b3624f8a 100644 --- a/Iceberg.package/IceCommitInfo.class/instance/diffToParent.st +++ b/Iceberg.package/IceCommitInfo.class/instance/diffToParent.st @@ -1,3 +1,7 @@ *Iceberg-Changes diffToParent - ^ IceDiff from: self to: self parents first \ No newline at end of file + ^ IceDiff + from: self + to: (self parents + ifNotEmpty: #first + ifEmpty: [ nil ]) \ No newline at end of file diff --git a/Iceberg.package/IceCommitInfo.class/instance/parents.st b/Iceberg.package/IceCommitInfo.class/instance/parents.st index a6f1e2f045..9e8cf3249d 100644 --- a/Iceberg.package/IceCommitInfo.class/instance/parents.st +++ b/Iceberg.package/IceCommitInfo.class/instance/parents.st @@ -1,5 +1,5 @@ accessing parents - ^ parents ifNil: [ parents := - parentIds collect: [ :parentId | - self repository commitAt: parentId ] ] \ No newline at end of file + ^ parents ifNil: [ + parents := parentIds + collect: [ :parentId | self repository commitAt: parentId ] ] \ No newline at end of file diff --git a/Iceberg.package/IcePlaintextCredentials.class/instance/readFrom..st b/Iceberg.package/IcePlaintextCredentials.class/instance/readFrom..st new file mode 100644 index 0000000000..ccc300eae8 --- /dev/null +++ b/Iceberg.package/IcePlaintextCredentials.class/instance/readFrom..st @@ -0,0 +1,4 @@ +instance creation +readFrom: credentials + self username: credentials username. + self password: credentials password \ No newline at end of file diff --git a/Iceberg.package/IceRemoteBranch.class/instance/remoteName.st b/Iceberg.package/IceRemoteBranch.class/instance/remoteName.st new file mode 100644 index 0000000000..779fa59f2e --- /dev/null +++ b/Iceberg.package/IceRemoteBranch.class/instance/remoteName.st @@ -0,0 +1,3 @@ +accessing +remoteName + ^ self name copyUpToLast: $/ \ No newline at end of file