<feed xmlns='http://www.w3.org/2005/Atom'>
<title>timetasker/timetask, branch v0.1.1</title>
<subtitle>A CLI for submitting Time Task time sheets</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/timetasker/'/>
<entry>
<title>Move HTTP response body errors into http.go</title>
<updated>2017-06-03T22:38:28+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-06-03T22:38:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/timetasker/commit/?id=d4a9537b5671fafe04335b9f91c5d5869d4a2358'/>
<id>d4a9537b5671fafe04335b9f91c5d5869d4a2358</id>
<content type='text'>
Take the errors in `main()` that check the response body contents for
known error strings and put them in their respective functions in
"timetask/http.go".

Didn't really make sense to me that these functions were returning HTTP
responses that we weren't really using in a meaningful way. Instead they
should just do their thing and let us know if there was a problem.

That includes checking to see if there were any non-standard errors,
like the ones we had custom-built. Now all that handling and
error-making is self-contained, which feels much nicer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Take the errors in `main()` that check the response body contents for
known error strings and put them in their respective functions in
"timetask/http.go".

Didn't really make sense to me that these functions were returning HTTP
responses that we weren't really using in a meaningful way. Instead they
should just do their thing and let us know if there was a problem.

That includes checking to see if there were any non-standard errors,
like the ones we had custom-built. Now all that handling and
error-making is self-contained, which feels much nicer.
</pre>
</div>
</content>
</entry>
<entry>
<title>RequestModules(): Pretty print modules</title>
<updated>2017-06-03T22:19:35+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-06-03T22:19:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/timetasker/commit/?id=eb82e5e447dff67d5bcd1a2d5c9c52990a840e29'/>
<id>eb82e5e447dff67d5bcd1a2d5c9c52990a840e29</id>
<content type='text'>
Parse the module XML with `ModuleParseXML()`. Take the resulting
`[]Module` slice and use it to generate a string of the following
format:

    ID	Module
    55555	R&amp;amp;D
    77777	Sprint 1
    222222 Sprint 2

This string is what gets printed to the console, which makes it rather
easy to read the modules that are available for the given project and
grab the appropriate ID to put into your config file.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Parse the module XML with `ModuleParseXML()`. Take the resulting
`[]Module` slice and use it to generate a string of the following
format:

    ID	Module
    55555	R&amp;amp;D
    77777	Sprint 1
    222222 Sprint 2

This string is what gets printed to the console, which makes it rather
easy to read the modules that are available for the given project and
grab the appropriate ID to put into your config file.
</pre>
</div>
</content>
</entry>
<entry>
<title>Change `ParseXML()` name to `ModuleParseXML()`</title>
<updated>2017-06-03T22:10:14+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-06-03T22:10:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/timetasker/commit/?id=7e711772def7a5d711500c3c6c37ea41b57ac598'/>
<id>7e711772def7a5d711500c3c6c37ea41b57ac598</id>
<content type='text'>
Prefix the function name to make it more obvious what it relates to.
Since this function lives in the `timetask` module and will be used in
contexts that have nothing to do with Modules.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prefix the function name to make it more obvious what it relates to.
Since this function lives in the `timetask` module and will be used in
contexts that have nothing to do with Modules.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add module.go for parsing Module XML</title>
<updated>2017-06-03T22:05:39+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-06-03T22:05:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/timetasker/commit/?id=c113de965dea24c44023a9aabcff7f8ee1f0caa0'/>
<id>c113de965dea24c44023a9aabcff7f8ee1f0caa0</id>
<content type='text'>
A new function that parses the XML returned by the `RequestModules()`
function.

It provides a `Module` type that allows us to interact with modules more
easily in code.

The `ParseXML()` function will take an XML string and return a slice of
`Module`s.

Added a test just to facilitate development. Wasn't able to find an easy
way to compare slices in Go, so just printed the values and checked the
result visually. Not a useful test for future use, but it served its
purpose. Eventually it would be nice to find a way to compare structs
and have a real pass/fail condition.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A new function that parses the XML returned by the `RequestModules()`
function.

It provides a `Module` type that allows us to interact with modules more
easily in code.

The `ParseXML()` function will take an XML string and return a slice of
`Module`s.

Added a test just to facilitate development. Wasn't able to find an easy
way to compare slices in Go, so just printed the values and checked the
result visually. Not a useful test for future use, but it served its
purpose. Eventually it would be nice to find a way to compare structs
and have a real pass/fail condition.
</pre>
</div>
</content>
</entry>
<entry>
<title>TestLogin(): Fix `Login()` assignment mismatch</title>
<updated>2017-06-03T21:37:32+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-06-03T21:37:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/timetasker/commit/?id=aff9a869ffab0eeb8c644826b9250a500468ff1a'/>
<id>aff9a869ffab0eeb8c644826b9250a500468ff1a</id>
<content type='text'>
`Login()` now returns 3 values. Update the test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`Login()` now returns 3 values. Update the test.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add an option to list "Modules" (sprints &amp; their IDs)</title>
<updated>2017-06-03T21:08:08+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-06-03T21:08:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/timetasker/commit/?id=d833ffe6cd5efd97b00f907ed426a88275a8c8db'/>
<id>d833ffe6cd5efd97b00f907ed426a88275a8c8db</id>
<content type='text'>
Sprints will change with time while the other IDs of a project will stay
the same. Thus sprints, which live in the `Module` field, must be
updated regularly.

In order to facilitate that updating, instead of requiring users to get
those IDs directly from the TimeTask website every time, have them use
this command to get the names of sprints and their IDs. They can then
update the ID manually in their config file.

This code makes a request to the endpoint that returns module IDs for
the site (the site queries this via AJAX to update its interface).

The result of the request is some XML containing the modules and their
IDs. For now I'm just printing this out. We'll want to parse the XML and
display it in a nicer way.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sprints will change with time while the other IDs of a project will stay
the same. Thus sprints, which live in the `Module` field, must be
updated regularly.

In order to facilitate that updating, instead of requiring users to get
those IDs directly from the TimeTask website every time, have them use
this command to get the names of sprints and their IDs. They can then
update the ID manually in their config file.

This code makes a request to the endpoint that returns module IDs for
the site (the site queries this via AJAX to update its interface).

The result of the request is some XML containing the modules and their
IDs. For now I'm just printing this out. We'll want to parse the XML and
display it in a nicer way.
</pre>
</div>
</content>
</entry>
<entry>
<title>buildSubmissionParams(): Fix time string replacement bug</title>
<updated>2017-06-03T16:31:17+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-06-03T16:31:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/timetasker/commit/?id=6d138ee3c53913ef63565f66fed1b79d339b3230'/>
<id>6d138ee3c53913ef63565f66fed1b79d339b3230</id>
<content type='text'>
We ran into a bug where submitting "7" as the time spent would become
"700" on the site.

This was because our `n` value of 0 wasn't replacing the "." in the
string. Thus "7.00" became "7.00" after the replacement. Not right. I
misunderstood what that argument was doing and what the word "empty" in
the documentation meant.

Change the `n` value to replace all "."s in the string.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We ran into a bug where submitting "7" as the time spent would become
"700" on the site.

This was because our `n` value of 0 wasn't replacing the "." in the
string. Thus "7.00" became "7.00" after the replacement. Not right. I
misunderstood what that argument was doing and what the word "empty" in
the documentation meant.

Change the `n` value to replace all "."s in the string.
</pre>
</div>
</content>
</entry>
<entry>
<title>Change `TimeEntry.Time` to a `float64`</title>
<updated>2017-06-03T15:25:26+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-06-03T15:25:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/timetasker/commit/?id=e8bee60ed342ab4df93bf2fb582706ad7fd42546'/>
<id>e8bee60ed342ab4df93bf2fb582706ad7fd42546</id>
<content type='text'>
I had forgotten that time spent can be a decimal. Make this field a
float and change related code accordingly:

* --time flag
* `NewTimeEntry()` `time` argument
* `buildSubmissionParams()` can't use `strconv.Itoa` as that's an
  integer function. Instead we use `FormatFloat`. Truncate time parsing
  to two decimal places because to me that seems like enough. Who's
  going to say they spent `0.324` hours on something? Also, in order to
  be able to properly submit values to TimeTask (at least on the edition
  I use), the times must be written in European/French format, with
  commas (`,`) as decimal separators. Do a string replace to get this,
  as the float formatter will give us a period (`.`) separator.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I had forgotten that time spent can be a decimal. Make this field a
float and change related code accordingly:

* --time flag
* `NewTimeEntry()` `time` argument
* `buildSubmissionParams()` can't use `strconv.Itoa` as that's an
  integer function. Instead we use `FormatFloat`. Truncate time parsing
  to two decimal places because to me that seems like enough. Who's
  going to say they spent `0.324` hours on something? Also, in order to
  be able to properly submit values to TimeTask (at least on the edition
  I use), the times must be written in European/French format, with
  commas (`,`) as decimal separators. Do a string replace to get this,
  as the float formatter will give us a period (`.`) separator.
</pre>
</div>
</content>
</entry>
<entry>
<title>main.go;http.go: Remove commented unused imports</title>
<updated>2017-06-03T13:36:27+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-06-03T13:36:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/timetasker/commit/?id=e439f382fd4bfed4cb547ca59fc0d679658457d4'/>
<id>e439f382fd4bfed4cb547ca59fc0d679658457d4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Run gofmt on all project files</title>
<updated>2017-06-03T13:35:15+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2017-06-03T13:35:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/timetasker/commit/?id=10b741fb0c8e9c61647ea8ff977d6242fc86656e'/>
<id>10b741fb0c8e9c61647ea8ff977d6242fc86656e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
