donald 0.1.1 → 0.1.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.
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright © 2009
3
+ Copyright © 2010
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.textile CHANGED
@@ -14,21 +14,27 @@ donald
14
14
 
15
15
  h2. Options:
16
16
 
17
- -m or --mvim
18
- Open files using mvim
17
+ h3. -g or --gvim
19
18
 
20
- -g or --gvim
21
19
  Open files using gvim
22
20
 
23
21
  Example:
24
22
 
25
23
  donald -g
26
24
 
25
+ h3. -m or --mvim
26
+
27
+ Open files using mvim
28
+
29
+ h3. -t or --textmate
30
+
31
+ Open files using Textmate
32
+
27
33
  h2. License
28
34
 
29
35
  (The MIT License)
30
36
 
31
- Copyright © 2009
37
+ Copyright © 2010
32
38
 
33
39
  Permission is hereby granted, free of charge, to any person obtaining
34
40
  a copy of this software and associated documentation files (the
data/bin/donald CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  require File.expand_path(File.dirname(__FILE__) + '/../lib/donald/merge_tool')
3
3
 
4
- merge_tool = Donald::MergeTool.new(ARGV)
4
+ merge_tool = Donald::MergeTool.new(STDOUT, ARGV)
5
5
 
6
6
  merge_tool.start
@@ -3,7 +3,8 @@ module Donald
3
3
  DELIMITER = '******************************'
4
4
  DEFAULT_EDITOR = 'vim'
5
5
 
6
- def initialize args = []
6
+ def initialize output, args = []
7
+ @output = output
7
8
  @options = parse_options args
8
9
  end
9
10
 
@@ -40,13 +41,13 @@ module Donald
40
41
  def call_vim files
41
42
  editor = @options[:editor] || DEFAULT_EDITOR
42
43
 
43
- system "#{editor} -p #{files.join(' ')}"
44
+ Kernel.system "#{editor}#{tab_argument editor} #{files.join(' ')}"
44
45
  end
45
46
 
46
47
  def print_files files
47
48
  print_delimiter
48
49
 
49
- files.each {|f| puts f}
50
+ files.each {|f| @output.puts f}
50
51
 
51
52
  print_delimiter
52
53
  end
@@ -54,13 +55,13 @@ module Donald
54
55
  def print_no_files_message
55
56
  print_delimiter
56
57
 
57
- puts 'No unmerged files found'
58
+ @output.puts 'No unmerged files found'
58
59
 
59
60
  print_delimiter
60
61
  end
61
62
 
62
63
  def print_delimiter
63
- puts DELIMITER
64
+ @output.puts DELIMITER
64
65
  end
65
66
 
66
67
  def parse_options args
@@ -68,8 +69,13 @@ module Donald
68
69
 
69
70
  options.merge! :editor => 'mvim' if args.include?('-m') || args.include?('--mvim')
70
71
  options.merge! :editor => 'gvim' if args.include?('-g') || args.include?('--gvim')
72
+ options.merge! :editor => 'mate' if args.include?('-t') || args.include?('--textmate')
71
73
 
72
74
  options
73
75
  end
76
+
77
+ def tab_argument editor
78
+ editor.include?('vim') ? ' -p' : ''
79
+ end
74
80
  end
75
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: donald
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Grasselli
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-21 00:00:00 -03:00
12
+ date: 2010-04-03 00:00:00 -03:00
13
13
  default_executable: donald
14
14
  dependencies: []
15
15