gwtf 0.4.2 → 0.4.3

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.
data/bin/gwtf CHANGED
@@ -44,8 +44,8 @@ pre do |global,command,options,args|
44
44
  project_dir = File.join(global[:data], global[:project])
45
45
 
46
46
  unless File.directory?(project_dir)
47
- if command.name == :new
48
- puts "Created a new project %s in %s" % [global[:project], project_dir]
47
+ if command.name == :new || global[:project] == "default"
48
+ puts "Created a new project %s in %s" % [global[:project], project_dir] unless global[:project] == "default"
49
49
  Gwtf::Items.setup(project_dir)
50
50
  else
51
51
  raise "Unknown project %s" % [global[:project]]
@@ -1,6 +1,14 @@
1
1
  desc 'Start work on an item in a subshell'
2
2
  arg_name 'Item id'
3
3
  command :shell do |c|
4
+ c.desc 'Runs a script before starting the sub-shell'
5
+ c.default_value nil
6
+ c.flag [:pre]
7
+
8
+ c.desc 'Runs a script after the sub-shell'
9
+ c.default_value nil
10
+ c.flag [:post]
11
+
4
12
  c.action do |global_options,options,args|
5
13
  raise "Please specify an item ID to work on" if args.empty?
6
14
  raise "SHELL is not set, cannot create sub shell" unless ENV.include?("SHELL")
@@ -14,13 +22,20 @@ command :shell do |c|
14
22
  ENV["GWTF_PROJECT"] = global_options[:project]
15
23
  ENV["GWTF_SUBJECT"] = item.subject
16
24
 
25
+ if options[:pre]
26
+ system(options[:pre])
27
+ end
28
+
17
29
  system(ENV["SHELL"])
18
30
 
31
+ if options[:post]
32
+ system(options[:post])
33
+ end
34
+
19
35
  elapsed_time = Time.now - start_time
20
36
 
21
37
  STDOUT.sync = true
22
38
 
23
-
24
39
  begin
25
40
  description = Gwtf.ask "Optional description for work log (start with done! to close): "
26
41
 
@@ -1,3 +1,3 @@
1
1
  module Gwtf
2
- VERSION = '0.4.2'
2
+ VERSION = '0.4.3'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gwtf
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 2
10
- version: 0.4.2
9
+ - 3
10
+ version: 0.4.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - R.I.Pienaar
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-28 00:00:00 +01:00
18
+ date: 2012-04-03 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency