pione 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +16 -13
- data/.travis.yml +1 -1
- data/History.txt +11 -0
- data/Rakefile +13 -0
- data/bin/pione-package +5 -0
- data/example/AbstractRule/package.yml +6 -0
- data/example/AbstractRule/scenario/a/output/message.txt +1 -0
- data/example/AbstractRule/scenario/a/scenario.yml +4 -0
- data/example/AbstractRule/scenario/b/output/message.txt +1 -0
- data/example/AbstractRule/scenario/b/scenario.yml +4 -0
- data/example/AbstractRule/scenario/c/output/message.txt +1 -0
- data/example/AbstractRule/scenario/c/scenario.yml +4 -0
- data/example/HelloWorld/package.yml +5 -1
- data/example/HelloWorld/scenario/scenario.yml +2 -1
- data/example/LoopByTouch/package.yml +4 -1
- data/example/MakePair/package.yml +6 -0
- data/example/MakePair/scenario/{input → case1/input}/1.i +0 -0
- data/example/MakePair/scenario/{input → case1/input}/2.i +0 -0
- data/example/MakePair/scenario/{input → case1/input}/3.i +0 -0
- data/example/MakePair/scenario/{input → case1/input}/4.i +0 -0
- data/example/MakePair/scenario/{input → case1/input}/5.i +0 -0
- data/example/MakePair/scenario/{output → case1/output}/comb-1-2.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/comb-1-3.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/comb-1-4.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/comb-1-5.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/comb-2-3.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/comb-2-4.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/comb-2-5.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/comb-3-4.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/comb-3-5.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/comb-4-5.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-1-2.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-1-3.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-1-4.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-1-5.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-2-1.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-2-3.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-2-4.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-2-5.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-3-1.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-3-2.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-3-4.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-3-5.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-4-1.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-4-2.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-4-3.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-4-5.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-5-1.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-5-2.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-5-3.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/perm-5-4.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/succ-1-2.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/succ-2-3.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/succ-3-4.pair +0 -0
- data/example/MakePair/scenario/{output → case1/output}/succ-4-5.pair +0 -0
- data/example/MakePair/scenario/case1/scenario.yml +42 -0
- data/example/MakePair/scenario/case2/input/10.i +0 -0
- data/example/MakePair/scenario/case2/input/11.i +0 -0
- data/example/MakePair/scenario/case2/input/9.i +0 -0
- data/example/MakePair/scenario/case2/output/comb-10-11.pair +0 -0
- data/example/MakePair/scenario/case2/output/comb-9-10.pair +0 -0
- data/example/MakePair/scenario/case2/output/comb-9-11.pair +0 -0
- data/example/MakePair/scenario/case2/output/perm-10-11.pair +0 -0
- data/example/MakePair/scenario/case2/output/perm-10-9.pair +0 -0
- data/example/MakePair/scenario/case2/output/perm-11-10.pair +0 -0
- data/example/MakePair/scenario/case2/output/perm-11-9.pair +0 -0
- data/example/MakePair/scenario/case2/output/perm-9-10.pair +0 -0
- data/example/MakePair/scenario/case2/output/perm-9-11.pair +0 -0
- data/example/MakePair/scenario/case2/output/succ-10-11.pair +0 -0
- data/example/MakePair/scenario/case2/output/succ-9-10.pair +0 -0
- data/example/MakePair/scenario/case2/scenario.yml +17 -0
- data/example/MakePair/scenario/case3/input/1.i +0 -0
- data/example/MakePair/scenario/case3/input/3.i +0 -0
- data/example/MakePair/scenario/case3/input/5.i +0 -0
- data/example/MakePair/scenario/case3/input/7.i +0 -0
- data/example/MakePair/scenario/case3/input/9.i +0 -0
- data/example/MakePair/scenario/case3/output/comb-1-3.pair +0 -0
- data/example/MakePair/scenario/case3/output/comb-1-5.pair +0 -0
- data/example/MakePair/scenario/case3/output/comb-1-7.pair +0 -0
- data/example/MakePair/scenario/case3/output/comb-1-9.pair +0 -0
- data/example/MakePair/scenario/case3/output/comb-3-5.pair +0 -0
- data/example/MakePair/scenario/case3/output/comb-3-7.pair +0 -0
- data/example/MakePair/scenario/case3/output/comb-3-9.pair +0 -0
- data/example/MakePair/scenario/case3/output/comb-5-7.pair +0 -0
- data/example/MakePair/scenario/case3/output/comb-5-9.pair +0 -0
- data/example/MakePair/scenario/case3/output/comb-7-9.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-1-3.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-1-5.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-1-7.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-1-9.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-3-1.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-3-5.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-3-7.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-3-9.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-5-1.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-5-3.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-5-7.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-5-9.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-7-1.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-7-3.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-7-5.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-7-9.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-9-1.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-9-3.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-9-5.pair +0 -0
- data/example/MakePair/scenario/case3/output/perm-9-7.pair +0 -0
- data/example/MakePair/scenario/case3/scenario.yml +39 -0
- data/example/PegasusWMS/Merge/Merge.pione +21 -0
- data/example/PegasusWMS/Merge/package.yml +2 -0
- data/example/PegasusWMS/Pipeline/Pipeline.pione +20 -0
- data/example/PegasusWMS/Pipeline/package.yml +2 -0
- data/example/PegasusWMS/Split/Split.pione +27 -0
- data/example/PegasusWMS/Split/package.yml +2 -0
- data/example/ScoreAggregation/package.yml +4 -0
- data/example/ScoreAggregation/scenario/case1/scenario.yml +27 -1
- data/example/SerialProcessing/package.yml +5 -1
- data/example/SerialProcessing/scenario/scenario.yml +10 -0
- data/lib/pione.rb +20 -71
- data/lib/pione/agent.rb +17 -0
- data/lib/pione/agent/basic-agent.rb +2 -4
- data/lib/pione/command.rb +1 -0
- data/lib/pione/command/option.rb +4 -1
- data/lib/pione/command/pione-package.rb +97 -0
- data/lib/pione/command/pione-task-worker.rb +11 -7
- data/lib/pione/component.rb +5 -0
- data/lib/pione/component/document.rb +22 -5
- data/lib/pione/component/package-archiver.rb +92 -0
- data/lib/pione/component/package-expander.rb +37 -0
- data/lib/pione/component/package-filename.rb +38 -0
- data/lib/pione/component/package-reader.rb +276 -0
- data/lib/pione/component/package.rb +50 -162
- data/lib/pione/front.rb +14 -0
- data/lib/pione/location.rb +5 -0
- data/lib/pione/location/basic-location.rb +47 -274
- data/lib/pione/location/data-location.rb +328 -0
- data/lib/pione/location/dropbox-location.rb +30 -7
- data/lib/pione/location/exception.rb +38 -0
- data/lib/pione/location/ftp-location.rb +24 -13
- data/lib/pione/location/git-repository-location.rb +153 -0
- data/lib/pione/location/http-location.rb +65 -0
- data/lib/pione/location/https-location.rb +37 -0
- data/lib/pione/location/local-location.rb +24 -5
- data/lib/pione/parser.rb +14 -0
- data/lib/pione/patch.rb +10 -0
- data/lib/pione/patch/drb-patch.rb +2 -2
- data/lib/pione/relay.rb +11 -0
- data/lib/pione/system/file-cache.rb +1 -1
- data/lib/pione/system/global.rb +15 -0
- data/lib/pione/tuple-space.rb +11 -0
- data/lib/pione/tuple-space/tuple-space-server.rb +1 -1
- data/lib/pione/util.rb +1 -0
- data/lib/pione/util/error-report.rb +7 -0
- data/lib/pione/util/misc.rb +2 -2
- data/lib/pione/util/zip.rb +60 -0
- data/lib/pione/version.rb +1 -1
- data/pione.gemspec +5 -1
- data/test/agent/spec_rule-provider.rb +2 -2
- data/test/command/spec_pione-package.rb +15 -0
- data/test/component/spec_document.rb +2 -2
- data/test/component/spec_package-archiver.rb +27 -0
- data/test/component/spec_package-expander.rb +11 -0
- data/test/component/spec_package-filename.rb +79 -0
- data/test/component/spec_package-reader.rb +100 -0
- data/test/component/spec_package.rb +50 -33
- data/test/location/http-behavior.rb +59 -0
- data/test/location/location-behavior.rb +8 -0
- data/test/location/spec_basic-location.rb +5 -1
- data/test/location/spec_git-repository-location.rb +143 -0
- data/test/location/spec_http-location.rb +28 -0
- data/test/location/spec_http-location/a.txt +1 -0
- data/test/location/spec_http-location/b.txt +1 -0
- data/test/location/spec_http-location/c.txt +1 -0
- data/test/location/spec_http-location/dir/d.txt +1 -0
- data/test/location/spec_https-location.rb +37 -0
- data/test/rule-handler/spec_flow-handler.rb +1 -1
- data/test/rule-handler/spec_update-criteria.rb +1 -1
- data/test/test-data/package/HelloWorld+v0.1.0.ppg +0 -0
- data/test/test-data/package/HelloWorld-gitrepos.zip +0 -0
- data/test/test-data/package/HelloWorld/HelloWorld.pione +5 -0
- data/test/test-data/package/HelloWorld/package.yml +6 -0
- data/test/test-data/package/HelloWorld/scenario/output/message.txt +1 -0
- data/test/test-data/package/HelloWorld/scenario/scenario.yml +3 -0
- data/test/test-data/package/TestPackage1+v0.1.0.ppg +0 -0
- data/test/{component/spec_package/TestPackage → test-data/package/TestPackage1}/Test.pione +3 -1
- data/test/test-data/package/TestPackage1/bin/count +11 -0
- data/test/test-data/package/TestPackage1/package.yml +9 -0
- data/test/{component/spec_package/TestPackage → test-data/package/TestPackage1}/scenario/case1/input/1.txt +0 -0
- data/test/test-data/package/TestPackage1/scenario/case1/output/1.count +1 -0
- data/test/test-data/package/TestPackage1/scenario/case1/scenario.yml +6 -0
- data/test/test-data/package/TestPackage1/scenario/case2/input/1.txt +2 -0
- data/test/test-data/package/TestPackage1/scenario/case2/input/2.txt +1 -0
- data/test/test-data/package/TestPackage1/scenario/case2/input/3.txt +3 -0
- data/test/test-data/package/TestPackage1/scenario/case2/output/1.count +1 -0
- data/test/test-data/package/TestPackage1/scenario/case2/output/2.count +1 -0
- data/test/test-data/package/TestPackage1/scenario/case2/output/3.count +1 -0
- data/test/test-data/package/TestPackage1/scenario/case2/scenario.yml +10 -0
- data/test/test-data/package/TestPackage1/scenario/case3/input/a.txt +1 -0
- data/test/test-data/package/TestPackage1/scenario/case3/input/b.txt +1 -0
- data/test/test-data/package/TestPackage1/scenario/case3/output/a.count +1 -0
- data/test/test-data/package/TestPackage1/scenario/case3/output/b.count +1 -0
- data/test/test-data/package/TestPackage1/scenario/case3/scenario.yml +8 -0
- data/test/test-util.rb +10 -146
- data/test/test-util/command.rb +53 -0
- data/test/test-util/package.rb +9 -0
- data/test/test-util/parser.rb +45 -0
- data/test/test-util/transformer.rb +50 -0
- data/test/test-util/webserver.rb +43 -0
- data/test/util/spec_error-report.rb +12 -3
- data/test/util/spec_zip.rb +36 -0
- metadata +282 -54
- data/example/MakePair/scenario/scenario.yml +0 -1
- data/test/component/spec_package/TestPackage/bin/count +0 -3
- data/test/component/spec_package/TestPackage/package.yml +0 -7
- data/test/component/spec_package/TestPackage/scenario/case1/scenario.yml +0 -1
@@ -0,0 +1,59 @@
|
|
1
|
+
shared "http" do
|
2
|
+
it "should not be writable" do
|
3
|
+
location("/a.txt").should.not.be.writable
|
4
|
+
end
|
5
|
+
|
6
|
+
it "should read files" do
|
7
|
+
location("/a.txt").read.should == "A"
|
8
|
+
location("/b.txt").read.should == "AB"
|
9
|
+
location("/c.txt").read.should == "ABC"
|
10
|
+
location("/dir/d.txt").read.should == "ABCD"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should get size" do
|
14
|
+
location("/a.txt").size.should == 1
|
15
|
+
location("/b.txt").size.should == 2
|
16
|
+
location("/c.txt").size.should == 3
|
17
|
+
location("/dir/d.txt").size.should == 4
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should get mtime" do
|
21
|
+
location("/a.txt").mtime.to_s.should == File.mtime(File.join(@path, "a.txt")).to_s
|
22
|
+
location("/b.txt").mtime.to_s.should == File.mtime(File.join(@path, "b.txt")).to_s
|
23
|
+
location("/c.txt").mtime.to_s.should == File.mtime(File.join(@path, "c.txt")).to_s
|
24
|
+
location("/dir/d.txt").mtime.to_s.should == File.mtime(File.join(@path, "dir", "d.txt")).to_s
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should exist" do
|
28
|
+
location("/a.txt").should.exist
|
29
|
+
location("/b.txt").should.exist
|
30
|
+
location("/c.txt").should.exist
|
31
|
+
location("/dir/d.txt").should.exist
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should not exist" do
|
35
|
+
location("/d.txt").should.not.exist
|
36
|
+
location("/dir").should.not.exist
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should be files" do
|
40
|
+
location("/a.txt").should.be.file
|
41
|
+
location("/b.txt").should.be.file
|
42
|
+
location("/c.txt").should.be.file
|
43
|
+
location("/dir/d.txt").should.be.file
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should not be files" do
|
47
|
+
location("/d.txt").should.not.file
|
48
|
+
location("/dir").should.not.file
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should not be directories" do
|
52
|
+
location("/a.txt").should.not.be.directory
|
53
|
+
location("/b.txt").should.not.be.directory
|
54
|
+
location("/c.txt").should.not.be.directory
|
55
|
+
location("/dir/d.txt").should.not.be.directory
|
56
|
+
location("/d.txt").should.not.directory
|
57
|
+
location("/dir").should.not.directory
|
58
|
+
end
|
59
|
+
end
|
@@ -122,4 +122,12 @@ shared "location" do
|
|
122
122
|
(@dir + "D").directory_entries.should.not.include(@dir + "D" + "Y")
|
123
123
|
(@dir + "D").directory_entries.should.not.include(@dir + "D" + "Z")
|
124
124
|
end
|
125
|
+
|
126
|
+
it "should get local location" do
|
127
|
+
@file.create("A")
|
128
|
+
local = @file.local
|
129
|
+
local.scheme.should == "local"
|
130
|
+
local.should.exist
|
131
|
+
local.should.file
|
132
|
+
end
|
125
133
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative '../test-util'
|
2
2
|
|
3
|
-
class TestLocation < Location::
|
3
|
+
class TestLocation < Location::DataLocation
|
4
4
|
set_scheme "test"
|
5
5
|
end
|
6
6
|
|
@@ -32,4 +32,8 @@ describe 'Location::BasicLocation' do
|
|
32
32
|
it 'should get basename' do
|
33
33
|
Location["test:/a/name"].basename.should == "name"
|
34
34
|
end
|
35
|
+
|
36
|
+
it 'should get extension name' do
|
37
|
+
Location["test:/a/name.txt"].extname.should == ".txt"
|
38
|
+
end
|
35
39
|
end
|
@@ -0,0 +1,143 @@
|
|
1
|
+
require_relative '../test-util'
|
2
|
+
|
3
|
+
$stdout = STDOUT
|
4
|
+
$stderr = STDERR
|
5
|
+
|
6
|
+
describe "Pione::Location::GitRepositoryLocation" do
|
7
|
+
before do
|
8
|
+
Global.git_repository_directory
|
9
|
+
end
|
10
|
+
|
11
|
+
#
|
12
|
+
# test git URL handling
|
13
|
+
#
|
14
|
+
|
15
|
+
it "should get repository location of local filesystem" do
|
16
|
+
location = Location[git: "/path/to/repos.git"]
|
17
|
+
location.location_type.should == :git_repository
|
18
|
+
location.address.should == "/path/to/repos.git"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should get repository locatoion of git server" do
|
22
|
+
location = Location[git: "git://path/to/repos.git"]
|
23
|
+
location.location_type.should == :git_repository
|
24
|
+
location.address.should == "git://path/to/repos.git"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should get repository location of http" do
|
28
|
+
location = Location[git: "https://github.com/pione/pione.git"]
|
29
|
+
location.location_type.should == :git_repository
|
30
|
+
location.address.should == "https://github.com/pione/pione.git"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should get repository location of ssh" do
|
34
|
+
location = Location[git: "git@github.com:pione/pione.git"]
|
35
|
+
location.location_type.should == :git_repository
|
36
|
+
location.address.should == "git@github.com:pione/pione.git"
|
37
|
+
end
|
38
|
+
|
39
|
+
#
|
40
|
+
# test repository operations
|
41
|
+
#
|
42
|
+
|
43
|
+
shared "git repository location" do
|
44
|
+
it "should get hash id from tag" do
|
45
|
+
@location.ref(tag: "v0.1.0").should == "2bb5f582387ac04b429db26dc1c597cf0b8fc0fe"
|
46
|
+
@location.should.has_local
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should get hash id from branch" do
|
50
|
+
@location.ref(branch: "master").should == "d0a3837fe04d11ac012db1994c4774a3e39c00fc"
|
51
|
+
@location.should.has_local
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should get compact hash id" do
|
55
|
+
@location.compact_hash_id.should == "d0a3837"
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should export repository at HEAD" do
|
59
|
+
exported = Location[Temppath.mkdir]
|
60
|
+
@location.export(exported)
|
61
|
+
(exported + "package.yml").should.exist
|
62
|
+
(exported + "scenario" + "scenario.yml").should.exist
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should export repository at the hash id" do
|
66
|
+
exported = Location[Temppath.mkdir]
|
67
|
+
(@location + {hashid: "2bb5f58"}).export(exported)
|
68
|
+
(exported + "package.yml").should.exist
|
69
|
+
(exported + "scenario" + "scenario.yml").should.exist
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should export repository at the tag v0.1.0" do
|
73
|
+
exported = Location[Temppath.mkdir]
|
74
|
+
(@location + {tag: "v0.1.0"}).export(exported)
|
75
|
+
(exported + "package.yml").should.exist
|
76
|
+
(exported + "scenario" + "scenario.yml").should.exist
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should export repository at the branch master" do
|
80
|
+
exported = Location[Temppath.mkdir]
|
81
|
+
(@location + {branch: "master"}).export(exported)
|
82
|
+
(exported + "package.yml").should.exist
|
83
|
+
(exported + "scenario" + "scenario.yml").should.exist
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
describe "local" do
|
88
|
+
before do
|
89
|
+
@repos_location = Location[Temppath.mkdir]
|
90
|
+
repos_zip = TestUtil::TEST_PACKAGE_DIR + "HelloWorld-gitrepos.zip"
|
91
|
+
Util::Zip.uncompress(repos_zip, @repos_location)
|
92
|
+
end
|
93
|
+
|
94
|
+
describe "head" do
|
95
|
+
before do
|
96
|
+
@location = Location[git: @repos_location.path]
|
97
|
+
end
|
98
|
+
|
99
|
+
behaves_like "git repository location"
|
100
|
+
end
|
101
|
+
|
102
|
+
describe "with tag" do
|
103
|
+
before do
|
104
|
+
@location = Location[git: @repos_location.path, tag: "v0.1.0"]
|
105
|
+
end
|
106
|
+
|
107
|
+
behaves_like "git repository location"
|
108
|
+
end
|
109
|
+
|
110
|
+
describe "with hash id" do
|
111
|
+
before do
|
112
|
+
@location = Location[git: @repos_location.path, hash_id: "a5dd7b0"]
|
113
|
+
end
|
114
|
+
|
115
|
+
behaves_like "git repository location"
|
116
|
+
end
|
117
|
+
|
118
|
+
describe "with branch" do
|
119
|
+
before do
|
120
|
+
@location = Location[git: @repos_location.path, branch: "master"]
|
121
|
+
end
|
122
|
+
|
123
|
+
behaves_like "git repository location"
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
# describe "http" do
|
128
|
+
# before do
|
129
|
+
# @repos_location = Location[Temppath.mkdir]
|
130
|
+
# repos_zip = TestUtil::TEST_PACKAGE_DIR + "HelloWorld-gitrepos.zip"
|
131
|
+
# Util::Zip.uncompress(repos_zip, @repos_location)
|
132
|
+
# @server = TestUtil::WebServer.start(@repos_location)
|
133
|
+
# @location = Location[git: @server.root.uri]
|
134
|
+
# end
|
135
|
+
|
136
|
+
# after do
|
137
|
+
# @server.terminate
|
138
|
+
# end
|
139
|
+
|
140
|
+
# behaves_like "git repository location"
|
141
|
+
# end
|
142
|
+
end
|
143
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require_relative "../test-util"
|
2
|
+
require_relative "http-behavior"
|
3
|
+
require 'webrick'
|
4
|
+
|
5
|
+
describe "Pione::Location::HTTPLocation" do
|
6
|
+
before do
|
7
|
+
@path = File.join(File.dirname(__FILE__), "spec_http-location")
|
8
|
+
logger = WEBrick::Log.new(StringIO.new("", "w"))
|
9
|
+
@server = WEBrick::HTTPServer.new(DocumentRoot: @path, Port: 54673, Logger: logger, AccessLog: logger)
|
10
|
+
@thread = Thread.new do
|
11
|
+
retriable(on: WEBrick::ServerError, tries: 10, interval: 2) do
|
12
|
+
@server.start
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
after do
|
18
|
+
@server.shutdown
|
19
|
+
@thread.kill
|
20
|
+
end
|
21
|
+
|
22
|
+
def location(path)
|
23
|
+
Location["http://127.0.0.1:%s%s" % [@server.config[:Port], path]]
|
24
|
+
end
|
25
|
+
|
26
|
+
behaves_like "http"
|
27
|
+
end
|
28
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
A
|
@@ -0,0 +1 @@
|
|
1
|
+
AB
|
@@ -0,0 +1 @@
|
|
1
|
+
ABC
|
@@ -0,0 +1 @@
|
|
1
|
+
ABCD
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative "../test-util"
|
2
|
+
require_relative "http-behavior"
|
3
|
+
require 'webrick'
|
4
|
+
require 'webrick/https'
|
5
|
+
|
6
|
+
describe "Pione::Location::HTTPSLocation" do
|
7
|
+
before do
|
8
|
+
@path = File.join(File.dirname(__FILE__), "spec_http-location")
|
9
|
+
logger = WEBrick::Log.new(StringIO.new("", "w"))
|
10
|
+
@server = WEBrick::HTTPServer.new(
|
11
|
+
DocumentRoot: @path,
|
12
|
+
Port: 54673,
|
13
|
+
Logger: logger,
|
14
|
+
AccessLog: logger,
|
15
|
+
SSLEnable: true,
|
16
|
+
SSLCertName: [["CN", WEBrick::Utils.getservername]]
|
17
|
+
)
|
18
|
+
@thread = Thread.new do
|
19
|
+
$stderr = StringIO.new("", "w")
|
20
|
+
retriable(on: WEBrick::ServerError, tries: 5, interval: 1) do
|
21
|
+
@server.start
|
22
|
+
end
|
23
|
+
$stderr = STDOUT
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
after do
|
28
|
+
@server.shutdown
|
29
|
+
@thread.kill
|
30
|
+
end
|
31
|
+
|
32
|
+
def location(path)
|
33
|
+
Location["https://127.0.0.1:%s%s" % [@server.config[:Port], path]]
|
34
|
+
end
|
35
|
+
|
36
|
+
behaves_like "http"
|
37
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../test-util'
|
2
2
|
|
3
3
|
path = Pathname.new(File.join(File.dirname(__FILE__), "spec_update-criteria.pione"))
|
4
|
-
document = Component::Document.load(path
|
4
|
+
document = Component::Document.load(path)
|
5
5
|
|
6
6
|
time = 10.times.map {sleep 0.001; Time.now}
|
7
7
|
tuple = {}
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
Hello, world!
|
Binary file
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
1
|
@@ -0,0 +1 @@
|
|
1
|
+
cabcb
|
@@ -0,0 +1 @@
|
|
1
|
+
2
|
@@ -0,0 +1 @@
|
|
1
|
+
1
|
@@ -0,0 +1 @@
|
|
1
|
+
7
|