beeminder 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem 'rake'
4
+
3
5
  # Specify your gem's dependencies in beeminder-gem.gemspec
4
6
  gemspec
@@ -68,6 +68,8 @@ else
68
68
  Trollop::die "invalid date" if date.nil?
69
69
 
70
70
  g = bee.goal goal
71
- dp = Beeminder::Datapoint.new :timestamp => date, :value => value, :comment => (comment || "")
71
+ dp = Beeminder::Datapoint.new :timestamp => date,
72
+ :value => value,
73
+ :comment => (comment || "")
72
74
  g.add dp
73
75
  end
@@ -150,7 +150,7 @@ module Beeminder
150
150
  end
151
151
  end
152
152
 
153
- # Convert datapoint to hash for POSTing.
153
+ # Convert goal to hash for POSTing.
154
154
  # @return [Hash]
155
155
  def to_hash
156
156
  {
@@ -132,16 +132,12 @@ module Beeminder
132
132
  # @param time [Date|DateTime|Time] Time to convert.
133
133
  # @return [Time] Converted time.
134
134
  def convert_to_timezone time
135
- # TODO seems way too hack-ish
136
- old_tz = Time.zone
137
- Time.zone = @timezone
135
+ Time.use_zone(@timezone){
138
136
 
139
- time = time.to_time
140
- t = Time.new(time.year, time.month, time.day, time.hour, time.min, time.sec)
141
-
142
- Time.zone = old_tz
143
-
144
- t
137
+ time = time.to_time unless time.is_a?(Time)
138
+ Time.local(time.year, time.month, time.day, time.hour, time.min, time.sec)
139
+
140
+ }
145
141
  end
146
142
 
147
143
  private
@@ -1,3 +1,3 @@
1
1
  module Beeminder
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beeminder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-19 00:00:00.000000000 Z
12
+ date: 2013-01-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -142,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  segments:
144
144
  - 0
145
- hash: 4040090933613779056
145
+ hash: 996315672154388465
146
146
  required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  none: false
148
148
  requirements:
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  segments:
153
153
  - 0
154
- hash: 4040090933613779056
154
+ hash: 996315672154388465
155
155
  requirements: []
156
156
  rubyforge_project:
157
157
  rubygems_version: 1.8.23