Pratt 1.5.8 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,9 +19,12 @@ namespace :pratt do
19
19
 
20
20
  namespace :schema do
21
21
  desc "Run schema file"
22
- task :run => :establish_connection do
23
- raise "Missing required file argument" unless ENV.include? 'file'
24
- schema_change = File.open( ENV['file'] ).read
22
+ task :run, :file, :needs => :establish_connection do |t, args|
23
+ puts args.inspect
24
+ puts args.file.nil?
25
+ puts args.file.empty?
26
+ raise "Missing required file argument" if args.file.nil? or ( not args.file.nil? and args.file.empty? )
27
+ schema_change = File.open( args.file ).read
25
28
 
26
29
  ActiveRecord::Schema.define do
27
30
  ActiveRecord::Base.transaction do
@@ -3,16 +3,17 @@ Project detail
3
3
  by <%= scale.red %> from
4
4
  <%= when_to.send("beginning_of_#{scale}").strftime(Pratt::FMT).blue %> to <%= when_to.send("end_of_#{scale}").strftime(Pratt::FMT).blue %>
5
5
  <% end %>
6
- <%= padded_to_max(' ') << 'dys'.underline << ' '*5 << 'hrs'.underline << ' '*5 << 'min'.underline %>
7
- <%= ( '-'.or '·')*60 %>
6
+ <%= padded_to_max('') << ' ' << 'dys'.underline << ' '*5 << 'hrs'.underline << ' '*5 << 'min'.underline << ' '*3 << 'total'.underline %>
7
+ <%= ( '-'.or '·')*67 %>
8
8
 
9
9
  <% @projects.each do |proj| %>
10
- <% if show_all or ( !show_all and proj.time_spent(scale, when_to) != 0.0 ) %>
11
- <%= padded_to_max(proj.name) %><%= ('|'.or '⋮') %> <%= Pratt.totals(proj.time_spent(scale, when_to)) %>
10
+ <% hour_spent = proj.time_spent(scale, when_to) %>
11
+ <% if show_all or ( !show_all and hour_spent != 0.0 ) %>
12
+ <%= padded_to_max(proj.name) %><%= ('|'.or '⋮') %> <%= Pratt.fmt_i(hour_spent / 24, 'day', :cyan) %> <%= Pratt.fmt_i(hour_spent % 24, 'hour', :yellow) %> <%= Pratt.fmt_i((60*(hour_spent - hour_spent.to_i)), 'min', :green) %> <%= "%0.2f".blue% hour_spent %>
12
13
  <% end %>
13
14
  <% end %>
14
15
 
15
- <%= ( '-'.or '·' )*60 %>
16
+ <%= ( '-'.or '·' )*67 %>
16
17
 
17
18
  <%= padded_to_max('Total') %> <%= ("%0.2f"%@scaled_total).underline %> hrs
18
19
  <%= Pratt.percent(Project.primary.name, @primary.to_f, @scaled_total, :green) %>
@@ -41,19 +41,19 @@ project_combo.pack('side' => 'bottom', 'fill' => 'y')
41
41
 
42
42
  change = proc {
43
43
  Process.detach(
44
- fork { system("ruby bin/pratt.rb --change '#{project_combo.get}' --begin '#{project_combo.get}' --unlock") }
44
+ fork { system("ruby bin/pratt.rb --project '#{project_combo.get}' --change --begin --unlock") }
45
45
  )
46
46
  exit
47
47
  }
48
48
  quit = proc {
49
49
  Process.detach(
50
- fork { system("ruby bin/pratt.rb --end '#{project_combo.get}' --unlock --quit") }
50
+ fork { system("ruby bin/pratt.rb --project '#{project_combo.get}' --end --unlock --quit") }
51
51
  )
52
52
  exit
53
53
  }
54
54
  start = proc {
55
55
  Process.detach(
56
- fork { system("ruby bin/pratt.rb --begin '#{project_combo.get}' --unlock") }
56
+ fork { system("ruby bin/pratt.rb --project '#{project_combo.get}' --begin --unlock") }
57
57
  )
58
58
  exit
59
59
  }
@@ -27,21 +27,15 @@ ARGV.options do |opt|
27
27
  end
28
28
 
29
29
  yes = proc {
30
- c = fork { system("ruby bin/pratt.rb --restart '#{opts.project_name}' --unlock") }
30
+ c = fork { system("ruby bin/pratt.rb --project '#{opts.project_name}' --restart --unlock") }
31
31
  Process.detach(c)
32
32
  exit
33
33
  }
34
34
  adjust = proc {
35
- c = fork { system("ruby bin/pratt.rb --end '#{opts.project_name}' --unlock --gui") }
35
+ c = fork { system("ruby bin/pratt.rb --project '#{opts.project_name}' --end --unlock --gui") }
36
36
  Process.detach(c)
37
37
  exit
38
38
  }
39
- ignore = proc {
40
- Process.detach(
41
- fork { system("ruby bin/pratt.rb --unlock") }
42
- )
43
- exit
44
- }
45
39
 
46
40
  root = TkRoot.new { title "Pratt Reminder" }
47
41
 
@@ -72,14 +66,6 @@ end.pack('side' => 'left', :fill => 'y')
72
66
  root.bind("Alt-y", yes)
73
67
  #root.bind("Return", yes)
74
68
 
75
- TkButton.new(botm_frm) do
76
- text "Ignore"
77
- command ignore
78
- underline 0
79
- end.pack('side' => 'right', :fill => 'y')
80
- root.bind("Alt-i", ignore)
81
- root.bind("Escape", ignore)
82
-
83
69
  TkButton.new(botm_frm) do
84
70
  text "Adjust"
85
71
  command adjust
@@ -1,8 +1,6 @@
1
1
  #!/usr/bin/ruby
2
2
  require 'tk'
3
3
  require 'tkextlib/tile'
4
- require 'optparse'
5
- require 'ostruct'
6
4
 
7
5
  $project = self.project
8
6
 
@@ -51,15 +49,6 @@ TkButton.new(botm_frm) do
51
49
  underline 0
52
50
  end.pack('side' => 'left', :fill => 'y')
53
51
  root.bind("Alt-y", yes)
54
- #root.bind("Return", yes)
55
-
56
- TkButton.new(botm_frm) do
57
- text "Ignore"
58
- command cleanup
59
- underline 0
60
- end.pack('side' => 'right', :fill => 'y')
61
- root.bind("Alt-i", cleanup)
62
- root.bind("Escape", cleanup)
63
52
 
64
53
  TkButton.new(botm_frm) do
65
54
  text "Adjust"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Pratt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.8
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Noel-Hemming
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-20 00:00:00 -07:00
12
+ date: 2010-02-15 00:00:00 -08:00
13
13
  default_executable: pratt.rb
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -52,6 +52,16 @@ dependencies:
52
52
  - !ruby/object:Gem::Version
53
53
  version: 1.2.4
54
54
  version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: shifty_week
57
+ type: :runtime
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 0.1.0
64
+ version:
55
65
  description: "\n\
56
66
  \t Need a way to keep track of your time, but get caught up in work? Or constant interruptions?\n\
57
67
  \t Yeah you know who I'm talking about. Those people from the [abc] department always \"NEEDING xyz FEATURE NOW!!!\".\n\
@@ -69,21 +79,26 @@ extensions: []
69
79
 
70
80
  extra_rdoc_files:
71
81
  - README.txt
82
+ - TODO
72
83
  files:
73
84
  - .exrc
74
85
  - .gitignore
75
86
  - History.txt
76
87
  - Manifest.txt
77
88
  - Pratt.gemspec
89
+ - Pratt.mm
78
90
  - README.txt
79
91
  - Rakefile
92
+ - Session.vim
80
93
  - TODO
81
94
  - VERSION
82
95
  - bin/pratt.rb
83
96
  - config.rb
97
+ - db/sqlite_databases_go_here
84
98
  - lib/pratt.rb
85
99
  - lib/pratt/array.rb
86
100
  - lib/pratt/string.rb
101
+ - lib/pratt/time.rb
87
102
  - models/app.rb
88
103
  - models/customer.rb
89
104
  - models/payment.rb
@@ -331,6 +346,9 @@ files:
331
346
  - pkgs/tile-0.8.2/win/tile.rc
332
347
  - pkgs/tile-0.8.2/win/winTheme.c
333
348
  - pkgs/tile-0.8.2/win/xpTheme.c
349
+ - pkgs/tktray1.2.tar.gz
350
+ - pratt.mm
351
+ - reports/travel.log
334
352
  - spec/app_spec.rb
335
353
  - spec/customer_spec.rb
336
354
  - spec/fixtures/graph.expectation
@@ -375,16 +393,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
393
  version:
376
394
  requirements: []
377
395
 
378
- rubyforge_project:
396
+ rubyforge_project: Pratt
379
397
  rubygems_version: 1.3.5
380
398
  signing_key:
381
399
  specification_version: 3
382
400
  summary: Pro/Re-Active Time Tracker. Track time based on what you expect to be working on, with frequent prompts to ensure accuracy.
383
401
  test_files:
402
+ - spec/customer_spec.rb
403
+ - spec/project_spec.rb
384
404
  - spec/pratt_spec.rb
405
+ - spec/spec_helper.rb
406
+ - spec/app_spec.rb
385
407
  - spec/whence_spec.rb
386
408
  - spec/payment_spec.rb
387
- - spec/app_spec.rb
388
- - spec/project_spec.rb
389
- - spec/spec_helper.rb
390
- - spec/customer_spec.rb