emplace 0.3.0 → 0.3.1
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.
- checksums.yaml +4 -4
- data/README.md +12 -1
- data/test/emplace-test.rb +28 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a0f3bf5e0f9ae18239005e05112f284f2df060f
|
4
|
+
data.tar.gz: 1fa7cee85c1b93898f35f485ed4eab72d04fe20a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acedf4c915f7baf4703d541b94f5bbde52803aa3bd6496aad65e8c853f5428f9e3bd35d52aac518ccb46f90be3b724c9137a6757316082a0e094a08edad3246e
|
7
|
+
data.tar.gz: f748b9e6d7563a1e00c0ec2a2132e84ac35e5828646e344d8271abc835ebf20f16c40c38ccf1c5068260b47d75c442bb80c025a9ea23e7d21c99a7984785cde2
|
data/README.md
CHANGED
@@ -21,12 +21,23 @@ Or install it yourself as:
|
|
21
21
|
## Rakefile Usage
|
22
22
|
|
23
23
|
require 'emplace'
|
24
|
-
project = Emplace.new 'project-name'
|
24
|
+
project = Emplace::Project.new 'project-name'
|
25
25
|
project.cmake!
|
26
26
|
project.build!
|
27
27
|
project.test!
|
28
|
+
# create 'dist/project-<package-name>'
|
28
29
|
project.package!
|
29
30
|
|
31
|
+
dependency = Emplace::Project.new 'dependency-name',
|
32
|
+
url: 'https://dependency.org/download',
|
33
|
+
version: 'v1.0'
|
34
|
+
|
35
|
+
# download 'https://dependency.org/download/v1.0/dependency-name-<package-name>'
|
36
|
+
# or locally, copy from '../dependency-name/dist/dependency-name-<package-name>'
|
37
|
+
dependency.fetch!
|
38
|
+
# extract to vendor/dependency-name/
|
39
|
+
dependency.extract!
|
40
|
+
|
30
41
|
## CMake Macros
|
31
42
|
|
32
43
|
include(Emplace)
|
data/test/emplace-test.rb
CHANGED
@@ -89,6 +89,24 @@ class TestEmplace < Test::Unit::TestCase
|
|
89
89
|
FileUtils.rm_rf 'vendor'
|
90
90
|
end
|
91
91
|
|
92
|
+
def testFetchLocal
|
93
|
+
FileUtils.mkdir_p 'myproj/vendor'
|
94
|
+
FileUtils.mkdir_p 'foo/dist'
|
95
|
+
|
96
|
+
File.write('foo/dist/foo-linux-x86_64.tgz', 'foo')
|
97
|
+
|
98
|
+
local = Local.new
|
99
|
+
project = Emplace::Project.new 'foo', {}, local
|
100
|
+
Dir.chdir('myproj') {
|
101
|
+
project.fetch!
|
102
|
+
}
|
103
|
+
|
104
|
+
assert_equal 'foo', File.read('myproj/vendor/foo-linux-x86_64.tgz')
|
105
|
+
ensure
|
106
|
+
FileUtils.rm_rf 'myproj'
|
107
|
+
FileUtils.rm_rf 'foo'
|
108
|
+
end
|
109
|
+
|
92
110
|
def modpath
|
93
111
|
File.join(File.dirname(File.dirname(__FILE__)), 'modules')
|
94
112
|
end
|
@@ -113,4 +131,14 @@ class TestEmplace < Test::Unit::TestCase
|
|
113
131
|
end
|
114
132
|
end
|
115
133
|
|
134
|
+
class Local < Emplace.send(:local, Emplace::Linux)
|
135
|
+
attr_reader :commands
|
136
|
+
def arch
|
137
|
+
'x86_64'
|
138
|
+
end
|
139
|
+
def sh(cmd, dir='')
|
140
|
+
(@commands ||= []) << cmd
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
116
144
|
end
|