lib/docurium.rb in docurium-0.0.3 vs lib/docurium.rb in docurium-0.0.4
- old
+ new
@@ -4,18 +4,19 @@
require 'rocco'
require 'docurium/layout'
require 'pp'
class Docurium
- Version = VERSION = '0.0.3'
+ Version = VERSION = '0.0.4'
attr_accessor :branch, :output_dir, :data
def initialize(config_file)
raise "You need to specify a config file" if !config_file
raise "You need to specify a valid config file" if !valid_config(config_file)
@sigs = {}
+ @groups = {}
clear_data
end
def clear_data(version = 'HEAD')
@data = {:files => [], :functions => {}, :globals => {}, :types => {}, :prefix => ''}
@@ -61,11 +62,11 @@
out " - processing examples for #{version}"
`git read-tree #{version}:#{ex}`
`git checkout-index -a`
files = []
- Dir.glob("**/*") do |file|
+ Dir.glob("**/*.c") do |file|
next if !File.file?(file)
files << file
end
files.each do |file|
out " # #{file}"
@@ -120,11 +121,12 @@
Dir.chdir(outdir) do
project = {
:versions => versions.reverse,
:github => @options['github'],
:name => @options['name'],
- :signatures => @sigs
+ :signatures => @sigs,
+ :groups => @groups
}
File.open("project.json", 'w+') do |f|
f.write(project.to_json)
end
end
@@ -258,9 +260,10 @@
next if group.empty?
if !rest
group = value[:file].gsub('.h', '').gsub('/', '_')
end
@data[:functions][key][:group] = group
+ @groups[key] = group
func[group] ||= []
func[group] << key
func[group].sort!
end
misc = []