kar 0.1.2 → 0.1.3
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/CHANGELOG.md +5 -0
- data/README.md +31 -7
- data/kar.gemspec +1 -1
- data/lib/kar/cargotask.rb +7 -10
- data/lib/kar/dsl.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4e88a860068093597ff4434adfe3ff6f5f7f3db2576b66708e0e57d0dc0bb96d
|
|
4
|
+
data.tar.gz: 1949ce09fc44920dbe98c61f2214ee7d81323f60e6a7f22b082068ecaf25b52e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 892276c83f0431711faaf1569154b9ec04e06b7689e34eca638dd55c3d69da91dda5720f9af844f8794755c01e0f3b1dacee5064e00e182a00a8a2e0533607fc
|
|
7
|
+
data.tar.gz: a135684469b46c1b14896faa8f3abdff6a364edde5ec006864bb8bd9bbffac62bacaae26acc8d4cf79e913a91cb09fbd3ef6ae373d237920c005cf2afffe1bf9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -19,23 +19,47 @@ Usage
|
|
|
19
19
|
|
|
20
20
|
# Rakefile
|
|
21
21
|
require "kar/dsl"
|
|
22
|
+
|
|
23
|
+
### Download task ###
|
|
24
|
+
|
|
25
|
+
It downloads a file and declares file task.
|
|
22
26
|
|
|
23
27
|
download "local/path/to/file" => "https://example.net/remote/path/to/file"
|
|
28
|
+
|
|
29
|
+
### Multiple files task ###
|
|
30
|
+
|
|
31
|
+
It declares multiple file tasks at a time.
|
|
32
|
+
|
|
33
|
+
# Rakefile
|
|
24
34
|
FILES = FileList["fileA", "fileB", "fileC"]
|
|
25
35
|
files FILES
|
|
36
|
+
|
|
37
|
+
### Cargo task ###
|
|
38
|
+
|
|
39
|
+
It declares a cargo task which builds extensions in Rust.
|
|
40
|
+
|
|
41
|
+
# Rakefile
|
|
26
42
|
cargo "my_gem"
|
|
27
43
|
|
|
44
|
+
Run the task:
|
|
45
|
+
|
|
46
|
+
% rake cargo
|
|
47
|
+
|
|
48
|
+
And cargo:check task which checks Rust source files and is useful for dependency of build task.
|
|
49
|
+
|
|
50
|
+
# Rakefile
|
|
51
|
+
task build: "cargo:check"
|
|
52
|
+
|
|
53
|
+
Run the task:
|
|
54
|
+
|
|
55
|
+
% rake build # invokes cargo:checks
|
|
56
|
+
|
|
28
57
|
Development
|
|
29
58
|
-----------
|
|
30
59
|
|
|
31
|
-
To install this gem onto your local machine, run `
|
|
60
|
+
To install this gem onto your local machine, run `rake install`. To release a new version, update the version number in `kar.gemspec`, and then run `rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
32
61
|
|
|
33
62
|
Contributing
|
|
34
63
|
------------
|
|
35
64
|
|
|
36
|
-
Bug reports and pull requests are welcome on GitHub at https://gitlab.com/KitaitiMakoto/kar. This project is intended to be a safe, welcoming space for collaboration
|
|
37
|
-
|
|
38
|
-
Code of Conduct
|
|
39
|
-
---------------
|
|
40
|
-
|
|
41
|
-
Everyone interacting in the Kar project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.com/KitaitiMakoto/kar/blob/main/CODE_OF_CONDUCT.md).
|
|
65
|
+
Bug reports and pull requests are welcome on GitHub at https://gitlab.com/KitaitiMakoto/kar. This project is intended to be a safe, welcoming space for collaboration.
|
data/kar.gemspec
CHANGED
data/lib/kar/cargotask.rb
CHANGED
|
@@ -5,9 +5,7 @@ require "shellwords"
|
|
|
5
5
|
require "stringio"
|
|
6
6
|
|
|
7
7
|
module Kar
|
|
8
|
-
class CargoTask
|
|
9
|
-
include Rake::DSL
|
|
10
|
-
|
|
8
|
+
class CargoTask < Rake::TaskLib
|
|
11
9
|
def initialize(target)
|
|
12
10
|
@target = target
|
|
13
11
|
|
|
@@ -35,16 +33,15 @@ module Kar
|
|
|
35
33
|
namespace :cargo do
|
|
36
34
|
task @target => dl_path
|
|
37
35
|
|
|
38
|
-
# TODO: Consider the case `target` is "
|
|
39
|
-
namespace :
|
|
36
|
+
# TODO: Consider the case `target` is "check"
|
|
37
|
+
namespace :check do
|
|
40
38
|
task @target => manifest do |t|
|
|
41
|
-
|
|
42
|
-
fail unless $?.success?
|
|
39
|
+
sh "cargo", "check", "--manifest-path", manifest.shellescape, "--locked", "--quiet"
|
|
43
40
|
end
|
|
44
41
|
end
|
|
45
42
|
|
|
46
|
-
desc "
|
|
47
|
-
task
|
|
43
|
+
desc "Check Rust sources and manifests"
|
|
44
|
+
task check: "cargo:check:#{@target}"
|
|
48
45
|
end
|
|
49
46
|
|
|
50
47
|
desc "Build all extensions in Rust"
|
|
@@ -81,7 +78,7 @@ module Kar
|
|
|
81
78
|
end
|
|
82
79
|
|
|
83
80
|
def src
|
|
84
|
-
@src ||= FileList["#{ext_dir}/src
|
|
81
|
+
@src ||= FileList["#{ext_dir}/src/**/*.rs"]
|
|
85
82
|
end
|
|
86
83
|
|
|
87
84
|
class Results
|
data/lib/kar/dsl.rb
CHANGED
|
@@ -56,12 +56,12 @@ module Kar
|
|
|
56
56
|
# # Rakefile
|
|
57
57
|
# cargo "my_gem"
|
|
58
58
|
#
|
|
59
|
-
# task build: :
|
|
59
|
+
# task build: "cargo:check"
|
|
60
60
|
#
|
|
61
61
|
# # shell
|
|
62
62
|
# % rake cargo
|
|
63
63
|
#
|
|
64
|
-
# Also defines a cargo:
|
|
64
|
+
# Also defines a cargo:check task which check sources and manifests.
|
|
65
65
|
# It's useful to add them to the dependency of build task and prevent building invalid gem package.
|
|
66
66
|
#
|
|
67
67
|
# Uses {https://docs.ruby-lang.org/en/master/Gem/Ext/CargoBuilder.html Gem::Ext::CargoBuilder} internally unlike {https://oxidize-rb.org/docs/api-reference/rb-sys-gem-config#rbsysextensiontask RbSys::ExtensionTask}
|