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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 997bfcbcd92bf9aea3625eaa6f66622c9077e93e754c83328ee48a24d0d42a59
4
- data.tar.gz: 1a32d287aa169199d98d8af143c3a12be8c84b3be894faf7c5a32479bf1887c8
3
+ metadata.gz: 4e88a860068093597ff4434adfe3ff6f5f7f3db2576b66708e0e57d0dc0bb96d
4
+ data.tar.gz: 1949ce09fc44920dbe98c61f2214ee7d81323f60e6a7f22b082068ecaf25b52e
5
5
  SHA512:
6
- metadata.gz: d71c84b1473e99ceb209f8c9510f66823446be3ae68aca1e31e389f6ff5c23c6bdcad4cf3886e28b8144dbf7c04c76ef4dede8ed2721d6d75e9d5ae11e28c0c9
7
- data.tar.gz: 240afac657222785391bb06b87254137e9fdacc71c323e155a12787d51abe163221c4c0560d1bb6bc89d68f1fbdd8fcb985a01f2ff1be289afdedbb4241a253a
6
+ metadata.gz: 892276c83f0431711faaf1569154b9ec04e06b7689e34eca638dd55c3d69da91dda5720f9af844f8794755c01e0f3b1dacee5064e00e182a00a8a2e0533607fc
7
+ data.tar.gz: a135684469b46c1b14896faa8f3abdff6a364edde5ec006864bb8bd9bbffac62bacaae26acc8d4cf79e913a91cb09fbd3ef6ae373d237920c005cf2afffe1bf9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.3] - 2025-10-26
4
+
5
+ - Make cargo task to be dependent on Rust source files
6
+ - cargo:validate -> cargo:check
7
+
3
8
  ## [0.1.2] - 2025-10-26
4
9
 
5
10
  - CargoTask, build extension in Rust
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 `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec 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).
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, and contributors are expected to adhere to the [code of conduct](https://gitlab.com/KitaitiMakoto/kar/blob/main/CODE_OF_CONDUCT.md).
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "kar"
3
- spec.version = "0.1.2"
3
+ spec.version = "0.1.3"
4
4
  spec.authors = ["Kitaiti Makoto"]
5
5
  spec.email = ["KitaitiMakoto@gmail.com"]
6
6
 
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 "validate"
39
- namespace :validate do
36
+ # TODO: Consider the case `target` is "check"
37
+ namespace :check do
40
38
  task @target => manifest do |t|
41
- `cargo metadata --format-version=1 --manifest-path=#{manifest.shellescape} --locked --quiet`
42
- fail unless $?.success?
39
+ sh "cargo", "check", "--manifest-path", manifest.shellescape, "--locked", "--quiet"
43
40
  end
44
41
  end
45
42
 
46
- desc "Validate Cargo.lock files"
47
- task validate: "cargo:validate:#{@target}"
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/*/*.rs"]
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: :cargo
59
+ # task build: "cargo:check"
60
60
  #
61
61
  # # shell
62
62
  # % rake cargo
63
63
  #
64
- # Also defines a cargo:validate task which validates version `Cargo.lock`s are up-to-date.
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}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kitaiti Makoto