dev_tasks 1.0.9 → 1.0.10

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: 0f6cc2d760fdfdddbc2c4ca9b01947ab8b7c3dd0
4
- data.tar.gz: 9d5a99979cbd4b0858d7ef73f1b2fb611a99f61f
3
+ metadata.gz: 835ddd4c63c02ff79d9151c8752782c6076f912f
4
+ data.tar.gz: 23ebff2cd260f5b3f802975e5406df6364358dca
5
5
  SHA512:
6
- metadata.gz: 3d470d707835d5e40ef47e86aa0c8d04035461a832bc70de234d5c85206c945c057eeeaaa11541b6c3d854523c43fa7b2aa143e63627d0803197fa16dfb4952f
7
- data.tar.gz: 2b026fa30158ac928f31258c945d651ec3abd785a4d28d9eaba205bef601ba0502df836afd9e84ad83b58e511ea451bc7d51c27c188f0a4b5ea29f5dfd9abf5e
6
+ metadata.gz: 4fce902f51422665d96733862dca900279c0d66a7aff56ca79324e0d76cfa1198bdb6c36db917456ef99cdfca23ba1e29a0ead57c68689f18a1988ee58236cdb
7
+ data.tar.gz: ba4752504b3ac38e38301b62510532885600efbd9bb7093175032e778d915835b5ed236c5915f364e67e72a8b8fae1cda1875adf4ea4d05bcb7853a26eec9f56
@@ -1,16 +1,24 @@
1
1
  class Command < Hash
2
2
  def initialize command
3
- self[:input] = command
4
- self[:timeout] = 0
5
- self[:directory] = ''
6
- self[:exit_code] = 0
7
- self[:output] = ''
8
- self[:error] = ''
9
- self[:machine_name] = ''
10
- self[:user_name] = ''
11
- self[:start_time] = nil
12
- self[:end_time] = nil
13
3
 
4
+ if(command.kind_of?(String))
5
+ self[:input] = command
6
+ self[:timeout] = 0
7
+ self[:directory] = ''
8
+ self[:exit_code] = 0
9
+ self[:output] = ''
10
+ self[:error] = ''
11
+ self[:machine_name] = ''
12
+ self[:user_name] = ''
13
+ self[:start_time] = nil
14
+ self[:end_time] = nil
15
+ end
16
+
17
+ if(command.kind_of?(Hash))
18
+ command.each{|k,v|
19
+ self[k.to_sym]=v
20
+ }
21
+ end
14
22
  end
15
23
 
16
24
  def execute
@@ -1 +1 @@
1
- {"name":"dev_tasks","version":"1.0.9"}
1
+ {"name":"dev_tasks","version":"1.0.10"}
@@ -55,6 +55,15 @@ describe Command do
55
55
 
56
56
  end
57
57
 
58
+ it "should be able to write to/load from JSON" do
59
+ cmd=Command.new("ruby --version")
60
+ expect(cmd[:timeout]).to eq(0)
61
+ expect(cmd[:input]).to eq("ruby --version")
62
+ cmd2=Command.new(JSON.parse(cmd.to_json))
63
+ expect(cmd2[:timeout]).to eq(0)
64
+ expect(cmd2[:input]).to eq("ruby --version")
65
+ end
66
+
58
67
  it "should be able to execute rake command in specific directory" do
59
68
  dir="#{DEV[:dev_root]}/tmp/rake_test"
60
69
  FileUtils.mkdir_p(dir) if(!File.exists?(dir))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow