dev_tasks 1.0.7 → 1.0.8

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: 7adfd02d665ce953f778e069c4826ec537341ad5
4
- data.tar.gz: 10eaf828901cb039d38935f413b3282c4073cda8
3
+ metadata.gz: e616c120cce9756e071989f26921c5c209f66f47
4
+ data.tar.gz: 3930c3d97d0c7abe9c733ba4bbabcca59abbff10
5
5
  SHA512:
6
- metadata.gz: 9550e2b8062fb429443ebee30b0e9d25fd2f6c21ed3a3dc08b6703a3a0508e722f72342f58eaf900cd5b6541d992c078224368d5aad559bf6bf064926b3bba30
7
- data.tar.gz: 4db9243e5a4dde20a17533564a753e39a9c0c1b40d9f43ba0001d1f13c758223b101cf82c5237853799f4df056f665e5e3af13fb7239f76dbcdd0211fc4bbdca
6
+ metadata.gz: f993237fdb1890df7c495f35f14fd7e69e2f46166e085f93116f7a7e4d730af8769b36d0a49410f8daceae13c3ecc332d1f17d96007660e1a9270090f8500805
7
+ data.tar.gz: 0eeb7b35a7a9ca0968d9763a7b67def26479f9c51557bdaf154c2cf416df8248826146c0d04f9bfad5a15de1a4a150ce42a32b71abc8b3a70ee9e71b347c4ea0
data/lib/command.rb CHANGED
@@ -17,6 +17,8 @@ class Command < Hash
17
17
 
18
18
  Logger.start_command self
19
19
 
20
+ pwd=Dir.pwd
21
+ Dir.chdir(self[:directory]) if(self.has_key?(:directory) && File.exists?(self[:directory]))
20
22
  #print " " + Color.green + self[:input] + Color.clear
21
23
 
22
24
  self[:start_time]=Time.now
@@ -41,6 +43,7 @@ class Command < Hash
41
43
  #end
42
44
  end
43
45
 
46
+ Dir.chdir(pwd) if pwd != Dir.pwd
44
47
  Logger.end_command self
45
48
  end
46
49
 
data/lib/spec.json CHANGED
@@ -1 +1 @@
1
- {"name":"dev_tasks","version":"1.0.7"}
1
+ {"name":"dev_tasks","version":"1.0.8"}
data/spec/command_spec.rb CHANGED
@@ -55,4 +55,17 @@ describe Command do
55
55
 
56
56
  end
57
57
 
58
+ it "should be able to execute rake command in specific directory" do
59
+ dir="#{DEV[:dev_root]}/tmp/rake_test"
60
+ FileUtils.mkdir_p(dir) if(!File.exists?(dir))
61
+ File.open("#{dir}/rakefile.rb","w") { |f|
62
+ f.puts "task :default do"
63
+ f.puts " puts 'rake_test'"
64
+ f.puts "end"
65
+ }
66
+ cmd=Command.new("rake")
67
+ cmd[:directory]=dir
68
+ cmd.execute
69
+ expect(cmd[:output].include?('rake_test')).to eq(true)
70
+ end
58
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-03 00:00:00.000000000 Z
11
+ date: 2015-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake