dotime 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/History.txt +6 -0
  2. data/lib/basecamp.rb +18 -9
  3. data/lib/do_time.rb +1 -1
  4. metadata +10 -7
@@ -1,3 +1,9 @@
1
+ == 0.1.1 / 2007-05-24
2
+ * Updating basecamp.rb (http://forum.37signals.com/basecamp/forums/8/topics/2136)
3
+
4
+ == 0.1.0 / 2007-04-21
5
+ * Adding history file
6
+
1
7
  == 0.0.9 / 2007-04-21
2
8
  * Upgrading for compatibility with rubygems 0.9.2
3
9
 
@@ -23,7 +23,7 @@ end
23
23
  # session = Basecamp.new('your.basecamp.com', 'username', 'password')
24
24
  # puts "projects: #{session.projects.length}"
25
25
  class Basecamp
26
-
26
+
27
27
  # A wrapper to encapsulate the data returned by Basecamp, for easier access.
28
28
  class Record #:nodoc:
29
29
  attr_reader :type
@@ -36,7 +36,7 @@ class Basecamp
36
36
  def [](name)
37
37
  name = dashify(name)
38
38
  case @hash[name]
39
- when Hash then
39
+ when Hash then
40
40
  @hash[name] = (@hash[name].keys.length == 1 && Array === @hash[name].values.first) ?
41
41
  @hash[name].values.first.map { |v| Record.new(@hash[name].keys.first, v) } :
42
42
  Record.new(name, @hash[name])
@@ -84,7 +84,7 @@ class Basecamp
84
84
  # when to encode it as a simple field.
85
85
  class FileUpload
86
86
  attr_reader :filename, :content
87
-
87
+
88
88
  def initialize(filename, content)
89
89
  @filename = filename
90
90
  @content = content
@@ -148,7 +148,7 @@ class Basecamp
148
148
  url = "/projects/#{project_id}/msg"
149
149
  url << "/cat/#{category_id}" if category_id
150
150
  url << "/archive"
151
-
151
+
152
152
  records "post", url
153
153
  end
154
154
 
@@ -424,13 +424,22 @@ class Basecamp
424
424
  when "date" then Date.parse(content)
425
425
  else content
426
426
  end
427
+ # a special case to work-around a bug in XmlSimple. When you have an empty
428
+ # tag that has an attribute, XmlSimple will not add the __content__ key
429
+ # to the returned hash. Thus, we check for the presense of the 'type'
430
+ # attribute to look for empty, typed tags, and simply return nil for
431
+ # their value.
432
+ elsif value.keys == %w(type)
433
+ nil
434
+ # another special case, introduced by the latest rails, where an array
435
+ # type now exists. This is parsed by XmlSimple as a two-key hash, where
436
+ # one key is 'type' and the other is the actual array value.
437
+ elsif value.keys.length == 2 && value["type"] == "array"
438
+ value.delete("type")
439
+ typecast_value(value)
427
440
  else
428
441
  value.empty? ? nil : value.inject({}) do |h,(k,v)|
429
- if k == 'type'
430
- h = nil
431
- else
432
- h[k] = typecast_value(v)
433
- end
442
+ h[k] = typecast_value(v)
434
443
  h
435
444
  end
436
445
  end
@@ -17,7 +17,7 @@ end
17
17
  require File.dirname(__FILE__) + '/basecamp'
18
18
 
19
19
  class DoTime
20
- VERSION = '0.1.0'
20
+ VERSION = '0.1.1'
21
21
 
22
22
  include HighLine::SystemExtensions
23
23
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: dotime
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.0
7
- date: 2007-04-21 00:00:00 +02:00
6
+ version: 0.1.1
7
+ date: 2007-07-24 00:00:00 +02:00
8
8
  summary: Cheap time tracking for Basecamp todo lists
9
9
  require_paths:
10
10
  - lib
@@ -39,10 +39,13 @@ files:
39
39
  - test/test_do_time.rb
40
40
  test_files:
41
41
  - test/test_do_time.rb
42
- rdoc_options: []
43
-
44
- extra_rdoc_files: []
45
-
42
+ rdoc_options:
43
+ - --main
44
+ - README.txt
45
+ extra_rdoc_files:
46
+ - History.txt
47
+ - Manifest.txt
48
+ - README.txt
46
49
  executables:
47
50
  - dotime
48
51
  extensions: []
@@ -75,5 +78,5 @@ dependencies:
75
78
  requirements:
76
79
  - - ">="
77
80
  - !ruby/object:Gem::Version
78
- version: 1.2.0
81
+ version: 1.2.1
79
82
  version: