itamae-plugin-recipe-highlight 0.4.0 → 0.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29f4729ace2c86bb91175dd17de087b59a51424044ec85e61d52bb4e31be2fc3
4
- data.tar.gz: 35249ac240b005f451668ee33aa4a049a3677a4784b21d60858099a5cb720474
3
+ metadata.gz: 196f40a9df5acd16e6325b7e918beecba5f512a66c73d8331623faf0dc30a693
4
+ data.tar.gz: d954111255bd6edda21a797b39f6b28cdecaaf394b8cbe4cacfd6026f657bf95
5
5
  SHA512:
6
- metadata.gz: 3519396bee3343a961870d09e20b1e12c6070aa87c3462f27f885537e845840d67906e709e448f6c6c5ce0a3462eb71879f23ba9d2268cb88c8092625de2b9d6
7
- data.tar.gz: 1dd7385622869db646985b33eb26ead89b5efe170a343996ea2cb25f1412eccdef9467f6753961c8830e118e4ebe0bb963be996c4308742ba9b708c0ef658a3c
6
+ metadata.gz: 8908129d1308649432d11b0f947bcd74b2a1406bcea96ea38f1d6ea9d0b5db60187bdfb4f086e99876bb704b1972b85fcb800d4df7d35e72c95964babafbc391
7
+ data.tar.gz: bf70c7b4df96e94fa914d9492a4e0e172606936331e725623846cd61f214495124fe2c3f01148c022734b0800ecba2c83408637b404500d71d36aff2cab15712
data/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.6.0 - 2024-11-14
6
+
7
+ ### Added
8
+
9
+ * `node[:highlight][:download_root_url]`,
10
+ `node[:highlight][:archive_file_name]`,
11
+ `node[:highlight][:archive_file_path]`, `node[:highlight][:tmpdir]`,
12
+ `node[:highlight][:srcdir]`, `node[:highlight][:makefile]`,
13
+ `node[:highlight][:exist]`, `node[:highlight][:updated]`,
14
+ `node[:highlight][:makefile_exist]`
15
+
16
+ ### Removed
17
+
18
+ * Verify recipe. So `node[:highlight][:verify]` now doesn't have any
19
+ efffect.
20
+ * `node[:highlight][:commands][:wget]`, `node[:highlight][:tmp]`,
21
+ `node[:highlight][:commands][:gpg]`
22
+
23
+ ## 0.5.0 - 2024-06-02
24
+
25
+ ### Changed
26
+
27
+ * Update Highlight version to v4.12.
28
+
5
29
  ## 0.4.0 - 2024-03-29
6
30
 
7
31
  ### Changed
data/Gemfile CHANGED
@@ -2,4 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'rubocop', '~> 1.21'
5
+ gem 'rubocop', '~> 1.48'
data/Gemfile.lock ADDED
@@ -0,0 +1,65 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ itamae-plugin-recipe-highlight (0.5.0)
5
+ itamae (~> 1.14)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ansi (1.5.0)
11
+ ast (2.4.2)
12
+ base64 (0.2.0)
13
+ hashie (5.0.0)
14
+ itamae (1.14.1)
15
+ ansi
16
+ hashie
17
+ schash (~> 0.1.0)
18
+ specinfra (>= 2.64.0, < 3.0.0)
19
+ thor (>= 1.0.0)
20
+ json (2.8.1)
21
+ language_server-protocol (3.17.0.3)
22
+ net-scp (4.0.0)
23
+ net-ssh (>= 2.6.5, < 8.0.0)
24
+ net-ssh (7.3.0)
25
+ net-telnet (0.2.0)
26
+ parallel (1.26.3)
27
+ parser (3.3.6.0)
28
+ ast (~> 2.4.1)
29
+ racc
30
+ racc (1.8.1)
31
+ rainbow (3.1.1)
32
+ regexp_parser (2.9.2)
33
+ rubocop (1.68.0)
34
+ json (~> 2.3)
35
+ language_server-protocol (>= 3.17.0)
36
+ parallel (~> 1.10)
37
+ parser (>= 3.3.0.2)
38
+ rainbow (>= 2.2.2, < 4.0)
39
+ regexp_parser (>= 2.4, < 3.0)
40
+ rubocop-ast (>= 1.32.2, < 2.0)
41
+ ruby-progressbar (~> 1.7)
42
+ unicode-display_width (>= 2.4.0, < 3.0)
43
+ rubocop-ast (1.36.1)
44
+ parser (>= 3.3.1.0)
45
+ ruby-progressbar (1.13.0)
46
+ schash (0.1.2)
47
+ sfl (2.3)
48
+ specinfra (2.91.0)
49
+ base64
50
+ net-scp
51
+ net-ssh (>= 2.7)
52
+ net-telnet
53
+ sfl
54
+ thor (1.3.2)
55
+ unicode-display_width (2.6.0)
56
+
57
+ PLATFORMS
58
+ x86_64-linux
59
+
60
+ DEPENDENCIES
61
+ itamae-plugin-recipe-highlight!
62
+ rubocop (~> 1.48)
63
+
64
+ BUNDLED WITH
65
+ 2.3.26
@@ -4,23 +4,21 @@ require 'uri'
4
4
  node.reverse_merge!(
5
5
  {
6
6
  highlight: {
7
- tmp: '/tmp',
8
- version: '4.11',
7
+ version: '4.12',
9
8
  command: 'highlight',
10
- verify: true,
11
9
  dependencies: {
12
10
  lua: 'liblua5.4-dev',
13
11
  boost: 'libboost-dev'
14
12
  },
15
13
  commands: {
16
- gpg: 'gpg',
17
14
  grep: 'grep',
18
15
  make: 'make',
19
16
  tar: 'tar',
20
17
  test: 'test',
21
- type: 'type',
22
- wget: 'wget',
23
- }
18
+ type: 'type'
19
+ },
20
+ download_root_url: 'http://www.andre-simon.de/zip/',
21
+ tmpdir: '/tmp/itamae-highlight'
24
22
  }
25
23
  }
26
24
  )
@@ -28,121 +26,120 @@ node.reverse_merge!(
28
26
  node.validate! do
29
27
  {
30
28
  highlight: {
31
- tmp: string,
32
29
  version: string,
33
30
  command: string,
34
- verify: boolean,
35
31
  dependencies: {
36
32
  lua: string,
37
- boost: string,
33
+ boost: string
38
34
  },
39
35
  commands: {
40
- gpg: string,
41
36
  grep: string,
42
37
  make: string,
43
38
  tar: string,
44
- type: string,
45
- wget: string,
46
- }
39
+ type: string
40
+ },
41
+ download_root_url: string,
42
+ tmpdir: string
47
43
  }
48
44
  }
49
45
  end
50
46
 
51
- command_exists = [node[:highlight][:commands][:type], node[:highlight][:command]].shelljoin
52
-
53
- grep_version = [node[:highlight][:commands][:grep], "highlight version #{ node[:highlight][:version] }"].shelljoin
54
- print_version = [node[:highlight][:command], '--version'].shelljoin
55
- updated = "#{ print_version } | #{ grep_version }"
56
-
57
- tmp_dir = run_command(["mktemp", "--directory", "--tmpdir=#{node[:highlight][:tmp]}"].shelljoin).stdout
58
-
59
- source_dir = File.join(tmp_dir, "highlight-#{ node[:highlight][:version] }")
60
- makefile_exists = [node[:highlight][:commands][:test], '-f', File.join(source_dir, 'makefile')].shelljoin
61
-
62
- archive_file_name = "highlight-#{ node[:highlight][:version] }.tar.bz2"
63
- archive_file_path = File.join(tmp_dir, archive_file_name)
64
- download_root_url = 'http://www.andre-simon.de/zip/'
65
-
66
- directory tmp_dir
67
-
68
- package 'wget'
69
-
70
- execute 'download archive file' do
71
- cwd tmp_dir
72
- download = [node[:highlight][:commands][:wget], URI.join(download_root_url, archive_file_name).to_s].shelljoin
73
- command download
47
+ node.reverse_merge!(
48
+ {
49
+ highlight: {
50
+ archive_file_name: "highlight-#{node[:highlight][:version]}.tar.bz2",
51
+ srcdir: File.join(node[:highlight][:tmpdir], "highlight-#{node[:highlight][:version]}"),
52
+ exist: [node[:highlight][:commands][:type], node[:highlight][:command]].shelljoin,
53
+ updated:
54
+ begin
55
+ grep_version = [node[:highlight][:commands][:grep], "highlight version #{node[:highlight][:version]}"].shelljoin
56
+ print_version = [node[:highlight][:command], '--version'].shelljoin
57
+ "#{print_version} | #{grep_version}"
58
+ end
59
+ }
60
+ }
61
+ )
74
62
 
75
- not_if command_exists
76
- not_if updated
77
- not_if makefile_exists
63
+ node.validate! do
64
+ {
65
+ highlight: {
66
+ archive_file_name: string,
67
+ srcdir: string,
68
+ exist: string,
69
+ updated: string
70
+ }
71
+ }
78
72
  end
79
73
 
80
- if node[:highlight][:verify]
81
- signature_name = "highlight-#{ node[:highlight][:version] }.tar.bz2.asc"
82
- signature_path = File.join(tmp_dir, signature_name)
83
-
84
- http_request signature_path do
85
- url URI.join(download_root_url, signature_name).to_s
86
-
87
- not_if command_exists
88
- not_if updated
89
- not_if [node[:highlight][:commands][:test], '-f', signature_path].shelljoin
90
- end
91
-
92
- execute 'receive key' do
93
- key_id = 'D805A7C7'
74
+ node.reverse_merge!(
75
+ {
76
+ highlight: {
77
+ archive_file_path: File.join(node[:highlight][:tmpdir], node[:highlight][:archive_file_name]),
78
+ makefile: File.join(node[:highlight][:srcdir], 'makefile')
79
+ }
80
+ }
81
+ )
94
82
 
95
- fetch_key = [node[:highlight][:commands][:gpg], '--keyserver', 'pgp.mit.edu', '--recv-key', key_id].shelljoin
96
- command fetch_key
83
+ node.validate! do
84
+ {
85
+ highlight: {
86
+ archive_file_path: string,
87
+ makefile: string
88
+ }
89
+ }
90
+ end
97
91
 
98
- not_if command_exists
99
- not_if updated
92
+ node.reverse_merge!(
93
+ {
94
+ highlight: {
95
+ makefile_exist: [node[:highlight][:commands][:test], '-f', node[:highlight][:makefile]].shelljoin
96
+ }
97
+ }
98
+ )
100
99
 
101
- export_public_key = [node[:highlight][:commands][:gpg], '--export', '--armor', key_id].shelljoin
102
- check_not_yet_imported = [node[:highlight][:commands][:grep], 'nothing exported'].shelljoin
103
- only_if "#{ export_public_key } | #{ check_not_yet_imported }"
104
- end
100
+ node.validate! do
101
+ {
102
+ highlight: {
103
+ makefile_exist: string
104
+ }
105
+ }
106
+ end
105
107
 
106
- execute 'verify' do
107
- verify_archive = [node[:highlight][:commands][:gpg], '--verify', signature_path, archive_file_path].shelljoin
108
- command verify_archive
108
+ directory node[:highlight][:tmpdir]
109
109
 
110
- not_if command_exists
111
- not_if updated
112
- end
110
+ http_request node[:highlight][:archive_file_path] do
111
+ url URI.join(node[:highlight][:download_root_url], node[:highlight][:archive_file_name]).to_s
112
+ cwd node[:highlight][:tmpdir]
113
+ not_if node[:highlight][:exist]
114
+ not_if node[:highlight][:updated]
115
+ not_if node[:highlight][:makefile_exist]
113
116
  end
114
117
 
115
118
  execute 'extract' do
116
- extract_archive = [node[:highlight][:commands][:tar], 'axf', archive_file_path].shelljoin
117
- command extract_archive
118
- cwd tmp_dir
119
-
120
- not_if command_exists
121
- not_if updated
122
- not_if makefile_exists
119
+ command [node[:highlight][:commands][:tar], 'axf', node[:highlight][:archive_file_path]].shelljoin
120
+ cwd node[:highlight][:tmpdir]
121
+ not_if node[:highlight][:exist]
122
+ not_if node[:highlight][:updated]
123
+ not_if node[:highlight][:makefile_exist]
123
124
  end
124
125
 
125
- [node[:highlight][:dependencies][:lua], node[:highlight][:dependencies][:boost]].each do |pack|
126
- package pack do
127
- not_if command_exists
128
- not_if updated
126
+ node[:highlight][:dependencies].each do |_, name|
127
+ package name do
128
+ not_if node[:highlight][:exist]
129
+ not_if node[:highlight][:updated]
129
130
  end
130
131
  end
131
132
 
132
133
  execute 'compile' do
133
- compile_cli = [node[:highlight][:commands][:make], 'cli'].shelljoin
134
- command compile_cli
135
- cwd source_dir
136
-
137
- not_if command_exists
138
- not_if updated
134
+ command [node[:highlight][:commands][:make], 'cli'].shelljoin
135
+ cwd node[:highlight][:srcdir]
136
+ not_if node[:highlight][:exist]
137
+ not_if node[:highlight][:updated]
139
138
  end
140
139
 
141
140
  execute 'install' do
142
- install_files = [node[:highlight][:commands][:make], 'install'].shelljoin
143
- command install_files
144
- cwd source_dir
145
-
146
- not_if command_exists
147
- not_if updated
141
+ command [node[:highlight][:commands][:make], 'install'].shelljoin
142
+ cwd node[:highlight][:srcdir]
143
+ not_if node[:highlight][:exist]
144
+ not_if node[:highlight][:updated]
148
145
  end
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module Highlight
5
- VERSION = '0.4.0'
5
+ VERSION = '0.6.0'.freeze
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-highlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - gemmaro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-29 00:00:00.000000000 Z
11
+ date: 2024-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: itamae
@@ -34,6 +34,7 @@ extra_rdoc_files: []
34
34
  files:
35
35
  - CHANGELOG.md
36
36
  - Gemfile
37
+ - Gemfile.lock
37
38
  - LICENSE.txt
38
39
  - README.md
39
40
  - Rakefile
@@ -41,10 +42,16 @@ files:
41
42
  - lib/itamae/plugin/recipe/highlight/default.rb
42
43
  - lib/itamae/plugin/recipe/highlight/version.rb
43
44
  homepage: https://codeberg.org/gemmaro/itamae-plugin-recipe-highlight
44
- licenses: []
45
+ licenses:
46
+ - Apache-2.0
45
47
  metadata:
48
+ rubygems_mfa_required: 'true'
49
+ bug_tracker_uri: https://codeberg.org/gemmaro/itamae-plugin-recipe-highlight/issues
50
+ changelog_uri: https://codeberg.org/gemmaro/itamae-plugin-recipe-highlight/src/branch/main/CHANGELOG.md
51
+ documentation_uri: https://www.rubydoc.info/gems/itamae-plugin-recipe-highlight
46
52
  homepage_uri: https://codeberg.org/gemmaro/itamae-plugin-recipe-highlight
47
- source_code_uri: https://codeberg.org/gemmaro/itamae-plugin-recipe-highlight.git
53
+ source_code_uri: https://codeberg.org/gemmaro/itamae-plugin-recipe-highlight
54
+ wiki_uri: https://codeberg.org/gemmaro/itamae-plugin-recipe-highlight/wiki
48
55
  post_install_message:
49
56
  rdoc_options: []
50
57
  require_paths: