itamae-plugin-recipe-highlight 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2160685314e586f026eaf4e5f082bcb54e6b384f0b137ee7dc141825fe63c2ac
4
- data.tar.gz: 212ac98b6198685f296f5f73ad047086b39b8e5bca74fc68a9a225dee7f03a95
3
+ metadata.gz: 29f4729ace2c86bb91175dd17de087b59a51424044ec85e61d52bb4e31be2fc3
4
+ data.tar.gz: 35249ac240b005f451668ee33aa4a049a3677a4784b21d60858099a5cb720474
5
5
  SHA512:
6
- metadata.gz: 8ad25864df90cf5ff7c36eb0f02c9e417a4c8ccca1e1d440451c08d2b40ca6e778e1648e13d2cb9e16f8307b38ee4b7c50905ee09e1213e07efcd55de7db592f
7
- data.tar.gz: e71483e9ab2c9b6396db6e76eb09a42a3d885c0c5d210e353a4dc1a22d38b9c085186219b2d371ad1e1ce15e3def2c367790f92594ea1f627d4b2e7fa02e4fe6
6
+ metadata.gz: 3519396bee3343a961870d09e20b1e12c6070aa87c3462f27f885537e845840d67906e709e448f6c6c5ce0a3462eb71879f23ba9d2268cb88c8092625de2b9d6
7
+ data.tar.gz: 1dd7385622869db646985b33eb26ead89b5efe170a343996ea2cb25f1412eccdef9467f6753961c8830e118e4ebe0bb963be996c4308742ba9b708c0ef658a3c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.4.0 - 2024-03-29
6
+
7
+ ### Changed
8
+
9
+ * Update Highlight version to v4.11.
10
+
11
+ ### Fixed
12
+
13
+ * Fixed not to create a temporary directory on the host system.
14
+
5
15
  ## 0.3.0 - 2023-11-14
6
16
 
7
17
  ### Changed
@@ -5,7 +5,7 @@ node.reverse_merge!(
5
5
  {
6
6
  highlight: {
7
7
  tmp: '/tmp',
8
- version: '4.10',
8
+ version: '4.11',
9
9
  command: 'highlight',
10
10
  verify: true,
11
11
  dependencies: {
@@ -54,95 +54,95 @@ grep_version = [node[:highlight][:commands][:grep], "highlight version #{ node[:
54
54
  print_version = [node[:highlight][:command], '--version'].shelljoin
55
55
  updated = "#{ print_version } | #{ grep_version }"
56
56
 
57
- Dir.mktmpdir(node[:highlight][:tmp]) do |tmp_dir|
58
- source_dir = File.join(tmp_dir, "highlight-#{ node[:highlight][:version] }")
59
- makefile_exists = [node[:highlight][:commands][:test], '-f', File.join(source_dir, 'makefile')].shelljoin
57
+ tmp_dir = run_command(["mktemp", "--directory", "--tmpdir=#{node[:highlight][:tmp]}"].shelljoin).stdout
60
58
 
61
- archive_file_name = "highlight-#{ node[:highlight][:version] }.tar.bz2"
62
- archive_file_path = File.join(tmp_dir, archive_file_name)
63
- download_root_url = 'http://www.andre-simon.de/zip/'
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
64
61
 
65
- directory tmp_dir
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/'
66
65
 
67
- package 'wget'
66
+ directory tmp_dir
68
67
 
69
- execute 'download archive file' do
70
- cwd tmp_dir
71
- download = [node[:highlight][:commands][:wget], URI.join(download_root_url, archive_file_name).to_s].shelljoin
72
- command download
68
+ package 'wget'
73
69
 
74
- not_if command_exists
75
- not_if updated
76
- not_if makefile_exists
77
- end
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
78
74
 
79
- if node[:highlight][:verify]
80
- signature_name = "highlight-#{ node[:highlight][:version] }.tar.bz2.asc"
81
- signature_path = File.join(tmp_dir, signature_name)
82
-
83
- http_request signature_path do
84
- url URI.join(download_root_url, signature_name).to_s
75
+ not_if command_exists
76
+ not_if updated
77
+ not_if makefile_exists
78
+ end
85
79
 
86
- not_if command_exists
87
- not_if updated
88
- not_if [node[:highlight][:commands][:test], '-f', signature_path].shelljoin
89
- end
80
+ if node[:highlight][:verify]
81
+ signature_name = "highlight-#{ node[:highlight][:version] }.tar.bz2.asc"
82
+ signature_path = File.join(tmp_dir, signature_name)
90
83
 
91
- execute 'receive key' do
92
- key_id = 'D805A7C7'
84
+ http_request signature_path do
85
+ url URI.join(download_root_url, signature_name).to_s
93
86
 
94
- fetch_key = [node[:highlight][:commands][:gpg], '--keyserver', 'pgp.mit.edu', '--recv-key', key_id].shelljoin
95
- command fetch_key
87
+ not_if command_exists
88
+ not_if updated
89
+ not_if [node[:highlight][:commands][:test], '-f', signature_path].shelljoin
90
+ end
96
91
 
97
- not_if command_exists
98
- not_if updated
92
+ execute 'receive key' do
93
+ key_id = 'D805A7C7'
99
94
 
100
- export_public_key = [node[:highlight][:commands][:gpg], '--export', '--armor', key_id].shelljoin
101
- check_not_yet_imported = [node[:highlight][:commands][:grep], 'nothing exported'].shelljoin
102
- only_if "#{ export_public_key } | #{ check_not_yet_imported }"
103
- end
95
+ fetch_key = [node[:highlight][:commands][:gpg], '--keyserver', 'pgp.mit.edu', '--recv-key', key_id].shelljoin
96
+ command fetch_key
104
97
 
105
- execute 'verify' do
106
- verify_archive = [node[:highlight][:commands][:gpg], '--verify', signature_path, archive_file_path].shelljoin
107
- command verify_archive
98
+ not_if command_exists
99
+ not_if updated
108
100
 
109
- not_if command_exists
110
- not_if updated
111
- end
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 }"
112
104
  end
113
105
 
114
- execute 'extract' do
115
- extract_archive = [node[:highlight][:commands][:tar], 'axf', archive_file_path].shelljoin
116
- command extract_archive
117
- cwd tmp_dir
106
+ execute 'verify' do
107
+ verify_archive = [node[:highlight][:commands][:gpg], '--verify', signature_path, archive_file_path].shelljoin
108
+ command verify_archive
118
109
 
119
110
  not_if command_exists
120
111
  not_if updated
121
- not_if makefile_exists
122
112
  end
113
+ end
123
114
 
124
- [node[:highlight][:dependencies][:lua], node[:highlight][:dependencies][:boost]].each do |pack|
125
- package pack do
126
- not_if command_exists
127
- not_if updated
128
- end
129
- end
115
+ execute 'extract' do
116
+ extract_archive = [node[:highlight][:commands][:tar], 'axf', archive_file_path].shelljoin
117
+ command extract_archive
118
+ cwd tmp_dir
130
119
 
131
- execute 'compile' do
132
- compile_cli = [node[:highlight][:commands][:make], 'cli'].shelljoin
133
- command compile_cli
134
- cwd source_dir
120
+ not_if command_exists
121
+ not_if updated
122
+ not_if makefile_exists
123
+ end
135
124
 
125
+ [node[:highlight][:dependencies][:lua], node[:highlight][:dependencies][:boost]].each do |pack|
126
+ package pack do
136
127
  not_if command_exists
137
128
  not_if updated
138
129
  end
130
+ end
139
131
 
140
- execute 'install' do
141
- install_files = [node[:highlight][:commands][:make], 'install'].shelljoin
142
- command install_files
143
- cwd source_dir
132
+ execute 'compile' do
133
+ compile_cli = [node[:highlight][:commands][:make], 'cli'].shelljoin
134
+ command compile_cli
135
+ cwd source_dir
144
136
 
145
- not_if command_exists
146
- not_if updated
147
- end
137
+ not_if command_exists
138
+ not_if updated
139
+ end
140
+
141
+ 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
148
148
  end
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module Highlight
5
- VERSION = '0.3.0'
5
+ VERSION = '0.4.0'
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.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - gemmaro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-13 00:00:00.000000000 Z
11
+ date: 2024-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: itamae