reservoir 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
- version: 0.1.0
1
+ version: 0.1.1
2
2
  display:
3
- filename: @@SERVER_NAME@@.reservoir
3
+ filename: @@SERVER_NAME@@
4
4
  mode: data_only
5
5
  remotes:
6
6
  - user: deployer
@@ -1,3 +1,5 @@
1
+ require "pathname"
2
+
1
3
  module Reservoir
2
4
 
3
5
  class Application
@@ -89,6 +91,7 @@ module Reservoir
89
91
  if @display == :stdio
90
92
  STDOUT.puts output
91
93
  elsif is_file?
94
+ system("mkdir -p #{Pathname.new(@display[:filename]).parent}")
92
95
  open(@display[:filename], 'a+') { |f| f.puts(output) }
93
96
  else
94
97
  output
@@ -1,6 +1,6 @@
1
1
  module Reservoir
2
2
 
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
 
5
5
  class Version
6
6
 
@@ -23,14 +23,20 @@ module Reservoir
23
23
  Caller.stub!(:exec).with("node -version").and_return("")
24
24
  Caller.stub!(:exec).with("ssh aforward@a4word.com 'ruby --version'").and_return("1.2.6")
25
25
 
26
- File.delete("output.txt") if File.exist?("output.txt")
27
- File.delete("a4word.com.reservoir") if File.exist?("a4word.com.reservoir")
26
+ cleanup
28
27
  end
29
28
 
30
29
  after(:all) do
30
+ cleanup
31
+ end
32
+
33
+ def cleanup
31
34
  File.delete("output.txt") if File.exist?("output.txt")
35
+ File.delete("a4word.com") if File.exist?("a4word.com")
36
+ system("rm -rf ./tmp")
32
37
  end
33
38
 
39
+
34
40
  describe "#run" do
35
41
 
36
42
  describe "no args" do
@@ -102,20 +108,19 @@ module Reservoir
102
108
 
103
109
  it "should save files to disk" do
104
110
  @application.run([@project_file,@project_file2])
105
- File.exists?("a4word.com.reservoir").should == true
111
+ File.exists?("a4word.com").should == true
106
112
  end
107
113
 
108
114
 
109
115
  it "should clean up existing files" do
110
- open("a4word.com.reservoir", 'a+') { |f| f.puts("garble") }
116
+ open("a4word.com", 'a+') { |f| f.puts("garble") }
111
117
  @application.run([@project_file,@project_file2])
112
- IO.read("a4word.com.reservoir").should == "reservoir, version 0.1.0\nserver: aforward@a4word.com\nfile: /Users/aforward/tp/projects/cenx/reservoir/spec/sample_project2.yml\nruby : 1.2.6 : /path/to/a4word/ruby\n"
118
+ IO.read("a4word.com").should == "reservoir, version 0.1.1\nserver: aforward@a4word.com\nfile: /Users/aforward/tp/projects/cenx/reservoir/spec/sample_project2.yml\nruby : 1.2.6 : /path/to/a4word/ruby\n"
113
119
  end
114
120
 
115
121
  it "should support mode: data_only" do
116
- open("a4word.com.reservoir", 'a+') { |f| f.puts("garble") }
117
122
  @application.run([@project_file3])
118
- IO.read("a4word.com.reservoir").should == "reservoir, version 0.1.0\nruby : 1.2.6 : /path/to/a4word/ruby\n"
123
+ IO.read("./tmp/moretmp/a4word.com").should == "reservoir, version 0.1.1\nruby : 1.2.6 : /path/to/a4word/ruby\n"
119
124
  end
120
125
 
121
126
  end
@@ -147,7 +152,7 @@ module Reservoir
147
152
  describe "#messages" do
148
153
 
149
154
  it "should version_message" do
150
- @application.version_message.should == "reservoir, version 0.1.0\n"
155
+ @application.version_message.should == "reservoir, version 0.1.1\n"
151
156
  end
152
157
 
153
158
  it "should usage_message" do
data/spec/project_spec.rb CHANGED
@@ -64,7 +64,7 @@ module Reservoir
64
64
  t = project.template(clazz)
65
65
  t.remote_user.should == 'aforward'
66
66
  t.remote_server.should == 'a4word.com'
67
- project.display.should == { :filename => "a4word.com.reservoir" }
67
+ project.display.should == { :filename => "a4word.com" }
68
68
  end
69
69
 
70
70
  it "should ignore remote data if not set" do
@@ -1,4 +1,4 @@
1
- version: 0.1.0
1
+ version: 0.1.1
2
2
  display: string
3
3
  scripts:
4
4
  - name: ruby
@@ -1,6 +1,6 @@
1
- version: 0.1.0
1
+ version: 0.1.1
2
2
  display:
3
- filename: @@SERVER_NAME@@.reservoir
3
+ filename: @@SERVER_NAME@@
4
4
  remotes:
5
5
  - user: aforward
6
6
  server: a4word.com
@@ -1,6 +1,6 @@
1
- version: 0.1.0
1
+ version: 0.1.1
2
2
  display:
3
- filename: @@SERVER_NAME@@.reservoir
3
+ filename: ./tmp/moretmp/@@SERVER_NAME@@
4
4
  mode: data_only
5
5
  remotes:
6
6
  - user: aforward
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reservoir
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-15 00:00:00.000000000Z
12
+ date: 2011-09-16 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70307851600340 !ruby/object:Gem::Requirement
16
+ requirement: &2156756840 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70307851600340
24
+ version_requirements: *2156756840
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: autotest
27
- requirement: &70307851599920 !ruby/object:Gem::Requirement
27
+ requirement: &2156756420 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70307851599920
35
+ version_requirements: *2156756420
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: autotest-fsevent
38
- requirement: &70307851599460 !ruby/object:Gem::Requirement
38
+ requirement: &2156755960 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70307851599460
46
+ version_requirements: *2156755960
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rb-fsevent
49
- requirement: &70307851599040 !ruby/object:Gem::Requirement
49
+ requirement: &2156755540 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70307851599040
57
+ version_requirements: *2156755540
58
58
  description: Helps manage cloud-based server instances by enumerating, comparing and
59
59
  diff'ing application configurations
60
60
  email:
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project: reservoir
111
- rubygems_version: 1.8.6
111
+ rubygems_version: 1.8.5
112
112
  signing_key:
113
113
  specification_version: 3
114
114
  summary: What apps, versions and configurations to you have setup on your server