durt 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'application_record'
4
+
5
+ module Durt
6
+ class Status < ApplicationRecord
7
+ scope :active, -> { where(active: true) }
8
+
9
+ scope :to_choice_h, -> { Hash[map { |s| [s.name, s.id] }] }
10
+ end
11
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Durt
4
+ class TimeTracker
5
+ def self.active?
6
+ true
7
+ end
8
+
9
+ def self.switch_project(_project); end
10
+
11
+ def self.enter(_memo)
12
+ raise NotImplementedError
13
+ end
14
+
15
+ def self.start
16
+ raise NotImplementedError
17
+ end
18
+
19
+ def self.stop
20
+ raise NotImplementedError
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'plugin'
4
+
5
+ module Durt
6
+ class UpworkPlugin < Plugin
7
+ def enter(issue)
8
+ time_tracker.enter(issue)
9
+ end
10
+
11
+ def start(_value)
12
+ time_tracker.start
13
+ end
14
+
15
+ def stop(_value)
16
+ time_tracker.stop
17
+ end
18
+
19
+ def time_tracker_class
20
+ Durt::UpworkTracker
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'time_tracker'
4
+
5
+ module Durt
6
+ class UpworkTracker < TimeTracker
7
+ def self.open_edit_memo
8
+ `xdotool key super+7`
9
+
10
+ reset_workspace
11
+
12
+ `xdotool key ctrl+alt+e`
13
+ end
14
+
15
+ def self.edit_memo(issue)
16
+ `xdotool key ctrl+shift+BackSpace`
17
+
18
+ `xdotool type '#{issue}'`
19
+ sleep(0.5)
20
+
21
+ `xdotool key Tab`
22
+ `xdotool key Tab`
23
+ `xdotool key Return`
24
+ sleep(0.5)
25
+ end
26
+
27
+ def self.close_edit_memo
28
+ `xdotool key ctrl+alt+t`
29
+ `xdotool key super+7`
30
+ sleep(1)
31
+ end
32
+
33
+ def self.enter(issue)
34
+ open_edit_memo
35
+ edit_memo(issue)
36
+ close_edit_memo
37
+
38
+ stop
39
+ end
40
+
41
+ def self.start
42
+ `xdotool key ctrl+alt+0x005D`
43
+ end
44
+
45
+ def self.stop
46
+ `xdotool key ctrl+alt+0x005B`
47
+ end
48
+
49
+ def self.switch_project(project)
50
+ open_edit_memo
51
+
52
+ `xdotool key Escape`
53
+ sleep(0.5)
54
+
55
+ toggle_fullscreen
56
+
57
+ `xdotool mousemove --sync 400 50 click 1`
58
+ sleep(0.5)
59
+
60
+ `xdotool key Tab`
61
+ sleep(0.5)
62
+
63
+ `xdotool type #{project.name}`
64
+ sleep(0.5)
65
+
66
+ `xdotool mousemove --sync 400 150 click 1`
67
+ sleep(0.5)
68
+
69
+ toggle_fullscreen
70
+
71
+ close_edit_memo
72
+ end
73
+
74
+ def self.toggle_fullscreen
75
+ `xdotool key super+f`
76
+ sleep(0.5)
77
+ end
78
+
79
+ # private
80
+
81
+ def self.reset_workspace
82
+ # Ensure that the time tracking window moves to current workspace
83
+ `xdotool key ctrl+alt+t`
84
+ `xdotool key ctrl+alt+t`
85
+ sleep(0.5)
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Durt
4
+ VERSION = '0.11.0'
5
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ describe Durt::VERSION do
4
+ it 'should be defined' do
5
+ expect(Durt::VERSION).to eq('0.1.0')
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'simplecov'
4
+ SimpleCov.start do
5
+ add_filter '/spec/'
6
+ add_filter '/bin/'
7
+ end
8
+
9
+ require_relative '../lib/durt'
metadata ADDED
@@ -0,0 +1,264 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: durt
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.11.0
5
+ platform: ruby
6
+ authors:
7
+ - Luis Felipe Sanchez
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-06-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activerecord
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: chronic_duration
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.10'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: jira-ruby
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.6'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: octokit
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '4.13'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '4.13'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.11'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.11'
83
+ - !ruby/object:Gem::Dependency
84
+ name: sqlite3
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 1.3.6
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 1.3.6
97
+ - !ruby/object:Gem::Dependency
98
+ name: standalone_migrations
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '5.2'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '5.2'
111
+ - !ruby/object:Gem::Dependency
112
+ name: tracker_api
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.9'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.9'
125
+ - !ruby/object:Gem::Dependency
126
+ name: tty-prompt
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.18'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.18'
139
+ - !ruby/object:Gem::Dependency
140
+ name: aruba
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.14'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.14'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rake
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '12.3'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '12.3'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rspec
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '3.9'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '3.9'
181
+ - !ruby/object:Gem::Dependency
182
+ name: simplecov
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '0.15'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '0.15'
195
+ description: EBS tool for me
196
+ email:
197
+ executables:
198
+ - durt
199
+ extensions: []
200
+ extra_rdoc_files: []
201
+ files:
202
+ - LICENSE
203
+ - README.md
204
+ - bin/durt
205
+ - db/config.yml
206
+ - db/sample.sqlite3
207
+ - lib/durt.rb
208
+ - lib/durt/application_record.rb
209
+ - lib/durt/bug_tracker.rb
210
+ - lib/durt/command.rb
211
+ - lib/durt/configurable.rb
212
+ - lib/durt/ebs_plugin.rb
213
+ - lib/durt/github_bug_tracker.rb
214
+ - lib/durt/github_plugin.rb
215
+ - lib/durt/global_controller.rb
216
+ - lib/durt/issue.rb
217
+ - lib/durt/jira_bug_tracker.rb
218
+ - lib/durt/jira_plugin.rb
219
+ - lib/durt/local_bug_tracker.rb
220
+ - lib/durt/local_plugin.rb
221
+ - lib/durt/notify_plugin.rb
222
+ - lib/durt/notify_tracker.rb
223
+ - lib/durt/null_bug_tracker.rb
224
+ - lib/durt/null_time_tracker.rb
225
+ - lib/durt/pivotal_bug_tracker.rb
226
+ - lib/durt/pivotal_plugin.rb
227
+ - lib/durt/plugin.rb
228
+ - lib/durt/project.rb
229
+ - lib/durt/project_controller.rb
230
+ - lib/durt/service.rb
231
+ - lib/durt/session.rb
232
+ - lib/durt/status.rb
233
+ - lib/durt/time_tracker.rb
234
+ - lib/durt/upwork_plugin.rb
235
+ - lib/durt/upwork_tracker.rb
236
+ - lib/durt/version.rb
237
+ - spec/durt/version_spec.rb
238
+ - spec/spec_helper.rb
239
+ homepage: https://durt.github.io
240
+ licenses:
241
+ - MIT
242
+ metadata: {}
243
+ post_install_message:
244
+ rdoc_options: []
245
+ require_paths:
246
+ - lib
247
+ required_ruby_version: !ruby/object:Gem::Requirement
248
+ requirements:
249
+ - - ">="
250
+ - !ruby/object:Gem::Version
251
+ version: '0'
252
+ required_rubygems_version: !ruby/object:Gem::Requirement
253
+ requirements:
254
+ - - ">="
255
+ - !ruby/object:Gem::Version
256
+ version: '0'
257
+ requirements: []
258
+ rubygems_version: 3.0.3
259
+ signing_key:
260
+ specification_version: 4
261
+ summary: Unify tools for EBS
262
+ test_files:
263
+ - spec/durt/version_spec.rb
264
+ - spec/spec_helper.rb