to-do 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.md +3 -1
  2. data/VERSION +1 -1
  3. data/lib/to-do/cli.rb +14 -7
  4. data/to-do.gemspec +1 -1
  5. metadata +16 -16
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
- #to-do 1.2
1
+ #to-do 1.2.1
2
2
 
3
3
  A simple command line todo application.
4
4
 
5
+ ##What's new 1.2.1
6
+ * Bug Fixes
5
7
 
6
8
  ##What's new in 1.2
7
9
  * Remove a list
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.2.1
data/lib/to-do/cli.rb CHANGED
@@ -7,11 +7,8 @@ module Todo
7
7
  # the methods to parse command line arguments.
8
8
  module CLI
9
9
  extend self
10
- WORKING_LIST = ""
11
- if File.exists?(File.join(Config[:lists_directory], Config[:working_list_name]+'.yml'))
12
10
  # The current working list
13
- WORKING_LIST=YAML.load_file(File.join(Config[:lists_directory], Config[:working_list_name]+'.yml'))
14
- end
11
+ WORKING_LIST=YAML.load_file(File.join(Config[:lists_directory], Config[:working_list_name]+'.yml')) if File.exists?(File.join(Config[:lists_directory], Config[:working_list_name]+'.yml'))
15
12
 
16
13
  # The option flags
17
14
  OPTIONS = {
@@ -80,7 +77,12 @@ module Todo
80
77
  exit
81
78
  end
82
79
  opts.on('-w', "displays the name of the current list") do
83
- puts "Working list is #{WORKING_LIST.name}"
80
+ if Config[:working_list_exists]
81
+ puts "Working list is #{WORKING_LIST.name}"
82
+ else
83
+ puts "Working List does not exist yet. Please create one"
84
+ puts "todo create <list name>"
85
+ end
84
86
  exit
85
87
  end
86
88
  end
@@ -123,6 +125,7 @@ module Todo
123
125
  when "create", "switch"
124
126
  if File.exists?(File.join(Config[:lists_directory], ARGV[1..-1].join('_').downcase + '.yml'))
125
127
  Config[:working_list_name] = ARGV[1..-1].join('_').downcase
128
+ Config[:working_list_exists] = true
126
129
  puts "Switch to #{ARGV[1..-1].join(' ')}"
127
130
  new_list = YAML.load_file(File.join(Config[:lists_directory],
128
131
  Config[:working_list_name]+'.yml')) if File.exists?(File.join(Config[:lists_directory],
@@ -163,8 +166,12 @@ module Todo
163
166
  # Parses the commands and options
164
167
  def parse
165
168
  optparse = option_parser
166
- optparse.parse!
167
- commands_parser
169
+ begin
170
+ optparse.parse!
171
+ commands_parser
172
+ rescue OptionParser::InvalidOption => e
173
+ puts "#{e}. See todo -h for help."
174
+ end
168
175
  end
169
176
 
170
177
  end
data/to-do.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "to-do"
8
- s.version = "1.2.0"
8
+ s.version = "1.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristen Mills"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: to-do
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
16
- requirement: &70154354563460 !ruby/object:Gem::Requirement
16
+ requirement: &70161145118480 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70154354563460
24
+ version_requirements: *70161145118480
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rdoc
27
- requirement: &70154354562980 !ruby/object:Gem::Requirement
27
+ requirement: &70161145118000 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.12'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70154354562980
35
+ version_requirements: *70161145118000
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &70154354562500 !ruby/object:Gem::Requirement
38
+ requirement: &70161145117520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.0.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70154354562500
46
+ version_requirements: *70161145117520
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jeweler
49
- requirement: &70154354586060 !ruby/object:Gem::Requirement
49
+ requirement: &70161145117040 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.8.4
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70154354586060
57
+ version_requirements: *70161145117040
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: simplecov
60
- requirement: &70154354585580 !ruby/object:Gem::Requirement
60
+ requirement: &70161145116500 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70154354585580
68
+ version_requirements: *70161145116500
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: colorize
71
- requirement: &70154354585100 !ruby/object:Gem::Requirement
71
+ requirement: &70161145115960 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70154354585100
79
+ version_requirements: *70161145115960
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: yard
82
- requirement: &70154354584620 !ruby/object:Gem::Requirement
82
+ requirement: &70161145115400 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70154354584620
90
+ version_requirements: *70161145115400
91
91
  description: A simple command line todo application
92
92
  email: kristen@kristen-mills.com
93
93
  executables:
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  segments:
128
128
  - 0
129
- hash: 3446128004627456738
129
+ hash: 1554472922961583254
130
130
  required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  none: false
132
132
  requirements: