pmsrb 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +6 -0
- data/License.txt +20 -0
- data/Manifest.txt +23 -0
- data/README.txt +73 -0
- data/Rakefile +4 -0
- data/config/hoe.rb +73 -0
- data/config/requirements.rb +17 -0
- data/lib/pmsrb.rb +310 -0
- data/lib/pmsrb/platform.rb +70 -0
- data/lib/pmsrb/progressbar.rb +236 -0
- data/lib/pmsrb/version.rb +9 -0
- data/log/debug.log +0 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +74 -0
- data/setup.rb +1585 -0
- data/spec/pmsrb_spec.rb +275 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +9 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/rspec.rake +21 -0
- data/tasks/website.rake +15 -0
- metadata +91 -0
data/spec/pmsrb_spec.rb
ADDED
@@ -0,0 +1,275 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper.rb'
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
include PMS
|
6
|
+
|
7
|
+
describe "The pmsrb dsl" do
|
8
|
+
|
9
|
+
working_dir = File.dirname(__FILE__)+"/tmp"
|
10
|
+
credentials = PMS::Credentials.new(".pmsrb")
|
11
|
+
user = credentials.user
|
12
|
+
pass = credentials.pass
|
13
|
+
|
14
|
+
before(:all) do
|
15
|
+
[working_dir, working_dir+"2"].each do |tmp_path|
|
16
|
+
FileUtils.mkdir_p tmp_path
|
17
|
+
FileUtils.rm_r tmp_path
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
it "has a vendor method" do
|
22
|
+
(vendor do; end).class.should eql(Vendor)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "can grab from a server" do
|
26
|
+
vendor do
|
27
|
+
download "http://www.google.com/intl/en_ALL/images/logo.gif", working_dir
|
28
|
+
end
|
29
|
+
File.exists?(working_dir+"/logo.gif").should == true
|
30
|
+
end
|
31
|
+
|
32
|
+
it "needs a working_directory" do
|
33
|
+
lambda {
|
34
|
+
vendor do
|
35
|
+
download "http://www.google.com/intl/en_ALL/images/logo.gif"
|
36
|
+
end
|
37
|
+
}.should raise_error
|
38
|
+
end
|
39
|
+
|
40
|
+
it "can extract a .tar.gz" do
|
41
|
+
vendor do
|
42
|
+
working_directory working_dir
|
43
|
+
download "http://shatteredruby.com/rice/rice_alias_bug.tgz"
|
44
|
+
extract_tgz
|
45
|
+
end
|
46
|
+
File.exists?(working_dir+"/rice_alias_bug/Rakefile")
|
47
|
+
end
|
48
|
+
|
49
|
+
it "can build from a .tar.gz" do
|
50
|
+
vendor do
|
51
|
+
working_directory working_dir
|
52
|
+
download "http://shatteredruby.com/rice/rice_alias_bug.tgz"
|
53
|
+
extract_tgz
|
54
|
+
cd "rice_alias_bug"
|
55
|
+
build "rake"
|
56
|
+
build "make"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
it "can extract .zip" do
|
61
|
+
vendor do
|
62
|
+
working_directory working_dir
|
63
|
+
download "http://shatteredruby.com/rice/rice.zip"
|
64
|
+
extract
|
65
|
+
end
|
66
|
+
File.exists?(working_dir+"/rice.txt").should == true
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should stop on errors" do
|
70
|
+
vendor do
|
71
|
+
working_directory working_dir
|
72
|
+
download "http://shatteredruby.com/rice/rice_alias_bug.tgz"
|
73
|
+
extract
|
74
|
+
cd "rice_alias_bug"
|
75
|
+
build("lake", "make").should == false
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should not download the same file multiple times" do
|
80
|
+
Net::HTTP.should_not_receive(:start)
|
81
|
+
vendor do
|
82
|
+
working_directory working_dir
|
83
|
+
download "http://shatteredruby.com/rice/rice_alias_bug.tgz"
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
it "should copy files" do
|
88
|
+
vendor do
|
89
|
+
working_directory working_dir
|
90
|
+
download "http://shatteredruby.com/rice/rice_alias_bug.tgz"
|
91
|
+
extract
|
92
|
+
cd "rice_alias_bug"
|
93
|
+
cp "*", "../../tmp2"
|
94
|
+
end
|
95
|
+
|
96
|
+
File.exists?(working_dir+"/../tmp2/Rakefile").should == true
|
97
|
+
end
|
98
|
+
|
99
|
+
|
100
|
+
it "should allow for file copy" do
|
101
|
+
vendor do
|
102
|
+
working_directory working_dir
|
103
|
+
download "http://shatteredruby.com/rice/rice_alias_bug.tgz"
|
104
|
+
extract
|
105
|
+
cd "rice_alias_bug"
|
106
|
+
cp "Rakefile", "../../tmp2/Rakefile2"
|
107
|
+
end
|
108
|
+
File.exists?(working_dir+"/../tmp2/Rakefile2").should == true
|
109
|
+
FileTest.directory?(working_dir+"/../tmp2/Rakefile2").should == false
|
110
|
+
end
|
111
|
+
|
112
|
+
it "should allow for installation" do
|
113
|
+
vendor do
|
114
|
+
working_directory working_dir
|
115
|
+
download "http://shatteredruby.com/rice/rice_alias_bug.tgz"
|
116
|
+
extract
|
117
|
+
cd "rice_alias_bug"
|
118
|
+
cp "Rakefile", "../../tmp2/Rakefile2"
|
119
|
+
install "*", "../../tmp2"
|
120
|
+
end
|
121
|
+
File.exists?(working_dir+"/../tmp2/Rakefile2").should == false
|
122
|
+
end
|
123
|
+
|
124
|
+
it "should allow recursive installation" do
|
125
|
+
vendor do
|
126
|
+
working_directory working_dir
|
127
|
+
download "http://shatteredruby.com/rice/rice_alias_bug.tgz"
|
128
|
+
extract
|
129
|
+
cd "rice_alias_bug"
|
130
|
+
cp "Rakefile", "tmp/Rakefile"
|
131
|
+
install "**/*", "../../tmp2"
|
132
|
+
end
|
133
|
+
File.exists?(working_dir+"/rice_alias_bug/tmp/Rakefile").should == true
|
134
|
+
File.exists?(working_dir+"/../tmp2/tmp/Rakefile").should == true
|
135
|
+
end
|
136
|
+
|
137
|
+
it "should allow for FTP upload/download" do
|
138
|
+
vendor do
|
139
|
+
working_directory working_dir
|
140
|
+
touch "ftp_upload.txt"
|
141
|
+
|
142
|
+
upload "ftp_upload.txt" do
|
143
|
+
host "ftp.shatteredruby.com"
|
144
|
+
credentials(".pmsrb")
|
145
|
+
target_directory "upload"
|
146
|
+
end
|
147
|
+
|
148
|
+
rm "ftp_upload.txt"
|
149
|
+
end
|
150
|
+
File.exists?(working_dir+"/ftp_upload.txt").should == false
|
151
|
+
|
152
|
+
vendor do
|
153
|
+
working_directory working_dir
|
154
|
+
download "ftp://#{user}:#{pass}@shatteredruby.com/upload/ftp_upload.txt"
|
155
|
+
end
|
156
|
+
File.exists?(working_dir+"/ftp_upload.txt").should == true
|
157
|
+
end
|
158
|
+
|
159
|
+
it "should allow for zip archiving" do
|
160
|
+
vendor do
|
161
|
+
working_directory working_dir
|
162
|
+
|
163
|
+
FileUtils.mkdir_p "#{working_dir}/archivedir/deeppath"
|
164
|
+
file = File.open("#{working_dir}/archivedir/test.txt", 'w')
|
165
|
+
file.puts "1"
|
166
|
+
file.close
|
167
|
+
file = File.open("#{working_dir}/archivedir/deeppath/test2.txt", 'w')
|
168
|
+
file.puts "2"
|
169
|
+
file.close
|
170
|
+
|
171
|
+
archive "archivedir/**/*", 'archivedir.zip'
|
172
|
+
|
173
|
+
File.exists?("#{working_dir}/archivedir.zip").should == true
|
174
|
+
|
175
|
+
FileUtils.rm_r("#{working_dir}/archivedir")
|
176
|
+
File.exists?("#{working_dir}/archivedir/test.txt").should == false
|
177
|
+
|
178
|
+
@current_file = "#{working_dir}/archivedir.zip"
|
179
|
+
extract
|
180
|
+
|
181
|
+
File.exists?("#{working_dir}/archivedir/test.txt").should == true
|
182
|
+
File.exists?("#{working_dir}/archivedir/deeppath/test2.txt").should == true
|
183
|
+
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
it "should allow for tgz archiving" do
|
188
|
+
vendor do
|
189
|
+
working_directory working_dir
|
190
|
+
|
191
|
+
FileUtils.mkdir_p "#{working_dir}/archivedirtgz/deeppath"
|
192
|
+
file = File.open("#{working_dir}/archivedirtgz/test.txt", 'w')
|
193
|
+
file.puts "1"
|
194
|
+
file.close
|
195
|
+
file = File.open("#{working_dir}/archivedirtgz/deeppath/test2.txt", 'w')
|
196
|
+
file.puts "2"
|
197
|
+
file.close
|
198
|
+
|
199
|
+
archive "archivedirtgz/**/*", 'archivedir.tgz'
|
200
|
+
|
201
|
+
File.exists?("#{working_dir}/archivedir.tgz").should == true
|
202
|
+
|
203
|
+
FileUtils.rm_r("#{working_dir}/archivedirtgz")
|
204
|
+
File.exists?("#{working_dir}/archivedirtgz/test.txt").should == false
|
205
|
+
|
206
|
+
@current_file = "#{working_dir}/archivedir.tgz"
|
207
|
+
extract
|
208
|
+
|
209
|
+
glob = Dir.glob("#{working_dir}/**/*")
|
210
|
+
puts(glob.join(","))
|
211
|
+
|
212
|
+
File.exists?("#{working_dir}/archivedirtgz/test.txt").should == true
|
213
|
+
File.exists?("#{working_dir}/archivedirtgz/deeppath/test2.txt").should == true
|
214
|
+
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
|
219
|
+
it "should allow for FTP archive upload/download" do
|
220
|
+
vendor do
|
221
|
+
working_directory working_dir
|
222
|
+
touch "upload.txt"
|
223
|
+
|
224
|
+
archive ["upload.txt"], "upload.zip"
|
225
|
+
archive ["upload.txt"], "upload.tgz"
|
226
|
+
|
227
|
+
upload "upload.zip" do
|
228
|
+
host "ftp.shatteredruby.com"
|
229
|
+
puts "logging in"
|
230
|
+
credentials(".pmsrb")
|
231
|
+
target_directory "upload"
|
232
|
+
end
|
233
|
+
upload "upload.tgz" do
|
234
|
+
host "ftp.shatteredruby.com"
|
235
|
+
puts "logging in"
|
236
|
+
credentials(".pmsrb")
|
237
|
+
target_directory "upload"
|
238
|
+
end
|
239
|
+
|
240
|
+
File.exists?(working_dir+"/upload.txt").should == true
|
241
|
+
rm "upload.txt"
|
242
|
+
end
|
243
|
+
File.exists?(working_dir+"/upload.txt").should == false
|
244
|
+
|
245
|
+
vendor do
|
246
|
+
working_directory working_dir
|
247
|
+
download "ftp://#{user}:#{pass}@shatteredruby.com/upload/upload.zip"
|
248
|
+
extract
|
249
|
+
File.exists?(working_dir+"/upload.txt").should == true
|
250
|
+
rm "upload.txt"
|
251
|
+
end
|
252
|
+
File.exists?(working_dir+"/upload.txt").should == false
|
253
|
+
|
254
|
+
vendor do
|
255
|
+
working_directory working_dir
|
256
|
+
download "ftp://#{user}:#{pass}@shatteredruby.com/upload/upload.tgz"
|
257
|
+
extract
|
258
|
+
File.exists?(working_dir+"/upload.txt").should == true
|
259
|
+
rm "upload.txt"
|
260
|
+
end
|
261
|
+
File.exists?(working_dir+"/upload.txt").should == false
|
262
|
+
|
263
|
+
end
|
264
|
+
|
265
|
+
it "allows specifying a credentials file." do
|
266
|
+
ftp = PMS::FTPTransfer.new()
|
267
|
+
File.open(ENV["HOME"]+"/.test_pmsrb", "w") do |file|
|
268
|
+
file.write("username user\npassword pass")
|
269
|
+
end
|
270
|
+
creds = ftp.credentials(".test_pmsrb")
|
271
|
+
creds.user.should == "user"
|
272
|
+
creds.pass.should == "pass"
|
273
|
+
FileUtils.rm_r(ENV["HOME"]+"/.test_pmsrb")
|
274
|
+
end
|
275
|
+
end
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
desc 'Release the website and new gem version'
|
2
|
+
task :deploy => [:check_version, :website, :release] do
|
3
|
+
puts "Remember to create SVN tag:"
|
4
|
+
puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
|
5
|
+
"svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
|
6
|
+
puts "Suggested comment:"
|
7
|
+
puts "Tagging release #{CHANGES}"
|
8
|
+
end
|
9
|
+
|
10
|
+
desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
|
11
|
+
task :local_deploy => [:website_generate, :install_gem]
|
12
|
+
|
13
|
+
task :check_version do
|
14
|
+
unless ENV['VERSION']
|
15
|
+
puts 'Must pass a VERSION=x.y.z release version'
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
unless ENV['VERSION'] == VERS
|
19
|
+
puts "Please update your version.rb to match the release version, currently #{VERS}"
|
20
|
+
exit
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
|
25
|
+
task :install_gem_no_doc => [:clean, :package] do
|
26
|
+
sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
|
27
|
+
end
|
28
|
+
|
29
|
+
namespace :manifest do
|
30
|
+
desc 'Recreate Manifest.txt to include ALL files'
|
31
|
+
task :refresh do
|
32
|
+
`rake check_manifest | patch -p0 > Manifest.txt`
|
33
|
+
end
|
34
|
+
end
|
data/tasks/rspec.rake
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
begin
|
2
|
+
require 'spec'
|
3
|
+
rescue LoadError
|
4
|
+
require 'rubygems'
|
5
|
+
require 'spec'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'spec/rake/spectask'
|
9
|
+
rescue LoadError
|
10
|
+
puts <<-EOS
|
11
|
+
To use rspec for testing you must install rspec gem:
|
12
|
+
gem install rspec
|
13
|
+
EOS
|
14
|
+
exit(0)
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run the specs under spec/models"
|
18
|
+
Spec::Rake::SpecTask.new do |t|
|
19
|
+
t.spec_opts = ['--options', "spec/spec.opts"]
|
20
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
21
|
+
end
|
data/tasks/website.rake
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
desc 'Generate website files using STATICMATIC!!'
|
2
|
+
task :website_generate => :ruby_env do
|
3
|
+
sh %{ staticmatic build website }
|
4
|
+
end
|
5
|
+
|
6
|
+
desc 'Upload website files to rubyforge'
|
7
|
+
task :website_upload do
|
8
|
+
host = "#{rubyforge_username}@rubyforge.org"
|
9
|
+
remote_dir = "/var/www/gforge-projects/#{PATH}/"
|
10
|
+
local_dir = 'website/site'
|
11
|
+
sh %{rsync -aCv #{local_dir}/ #{host}:#{remote_dir}}
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'Generate and upload website files'
|
15
|
+
task :website => [:website_generate, :website_upload]
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.4
|
3
|
+
specification_version: 1
|
4
|
+
name: pmsrb
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.1.0
|
7
|
+
date: 2008-04-19 00:00:00 -06:00
|
8
|
+
summary: pmsrb is a binary (p)ackage (m)anagement (s)ystem meant for gracefully handling the differences in binary distribution on different platforms.
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email:
|
12
|
+
- ""
|
13
|
+
homepage: http://pmsrb.rubyforge.org
|
14
|
+
rubyforge_project: pmsrb
|
15
|
+
description: pmsrb is a binary (p)ackage (m)anagement (s)ystem meant for gracefully handling the differences in binary distribution on different platforms.
|
16
|
+
autorequire:
|
17
|
+
default_executable:
|
18
|
+
bindir: bin
|
19
|
+
has_rdoc: true
|
20
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ">"
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 0.0.0
|
25
|
+
version:
|
26
|
+
platform: ruby
|
27
|
+
signing_key:
|
28
|
+
cert_chain:
|
29
|
+
post_install_message:
|
30
|
+
authors:
|
31
|
+
- - Martyn Garcia
|
32
|
+
- Mikkel Garcia
|
33
|
+
files:
|
34
|
+
- History.txt
|
35
|
+
- License.txt
|
36
|
+
- Manifest.txt
|
37
|
+
- README.txt
|
38
|
+
- Rakefile
|
39
|
+
- config/hoe.rb
|
40
|
+
- config/requirements.rb
|
41
|
+
- lib/pmsrb.rb
|
42
|
+
- lib/pmsrb/platform.rb
|
43
|
+
- lib/pmsrb/progressbar.rb
|
44
|
+
- lib/pmsrb/version.rb
|
45
|
+
- log/debug.log
|
46
|
+
- script/destroy
|
47
|
+
- script/generate
|
48
|
+
- script/txt2html
|
49
|
+
- setup.rb
|
50
|
+
- spec/pmsrb_spec.rb
|
51
|
+
- spec/spec.opts
|
52
|
+
- spec/spec_helper.rb
|
53
|
+
- tasks/deployment.rake
|
54
|
+
- tasks/environment.rake
|
55
|
+
- tasks/rspec.rake
|
56
|
+
- tasks/website.rake
|
57
|
+
test_files: []
|
58
|
+
|
59
|
+
rdoc_options:
|
60
|
+
- --main
|
61
|
+
- README.txt
|
62
|
+
extra_rdoc_files:
|
63
|
+
- History.txt
|
64
|
+
- License.txt
|
65
|
+
- Manifest.txt
|
66
|
+
- README.txt
|
67
|
+
executables: []
|
68
|
+
|
69
|
+
extensions: []
|
70
|
+
|
71
|
+
requirements: []
|
72
|
+
|
73
|
+
dependencies:
|
74
|
+
- !ruby/object:Gem::Dependency
|
75
|
+
name: archive-tar-minitar
|
76
|
+
version_requirement:
|
77
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 0.5.2
|
82
|
+
version:
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubyzip
|
85
|
+
version_requirement:
|
86
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 0.9.1
|
91
|
+
version:
|