rtlsdr 0.1.9 → 0.1.10

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: c370a5ba9c19c9bc281748d95af3e0d739bc4c45bd1f7b6a748f5f225633fe02
4
- data.tar.gz: c5c683baa72b876bb2fcddee14b82274880d6348c74fcbe780cd8516a9fb1f68
3
+ metadata.gz: 19e27da2cf52915c73a17f064e602ca1f26a8535c6db93f37d5435241a12cfb6
4
+ data.tar.gz: afe03bc40b9c2f09a2d0e404200f76a2cd44f2e1ef0245962a9c76df6b907a3b
5
5
  SHA512:
6
- metadata.gz: 80a4cf170e8f566f8f4050ac141e3745a7bc3c37944e715f08f6cb8ce5b09bef1e264bd74f6f836c0ddc945a4e896e1816c8b63abfb9222e3e6cfd07ac18888d
7
- data.tar.gz: de1f5fb3133170a4edeed86eb0e0498797ff7897d6168e0d724c2af5ba149d7d01b17db2479a93c45c833ce98866b18c60a02c916f2ffd19c2aa0ad528e94f0e
6
+ metadata.gz: 4888cd280b0873cea23daa1af07c949c8d0163df3da8cfae451b0c1d717662b90d351b0c990510a18f8ea41ac71b3f68d1cf8fac513516b4a7ad8d93865296ab
7
+ data.tar.gz: 2eb2514823b9ed8dbd6fe867fea769bd3db283148efc6431c3d4060dbbb988897f582d396e0951cb9cf4d445fc3f0686554bbe3de1849827c4695a798a99b9b4
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.4.4
1
+ 3.4.5
data/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.1.10] - 2025-07-19
6
+
7
+ ### Added
8
+
9
+ ### Changed
10
+
11
+ Update gems
12
+
13
+ ### Fixed
14
+
15
+
5
16
  ## [0.1.9] - 2025-06-13
6
17
 
7
18
  ### Added
data/Rakefile CHANGED
@@ -6,42 +6,59 @@ require "rubocop/rake_task"
6
6
  require "rdoc/task"
7
7
  require "yard"
8
8
 
9
- # rubocop:disable Metrics/BlockLength
10
-
11
9
  RSpec::Core::RakeTask.new(:spec)
12
-
13
10
  RuboCop::RakeTask.new
14
11
 
15
- # RDoc documentation generation
12
+ DOC_TITLE = "RTL-SDR Ruby Gem Documentation"
13
+ DOC_FILES = ["lib/**/*.rb", "-", "README.md", "CHANGELOG.md", "LICENSE.txt"].freeze
14
+
15
+ def update_file_version(file_path, current_version, new_version)
16
+ return unless File.exist?(file_path)
17
+
18
+ content = File.read(file_path)
19
+
20
+ case file_path
21
+ when /version\.rb$/
22
+ updated = content.gsub(/VERSION = "#{Regexp.escape(current_version)}"/, %(VERSION = "#{new_version}"))
23
+ when "Gemfile.lock"
24
+ updated = content.gsub(/rtlsdr \(#{Regexp.escape(current_version)}\)/, "rtlsdr (#{new_version})")
25
+ when "CHANGELOG.md"
26
+ date = Time.now.strftime("%Y-%m-%d")
27
+ new_entry = "\n## [#{new_version}] - #{date}\n\n### Added\n\n### Changed\n\n### Fixed\n\n"
28
+
29
+ updated = if content.include?("## [Unreleased]")
30
+ content.sub(/(## \[Unreleased\].*?\n)/, "\\1#{new_entry}")
31
+ elsif content.include?("# Changelog")
32
+ content.sub(/(# Changelog\s*\n)/, "\\1#{new_entry}")
33
+ else
34
+ "# Changelog#{new_entry}#{content}"
35
+ end
36
+ end
37
+
38
+ File.write(file_path, updated) if updated
39
+ end
40
+
41
+ def current_version
42
+ require_relative "lib/rtlsdr/version"
43
+ RTLSDR::VERSION
44
+ end
45
+
16
46
  RDoc::Task.new(:rdoc) do |rdoc|
17
47
  rdoc.rdoc_dir = "doc"
18
- rdoc.title = "RTL-SDR Ruby Gem Documentation"
48
+ rdoc.title = DOC_TITLE
19
49
  rdoc.main = "README.md"
20
- rdoc.rdoc_files.include("README.md", "CHANGELOG.md", "LICENSE.txt", "lib/**/*.rb")
21
-
22
- # RDoc options for better output
23
- rdoc.options << "--line-numbers"
24
- rdoc.options << "--all"
25
- rdoc.options << "--charset=UTF-8"
26
- rdoc.options << "--exclude=spec/"
27
- rdoc.options << "--exclude=examples/"
28
- rdoc.options << "--exclude=bin/"
29
- rdoc.options << "--exclude=exe/"
50
+ rdoc.rdoc_files.include(*DOC_FILES.first(1), *DOC_FILES[2..-1])
51
+ rdoc.options << "--line-numbers" << "--all" << "--charset=UTF-8"
52
+ %w[spec examples bin exe].each { |dir| rdoc.options << "--exclude=#{dir}/" }
30
53
  rdoc.options << "--template=hanna" if system("gem list hanna -i > /dev/null 2>&1")
31
54
  end
32
55
 
33
- # Clean documentation
34
- desc "Remove generated documentation"
35
- task :clean_doc do
36
- rm_rf "doc"
37
- end
38
-
39
56
  YARD::Rake::YardocTask.new(:yard) do |yard|
40
- yard.files = ["lib/**/*.rb", "-", "README.md", "CHANGELOG.md", "LICENSE.txt"]
57
+ yard.files = DOC_FILES
41
58
  yard.options = [
42
59
  "--output-dir", "doc",
43
60
  "--readme", "README.md",
44
- "--title", "RTL-SDR Ruby Gem Documentation",
61
+ "--title", DOC_TITLE,
45
62
  "--markup", "markdown",
46
63
  "--markup-provider", "redcarpet",
47
64
  "--protected",
@@ -50,251 +67,84 @@ YARD::Rake::YardocTask.new(:yard) do |yard|
50
67
  ]
51
68
  end
52
69
 
53
- # YARD server for live documentation browsing
54
- desc "Start YARD documentation server"
55
- task :yard_server do
56
- system("yard server --reload")
57
- end
70
+ desc "Generate documentation"
71
+ task :docs do
72
+ puts "Generating documentation..."
58
73
 
59
- # YARD statistics
60
- desc "Show YARD documentation statistics"
61
- task :yard_stats do
62
- system("yard stats")
63
- end
64
-
65
- # Generate YARD documentation with coverage report
66
- desc "Generate YARD docs with coverage report"
67
- task :yard_coverage do
68
- puts "Generating YARD documentation with coverage report..."
74
+ system("rdoc --verbose lib/")
69
75
  system("yard doc")
70
-
71
- # Parse YARD output for coverage
72
- if system("yard stats > /tmp/yard_stats.txt 2>&1")
73
- stats = File.read("/tmp/yard_stats.txt")
74
- if stats =~ /(\d+\.\d+)% documented/
75
- coverage = Regexp.last_match(1).to_f
76
- puts "\nYARD Documentation coverage: #{coverage}%"
77
-
78
- if coverage < 90.0
79
- puts "WARNING: YARD documentation coverage is below 90%"
80
- exit 1 if ENV["REQUIRE_DOC_COVERAGE"]
81
- else
82
- puts "✓ YARD documentation coverage is good!"
83
- end
84
- end
85
- end
86
76
  end
87
77
 
88
- # Comprehensive documentation check
89
- desc "Check documentation coverage and quality"
90
- task :doc_check do
91
- puts "Running RDoc to check documentation coverage..."
92
- system("rdoc --verbose lib/ > /tmp/rdoc_output.txt 2>&1")
93
-
94
- # Parse output for coverage info
95
- if File.exist?("/tmp/rdoc_output.txt")
96
- output = File.read("/tmp/rdoc_output.txt")
97
- if output =~ /(\d+\.\d+)% documented/
98
- coverage = Regexp.last_match(1).to_f
99
- puts "Documentation coverage: #{coverage}%"
100
-
101
- if coverage < 90.0
102
- puts "WARNING: Documentation coverage is below 90%"
103
- exit 1 if ENV["REQUIRE_DOC_COVERAGE"]
104
- else
105
- puts "✓ Documentation coverage is good!"
106
- end
107
- end
108
-
109
- # Check for undocumented items
110
- if output.include?("undocumented")
111
- puts "\nUndocumented items found:"
112
- output.scan(/(\S+) \(undocumented\)/).each { |match| puts " - #{match[0]}" }
113
- end
114
- end
78
+ desc "Clean generated documentation"
79
+ task :clean_docs do
80
+ rm_rf ["doc", ".yardoc"]
115
81
  end
116
82
 
117
- # Documentation tasks
118
- desc "Generate all documentation (RDoc and YARD)"
119
- task docs: %i[rdoc yard]
120
-
121
- desc "Check all documentation coverage"
122
- task doc_coverage: %i[doc_check yard_coverage]
123
-
124
- desc "Clean all generated documentation"
125
- task clean_docs: [:clean_doc] do
126
- rm_rf "doc"
127
- rm_rf ".yardoc"
128
- end
129
-
130
- desc "Serve documentation locally"
131
- task :serve_docs do
132
- puts "Choose documentation format:"
133
- puts "1. RDoc (file://#{Dir.pwd}/doc/index.html)"
134
- puts "2. YARD server (http://localhost:8808)"
135
- print "Enter choice (1-2): "
136
-
137
- choice = $stdin.gets.chomp
138
- case choice
139
- when "1"
140
- Rake::Task[:rdoc].invoke unless File.exist?("doc/index.html")
141
- system("open doc/index.html") if RUBY_PLATFORM =~ /darwin/
142
- puts "RDoc documentation: file://#{Dir.pwd}/doc/index.html"
143
- when "2"
144
- Rake::Task[:yard_server].invoke
145
- else
146
- puts "Invalid choice"
83
+ namespace :version do
84
+ desc "Show current version"
85
+ task :show do
86
+ puts "Current version: #{current_version}"
147
87
  end
148
- end
149
88
 
150
- task default: %i[spec rubocop doc_check]
151
-
152
- # Task to help users install librtlsdr
153
- desc "Check for librtlsdr or provide installation instructions"
154
- task :check_librtlsdr do
155
- puts "Checking for librtlsdr installation..."
156
-
157
- # Try to load the library to check if it's available
158
- begin
159
- require_relative "lib/rtlsdr/ffi"
160
- puts "✓ librtlsdr found and loadable"
161
- rescue LoadError => e
162
- puts "✗ librtlsdr not found"
163
- puts
164
- puts "To install librtlsdr:"
165
- puts " Ubuntu/Debian: sudo apt-get install librtlsdr-dev"
166
- puts " macOS: brew install librtlsdr"
167
- puts " Windows: See https://github.com/steve-m/librtlsdr for build instructions"
168
- puts
169
- puts "Or build from source:"
170
- puts " git clone https://github.com/steve-m/librtlsdr.git"
171
- puts " cd librtlsdr && mkdir build && cd build"
172
- puts " cmake .. && make && sudo make install"
173
- puts
174
- puts "Error details: #{e.message}"
175
- exit 1
89
+ %i[patch minor major].each do |type|
90
+ desc "Bump #{type} version"
91
+ task type do
92
+ bump_version(type)
93
+ end
176
94
  end
177
95
  end
178
96
 
179
- desc "Bump version, update CHANGELOG, commit, tag, and push"
180
- task :publish_release do
97
+ desc "Bump patch version (shortcut)"
98
+ task bump: "version:patch"
99
+
100
+ desc "Release: bump version, update changelog, commit, tag, and push"
101
+ task :release do
181
102
  puts "Make sure you have committed all your changes before running this task."
182
- puts "Do you want to continue? (yes/no)"
103
+ print "Do you want to continue? (yes/no): "
183
104
 
184
- answer = $stdin.gets.chomp.downcase
185
- if answer == "yes"
105
+ if $stdin.gets.chomp.downcase == "yes"
106
+ old_version = current_version
186
107
  Rake::Task["version:patch"].invoke
187
108
 
188
- # Read the updated version from file since RTLSDR::VERSION is cached
189
109
  version_content = File.read("lib/rtlsdr/version.rb")
190
110
  new_version = version_content.match(/VERSION = "([^"]+)"/)[1]
191
111
 
192
112
  puts "Hit enter when you've updated the CHANGELOG"
193
- $stdin.gets.chomp.downcase
113
+ $stdin.gets
194
114
 
195
- puts "Committing changes..."
196
- system("git add -A")
197
- system("git commit -m 'Bump version to #{new_version}'")
198
- puts "Creating git tag..."
115
+ system("git add -A && git commit -m 'Bump version to #{new_version}'")
199
116
  system("git tag v#{new_version}")
200
- puts "Pushing changes and tags to remote repository..."
201
117
  system("git push && git push --tags")
202
- puts "Release process completed successfully!"
203
118
 
119
+ puts "Release process completed successfully!"
204
120
  Rake::Task["release"].invoke
205
121
  else
206
122
  puts "Release process aborted."
207
123
  end
208
124
  end
209
125
 
210
- # Version management tasks
211
- namespace :version do
212
- desc "Bump patch version (x.y.z -> x.y.z+1)"
213
- task :patch do
214
- bump_version(:patch)
215
- end
216
-
217
- desc "Bump minor version (x.y.z -> x.y+1.0)"
218
- task :minor do
219
- bump_version(:minor)
220
- end
221
-
222
- desc "Bump major version (x.y.z -> x+1.0.0)"
223
- task :major do
224
- bump_version(:major)
225
- end
226
-
227
- desc "Show current version"
228
- task :show do
229
- require_relative "lib/rtlsdr/version"
230
- puts "Current version: #{RTLSDR::VERSION}"
231
- end
232
- end
233
-
234
- desc "Bump patch version (shortcut for version:patch)"
235
- task :bump do
236
- Rake::Task["version:patch"].invoke
237
- end
238
-
239
- def bump_version(type) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
126
+ def bump_version(type)
240
127
  version_file = "lib/rtlsdr/version.rb"
241
128
  content = File.read(version_file)
129
+ current_ver = content.match(/VERSION = "([^"]+)"/)[1]
242
130
 
243
- # Extract current version
244
- current_version = content.match(/VERSION = "([^"]+)"/)[1]
245
- major, minor, patch = current_version.split(".").map(&:to_i)
131
+ major, minor, patch = current_ver.split(".").map(&:to_i)
246
132
 
247
- # Calculate new version based on type
248
133
  case type
249
- when :patch
250
- patch += 1
251
- when :minor
252
- minor += 1
253
- patch = 0
254
- when :major
255
- major += 1
256
- minor = 0
257
- patch = 0
134
+ when :patch then patch += 1
135
+ when :minor then minor += 1; patch = 0
136
+ when :major then major += 1; minor = 0; patch = 0
258
137
  end
259
138
 
260
139
  new_version = "#{major}.#{minor}.#{patch}"
261
140
 
262
- # Update version file
263
- new_content = content.gsub(/VERSION = "#{Regexp.escape(current_version)}"/, %(VERSION = "#{new_version}"))
264
- File.write(version_file, new_content)
265
-
266
- # Update Gemfile.lock if it exists
267
- if File.exist?("Gemfile.lock")
268
- gemfile_lock = File.read("Gemfile.lock")
269
- updated_gemfile_lock = gemfile_lock.gsub(/rtlsdr \(#{Regexp.escape(current_version)}\)/, "rtlsdr (#{new_version})")
270
- File.write("Gemfile.lock", updated_gemfile_lock)
271
- puts "Updated Gemfile.lock"
141
+ [version_file, "Gemfile.lock", "CHANGELOG.md"].each do |file|
142
+ update_file_version(file, current_ver, new_version)
272
143
  end
273
144
 
274
- puts "Version bumped from #{current_version} to #{new_version}"
275
-
276
- # Update CHANGELOG if it exists
277
- return unless File.exist?("CHANGELOG.md")
278
-
279
- changelog = File.read("CHANGELOG.md")
280
- date = Time.now.strftime("%Y-%m-%d")
281
-
282
- # Add new version entry at the top after the header
283
- new_entry = "\n## [#{new_version}] - #{date}\n\n### Added\n\n### Changed\n\n### Fixed\n\n"
284
-
285
- updated_changelog = if changelog.include?("## [Unreleased]")
286
- # Insert after Unreleased section
287
- changelog.sub(/(## \[Unreleased\].*?\n)/, "\\1#{new_entry}")
288
- elsif changelog.include?("# Changelog")
289
- # Insert after main header
290
- changelog.sub(/(# Changelog\s*\n)/, "\\1#{new_entry}")
291
- else
292
- # Prepend to file if no standard structure
293
- "# Changelog#{new_entry}#{changelog}"
294
- end
295
-
296
- File.write("CHANGELOG.md", updated_changelog)
297
- puts "Updated CHANGELOG.md with new version entry"
145
+ puts "Version bumped from #{current_ver} to #{new_version}"
146
+ puts "Updated Gemfile.lock" if File.exist?("Gemfile.lock")
147
+ puts "Updated CHANGELOG.md with new version entry" if File.exist?("CHANGELOG.md")
298
148
  end
299
149
 
300
- # rubocop:enable Metrics/BlockLength
150
+ task default: %i[spec rubocop docs]
@@ -12,5 +12,5 @@ module RTLSDR
12
12
  #
13
13
  # @return [String] Current gem version
14
14
  # @since 0.1.0
15
- VERSION = "0.1.9"
15
+ VERSION = "0.1.10"
16
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtlsdr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - joshfng
@@ -13,16 +13,16 @@ dependencies:
13
13
  name: ffi
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '1.17'
18
+ version: '0'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - "~>"
23
+ - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '1.17'
25
+ version: '0'
26
26
  description: Ruby bindings for librtlsdr - turn RTL2832 based DVB dongles into SDR
27
27
  receivers
28
28
  email: