time_tap 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,151 @@
1
+ html, body
2
+ margin: 0
3
+ padding: 0
4
+ font-family: Helvetica, sans
5
+ background-color: #eee
6
+
7
+ pre
8
+ font-family: Helvetica, sans
9
+ line-height: 1.2em
10
+ h1, h2, h3, h4, p
11
+ margin: 0
12
+
13
+
14
+ body
15
+ padding: 1em
16
+
17
+ #page_contents
18
+ background-color: #fff
19
+ padding: 1em
20
+
21
+ h2
22
+ color: #999
23
+ padding: 0.5em 0
24
+ b
25
+ color: #444
26
+
27
+ th
28
+ text-align: left
29
+ a.project
30
+ text-decoration: none
31
+ color: black
32
+ &:hover
33
+ text-decoration: underline
34
+ td
35
+ padding: 0.5em
36
+
37
+ i
38
+ color: #ccc
39
+
40
+ .tip
41
+ color: #ccc
42
+
43
+ h1 .tip
44
+ font-size: 0.5em
45
+
46
+ .clear
47
+ clear: both
48
+
49
+ .back
50
+ margin-bottom: 2em
51
+ a
52
+ background-color: #222
53
+ -webkit-border-radius: 0.5em
54
+ color: white
55
+ padding: 0.5em
56
+ // # display: block
57
+ // # float: left
58
+ text-decoration: none
59
+ &:hover
60
+ background-color: #444
61
+
62
+ ul.header
63
+ margin: 0
64
+ padding: 0
65
+ float: left
66
+ display: block
67
+ li
68
+ list-style: none
69
+ margin: 0
70
+ padding: 0
71
+ display: inline
72
+ a
73
+ background-color: #369
74
+
75
+ .header
76
+ margin: 0
77
+ padding: 0
78
+ a, input.submit
79
+ border: none
80
+ margin: 0
81
+ padding: 0
82
+ background-color: red
83
+ font-size: 0.6em
84
+ text-transform: uppercase
85
+ color: white
86
+ text-decoration: none
87
+ padding: 0.3em
88
+ h1
89
+ border-left: 15px solid #369
90
+ margin: 0
91
+ padding: 0.5em
92
+ clear: both
93
+ width: 50%
94
+ background-color: white
95
+ font-size: 1.3em
96
+ margin-bottom: 0.5em
97
+
98
+ a.cancel
99
+ background-color: #333
100
+
101
+ textarea
102
+ margin: 0
103
+ padding: 0
104
+ border: none
105
+ display: block
106
+ width: 100%
107
+ height: auto
108
+ font-size: 1em
109
+ font-family: monaco
110
+ line-height: 1em
111
+ .bad_content &
112
+ width: 49%
113
+ display: inline
114
+ &.bad
115
+ color: #ccc
116
+
117
+
118
+ #list
119
+ h1
120
+ border-color: #69c
121
+ ul
122
+ padding: 0
123
+ margin: 0
124
+ li
125
+ padding: 0
126
+ margin: 1px 0
127
+ list-style: none
128
+ a
129
+ padding: 0.5em
130
+ display: block
131
+ border-left: 1em solid #ccc
132
+ font-size: 1.3em
133
+ font-weight: bold
134
+ text-decoration: none
135
+ color: #ccc
136
+ width: 50%
137
+ background-color: white
138
+ line-height: 2em
139
+ &:hover
140
+ border-color: #369
141
+ color: black
142
+
143
+ a.day
144
+ text-decoration: none
145
+ color: #444
146
+ &:hover
147
+ text-decoration: underline
148
+
149
+
150
+
151
+
@@ -0,0 +1,49 @@
1
+ module TimeTap
2
+ module Watcher
3
+ extend self
4
+
5
+ def keep_watching editor
6
+ last = nil
7
+
8
+ # TODO: pick which application the user wants...
9
+ editor = editor.new
10
+
11
+ File.open(File.join(TimeTap.config[:root], ".tap_history"), 'a') do |history|
12
+ history.sync = true
13
+ loop do
14
+ exit if $stop
15
+ begin
16
+ if editor.is_running? && !(path = editor.current_path).blank?
17
+ mtime = File.stat(path).mtime
18
+ current = [path, mtime]
19
+
20
+ unless current == last
21
+ # The following equals to this shell code:
22
+ # `echo \`date +%s\`: \`pwd\``
23
+ history << "#{mtime.to_i}: #{path}\n"
24
+ last = [path, mtime]
25
+ end
26
+ end
27
+ rescue Editors::EditorError
28
+ # do nothing
29
+ rescue
30
+ puts Time.now.to_s
31
+ puts $!.to_s
32
+ puts $!.backtrace.join("\n")
33
+
34
+ File.open(File.join(TimeTap.config[:root], ".tap_errors"), "w") do |file|
35
+ file.puts Time.now.to_s
36
+ file.puts $!.to_s
37
+ file.puts $!.backtrace.join("\n")
38
+ end
39
+
40
+ raise if $!.kind_of?(SignalException)
41
+ end
42
+ sleep 30
43
+ end
44
+ end
45
+ end
46
+
47
+
48
+ end
49
+ end
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,21 @@
1
+ require 'bundler'
2
+ begin
3
+ Bundler.setup(:default, :development)
4
+ rescue Bundler::BundlerError => e
5
+ $stderr.puts e.message
6
+ $stderr.puts "Run `bundle install` to install missing gems"
7
+ exit e.status_code
8
+ end
9
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
10
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
11
+ require 'time_tap'
12
+ require 'rspec'
13
+ require 'rspec/autorun'
14
+
15
+ # Requires supporting files with custom matchers and macros, etc,
16
+ # in ./support/ and its subdirectories.
17
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
18
+
19
+ RSpec.configure do |config|
20
+
21
+ end
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "TimeTap" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
@@ -0,0 +1,115 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{time_tap}
8
+ s.version = "0.2.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Elia Schito"]
12
+ s.date = %q{2010-10-17}
13
+ s.default_executable = %q{timetap}
14
+ s.description = %q{TimeTap helps you track the time you spend coding on each project while in TextMate.}
15
+ s.email = %q{perlelia@gmail.com}
16
+ s.executables = ["timetap"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.md"
20
+ ]
21
+ s.files = [
22
+ ".gitignore",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE",
26
+ "README.md",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "bin/timetap",
30
+ "config.yaml",
31
+ "lib/time_tap.rb",
32
+ "lib/time_tap/daemon.rb",
33
+ "lib/time_tap/editors.rb",
34
+ "lib/time_tap/project.rb",
35
+ "lib/time_tap/server.rb",
36
+ "lib/time_tap/tasks.rb",
37
+ "lib/time_tap/views/index.haml",
38
+ "lib/time_tap/views/layout.haml",
39
+ "lib/time_tap/views/project.haml",
40
+ "lib/time_tap/views/project_day.haml",
41
+ "lib/time_tap/views/stylesheet.sass",
42
+ "lib/time_tap/watcher.rb",
43
+ "spec/.rspec",
44
+ "spec/spec_helper.rb",
45
+ "spec/time_tap_spec.rb",
46
+ "time_tap.gemspec"
47
+ ]
48
+ s.homepage = %q{http://github.com/elia/timetap}
49
+ s.require_paths = ["lib"]
50
+ s.rubygems_version = %q{1.3.7}
51
+ s.summary = %q{Unobtrusive time tracking for TextMate}
52
+ s.test_files = [
53
+ "spec/spec_helper.rb",
54
+ "spec/time_tap_spec.rb"
55
+ ]
56
+
57
+ if s.respond_to? :specification_version then
58
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
59
+ s.specification_version = 3
60
+
61
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
62
+ s.add_runtime_dependency(%q<activesupport>, ["~> 2.3.8"])
63
+ s.add_runtime_dependency(%q<actionpack>, ["~> 2.3.8"])
64
+ s.add_runtime_dependency(%q<i18n>, ["~> 0.3.5"])
65
+ s.add_runtime_dependency(%q<haml>, [">= 0"])
66
+ s.add_runtime_dependency(%q<rb-appscript>, [">= 0"])
67
+ s.add_runtime_dependency(%q<sinatra>, [">= 0"])
68
+ s.add_development_dependency(%q<rspec>, [">= 2.0.0.beta.19"])
69
+ s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
70
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
71
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.0.pre3"])
72
+ s.add_development_dependency(%q<rcov>, [">= 0"])
73
+ s.add_development_dependency(%q<rspec>, [">= 2.0.0.beta.19"])
74
+ s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
75
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
76
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.0.pre3"])
77
+ s.add_development_dependency(%q<rcov>, [">= 0"])
78
+ else
79
+ s.add_dependency(%q<activesupport>, ["~> 2.3.8"])
80
+ s.add_dependency(%q<actionpack>, ["~> 2.3.8"])
81
+ s.add_dependency(%q<i18n>, ["~> 0.3.5"])
82
+ s.add_dependency(%q<haml>, [">= 0"])
83
+ s.add_dependency(%q<rb-appscript>, [">= 0"])
84
+ s.add_dependency(%q<sinatra>, [">= 0"])
85
+ s.add_dependency(%q<rspec>, [">= 2.0.0.beta.19"])
86
+ s.add_dependency(%q<yard>, ["~> 0.6.0"])
87
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
88
+ s.add_dependency(%q<jeweler>, ["~> 1.5.0.pre3"])
89
+ s.add_dependency(%q<rcov>, [">= 0"])
90
+ s.add_dependency(%q<rspec>, [">= 2.0.0.beta.19"])
91
+ s.add_dependency(%q<yard>, ["~> 0.6.0"])
92
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
93
+ s.add_dependency(%q<jeweler>, ["~> 1.5.0.pre3"])
94
+ s.add_dependency(%q<rcov>, [">= 0"])
95
+ end
96
+ else
97
+ s.add_dependency(%q<activesupport>, ["~> 2.3.8"])
98
+ s.add_dependency(%q<actionpack>, ["~> 2.3.8"])
99
+ s.add_dependency(%q<i18n>, ["~> 0.3.5"])
100
+ s.add_dependency(%q<haml>, [">= 0"])
101
+ s.add_dependency(%q<rb-appscript>, [">= 0"])
102
+ s.add_dependency(%q<sinatra>, [">= 0"])
103
+ s.add_dependency(%q<rspec>, [">= 2.0.0.beta.19"])
104
+ s.add_dependency(%q<yard>, ["~> 0.6.0"])
105
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
106
+ s.add_dependency(%q<jeweler>, ["~> 1.5.0.pre3"])
107
+ s.add_dependency(%q<rcov>, [">= 0"])
108
+ s.add_dependency(%q<rspec>, [">= 2.0.0.beta.19"])
109
+ s.add_dependency(%q<yard>, ["~> 0.6.0"])
110
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
111
+ s.add_dependency(%q<jeweler>, ["~> 1.5.0.pre3"])
112
+ s.add_dependency(%q<rcov>, [">= 0"])
113
+ end
114
+ end
115
+
metadata ADDED
@@ -0,0 +1,344 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: time_tap
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
+ platform: ruby
12
+ authors:
13
+ - Elia Schito
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-10-17 00:00:00 +02:00
19
+ default_executable: timetap
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ hash: 19
28
+ segments:
29
+ - 2
30
+ - 3
31
+ - 8
32
+ version: 2.3.8
33
+ type: :runtime
34
+ name: activesupport
35
+ prerelease: false
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ hash: 19
44
+ segments:
45
+ - 2
46
+ - 3
47
+ - 8
48
+ version: 2.3.8
49
+ type: :runtime
50
+ name: actionpack
51
+ prerelease: false
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ~>
58
+ - !ruby/object:Gem::Version
59
+ hash: 25
60
+ segments:
61
+ - 0
62
+ - 3
63
+ - 5
64
+ version: 0.3.5
65
+ type: :runtime
66
+ name: i18n
67
+ prerelease: false
68
+ version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ requirement: &id004 !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 3
76
+ segments:
77
+ - 0
78
+ version: "0"
79
+ type: :runtime
80
+ name: haml
81
+ prerelease: false
82
+ version_requirements: *id004
83
+ - !ruby/object:Gem::Dependency
84
+ requirement: &id005 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ hash: 3
90
+ segments:
91
+ - 0
92
+ version: "0"
93
+ type: :runtime
94
+ name: rb-appscript
95
+ prerelease: false
96
+ version_requirements: *id005
97
+ - !ruby/object:Gem::Dependency
98
+ requirement: &id006 !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ hash: 3
104
+ segments:
105
+ - 0
106
+ version: "0"
107
+ type: :runtime
108
+ name: sinatra
109
+ prerelease: false
110
+ version_requirements: *id006
111
+ - !ruby/object:Gem::Dependency
112
+ requirement: &id007 !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ hash: 62196421
118
+ segments:
119
+ - 2
120
+ - 0
121
+ - 0
122
+ - beta
123
+ - 19
124
+ version: 2.0.0.beta.19
125
+ type: :development
126
+ name: rspec
127
+ prerelease: false
128
+ version_requirements: *id007
129
+ - !ruby/object:Gem::Dependency
130
+ requirement: &id008 !ruby/object:Gem::Requirement
131
+ none: false
132
+ requirements:
133
+ - - ~>
134
+ - !ruby/object:Gem::Version
135
+ hash: 7
136
+ segments:
137
+ - 0
138
+ - 6
139
+ - 0
140
+ version: 0.6.0
141
+ type: :development
142
+ name: yard
143
+ prerelease: false
144
+ version_requirements: *id008
145
+ - !ruby/object:Gem::Dependency
146
+ requirement: &id009 !ruby/object:Gem::Requirement
147
+ none: false
148
+ requirements:
149
+ - - ~>
150
+ - !ruby/object:Gem::Version
151
+ hash: 23
152
+ segments:
153
+ - 1
154
+ - 0
155
+ - 0
156
+ version: 1.0.0
157
+ type: :development
158
+ name: bundler
159
+ prerelease: false
160
+ version_requirements: *id009
161
+ - !ruby/object:Gem::Dependency
162
+ requirement: &id010 !ruby/object:Gem::Requirement
163
+ none: false
164
+ requirements:
165
+ - - ~>
166
+ - !ruby/object:Gem::Version
167
+ hash: -1876988218
168
+ segments:
169
+ - 1
170
+ - 5
171
+ - 0
172
+ - pre3
173
+ version: 1.5.0.pre3
174
+ type: :development
175
+ name: jeweler
176
+ prerelease: false
177
+ version_requirements: *id010
178
+ - !ruby/object:Gem::Dependency
179
+ requirement: &id011 !ruby/object:Gem::Requirement
180
+ none: false
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ hash: 3
185
+ segments:
186
+ - 0
187
+ version: "0"
188
+ type: :development
189
+ name: rcov
190
+ prerelease: false
191
+ version_requirements: *id011
192
+ - !ruby/object:Gem::Dependency
193
+ requirement: &id012 !ruby/object:Gem::Requirement
194
+ none: false
195
+ requirements:
196
+ - - ">="
197
+ - !ruby/object:Gem::Version
198
+ hash: 62196421
199
+ segments:
200
+ - 2
201
+ - 0
202
+ - 0
203
+ - beta
204
+ - 19
205
+ version: 2.0.0.beta.19
206
+ type: :development
207
+ name: rspec
208
+ prerelease: false
209
+ version_requirements: *id012
210
+ - !ruby/object:Gem::Dependency
211
+ requirement: &id013 !ruby/object:Gem::Requirement
212
+ none: false
213
+ requirements:
214
+ - - ~>
215
+ - !ruby/object:Gem::Version
216
+ hash: 7
217
+ segments:
218
+ - 0
219
+ - 6
220
+ - 0
221
+ version: 0.6.0
222
+ type: :development
223
+ name: yard
224
+ prerelease: false
225
+ version_requirements: *id013
226
+ - !ruby/object:Gem::Dependency
227
+ requirement: &id014 !ruby/object:Gem::Requirement
228
+ none: false
229
+ requirements:
230
+ - - ~>
231
+ - !ruby/object:Gem::Version
232
+ hash: 23
233
+ segments:
234
+ - 1
235
+ - 0
236
+ - 0
237
+ version: 1.0.0
238
+ type: :development
239
+ name: bundler
240
+ prerelease: false
241
+ version_requirements: *id014
242
+ - !ruby/object:Gem::Dependency
243
+ requirement: &id015 !ruby/object:Gem::Requirement
244
+ none: false
245
+ requirements:
246
+ - - ~>
247
+ - !ruby/object:Gem::Version
248
+ hash: -1876988218
249
+ segments:
250
+ - 1
251
+ - 5
252
+ - 0
253
+ - pre3
254
+ version: 1.5.0.pre3
255
+ type: :development
256
+ name: jeweler
257
+ prerelease: false
258
+ version_requirements: *id015
259
+ - !ruby/object:Gem::Dependency
260
+ requirement: &id016 !ruby/object:Gem::Requirement
261
+ none: false
262
+ requirements:
263
+ - - ">="
264
+ - !ruby/object:Gem::Version
265
+ hash: 3
266
+ segments:
267
+ - 0
268
+ version: "0"
269
+ type: :development
270
+ name: rcov
271
+ prerelease: false
272
+ version_requirements: *id016
273
+ description: TimeTap helps you track the time you spend coding on each project while in TextMate.
274
+ email: perlelia@gmail.com
275
+ executables:
276
+ - timetap
277
+ extensions: []
278
+
279
+ extra_rdoc_files:
280
+ - LICENSE
281
+ - README.md
282
+ files:
283
+ - .gitignore
284
+ - Gemfile
285
+ - Gemfile.lock
286
+ - LICENSE
287
+ - README.md
288
+ - Rakefile
289
+ - VERSION
290
+ - bin/timetap
291
+ - config.yaml
292
+ - lib/time_tap.rb
293
+ - lib/time_tap/daemon.rb
294
+ - lib/time_tap/editors.rb
295
+ - lib/time_tap/project.rb
296
+ - lib/time_tap/server.rb
297
+ - lib/time_tap/tasks.rb
298
+ - lib/time_tap/views/index.haml
299
+ - lib/time_tap/views/layout.haml
300
+ - lib/time_tap/views/project.haml
301
+ - lib/time_tap/views/project_day.haml
302
+ - lib/time_tap/views/stylesheet.sass
303
+ - lib/time_tap/watcher.rb
304
+ - spec/.rspec
305
+ - spec/spec_helper.rb
306
+ - spec/time_tap_spec.rb
307
+ - time_tap.gemspec
308
+ has_rdoc: true
309
+ homepage: http://github.com/elia/timetap
310
+ licenses: []
311
+
312
+ post_install_message:
313
+ rdoc_options: []
314
+
315
+ require_paths:
316
+ - lib
317
+ required_ruby_version: !ruby/object:Gem::Requirement
318
+ none: false
319
+ requirements:
320
+ - - ">="
321
+ - !ruby/object:Gem::Version
322
+ hash: 3
323
+ segments:
324
+ - 0
325
+ version: "0"
326
+ required_rubygems_version: !ruby/object:Gem::Requirement
327
+ none: false
328
+ requirements:
329
+ - - ">="
330
+ - !ruby/object:Gem::Version
331
+ hash: 3
332
+ segments:
333
+ - 0
334
+ version: "0"
335
+ requirements: []
336
+
337
+ rubyforge_project:
338
+ rubygems_version: 1.3.7
339
+ signing_key:
340
+ specification_version: 3
341
+ summary: Unobtrusive time tracking for TextMate
342
+ test_files:
343
+ - spec/spec_helper.rb
344
+ - spec/time_tap_spec.rb