rtlsdr 0.1.0 → 0.1.2

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: a684113fd7fab1a02eedacad523203bc20c1e88a3f4d4c8ef7ebddcf5e86b92b
4
- data.tar.gz: 23950e66b5bf1b36133479ef9adf62bfee9b27de76a11969063926af7dd485bc
3
+ metadata.gz: 710f4bd64dcbffaf300a9c0f224a8f9901a4add441a30ee20cb47618481888b6
4
+ data.tar.gz: 928c43327f57fe1c83322eaac961d81c665dbd29611266147d571f4463c29437
5
5
  SHA512:
6
- metadata.gz: 10696f54f07b1d4ecb534ce286245e111e9c8068d68ff08772e8587238fc6fafbbf95ab55de5c891d5c0470034b377b44b67c09eaf3f27cec1cdf69a677bffcb
7
- data.tar.gz: fe96888f3c93aa4947c7275cc74caf7585b222a973fd4cca06be7758516c66d8bfa71af5b442f5213b5521a1d44810f47d6e0faf22d85cfdad320333d6a9e07a
6
+ metadata.gz: 72d6c0589a2c47af7b80b385f8678f0c76dd2bf728878199a536f11d0b29f30dba75779491f3ed6d2f7b6f818c593ff330f7a52e6376945fcf9c59db5431ac3d
7
+ data.tar.gz: e80374925e3c131a5d1fc06a3e06b6e8f17dfa46a3aa04a368289c9998d86dd1d17dbe330172571472b1a2aa35eeadec0cc2ff903517ca621429357eb27d75aa
data/.yardconfig ADDED
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ # rubocop:disable Lint/UselessAssignment
4
+
5
+ # YARD Configuration file
6
+ # This file contains advanced configuration for YARD documentation generation
7
+
8
+ # Custom tags for RTL-SDR specific documentation
9
+ define_tag :frequency, :text, "Frequency Range"
10
+ define_tag :sample_rate, :text, "Sample Rate"
11
+ define_tag :gain, :text, "Gain Range"
12
+ define_tag :tuner, :text, "Tuner Support"
13
+ define_tag :thread_safety, :text, "Thread Safety"
14
+
15
+ # Plugin settings
16
+ plugins = []
17
+
18
+ # Custom CSS and templates
19
+ template_paths = ["templates"]
20
+
21
+ # Markup settings
22
+ markup = "markdown"
23
+ markup_provider = "redcarpet"
24
+
25
+ # Output settings
26
+ output_dir = "doc"
27
+ list_undoc = true
28
+ protected = true
29
+ private = false
30
+
31
+ # Source exclusions
32
+ exclude = [
33
+ "spec/**/*",
34
+ "examples/**/*",
35
+ "bin/**/*",
36
+ "exe/**/*",
37
+ "vendor/**/*",
38
+ "tmp/**/*",
39
+ ".git/**/*"
40
+ ]
41
+
42
+ # rubocop:enable Lint/UselessAssignment
data/.yardopts ADDED
@@ -0,0 +1,17 @@
1
+ --markup markdown
2
+ --markup-provider redcarpet
3
+ --title "RTL-SDR Ruby Gem Documentation"
4
+ --readme README.md
5
+ --files CHANGELOG.md,LICENSE.txt
6
+ --output-dir doc
7
+ --protected
8
+ --no-private
9
+ --embed-mixins
10
+ --verbose
11
+ --exclude spec/
12
+ --exclude examples/
13
+ --exclude bin/
14
+ --exclude exe/
15
+ --exclude vendor/
16
+ --exclude tmp/
17
+ --exclude .git/
data/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.1.2] - 2025-06-07
6
+
7
+ ### Added
8
+
9
+ ### Changed
10
+
11
+ ### Fixed
12
+
13
+
14
+ ## [0.1.1] - 2025-06-07
15
+
16
+ ### Added
17
+
18
+ Docs
19
+
20
+ ### Changed
21
+
22
+ NA
23
+
24
+ ### Fixed
25
+
26
+ NA
27
+
5
28
  ## [0.1.0] - 2025-06-07
6
29
 
7
30
  - Initial release
data/Rakefile CHANGED
@@ -4,6 +4,8 @@ require "bundler/gem_tasks"
4
4
  require "rspec/core/rake_task"
5
5
  require "rake/extensiontask"
6
6
  require "rubocop/rake_task"
7
+ require "rdoc/task"
8
+ require "yard"
7
9
 
8
10
  RSpec::Core::RakeTask.new(:spec)
9
11
 
@@ -13,7 +15,142 @@ Rake::ExtensionTask.new("rtlsdr") do |ext|
13
15
  ext.lib_dir = "lib/rtlsdr"
14
16
  end
15
17
 
16
- task default: %i[spec rubocop]
18
+ # RDoc documentation generation
19
+ RDoc::Task.new(:rdoc) do |rdoc|
20
+ rdoc.rdoc_dir = "doc"
21
+ rdoc.title = "RTL-SDR Ruby Gem Documentation"
22
+ rdoc.main = "README.md"
23
+ rdoc.rdoc_files.include("README.md", "CHANGELOG.md", "LICENSE.txt", "lib/**/*.rb")
24
+
25
+ # RDoc options for better output
26
+ rdoc.options << "--line-numbers"
27
+ rdoc.options << "--all"
28
+ rdoc.options << "--charset=UTF-8"
29
+ rdoc.options << "--exclude=spec/"
30
+ rdoc.options << "--exclude=examples/"
31
+ rdoc.options << "--exclude=bin/"
32
+ rdoc.options << "--exclude=exe/"
33
+ rdoc.options << "--template=hanna" if system("gem list hanna -i > /dev/null 2>&1")
34
+ end
35
+
36
+ # Clean documentation
37
+ desc "Remove generated documentation"
38
+ task :clean_doc do
39
+ rm_rf "doc"
40
+ end
41
+
42
+ YARD::Rake::YardocTask.new(:yard) do |yard|
43
+ yard.files = ["lib/**/*.rb", "-", "README.md", "CHANGELOG.md", "LICENSE.txt"]
44
+ yard.options = [
45
+ "--output-dir", "doc",
46
+ "--readme", "README.md",
47
+ "--title", "RTL-SDR Ruby Gem Documentation",
48
+ "--markup", "markdown",
49
+ "--markup-provider", "redcarpet",
50
+ "--protected",
51
+ "--no-private",
52
+ "--embed-mixins"
53
+ ]
54
+ end
55
+
56
+ # YARD server for live documentation browsing
57
+ desc "Start YARD documentation server"
58
+ task :yard_server do
59
+ system("yard server --reload")
60
+ end
61
+
62
+ # YARD statistics
63
+ desc "Show YARD documentation statistics"
64
+ task :yard_stats do
65
+ system("yard stats")
66
+ end
67
+
68
+ # Generate YARD documentation with coverage report
69
+ desc "Generate YARD docs with coverage report"
70
+ task :yard_coverage do
71
+ puts "Generating YARD documentation with coverage report..."
72
+ system("yard doc")
73
+
74
+ # Parse YARD output for coverage
75
+ if system("yard stats > /tmp/yard_stats.txt 2>&1")
76
+ stats = File.read("/tmp/yard_stats.txt")
77
+ if stats =~ /(\d+\.\d+)% documented/
78
+ coverage = Regexp.last_match(1).to_f
79
+ puts "\nYARD Documentation coverage: #{coverage}%"
80
+
81
+ if coverage < 90.0
82
+ puts "WARNING: YARD documentation coverage is below 90%"
83
+ exit 1 if ENV["REQUIRE_DOC_COVERAGE"]
84
+ else
85
+ puts "✓ YARD documentation coverage is good!"
86
+ end
87
+ end
88
+ end
89
+ end
90
+
91
+ # Comprehensive documentation check
92
+ desc "Check documentation coverage and quality"
93
+ task :doc_check do
94
+ puts "Running RDoc to check documentation coverage..."
95
+ system("rdoc --verbose lib/ > /tmp/rdoc_output.txt 2>&1")
96
+
97
+ # Parse output for coverage info
98
+ if File.exist?("/tmp/rdoc_output.txt")
99
+ output = File.read("/tmp/rdoc_output.txt")
100
+ if output =~ /(\d+\.\d+)% documented/
101
+ coverage = Regexp.last_match(1).to_f
102
+ puts "Documentation coverage: #{coverage}%"
103
+
104
+ if coverage < 90.0
105
+ puts "WARNING: Documentation coverage is below 90%"
106
+ exit 1 if ENV["REQUIRE_DOC_COVERAGE"]
107
+ else
108
+ puts "✓ Documentation coverage is good!"
109
+ end
110
+ end
111
+
112
+ # Check for undocumented items
113
+ if output.include?("undocumented")
114
+ puts "\nUndocumented items found:"
115
+ output.scan(/(\S+) \(undocumented\)/).each { |match| puts " - #{match[0]}" }
116
+ end
117
+ end
118
+ end
119
+
120
+ # Documentation tasks
121
+ desc "Generate all documentation (RDoc and YARD)"
122
+ task docs: %i[rdoc yard]
123
+
124
+ desc "Check all documentation coverage"
125
+ task doc_coverage: %i[doc_check yard_coverage]
126
+
127
+ desc "Clean all generated documentation"
128
+ task clean_docs: [:clean_doc] do
129
+ rm_rf "doc"
130
+ rm_rf ".yardoc"
131
+ end
132
+
133
+ desc "Serve documentation locally"
134
+ task :serve_docs do
135
+ puts "Choose documentation format:"
136
+ puts "1. RDoc (file://#{Dir.pwd}/doc/index.html)"
137
+ puts "2. YARD server (http://localhost:8808)"
138
+ print "Enter choice (1-2): "
139
+
140
+ choice = $stdin.gets.chomp
141
+ case choice
142
+ when "1"
143
+ Rake::Task[:rdoc].invoke unless File.exist?("doc/index.html")
144
+ system("open doc/index.html") if RUBY_PLATFORM =~ /darwin/
145
+ puts "RDoc documentation: file://#{Dir.pwd}/doc/index.html"
146
+ when "2"
147
+ Rake::Task[:yard_server].invoke
148
+ else
149
+ puts "Invalid choice"
150
+ end
151
+ end
152
+
153
+ task default: %i[spec rubocop doc_check]
17
154
 
18
155
  # Custom task to build librtlsdr if needed
19
156
  desc "Build librtlsdr from source (clones, configures, and compiles)"
@@ -31,3 +168,115 @@ end
31
168
 
32
169
  desc "Compile native extensions (depends on librtlsdr)"
33
170
  task compile: :build_librtlsdr
171
+
172
+ task :publish_release do
173
+ desc "Bump version, update CHANGELOG, commit, tag, and push"
174
+ puts "This task will bump the version, update CHANGELOG.md, commit the changes, create a git tag, and push everything to the remote repository."
175
+ puts "Make sure you have committed all your changes before running this task."
176
+ puts "Do you want to continue? (yes/no)"
177
+ answer = $stdin.gets.chomp.downcase
178
+ if answer == "yes"
179
+ Rake::Task["version:patch"].invoke
180
+ system("bundle install")
181
+ puts "Committing changes..."
182
+ system("git add -A")
183
+ system("git commit -m 'Bump version to #{RTLSDR::VERSION}'")
184
+ puts "Creating git tag..."
185
+ system("git tag v#{RTLSDR::VERSION}")
186
+ puts "Pushing changes and tags to remote repository..."
187
+ system("git push && git push --tags")
188
+ puts "Release process completed successfully!"
189
+
190
+ Rake::Task["release"].invoke
191
+ else
192
+ puts "Release process aborted."
193
+ end
194
+ end
195
+
196
+ # Version management tasks
197
+ namespace :version do
198
+ desc "Bump patch version (x.y.z -> x.y.z+1)"
199
+ task :patch do
200
+ bump_version(:patch)
201
+ end
202
+
203
+ desc "Bump minor version (x.y.z -> x.y+1.0)"
204
+ task :minor do
205
+ bump_version(:minor)
206
+ end
207
+
208
+ desc "Bump major version (x.y.z -> x+1.0.0)"
209
+ task :major do
210
+ bump_version(:major)
211
+ end
212
+
213
+ desc "Show current version"
214
+ task :show do
215
+ require_relative "lib/rtlsdr/version"
216
+ puts "Current version: #{RTLSDR::VERSION}"
217
+ end
218
+ end
219
+
220
+ desc "Bump patch version (shortcut for version:patch)"
221
+ task :bump do
222
+ Rake::Task["version:patch"].invoke
223
+ end
224
+
225
+ def bump_version(type) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
226
+ version_file = "lib/rtlsdr/version.rb"
227
+ content = File.read(version_file)
228
+
229
+ # Extract current version
230
+ current_version = content.match(/VERSION = "([^"]+)"/)[1]
231
+ major, minor, patch = current_version.split(".").map(&:to_i)
232
+
233
+ # Calculate new version based on type
234
+ case type
235
+ when :patch
236
+ patch += 1
237
+ when :minor
238
+ minor += 1
239
+ patch = 0
240
+ when :major
241
+ major += 1
242
+ minor = 0
243
+ patch = 0
244
+ end
245
+
246
+ new_version = "#{major}.#{minor}.#{patch}"
247
+
248
+ # Update version file
249
+ new_content = content.gsub(/VERSION = "#{Regexp.escape(current_version)}"/, %(VERSION = "#{new_version}"))
250
+ File.write(version_file, new_content)
251
+
252
+ puts "Version bumped from #{current_version} to #{new_version}"
253
+
254
+ # Update CHANGELOG if it exists
255
+ if File.exist?("CHANGELOG.md")
256
+ changelog = File.read("CHANGELOG.md")
257
+ date = Time.now.strftime("%Y-%m-%d")
258
+
259
+ # Add new version entry at the top after the header
260
+ new_entry = "\n## [#{new_version}] - #{date}\n\n### Added\n\n### Changed\n\n### Fixed\n\n"
261
+
262
+ updated_changelog = if changelog.include?("## [Unreleased]")
263
+ # Insert after Unreleased section
264
+ changelog.sub(/(## \[Unreleased\].*?\n)/, "\\1#{new_entry}")
265
+ elsif changelog.include?("# Changelog")
266
+ # Insert after main header
267
+ changelog.sub(/(# Changelog\s*\n)/, "\\1#{new_entry}")
268
+ else
269
+ # Prepend to file if no standard structure
270
+ "# Changelog#{new_entry}#{changelog}"
271
+ end
272
+
273
+ File.write("CHANGELOG.md", updated_changelog)
274
+ puts "Updated CHANGELOG.md with new version entry"
275
+ end
276
+
277
+ puts "Don't forget to:"
278
+ puts "1. Update CHANGELOG.md with your changes"
279
+ puts "2. Commit your changes: git add -A && git commit -m 'Bump version to #{new_version}'"
280
+ puts "3. Create a git tag: git tag v#{new_version}"
281
+ puts "4. Push changes: git push && git push --tags"
282
+ end
data/doc_config.rb ADDED
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Documentation configuration for RTL-SDR Ruby gem
4
+ # This file contains documentation configuration notes
5
+
6
+ # RDoc Configuration
7
+ # The RDoc configuration is handled in the Rakefile RDoc::Task.
8
+ # Key settings:
9
+ # - Title: "RTL-SDR Ruby Gem Documentation"
10
+ # - Main page: README.md
11
+ # - Output directory: doc/
12
+ # - Includes: README.md, CHANGELOG.md, LICENSE.txt, lib/**/*.rb
13
+ # - Excludes: spec/, examples/, bin/, exe/
14
+
15
+ # YARD Configuration
16
+ # YARD configuration is handled via:
17
+ # - .yardopts file for command line options
18
+ # - .yardconfig file for advanced settings
19
+ # - Rakefile YARD::Rake::YardocTask for task configuration
20
+
21
+ # Documentation Standards
22
+ # - 100% documentation coverage required
23
+ # - All public methods must have @param and @return tags
24
+ # - Examples should be provided using @example
25
+ # - Version tracking with @since tags