Skip to content

Commit

Permalink
Prepare v2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianvarela committed Aug 14, 2020
1 parent 5556d11 commit 37e5b0f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MasMagicPills.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'MasMagicPills'
s.version = '2.4.0'
s.version = '2.4.1'
s.swift_version = '5.0'
s.summary = 'Set of powerful utilities 💊.'

Expand Down
8 changes: 8 additions & 0 deletions MasMagicPills.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@
F20083832267E47F00AC6EE1 /* LocalizedSample.strings in Resources */ = {isa = PBXBuildFile; fileRef = F20083822267E47F00AC6EE1 /* LocalizedSample.strings */; };
F20083842267E47F00AC6EE1 /* LocalizedSample.strings in Resources */ = {isa = PBXBuildFile; fileRef = F20083822267E47F00AC6EE1 /* LocalizedSample.strings */; };
F20083852267E47F00AC6EE1 /* LocalizedSample.strings in Resources */ = {isa = PBXBuildFile; fileRef = F20083822267E47F00AC6EE1 /* LocalizedSample.strings */; };
F209D41D24E6C6BC002BF853 /* Int64Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F209D41C24E6C6BC002BF853 /* Int64Extensions.swift */; };
F209D41E24E6C6BC002BF853 /* Int64Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F209D41C24E6C6BC002BF853 /* Int64Extensions.swift */; };
F209D41F24E6C6BC002BF853 /* Int64Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F209D41C24E6C6BC002BF853 /* Int64Extensions.swift */; };
F210E6AE231EC709004D9F0A /* XibRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F210E6AD231EC709004D9F0A /* XibRepresentable.swift */; };
F210E6AF231EC709004D9F0A /* XibRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F210E6AD231EC709004D9F0A /* XibRepresentable.swift */; };
F210E6B2231EC7F0004D9F0A /* XibRepresentableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F210E6B1231EC7F0004D9F0A /* XibRepresentableTests.swift */; };
Expand Down Expand Up @@ -417,6 +420,7 @@
F200836E2266339800AC6EE1 /* SequenceExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SequenceExtensions.swift; sourceTree = "<group>"; };
F2008370226633A500AC6EE1 /* SequenceExtensionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SequenceExtensionsTests.swift; sourceTree = "<group>"; };
F20083822267E47F00AC6EE1 /* LocalizedSample.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = LocalizedSample.strings; sourceTree = "<group>"; };
F209D41C24E6C6BC002BF853 /* Int64Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Int64Extensions.swift; sourceTree = "<group>"; };
F210E6AD231EC709004D9F0A /* XibRepresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XibRepresentable.swift; sourceTree = "<group>"; };
F210E6B1231EC7F0004D9F0A /* XibRepresentableTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XibRepresentableTests.swift; sourceTree = "<group>"; };
F21A6776226F4E260026F6E9 /* CIImageExtensions+UIKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CIImageExtensions+UIKit.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -890,6 +894,7 @@
F20082E9225E1E7100AC6EE1 /* DateExtensionsTests.swift */,
F20082FD225E556500AC6EE1 /* DecimalExtensionsTests.swift */,
F68925D322CDE8950008263B /* IntExtensionsTests.swift */,
F209D41C24E6C6BC002BF853 /* Int64Extensions.swift */,
F22A38EB227C775C0012C010 /* DictionaryExtensionsTests.swift */,
F2008370226633A500AC6EE1 /* SequenceExtensionsTests.swift */,
F200830F225F4C5200AC6EE1 /* StringExtensionsTests.swift */,
Expand Down Expand Up @@ -1341,6 +1346,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F209D41D24E6C6BC002BF853 /* Int64Extensions.swift in Sources */,
F20082EA225E1E7100AC6EE1 /* DateExtensionsTests.swift in Sources */,
F200832F225F876300AC6EE1 /* StringExtensions+ValidatorsTests.swift in Sources */,
F249674A230EBE9500C06E2E /* JSONTestHelper.swift in Sources */,
Expand Down Expand Up @@ -1461,6 +1467,7 @@
F249674B230EBE9500C06E2E /* JSONTestHelper.swift in Sources */,
F20083642266317A00AC6EE1 /* URLExtensionsTests.swift in Sources */,
F20083462266117700AC6EE1 /* BundleExtensionsTests.swift in Sources */,
F209D41E24E6C6BC002BF853 /* Int64Extensions.swift in Sources */,
F200834B226612F800AC6EE1 /* FakeBundle.swift in Sources */,
F2496733230D5E1B00C06E2E /* DifferenceTests.swift in Sources */,
F20082DE225DFFCF00AC6EE1 /* BoolExtensionsTests.swift in Sources */,
Expand Down Expand Up @@ -1546,6 +1553,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F209D41F24E6C6BC002BF853 /* Int64Extensions.swift in Sources */,
F20083812267E0AE00AC6EE1 /* StringExtensionsUIKitTests.swift in Sources */,
F2008373226633A700AC6EE1 /* SequenceExtensionsTests.swift in Sources */,
F249674C230EBE9500C06E2E /* JSONTestHelper.swift in Sources */,
Expand Down
4 changes: 2 additions & 2 deletions Source/Foundation/Extensions/DecimalExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public extension Decimal {
return self / 60
}

/// Convert to Megabytes (1000 bytes) and format it with Locale and specific decimals
/// Convert given megas to Megabytes (1000 bytes) and format it with Locale and specific decimals
///
/// - Parameters:
/// - locale: Language rules (optional) (by default use current)
Expand All @@ -35,7 +35,7 @@ public extension Decimal {
unit: .init(symbol: "MB"))
}

/// Convert to Mebibytes (1024 bytes) and format it with Locale and specific decimals
/// Convert given megas to Mebibytes (1024 bytes) and format it with Locale and specific decimals
///
/// - Parameters:
/// - locale: Language rules (optional) (by default use current)
Expand Down
4 changes: 3 additions & 1 deletion Source/Foundation/Extensions/Int64Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import Foundation

extension Int64 {
public extension Int64 {
/// Return the given units of GB as bytes
static func gigaBytes(_ amount: Int64) -> Int64 {
return 1_024 * 1_024 * 1_024 * amount
}

/// Return the given units of MB as bytes
static func megaBytes(_ amount: Int64) -> Int64 {
return 1_024 * 1_024 * amount
}
Expand Down
19 changes: 19 additions & 0 deletions Tests/Foundation/Extensions/Int64Extensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import XCTest
import Foundation
import MasMagicPills

class Int64ExtensionsTests: XCTestCase {
func test_static_helpers() {
let sixGigaBytes = Int64.gigaBytes(6)
XCTAssertEqual(sixGigaBytes, 6 * 1_024 * 1_024 * 1_024)

let twentyFiveMegaBytes = Int64.megaBytes(25)
XCTAssertEqual(twentyFiveMegaBytes, 25 * 1_024 * 1_024)
}

func test_int_to_string_conversion() {
XCTAssertEqual((24 as Int64).toString, "24")
XCTAssertEqual((1_024 as Int64).toString, "1024")
XCTAssertNotEqual((1_024 as Int64).toString, "10")
}
}

0 comments on commit 37e5b0f

Please sign in to comment.