checkcheckit 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,7 +45,18 @@ class CheckCheckIt::Console
45
45
  list(args)
46
46
  return
47
47
  end
48
- list_name = Dir[dir + '/*/*'].find{ |fname| fname.include? target }
48
+
49
+ expanded_target = File.expand_path(target)
50
+ list_name = nil
51
+
52
+ # see if its a Path
53
+ if File.exists?(expanded_target)
54
+ list_name = expanded_target
55
+ else
56
+ #finding the list
57
+ list_name = Dir[dir + '/*/*'].find{ |fname| fname.include? target }
58
+ end
59
+
49
60
  if list_name
50
61
  list = List.new(list_name)
51
62
  if (emails = @options['email']) || @options['live']
@@ -1,3 +1,3 @@
1
1
  module CheckCheckIt
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -0,0 +1,23 @@
1
+ require 'helper'
2
+
3
+ class AnyFileTest < CheckCheckIt::TestCase
4
+
5
+ def setup
6
+ super
7
+ dir = File.join('/just/another')
8
+ FileUtils.mkdir_p(dir)
9
+ File.open(File.join(dir, 'file'), 'w') do |file|
10
+ file << "- 1\n"
11
+ file << "- 2\n- 3\n"
12
+ end
13
+ console.in_stream = MiniTest::Mock.new
14
+ console.web_socket = MiniTest::Mock.new
15
+ end
16
+
17
+ def test_with_any_file
18
+ 3.times { console.in_stream.expect :gets, "y" }
19
+ result = check "start /just/another/file"
20
+ console.in_stream.verify
21
+ end
22
+
23
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkcheckit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-17 00:00:00.000000000 Z
12
+ date: 2013-02-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: lucy-goosey
@@ -96,6 +96,7 @@ files:
96
96
  - lib/checkcheckit/console.rb
97
97
  - lib/checkcheckit/list.rb
98
98
  - lib/checkcheckit/version.rb
99
+ - test/any_file_test.rb
99
100
  - test/console_test.rb
100
101
  - test/helper.rb
101
102
  - test/list_test.rb
@@ -115,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
116
  version: '0'
116
117
  segments:
117
118
  - 0
118
- hash: -1282752391799519508
119
+ hash: -1655738984959365236
119
120
  required_rubygems_version: !ruby/object:Gem::Requirement
120
121
  none: false
121
122
  requirements:
@@ -124,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
125
  version: '0'
125
126
  segments:
126
127
  - 0
127
- hash: -1282752391799519508
128
+ hash: -1655738984959365236
128
129
  requirements: []
129
130
  rubyforge_project:
130
131
  rubygems_version: 1.8.23
@@ -132,6 +133,7 @@ signing_key:
132
133
  specification_version: 3
133
134
  summary: Command line tool for using checklists
134
135
  test_files:
136
+ - test/any_file_test.rb
135
137
  - test/console_test.rb
136
138
  - test/helper.rb
137
139
  - test/list_test.rb