dt-rake 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dt/rake.rb +18 -0
- data/lib/dt/rake/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a02c9bb0274b204dead482d2b420a4fe02296822
|
4
|
+
data.tar.gz: cdb8fb308901f59367c2821233b78a51938badcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d74db92577b65934fa8ab0aa3cb5718f3843874b9e536492c0b7160a47343d01090e0993706be2786cf8c2abf3f56b5ae109edb2ac80951ad8537731ebbc161
|
7
|
+
data.tar.gz: da5e8feb66adea80d3766b4e896f9c7370bb56d9fda8383cc4e49d9d1315c3049bf2eddbbc7d529df07b670fcf37e1f3dcf778705cb63144d4fda23067d33540
|
data/lib/dt/rake.rb
CHANGED
@@ -1,7 +1,25 @@
|
|
1
1
|
require "dt/rake/version"
|
2
2
|
require "dt/rake_helper"
|
3
|
+
require "pathname"
|
3
4
|
|
4
5
|
module Dt
|
5
6
|
module Rake
|
7
|
+
|
8
|
+
SCRIPT_RAILS = 'script/rails'
|
9
|
+
|
10
|
+
def self.get_rails_dir(dir)
|
11
|
+
path = ::Pathname.new(dir)
|
12
|
+
|
13
|
+
while path != path.parent
|
14
|
+
return path if rails_dir?(path)
|
15
|
+
path = path.parent
|
16
|
+
end
|
17
|
+
|
18
|
+
raise "No rails dir found in path"
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.rails_dir?(dir)
|
22
|
+
return File.exists? ("#{dir}/#{SCRIPT_RAILS}")
|
23
|
+
end
|
6
24
|
end
|
7
25
|
end
|
data/lib/dt/rake/version.rb
CHANGED