prj 1.0.0 → 1.0.1
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/VERSION +1 -1
- data/lib/prj/app.rb +1 -1
- data/spec/acceptance/app_spec.rb +31 -26
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/lib/prj/app.rb
CHANGED
data/spec/acceptance/app_spec.rb
CHANGED
@@ -26,40 +26,38 @@ describe "Prj::App" do
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
output.string.chomp.should == File.join(root, "baz/craps/poops")
|
34
|
-
end
|
29
|
+
it "prints matching directory and returns 0" do
|
30
|
+
with_config("projects_root" => root) do
|
31
|
+
Prj::App.new(output, ["ap"]).run.should == 0
|
32
|
+
output.string.chomp.should == File.join(root, "baz/craps/poops")
|
35
33
|
end
|
34
|
+
end
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
end
|
36
|
+
it "prints projects root and returns 0 if directory not found" do
|
37
|
+
with_config("projects_root" => root) do
|
38
|
+
Prj::App.new(output, ["nothingtofind"]).run.should == 0
|
39
|
+
output.string.chomp.should == root
|
42
40
|
end
|
41
|
+
end
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
43
|
+
it "allows case-insensitive search if option specified in config" do
|
44
|
+
with_config("projects_root" => root, "case_sensitive" => false) do
|
45
|
+
Prj::App.new(output, ["Fo"]).run.should == 0
|
46
|
+
output.string.chomp.should == File.join(root, "foo")
|
49
47
|
end
|
48
|
+
end
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
end
|
50
|
+
it "does not search nested repos by default" do
|
51
|
+
with_config("projects_root" => root) do
|
52
|
+
Prj::App.new(output, ["fob"]).run.should == 0
|
53
|
+
output.string.chomp.should_not == File.join(root, "foo/baz")
|
56
54
|
end
|
55
|
+
end
|
57
56
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
end
|
57
|
+
it "can search nested repos if 'search_nested_repositories' option is true" do
|
58
|
+
with_config("projects_root" => root, "search_nested_repositories" => true) do
|
59
|
+
Prj::App.new(output, ["fob"]).run.should == 0
|
60
|
+
output.string.chomp.should == File.join(root, "foo/baz")
|
63
61
|
end
|
64
62
|
end
|
65
63
|
|
@@ -73,6 +71,13 @@ describe "Prj::App" do
|
|
73
71
|
end
|
74
72
|
end
|
75
73
|
|
74
|
+
it "outputs project root if called without argument" do
|
75
|
+
with_config("projects_root" => "~/proj") do
|
76
|
+
Prj::App.new(output, []).run.should == 0
|
77
|
+
output.string.chomp.should == File.expand_path("~/proj")
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
76
81
|
def with_config(config = {})
|
77
82
|
tmp = Prj::App.config_path
|
78
83
|
config_path = File.join(Dir.tmpdir, ".prj.yml")
|