Kare Morstol
7ffcf7be5f
Skip speed test "testSpeedSwiftSplit" as it takes a very long time.
...
Also improve output of "testWhenSplitFileAsStringBecomesQuicker".
2014-12-18 01:49:46 +01:00
Kare Morstol
11a028d4ff
Fix #2 : "ReadableStreamType.readSome crashes with error "6555 Illegal instruction: 4" when using a Release build of SwiftShell."
...
Also fixes #1 : "SwiftShell_Speed_Tests unit tests never finish.".
It turns out NSString(data data: NSData, encoding encoding: UInt) returns an optional String, something Xcode/Swift neglected to tell me. Which is strange as they are normally very strict about these things. But what really solved these 2 issues (which are really the same issue) was removing the unnecessary cast "as String". For more on this really bizarre bug in the Swift compiler, see https://devforums.apple.com/message/1084852#1084852 .
2014-12-18 01:47:33 +01:00
Kare Morstol
1b70b6ffc6
Mention that standard input is also a stream.
2014-12-09 18:56:54 +01:00
Kare Morstol
cb3449a97d
Add link to included works under other licences to the README.
2014-12-09 18:49:58 +01:00
Kare Morstol
0974453073
Mention the parameters function in the README.
2014-12-09 18:37:33 +01:00
Kare Morstol
a1e26bfcc8
Tidy up / nitpick.
2014-12-09 18:07:04 +01:00
Kare Morstol
a3ab54ef21
Shorten headers, and small fixes.
2014-12-08 19:14:49 +01:00
Kare Morstol
a4aa7ca9f8
Clean up speed iteration speed tests. Still never finishes when built for Release.
2014-12-08 18:36:22 +01:00
Kare Morstol
b9554045d8
Mention shortcut to NSFileManager.defaultManager in README.
2014-12-08 00:06:34 +01:00
Kare Morstol
d2c33d562d
Add shortcut to NSFileManager.defaultManager.
2014-12-08 00:05:17 +01:00
Kare Morstol
8d28ff776d
Streamline the readme.
2014-12-06 23:39:17 +01:00
Kare Morstol
2f76425abd
Replace the one remaining call to "writeTo".
2014-12-05 18:40:04 +01:00
Kare Morstol
4d2fca7b74
Add operator |>> for printing anything to a writable stream.
...
Replaced all uses of writeTo with the new operator in unit tests, test scripts and readme.
2014-12-04 20:05:15 +01:00
Kare Morstol
7dab983e33
Fix small typo.
2014-12-04 19:23:38 +01:00
Kare Morstol
1f96ffa770
Enable "/" as file path concatenation operator.
...
Now you can do `let filepath = tempdirectory / "newfile.txt"`.
2014-12-02 02:06:21 +01:00
Kare Morstol
6cc240a138
Add local function "toURLOrError".
...
This will print an error message and halt immediately if the input is not a valid URL. Though I have not yet been able to create an invalid URL. NSURL even accepts * and : in the path itself.
2014-12-02 01:15:47 +01:00
Kare Morstol
e74189d008
Make tempdirectory a String instead of a NSURL.
...
The fact that NSURLs cannot be created with string literals makes them too cumbersome to use.
2014-12-02 00:17:39 +01:00
Kare Morstol
ecd20887b8
Remove a couple of double spaces.
2014-12-01 23:48:26 +01:00
Kare Morstol
caaf5459db
Move Files_Tests to its rightful position.
2014-12-01 23:44:39 +01:00
Kare Morstol
bf19e4241b
Add global variable "workdirectory".
2014-12-01 23:43:39 +01:00
Kare Morstol
fcd7eba2a4
Fix horrendous use of spaces for indentation.
2014-12-01 22:43:03 +01:00
Kare Morstol
85ba6e8e0d
Mark all example code as Swift.
2014-12-01 20:52:57 +01:00
Kare Morstol
ce8eb6f004
Make URL to "tempdirectory" read only.
2014-12-01 20:16:48 +01:00
Kare Morstol
a2985b049d
Add shell unit tests and update test scripts.
...
Run SwiftShellTests/Scripts/runtests.bash to perform all unit tests.
2014-11-26 20:58:22 +01:00
Kare Morstol
c65e029811
Include assert.sh from http://github.com/lehmannro/assert.sh for shell unit testing.
...
Also included the required licenses.
2014-11-26 20:36:43 +01:00
Kare Morstol
65625bbc75
Remove "listallexecutablesinpath.swift" and turn it into a Gist. List it as an example in the README.
...
It was way too wordy to use as a test.
2014-11-26 00:00:15 +01:00
Kare Morstol
f60f6ae083
Add script for testing reading and writing files.
2014-11-25 20:45:38 +01:00
Kare Morstol
b33bfb9a5f
Move "temporaryDirectory" to new file Files.swift and rename it "tempdirectory".
...
Because it could be useful in scripts too.
2014-11-25 20:38:32 +01:00
Kare Morstol
63513dedf3
Use the new "printErrorAndExit" function.
2014-11-25 19:15:21 +01:00
Kare Morstol
90d10292c8
Add function "open(forWriting:, overwrite:)" for writing and appending to files.
...
Also added func "temporaryDirectory" to XCTestCase_Additions.
2014-11-25 01:15:36 +01:00
Kare Morstol
a377eb18fd
Add better error reporting to “open” function. Add public function "printErrorAndExit".
2014-11-23 23:31:06 +01:00
Kare Morstol
05fb61a4ab
Remove unnecessary whitespace, courtesy of Xcode.
2014-11-23 23:19:30 +01:00
Kare Morstol
30f30baa07
Fixed small typo.
2014-11-23 20:22:51 +01:00
Kare Morstol
0fc373937c
Add link to a SwiftShell script, trash.swift.
...
Also removed the word "very".
2014-11-21 21:12:13 +01:00
Kare Morstol
6be3d656e3
Clean up playground.
2014-11-21 20:19:00 +01:00
Kare Morstol
7d667165fd
Clarify note about crashing when reading from streams.
...
It is the compiled code that crashes, not the compiler itself.
2014-11-21 20:14:53 +01:00
Kare Morstol
4b1e6d2689
Change countOccurrencesOfto use String.findAll.
2014-11-19 22:48:13 +01:00
Kare Morstol
a63bc3b536
Changed to the MIT license.
...
Because I don't really care that much about enforcing the sharing of changes.
2014-11-14 19:19:59 +01:00
Kare Morstol
cd5abf31d8
Add version of replace method with limit.
...
Also rename parameters in original version.
2014-11-06 00:04:51 +01:00
Kare Morstol
4254364b74
This indentation was brought to you by Xcode (6.1).
2014-11-06 00:02:24 +01:00
Kare Morstol
d557f6a5fd
Add take function.
2014-11-05 20:41:33 +01:00
Kare Morstol
b870c209e8
Add findAllmethod to String.
2014-11-05 19:57:13 +01:00
Kare Morstol
e67f465457
Add "countOccurrencesOf" to String.
2014-11-05 17:40:13 +01:00
Kare Morstol
548e0740d4
Tidy up the code some more.
2014-10-30 00:28:20 +01:00
Kare Morstol
e4272d043c
Tidy up the code.
2014-10-30 00:11:46 +01:00
Kare Morstol
e393c3d7a5
Change readme.md to use writeTo.
2014-10-25 21:07:40 +02:00
Kare Morstol
977888c03b
Rename "write" functions to "writeTo".
...
Because it makes more sense.
2014-10-25 19:17:07 +02:00
Kare Morstol
ba2fee299f
Clarify note about crashing when optimisations are turned on.
2014-10-24 22:24:09 +02:00
Kare Morstol
6ce3a3ab26
Add "writeln" functions to WriteableStreamType.
2014-10-24 21:05:18 +02:00
Kare Morstol
c04cd0d84b
Add function “drop” for discarding elements from a sequence.
2014-10-24 20:26:00 +02:00