Skip to content

Commit 7ca76d6

Browse files
committed
Small refactoring
1 parent 7157866 commit 7ca76d6

File tree

20 files changed

+151
-19
lines changed

20 files changed

+151
-19
lines changed

src/androidTest/kotlin/net/pearx/kpastebin/test/helper/runBlocking.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* Copyright © 2020, PearX Team
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
5+
* You can obtain one at https://mozilla.org/MPL/2.0/.
6+
*/
7+
18
package net.pearx.kpastebin.test.helper
29

310
import kotlinx.coroutines.CoroutineScope

src/commonMain/kotlin/net/pearx/kpastebin/PastebinClient.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* Copyright © 2020, PearX Team
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
5+
* You can obtain one at https://mozilla.org/MPL/2.0/.
6+
*/
7+
18
package net.pearx.kpastebin
29

310
import io.ktor.client.HttpClient

src/commonMain/kotlin/net/pearx/kpastebin/PastebinExceptions.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* Copyright © 2020, PearX Team
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
5+
* You can obtain one at https://mozilla.org/MPL/2.0/.
6+
*/
7+
18
package net.pearx.kpastebin
29

310
import net.pearx.kpastebin.model.Privacy

src/commonMain/kotlin/net/pearx/kpastebin/internal/Constant.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* Copyright © 2020, PearX Team
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
5+
* You can obtain one at https://mozilla.org/MPL/2.0/.
6+
*/
7+
18
package net.pearx.kpastebin.internal
29

310
internal const val API_URL = "https://pastebin.com/api"
@@ -7,4 +14,4 @@ internal const val API_URL_RAW = "$API_URL/api_raw.php"
714
internal const val URL_RAW = "https://pastebin.com/raw"
815

916
internal val XML_PROPERTY_REGEX = Regex("<([a-zA-Z_]+)>(.*)</\\1>")
10-
internal val XML_PARENT_REGEX = Regex("<([a-zA-Z]+)>((?:.|\r\n|\r|\n)+?)</\\1>")
17+
internal val XML_PARENT_REGEX = Regex("<([a-zA-Z]+)>((?:.|\r\n|\r|\n)+?)</\\1>")

src/commonMain/kotlin/net/pearx/kpastebin/internal/ExceptionHelper.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* Copyright © 2020, PearX Team
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
5+
* You can obtain one at https://mozilla.org/MPL/2.0/.
6+
*/
7+
18
package net.pearx.kpastebin.internal
29

310
import net.pearx.kpastebin.*
@@ -32,4 +39,4 @@ internal fun checkPastebinResponse(response: String) {
3239
}
3340
}
3441
}
35-
}
42+
}

src/commonMain/kotlin/net/pearx/kpastebin/model/AccountType.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* Copyright © 2020, PearX Team
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
5+
* You can obtain one at https://mozilla.org/MPL/2.0/.
6+
*/
7+
18
package net.pearx.kpastebin.model
29

310
/**
@@ -9,4 +16,4 @@ public enum class AccountType {
916

1017
/** Paid pro account. */
1118
PRO;
12-
}
19+
}

src/commonMain/kotlin/net/pearx/kpastebin/model/ExpireDate.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* Copyright © 2020, PearX Team
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
5+
* You can obtain one at https://mozilla.org/MPL/2.0/.
6+
*/
7+
18
package net.pearx.kpastebin.model
29

310
/**
@@ -34,4 +41,4 @@ public enum class ExpireDate(internal val code: String) {
3441
internal companion object {
3542
fun forCode(code: String) = values().first { it.code == code }
3643
}
37-
}
44+
}

src/commonMain/kotlin/net/pearx/kpastebin/model/PasteDetails.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* Copyright © 2020, PearX Team
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
5+
* You can obtain one at https://mozilla.org/MPL/2.0/.
6+
*/
7+
18
package net.pearx.kpastebin.model
29

310
import net.pearx.kpastebin.internal.XML_PARENT_REGEX
@@ -6,7 +13,6 @@ import net.pearx.kpastebin.internal.XML_PROPERTY_REGEX
613
/**
714
* A detailed Pastebin paste information.
815
*/
9-
@ExperimentalUnsignedTypes
1016
public data class PasteDetails(
1117
/** Paste key. */
1218
val key: String,
@@ -55,4 +61,4 @@ public data class PasteDetails(
5561
return lst
5662
}
5763
}
58-
}
64+
}

src/commonMain/kotlin/net/pearx/kpastebin/model/Privacy.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* Copyright © 2020, PearX Team
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
5+
* You can obtain one at https://mozilla.org/MPL/2.0/.
6+
*/
7+
18
package net.pearx.kpastebin.model
29

310
/**
@@ -12,4 +19,4 @@ public enum class Privacy {
1219

1320
/** Paste is visible only for you. */
1421
PRIVATE;
15-
}
22+
}

src/commonMain/kotlin/net/pearx/kpastebin/model/UserDetails.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* Copyright © 2020, PearX Team
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
5+
* You can obtain one at https://mozilla.org/MPL/2.0/.
6+
*/
7+
18
package net.pearx.kpastebin.model
29

310
import net.pearx.kpastebin.internal.XML_PARENT_REGEX
@@ -48,4 +55,4 @@ public data class UserDetails(
4855
throw IllegalArgumentException(input)
4956
}
5057
}
51-
}
58+
}

0 commit comments

Comments
 (0)