wakatime 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 219412fa91ea8fbcac9bdb1e7b604f101ce4d6fa
4
- data.tar.gz: b44d8ebef80a9955690b8602d4ef080f93a36f6a
3
+ metadata.gz: 4e9e3610362a10c5dbd18be01aff5a625ac8bae0
4
+ data.tar.gz: bded75dee86cafc4a4ff9bb87f041424e94e8c6d
5
5
  SHA512:
6
- metadata.gz: 72cf5b0620fd543c42fbd924ad7ebe5317a1f47724d411bc1957e00b1ff2b83a777c9e9c4973a439365617275bb43e0fb60968c38fde8c1e12d0dbdc07cae318
7
- data.tar.gz: 645eacb5a0ab3ad52f3b195146f61de51b7f5c7f8d3471c6011274e0b50e5355702cd70ccde3689d6b63f9db051b5a0513683d87fd67c9d514ead19153803965
6
+ metadata.gz: 0c7c8467fefa2dec39d7c07f6b76f65c76f4d6666baf4e923c60afb48ebcd8488ba6e0183e7e7cbfb1126f47a95200d2932fff583909455a2564559d7e0beed0
7
+ data.tar.gz: 329891cb971c9c10de4c1a8e10347d4db81634bcd358104816324113a00e66c44902726ac4c370e7fe0735488dab194820eb11d47e8881c84d90c1d7865ea062
data/README.md CHANGED
@@ -31,8 +31,11 @@ Or install it yourself as:
31
31
  #### Daily Summary
32
32
  @client.daily
33
33
 
34
- #### Actions
35
- @client.actions
34
+ #### Durations
35
+ @client.durations
36
+
37
+ #### Heartbearts
38
+ @client.hearbeats
36
39
 
37
40
  #### Current User
38
41
  @client.current_user
@@ -21,12 +21,16 @@ module Wakatime
21
21
  request_builder('summary/daily', start: start_at, end: end_at)
22
22
  end
23
23
 
24
- def actions(params = {})
24
+ def durations(date = Date.today)
25
+ request_builder('durations', date: date)
26
+ end
27
+
28
+ def heartbeats(params = {})
25
29
  params[:start] ||= Time.now - 86_400
26
30
  params[:end] ||= Time.now
27
31
  params[:show] ||= 'file,branch,project,time'
28
32
 
29
- request_builder('actions', params)
33
+ request_builder('heartbeats', params)
30
34
  end
31
35
 
32
36
  def plugins(params = {})
@@ -3,7 +3,8 @@ module Wakatime
3
3
  module Models
4
4
  class Item < Hashie::Mash; end
5
5
  class Summary < Item; end
6
- class Action < Item; end
6
+ class Duration < Item; end
7
+ class Heartbeat < Item; end
7
8
  class User < Item; end
8
9
  class Plugin < Item; end
9
10
  end
@@ -1,3 +1,3 @@
1
1
  module Wakatime
2
- VERSION = '0.0.2'
2
+ VERSION = '0.1.0'
3
3
  end
@@ -22,14 +22,14 @@ describe Wakatime::Client do
22
22
  end
23
23
  end
24
24
 
25
- describe '#actions' do
25
+ describe '#heartbeats' do
26
26
  it 'should return json' do
27
- stub_request(:get, "#{Wakatime::API_URL}/actions")
27
+ stub_request(:get, "#{Wakatime::API_URL}/heartbeats")
28
28
  .with(query: hash_including(:start, :end))
29
- .to_return(body: File.read('./spec/fixtures/actions.json'), status: 200)
29
+ .to_return(body: File.read('./spec/fixtures/heartbeats.json'), status: 200)
30
30
 
31
31
  client = Wakatime::Client.new(@session)
32
- expect(client.actions.last.time).to eq 1_422_631_940.699831
32
+ expect(client.heartbeats.last.time).to eq 1_422_631_940.699831
33
33
 
34
34
  end
35
35
  end
@@ -35,11 +35,11 @@ describe Wakatime, skip: true do
35
35
  end
36
36
 
37
37
  it 'will return json scoped to specified times' do
38
- actions = @client.actions
39
- expect(actions).to be_a Array
40
- expect(actions.first).to be_a Wakatime::Models::Action
41
- expect(actions.first).to respond_to :file
42
- expect(actions.first).to respond_to :time
38
+ heartbeats = @client.heartbeats
39
+ expect(heartbeats).to be_a Array
40
+ expect(heartbeats.first).to be_a Wakatime::Models::Action
41
+ expect(heartbeats.first).to respond_to :file
42
+ expect(heartbeats.first).to respond_to :time
43
43
  end
44
44
 
45
45
  it 'will return current user json' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wakatime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Osborne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-31 00:00:00.000000000 Z
11
+ date: 2015-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -157,9 +157,9 @@ files:
157
157
  - lib/wakatime/session.rb
158
158
  - lib/wakatime/version.rb
159
159
  - spec/client_spec.rb
160
- - spec/fixtures/actions.json
161
160
  - spec/fixtures/current_user.json
162
161
  - spec/fixtures/daily.json
162
+ - spec/fixtures/heartbeats.json
163
163
  - spec/fixtures/plugins.json
164
164
  - spec/fixtures/summary.json
165
165
  - spec/integration/core_spec.rb
@@ -194,9 +194,9 @@ specification_version: 4
194
194
  summary: An unofficial ruby gem for accessing Wakatime records
195
195
  test_files:
196
196
  - spec/client_spec.rb
197
- - spec/fixtures/actions.json
198
197
  - spec/fixtures/current_user.json
199
198
  - spec/fixtures/daily.json
199
+ - spec/fixtures/heartbeats.json
200
200
  - spec/fixtures/plugins.json
201
201
  - spec/fixtures/summary.json
202
202
  - spec/integration/core_spec.rb