purse 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,10 @@
1
- == 0.0.1 2008-07-19
1
+ == 0.1.1 2008-10-29
2
+
3
+ * minor enhancements:
4
+ * Error handling for git integration
5
+ * Prompt before creating pockets
6
+
7
+ == 0.1.0 2008-10-28
2
8
 
3
9
  * 1 major enhancement:
4
10
  * Initial release
@@ -35,8 +35,10 @@ module Purse
35
35
  end
36
36
  rescue MissingFile
37
37
  say("Could not find note: #{pocket_name}/#{note_name}")
38
+ rescue Git::GitExecuteError => e
39
+ say(e)
38
40
  rescue NoMethodError => e
39
- say("Sorry, there is no action #{action}.\nTry purse --help for a list of commands.")
41
+ say("Sorry, there is no action #{action}.\nTry purse --help for a list of commands. #{e}")
40
42
  end
41
43
  hr
42
44
  end
@@ -57,7 +59,14 @@ module Purse
57
59
 
58
60
  def init(pocket_name)
59
61
  pocket = Pocket.new(pocket_path(pocket_name))
60
- pocket.init
62
+ if !pocket.exists?
63
+ say("could not find pocket /#{pocket_name}")
64
+ if cli.agree("would you like to create it? (y/n)")
65
+ pocket.init
66
+ else
67
+ exit
68
+ end
69
+ end
61
70
  pocket
62
71
  end
63
72
 
@@ -132,7 +141,7 @@ module Purse
132
141
  say("Pulling changes from remote (#{pocket.remote})")
133
142
  pocket.pull
134
143
  hr
135
- sary("Pushing changes to remote (#{pocket.remote})")
144
+ say("Pushing changes to remote (#{pocket.remote})")
136
145
  pocket.push
137
146
  end
138
147
 
@@ -8,10 +8,14 @@ module Purse
8
8
  end
9
9
 
10
10
  def init
11
- FileUtils.mkdir_p(@path) unless File.readable?(@path)
11
+ FileUtils.mkdir_p(@path) unless exists?
12
12
  git
13
13
  end
14
14
 
15
+ def exists?
16
+ File.readable?(@path) && File.directory?(@path)
17
+ end
18
+
15
19
  def delete
16
20
  FileUtils.rm_rf(@path)
17
21
  end
@@ -52,8 +56,10 @@ module Purse
52
56
 
53
57
  def commit
54
58
  git.add('.')
55
- return if git.status.changed.empty?
59
+ # return if git.status.changed.empty?
56
60
  git.commit_all("Changes via Purse #{Time.now}")
61
+ rescue Git::GitExecuteError => e
62
+ puts e
57
63
  end
58
64
 
59
65
  def remote
@@ -2,7 +2,7 @@ module Purse
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: purse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Quint
@@ -9,9 +9,49 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-29 00:00:00 -04:00
12
+ date: 2008-10-30 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: highline
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.4.0
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: git
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.5
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: crypt
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 1.1.4
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: termios
47
+ type: :runtime
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 0.9.4
54
+ version:
15
55
  - !ruby/object:Gem::Dependency
16
56
  name: hoe
17
57
  type: :development