TokiCLI 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/.gitignore +9 -17
- data/.rspec +3 -0
- data/.travis.yml +3 -0
- data/CHANGELOG.md +4 -0
- data/README.md +99 -163
- data/Rakefile +5 -0
- data/TokiCLI.gemspec +5 -4
- data/bin/toki +2 -2
- data/lib/API/helpers.rb +27 -170
- data/lib/API/toki_api.rb +227 -0
- data/lib/API/toki_db.rb +67 -0
- data/lib/TokiCLI.rb +270 -5
- data/lib/TokiCLI/adnimport.rb +202 -0
- data/lib/TokiCLI/fileops.rb +187 -0
- data/lib/TokiCLI/status.rb +49 -37
- data/lib/TokiCLI/version.rb +1 -1
- data/lib/TokiCLI/view.rb +133 -86
- data/lib/TokiServer/.bowerrc +3 -0
- data/lib/TokiServer/.gitignore +2 -0
- data/lib/TokiServer/Gemfile +1 -0
- data/lib/TokiServer/bower.json +0 -0
- data/lib/TokiServer/bower_components/fastclick/.bower.json +4 -4
- data/lib/TokiServer/bower_components/fastclick/bower.json +1 -1
- data/lib/TokiServer/bower_components/fastclick/lib/fastclick.js +33 -2
- data/lib/TokiServer/bower_components/foundation/.bower.json +5 -4
- data/lib/TokiServer/bower_components/foundation/bower.json +2 -1
- data/lib/TokiServer/bower_components/foundation/css/foundation.css +2173 -922
- data/lib/TokiServer/bower_components/foundation/css/foundation.css.map +7 -0
- data/lib/TokiServer/bower_components/foundation/css/normalize.css +53 -16
- data/lib/TokiServer/bower_components/foundation/css/normalize.css.map +7 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation.js +782 -542
- data/lib/TokiServer/bower_components/foundation/js/foundation.min.js +4 -3
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.abide.js +45 -31
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.accordion.js +12 -6
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.alert.js +5 -5
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.clearing.js +34 -10
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.dropdown.js +83 -29
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.equalizer.js +3 -3
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.interchange.js +25 -12
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.joyride.js +112 -40
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.js +19 -5
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.magellan.js +22 -11
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.offcanvas.js +52 -8
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.orbit.js +133 -271
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.reveal.js +27 -20
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.slider.js +73 -33
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.tab.js +88 -31
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.tooltip.js +7 -5
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.topbar.js +44 -24
- data/lib/TokiServer/bower_components/foundation/js/vendor/fastclick.js +2 -2
- data/lib/TokiServer/bower_components/foundation/js/vendor/modernizr.js +2 -2
- data/lib/TokiServer/bower_components/foundation/scss/foundation.scss +38 -38
- data/lib/TokiServer/bower_components/foundation/scss/foundation/_functions.scss +3 -3
- data/lib/TokiServer/bower_components/foundation/scss/foundation/_settings.scss +417 -271
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_accordion.scss +110 -6
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_alert-boxes.scss +2 -2
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_block-grid.scss +2 -2
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_breadcrumbs.scss +8 -3
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_button-groups.scss +99 -9
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_buttons.scss +66 -28
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_clearing.scss +5 -5
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_dropdown-buttons.scss +4 -4
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_dropdown.scss +48 -35
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_forms.scss +104 -32
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_global.scss +48 -30
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_grid.scss +19 -4
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_icon-bar.scss +293 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_joyride.scss +11 -9
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_keystrokes.scss +4 -4
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_labels.scss +4 -2
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_magellan.scss +1 -1
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_offcanvas.scss +193 -35
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_orbit.scss +92 -147
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_pagination.scss +22 -10
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_panels.scss +10 -7
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_pricing-tables.scss +11 -11
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_progress-bars.scss +2 -2
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_range-slider.scss +29 -9
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_reveal.scss +60 -56
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_side-nav.scss +3 -2
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_split-buttons.scss +2 -2
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_sub-nav.scss +2 -2
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_switches.scss +226 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_tables.scss +13 -7
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_tabs.scss +22 -8
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_thumbs.scss +2 -4
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_toolbar.scss +70 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_tooltips.scss +9 -7
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_top-bar.scss +77 -44
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_type.scss +21 -9
- data/lib/TokiServer/bower_components/modernizr/.bower.json +4 -4
- data/lib/TokiServer/bower_components/modernizr/feature-detects/workers-blobworkers.js +2 -2
- data/lib/TokiServer/bower_components/modernizr/grunt.js +1 -1
- data/lib/TokiServer/bower_components/modernizr/modernizr.js +2 -2
- data/lib/TokiServer/config.rb +0 -0
- data/lib/TokiServer/humans.txt +0 -0
- data/lib/TokiServer/{itunesicon.rb → itunesicons.rb} +25 -23
- data/lib/TokiServer/js/app.js +0 -0
- data/lib/TokiServer/public/stylesheets/app.css +2636 -1610
- data/lib/TokiServer/robots.txt +0 -0
- data/lib/TokiServer/scss/_settings.scss +0 -0
- data/lib/TokiServer/scss/app.scss +7 -1
- data/lib/TokiServer/tokiserver.rb +239 -244
- data/lib/TokiServer/views/activity.erb +42 -0
- data/lib/TokiServer/views/apps_total.erb +8 -2
- data/lib/TokiServer/views/error.erb +13 -4
- data/lib/TokiServer/views/index.erb +36 -27
- data/lib/TokiServer/views/logs_total.erb +34 -0
- data/spec/TokiCLI_spec.rb +354 -0
- data/spec/mock/mock.sqlite3 +0 -0
- data/spec/spec_helper.rb +26 -0
- metadata +78 -23
- data/lib/API/dbapi.rb +0 -488
- data/lib/TokiCLI/app.rb +0 -389
- data/lib/TokiCLI/authorize.rb +0 -77
- data/lib/TokiCLI/export.rb +0 -81
- data/lib/TokiCLI/get_channels.rb +0 -22
- data/lib/TokiCLI/get_messages.rb +0 -32
- data/lib/TokiCLI/import.rb +0 -122
- data/lib/TokiCLI/scan.rb +0 -19
- data/lib/TokiCLI/search_messages.rb +0 -23
- data/lib/TokiServer/README.md +0 -37
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_reveal-new.scss +0 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_switch.scss +0 -294
- data/lib/TokiServer/views/name_log.erb +0 -50
- data/lib/TokiServer/views/name_split.erb +0 -37
- data/lib/TokiServer/views/name_total.erb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d881a874cdf17efa2db5ad24c0ab808d5a89fc7
|
4
|
+
data.tar.gz: 118745d1d2ee3ab2e4108115303f99fc507ed1c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ea00b551307a61234ffed4f78fcbbd8bb355e5831a88903107eadcf7e3ead7281b2f225dc5e173d2a60c243ac2a392c72776803e0d800bc382c60687d129ff1
|
7
|
+
data.tar.gz: d9d1c10fa33308227dbcb96e5ebbb497dc50f2d88a1338765d6c8ccd6bda7ece83b872b3631555e2597e00fb02bc3662c725ccc616abcc28358dd07127895207
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
CHANGED
@@ -1,20 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
6
3
|
Gemfile.lock
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
4
|
+
/_yardoc/
|
5
|
+
/coverage/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
tmp/
|
18
9
|
*.bundle
|
19
10
|
*.so
|
20
11
|
*.o
|
@@ -22,5 +13,6 @@ tmp
|
|
22
13
|
mkmf.log
|
23
14
|
token
|
24
15
|
.tags
|
25
|
-
|
16
|
+
.sass-cache/
|
26
17
|
.sublime*
|
18
|
+
*.gem
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,39 +1,10 @@
|
|
1
|
-
- [TokiCLI](#tokicli)
|
2
|
-
- [Installation](#installation)
|
3
|
-
- [Usage](#usage)
|
4
|
-
- [Total](#total)
|
5
|
-
- [Top](#top)
|
6
|
-
- [Day](#day)
|
7
|
-
- [Since](#since)
|
8
|
-
- [Before](#before)
|
9
|
-
- [Range](#range)
|
10
|
-
- [App](#app)
|
11
|
-
- [App before](#app-before)
|
12
|
-
- [App since](#app-since)
|
13
|
-
- [App day](#app-day)
|
14
|
-
- [App range](#app-range)
|
15
|
-
- [Log](#log)
|
16
|
-
- [Scan](#scan)
|
17
|
-
- [Auth](#auth)
|
18
|
-
- [Global option: JSON](#global-option-json)
|
19
|
-
- [Global option: CSV](#global-option-csv)
|
20
|
-
- [Restore database from App.net](#restore-database-from-appnet)
|
21
|
-
- [API](#api)
|
22
|
-
- [Local server for the API](#local-server-for-the-api)
|
23
|
-
- [Endpoints](#endpoints)
|
24
|
-
- [Tools](#tools)
|
25
|
-
- [Toki](#toki)
|
26
|
-
- [Important](#important)
|
27
|
-
- [Next](#next)
|
28
|
-
- [Thanks](#thanks)
|
29
|
-
|
30
1
|
# TokiCLI
|
31
2
|
|
32
3
|
Toki.app command-line client and API server.
|
33
4
|
|
34
5
|
Access your Toki data from the local database or from the App.net backup channel, via the CLI interface or the served API.
|
35
6
|
|
36
|
-
![
|
7
|
+
![TokiServer example](https://www.evernote.com/shard/s89/sh/dd392b00-82b6-4f13-b573-c925a99ae5a0/02aa5ea4266e8bc7e28d7c91ba8b922c/deep/0/toki-server.png)
|
37
8
|
|
38
9
|
|
39
10
|
## Installation
|
@@ -42,6 +13,20 @@ Access your Toki data from the local database or from the App.net backup channel
|
|
42
13
|
|
43
14
|
## Usage
|
44
15
|
|
16
|
+
### Help
|
17
|
+
|
18
|
+
`toki`
|
19
|
+
|
20
|
+
shows the basic commands.
|
21
|
+
|
22
|
+
`toki help <command>`
|
23
|
+
|
24
|
+
shows help and available options for a specific command.
|
25
|
+
|
26
|
+
Example:
|
27
|
+
|
28
|
+
`toki help bundle`
|
29
|
+
|
45
30
|
### Total
|
46
31
|
|
47
32
|
The **total** command shows the total usage time for all apps.
|
@@ -88,60 +73,74 @@ The **range** command shows your top used apps between two specific days.
|
|
88
73
|
|
89
74
|
### App
|
90
75
|
|
91
|
-
|
76
|
+
Complete log for an app
|
77
|
+
|
78
|
+
`toki app airmail`
|
79
|
+
|
80
|
+
Several apps may contain the same name. In that case, they will all be processed.
|
81
|
+
|
82
|
+
Example: `toki app apple`
|
92
83
|
|
93
|
-
|
84
|
+
#### App before
|
94
85
|
|
95
|
-
|
86
|
+
Complete log for an app before a specific day
|
96
87
|
|
97
|
-
|
88
|
+
`toki app airmail --before 2014-04-19`
|
98
89
|
|
99
|
-
`toki app --bundle 'com.googlecode.iterm2'`
|
100
90
|
|
101
|
-
|
91
|
+
#### App since
|
102
92
|
|
103
|
-
|
93
|
+
Complete log for an app since a specific day
|
104
94
|
|
105
|
-
`toki
|
95
|
+
`toki app airmail --since 2014-04-19`
|
106
96
|
|
107
|
-
`toki app_before --bundle 'com.googlecode.iterm2' 2014-04-19`
|
108
97
|
|
98
|
+
#### App day
|
109
99
|
|
110
|
-
|
100
|
+
Complete log for an app on a specific day
|
111
101
|
|
112
|
-
|
102
|
+
`toki app airmail --day 2014-04-19`
|
113
103
|
|
114
|
-
|
104
|
+
#### App range
|
115
105
|
|
116
|
-
|
106
|
+
Complete log for an app between two specific days
|
117
107
|
|
108
|
+
`toki app airmail --range 2014-04-19 2014-05-12`
|
118
109
|
|
119
|
-
### App day
|
120
110
|
|
121
|
-
|
111
|
+
### Bundle
|
122
112
|
|
123
|
-
|
113
|
+
Complete log for an app, given its exact bundle ID.
|
124
114
|
|
125
|
-
`
|
115
|
+
Same features as for `app`, just give an app bundle instead of an app name.
|
126
116
|
|
127
|
-
|
117
|
+
This should always return only one app log.
|
118
|
+
|
119
|
+
```
|
120
|
+
toki bundle it.bloop.airmail
|
121
|
+
toki bundle it.bloop.airmail --before 2014-04-19
|
122
|
+
toki bundle it.bloop.airmail --since 2014-04-19
|
123
|
+
toki bundle it.bloop.airmail --day 2014-04-19
|
124
|
+
toki bundle it.bloop.airmail --range 2014-04-19 2014-05-12
|
125
|
+
```
|
128
126
|
|
129
|
-
|
127
|
+
### Activity
|
130
128
|
|
131
|
-
|
129
|
+
Recent Toki activity log.
|
132
130
|
|
133
|
-
`toki
|
131
|
+
`toki activity`
|
134
132
|
|
133
|
+
#### Activity since
|
135
134
|
|
136
|
-
|
135
|
+
Complete Toki activity log since a specific day.
|
137
136
|
|
138
|
-
|
137
|
+
`toki activity --since 2014-04-19`
|
139
138
|
|
140
|
-
|
139
|
+
#### Activity day
|
141
140
|
|
142
|
-
|
141
|
+
Complete Toki activity log for a specific day.
|
143
142
|
|
144
|
-
|
143
|
+
`toki activity --day 2014-04-19`
|
145
144
|
|
146
145
|
### Scan
|
147
146
|
|
@@ -149,154 +148,101 @@ Scan for apps name.
|
|
149
148
|
|
150
149
|
Will crawl the Applications folder and try to resolve app names from bundle identifiers.
|
151
150
|
|
152
|
-
Toki
|
151
|
+
*Toki can display apps names in results only if apps have been scanned.*
|
152
|
+
|
153
153
|
|
154
|
-
###
|
154
|
+
### Option: JSON
|
155
155
|
|
156
|
-
|
156
|
+
Export the Toki results as a JSON file with the `--json` option:
|
157
157
|
|
158
|
-
|
158
|
+
`toki total --json`
|
159
159
|
|
160
|
-
|
160
|
+
`toki day 2014-04-18 --json `
|
161
161
|
|
162
|
-
|
162
|
+
`toki top -n10 -J`
|
163
163
|
|
164
|
-
|
164
|
+
### Option: CSV
|
165
165
|
|
166
|
-
|
166
|
+
Export the Toki results as a CSV file with the `--csv` option:
|
167
167
|
|
168
|
-
`toki
|
168
|
+
`toki total --csv`
|
169
169
|
|
170
|
-
|
170
|
+
`toki day 2014-04-18 --csv`
|
171
171
|
|
172
|
-
|
172
|
+
`toki top -n10 -C`
|
173
173
|
|
174
|
-
|
174
|
+
### Delete
|
175
175
|
|
176
|
-
|
176
|
+
Completely delete all traces of an app in the database.
|
177
177
|
|
178
|
-
|
178
|
+
With backup:
|
179
|
+
|
180
|
+
`toki delete it.bloop.airmail`
|
181
|
+
|
182
|
+
Without backup:
|
183
|
+
|
184
|
+
`toki delete it.bloop.airmail --no-backup`
|
179
185
|
|
180
186
|
### Restore database from App.net
|
181
187
|
|
182
188
|
Toki.app backs up your Toki tracked apps data 'in the cloud' via an App.net channel.
|
183
189
|
|
184
|
-
TokiCLI should be able to download this data and *rebuild the Toki database* if you lost your local install or
|
185
|
-
|
186
|
-
`toki auth`
|
190
|
+
TokiCLI should be able to download this data and *rebuild the Toki database* if you lost your local install or if it has been compromised.
|
187
191
|
|
188
192
|
`toki restore`
|
189
193
|
|
190
194
|
# API
|
191
195
|
|
192
|
-
##
|
196
|
+
## Server for the API
|
193
197
|
|
194
198
|
`toki serve`
|
195
199
|
|
196
|
-
|
200
|
+
Returns a JSON response for each request.
|
197
201
|
|
198
202
|
Examples of API calls with curl:
|
199
203
|
|
200
204
|
```
|
201
205
|
curl http://localhost:4567/api/apps/top/10
|
202
|
-
curl http://localhost:4567/api/find/safari/log
|
203
|
-
curl http://localhost:4567/api/find/safari/since/2014-05-27
|
204
|
-
curl http://localhost:4567/api/bundle/com.apple.Safari/before/2014-05-27
|
205
206
|
curl http://localhost:4567/api/apps/day/2014-05-27
|
206
207
|
curl http://localhost:4567/api/apps/range/2014-05-27/2014-05-30
|
208
|
+
curl http://localhost:4567/api/logs/app/safari/
|
209
|
+
curl http://localhost:4567/api/logs/app/safari/since/2014-05-27
|
210
|
+
curl http://localhost:4567/api/logs/bundle/com.apple.Safari/before/2014-05-27
|
211
|
+
curl http://localhost:4567/api/user
|
212
|
+
curl http://localhost:4567/api/bundles
|
207
213
|
```
|
208
214
|
|
209
|
-
|
215
|
+
Find the list of all endpoints with `curl http://localhost:4567/api`.
|
210
216
|
|
211
|
-
##
|
217
|
+
## Library
|
212
218
|
|
213
|
-
You can also use the TokiCLI API in another app
|
219
|
+
You can also use the TokiCLI API in another app:
|
214
220
|
|
215
221
|
`require 'TokiCLI'`
|
216
222
|
|
217
|
-
|
218
|
-
|
219
|
-
`toki = TokiCLI::DBAPI.new`
|
220
|
-
|
221
|
-
Get the total time for an app, in seconds, given its exact bundle identifier:
|
222
|
-
|
223
|
-
`time = toki.bundle_total 'com.sublimetext.3'`
|
224
|
-
|
225
|
-
With a (partial) name:
|
226
|
-
|
227
|
-
`time = toki.name_total 'sublime'`
|
228
|
-
|
229
|
-
Get the total time for an app, in seconds, given its exact bundle identifier, since a specific day:
|
230
|
-
|
231
|
-
`time = toki.bundle_total_since 'com.sublimetext.3', '2014-05-15'`
|
232
|
-
|
233
|
-
With a (partial) name:
|
234
|
-
|
235
|
-
`time = toki.name_total_since 'sublime', '2014-05-15'`
|
223
|
+
### Basic
|
236
224
|
|
237
|
-
|
225
|
+
Create a basic TokiCLI API instance:
|
238
226
|
|
239
|
-
`
|
227
|
+
`toki = TokiCLI::TokiAPI.new("#{~/Library/path/to/tokiapp/db}")`
|
240
228
|
|
241
|
-
|
229
|
+
*That's the format used by the test suite.*
|
242
230
|
|
243
|
-
|
231
|
+
### With apps names
|
244
232
|
|
245
|
-
|
233
|
+
Create a TokiCLI FileOps instance:
|
246
234
|
|
247
|
-
`
|
235
|
+
`fileops = TokiCLI::FileOps.new`
|
248
236
|
|
249
|
-
|
237
|
+
Scan for apps names (see ##Tools):
|
250
238
|
|
251
|
-
`
|
239
|
+
`fileops.save_bundles`
|
252
240
|
|
253
|
-
|
254
|
-
|
255
|
-
`time = toki.bundle_total_range 'com.sublimetext.3', '2014-05-15', '2014-05-17'`
|
256
|
-
|
257
|
-
With a (partial) name:
|
258
|
-
|
259
|
-
`time = toki.name_total_range 'sublime', '2014-05-15', '2014-05-17'`
|
260
|
-
|
261
|
-
Get the total time of all apps used between day 1 and day 2:
|
262
|
-
|
263
|
-
`apps = toki.apps_range '2014-05-15', '2014-05-17'`
|
264
|
-
|
265
|
-
Get the total time of all apps used on a specific day:
|
266
|
-
|
267
|
-
`apps = toki.apps_day '2014-05-15'`
|
268
|
-
|
269
|
-
Get the total time of all tracked apps:
|
270
|
-
|
271
|
-
`apps = toki.apps_total`
|
272
|
-
|
273
|
-
Get the top x tracked apps (5 by default):
|
274
|
-
|
275
|
-
`apps = toki.apps_top 10`
|
276
|
-
|
277
|
-
Get the complete log for an app:
|
278
|
-
|
279
|
-
`log = toki.bundle_log 'com.sublimetext.3'`
|
280
|
-
|
281
|
-
With a (partial) name:
|
282
|
-
|
283
|
-
`log = toki.name_log 'sublime text'`
|
284
|
-
|
285
|
-
|
286
|
-
## Tools
|
287
|
-
|
288
|
-
Scan disk for installed apps, get their names from their bundle identifiers and save the file (ignores unresolved identifiers):
|
289
|
-
|
290
|
-
`app_names = toki.scan_apps`
|
291
|
-
|
292
|
-
Get apps names and bundle identifiers (without re-scanning, and including unresolved identifiers):
|
293
|
-
|
294
|
-
`app_names = toki.tracked_apps`
|
295
|
-
|
296
|
-
Get bundle_id from app name or partial app name:
|
241
|
+
Create a TokiCLI API instance:
|
297
242
|
|
298
|
-
`
|
243
|
+
`toki = TokiCLI::TokiAPI.new(fileops.db_file, fileops.bundles)`
|
299
244
|
|
245
|
+
*See `toki_api.rb` and `fileops.rb` for the list of available methods.*
|
300
246
|
|
301
247
|
# Toki
|
302
248
|
|
@@ -311,13 +257,3 @@ It's a time tracker for your apps that sits in the menu bar.
|
|
311
257
|
**Tracking is the job of Toki.app by @keita.**
|
312
258
|
|
313
259
|
TokiCLI interacts only with the Toki.app database or the App.net backup channel.
|
314
|
-
|
315
|
-
## Next
|
316
|
-
|
317
|
-
Teasing: TokiCLI has only read-only commands... for now. ;)
|
318
|
-
|
319
|
-
## Thanks
|
320
|
-
|
321
|
-
Keita was super nice and said "Awesome!" instead of just "Yes" or "GTFO" when I asked him if I could use the 'Toki' name for this companion Gem.
|
322
|
-
|
323
|
-
Many thanks and congrats to Keita! :)
|