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 +4 -4
- data/README.md +5 -2
- data/lib/wakatime/client.rb +6 -2
- data/lib/wakatime/models/item.rb +2 -1
- data/lib/wakatime/version.rb +1 -1
- data/spec/client_spec.rb +4 -4
- data/spec/fixtures/{actions.json → heartbeats.json} +0 -0
- data/spec/integration/core_spec.rb +5 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e9e3610362a10c5dbd18be01aff5a625ac8bae0
|
4
|
+
data.tar.gz: bded75dee86cafc4a4ff9bb87f041424e94e8c6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c7c8467fefa2dec39d7c07f6b76f65c76f4d6666baf4e923c60afb48ebcd8488ba6e0183e7e7cbfb1126f47a95200d2932fff583909455a2564559d7e0beed0
|
7
|
+
data.tar.gz: 329891cb971c9c10de4c1a8e10347d4db81634bcd358104816324113a00e66c44902726ac4c370e7fe0735488dab194820eb11d47e8881c84d90c1d7865ea062
|
data/README.md
CHANGED
data/lib/wakatime/client.rb
CHANGED
@@ -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
|
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('
|
33
|
+
request_builder('heartbeats', params)
|
30
34
|
end
|
31
35
|
|
32
36
|
def plugins(params = {})
|
data/lib/wakatime/models/item.rb
CHANGED
data/lib/wakatime/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -22,14 +22,14 @@ describe Wakatime::Client do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
describe '#
|
25
|
+
describe '#heartbeats' do
|
26
26
|
it 'should return json' do
|
27
|
-
stub_request(:get, "#{Wakatime::API_URL}/
|
27
|
+
stub_request(:get, "#{Wakatime::API_URL}/heartbeats")
|
28
28
|
.with(query: hash_including(:start, :end))
|
29
|
-
.to_return(body: File.read('./spec/fixtures/
|
29
|
+
.to_return(body: File.read('./spec/fixtures/heartbeats.json'), status: 200)
|
30
30
|
|
31
31
|
client = Wakatime::Client.new(@session)
|
32
|
-
expect(client.
|
32
|
+
expect(client.heartbeats.last.time).to eq 1_422_631_940.699831
|
33
33
|
|
34
34
|
end
|
35
35
|
end
|
File without changes
|
@@ -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
|
-
|
39
|
-
expect(
|
40
|
-
expect(
|
41
|
-
expect(
|
42
|
-
expect(
|
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
|
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-
|
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
|