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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9174d0e370e6ff111503c7e69057be2a8e2af8ac
4
- data.tar.gz: 06888787c8e8466fa64bb0fc1812c963bb6a891d
3
+ metadata.gz: a02c9bb0274b204dead482d2b420a4fe02296822
4
+ data.tar.gz: cdb8fb308901f59367c2821233b78a51938badcc
5
5
  SHA512:
6
- metadata.gz: 7d235269f7bc92274e4609f30245c7bc63a178188d1e02acc62715e0983c865d40d7289569df6a4d30f9bfbee87dc1f3b05cdab618cd995db84acd3b928373e9
7
- data.tar.gz: e1ff8636abde8b48df9fff8ad320dfff798dad9a8c8d5a3c61b53979db3d759e2f82fc3ab88c4bcb6214f8f36553813ebbd1d9ce1a6707b6e4f0332f54fe808a
6
+ metadata.gz: 4d74db92577b65934fa8ab0aa3cb5718f3843874b9e536492c0b7160a47343d01090e0993706be2786cf8c2abf3f56b5ae109edb2ac80951ad8537731ebbc161
7
+ data.tar.gz: da5e8feb66adea80d3766b4e896f9c7370bb56d9fda8383cc4e49d9d1315c3049bf2eddbbc7d529df07b670fcf37e1f3dcf778705cb63144d4fda23067d33540
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Dt
2
2
  module Rake
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dt-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neeraj