Kare Morstol
3218fd4315
Update for Xcode 7 beta 6.
...
For some reason "NSURL.checkResourceIsReachable() throws" is gone and "checkResourceIsReachableAndReturnError(NSErrorPointer)" is back even though the documentation says otherwise. Methods of other Cocoa classes which take NSError pointers have been converted to throwing functions.
2015-08-28 00:34:01 +02:00
Kare Morstol
a9dbdcf629
Update to Swift 2.0 .
...
Wow, lots of changes in Swift 2.0! And all of them great, except for renaming println to print. What's up with that?
This is just to get it to compile, we will be trying and throwing errors in no time.
2015-06-28 00:52:40 +02:00
Kare Morstol
e55b2f91f5
Small changes to documentation
2015-03-20 22:02:28 +01:00
Kare Morstol
908a8ecaae
Revert "Fix compiler crash - make workdirectory a struct"
...
This reverts commit e8333f2922 .
2015-02-27 23:53:32 +01:00
Kare Morstol
9e2d44682f
Revert "Move workdirectory to NSFileManager extension."
...
This reverts commit f8f7c78de9 .
2015-02-27 23:52:56 +01:00
Kare Morstol
f8f7c78de9
Move workdirectory to NSFileManager extension.
...
To work around compiler crash in Xcode 6.3 beta 1 on public global
variables with default value. Wanted to move tempdirectory there too
but extensions can’t have stored properties.
Close #8 .
Close #9 (pull request from @beltex)
2015-02-14 00:34:52 +01:00
beltex
e8333f2922
Fix compiler crash - make workdirectory a struct
2015-02-13 12:33:15 -05:00
Kare Morstol
9555306183
Close #3 : Make sure runtests.bash is using an up to date _release_ build.
2015-01-06 18:34:40 +01:00
Kare Morstol
a1e26bfcc8
Tidy up / nitpick.
2014-12-09 18:07: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
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
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
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
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
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
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
977888c03b
Rename "write" functions to "writeTo".
...
Because it makes more sense.
2014-10-25 19:17:07 +02:00
Kare Morstol
c04cd0d84b
Add function “drop” for discarding elements from a sequence.
2014-10-24 20:26:00 +02:00
Kare Morstol
1b78cab9fd
Add a space before result of the parameters function.
...
So you don't have to remember to add it after the command.
2014-10-24 20:24:07 +02:00
Kare Morstol
e116a29a4a
Rename array to toArray.
2014-10-23 19:19:11 +02:00
Kare Morstol
6d588bfe29
Add "parameters" function for turning a sequence into valid parameters for a shell command, properly quoted.
2014-10-23 01:41:53 +02:00
Kare Morstol
991da5fd39
Add “array” function for turning a sequence into an array, used after the |> operator.
2014-10-23 00:14:10 +02:00
Kare Morstol
8441d5e87b
Add missing newline at end of file
2014-10-22 21:37:50 +02:00
Kare Morstol
9136d17843
Use "|> write(standardoutput)" instead of " |> standardoutput". And support writing of sequences of strings.
...
Avoids the special case of "|> WriteableStreamType".
2014-10-15 23:03:42 +02:00
Kare Morstol
d09aa63f3e
Add test testChainWithSequenceOfStreamsPrintedToStream.
2014-10-13 22:00:53 +02:00
Kare Morstol
a144bc2650
Fix small typo and excessive whitespace.
2014-10-09 18:36:28 +02:00
Kare Morstol
f56f7a0371
Use SwiftShells environment.
2014-10-07 19:03:56 +02:00
Kare Morstol
715cb3ef14
Test callswiftscriptfromswift last to test its components first.
2014-10-07 18:39:05 +02:00
Kare Morstol
b111afa8d8
Add bash script to test all Swift scripts.
2014-09-24 21:15:25 +02:00
Kare Morstol
c6734b8825
Add testSequenceOfStreamsToStream.
2014-09-24 21:03:09 +02:00
Kare Morstol
96eb12b9fe
Enable "sequence of readable streams |> writeablestream".
...
Updated test script and README.
2014-09-18 00:51:50 +02:00
Kare Morstol
dd6e0d3a8f
Clean up double spaces.
2014-09-17 23:41:38 +02:00
Kare Morstol
f0d4c34f9b
Add versions of global Swift functions that can be used with the |> operator.
...
- Moved overloads of |> operator for WriteableStreamType to Stream.swift.
Note: it takes forever to compile if you put too many |> operators in a row.
2014-09-17 23:39:21 +02:00
Kare Morstol
7ef52b67bf
Move XCTestCase.pathForTestResource to a file common for all unit test targets.
2014-09-15 22:17:06 +02:00
Kare Morstol
36e217c0c3
Make piping one stream to another lazy.
2014-09-12 01:12:50 +02:00
Kare Morstol
1d6788c08e
Add readme to scripts folder. Move test area.playground.
2014-09-11 21:39:35 +02:00
Kare Morstol
84b1d5624d
Add test script callswiftscriptfromswift.swift.
2014-09-11 20:37:44 +02:00
Kare Morstol
10f0f46c10
Add "$("shellcommand")" as a shortcut for in-line commands.
...
Like the one you have in bash.
2014-09-11 18:15:25 +02:00
Kare Morstol
f992418c9b
Add missing newline to the end.
2014-09-10 20:10:22 +02:00