conyard 0.1.1 → 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.
data/README.md CHANGED
@@ -2,4 +2,10 @@
2
2
 
3
3
  Previously I have used absolutely evil C Preprocessor macros to generate code; this is a new experiment in using Ruby to generate such code. The idea is that this project can generate mostly-filled out code for you to use, but providing more customisability than something the preprocessor dragged in.
4
4
 
5
- See the [wiki](https://github.com/NSError/Conyard/wiki) for a bit more information about this project and capabilities.
5
+ See the [wiki](https://github.com/NSError/Conyard/wiki) for a bit more information about this project and capabilities.
6
+
7
+ It's a gem now! Installation is as easy as:
8
+
9
+ [sudo] gem install conyard
10
+
11
+ Patches and suggestions welcome!
data/Rakefile CHANGED
@@ -4,6 +4,7 @@
4
4
  require 'rubygems' if RUBY_VERSION < '1.9'
5
5
  require 'rake'
6
6
  require 'erb'
7
+ require 'yaml'
7
8
 
8
9
  $CC = 'clang'
9
10
  $CXX = 'clang++'
@@ -13,6 +14,13 @@ CLEAN = FileList['.o']
13
14
  Dir.glob('**/*.rake').each { |r| import r }
14
15
 
15
16
  desc 'Runs a task using a file for arguments'
16
- task :generate, :argfile do
17
- # Some idea I had of doing stuff from config files
17
+ task :run, :argfile do |t, args|
18
+ argfile=args.argfile
19
+ raise 'Dude, no argument? You jerk!' unless argfile
20
+ config=File.read(File.expand_path(argfile))
21
+ lines = Array.new
22
+ config.each_line { |line| lines << line.strip }
23
+ tn = lines[0]
24
+ lines = lines[1 .. -1]
25
+ Rake::Task[tn].invoke *lines
18
26
  end
@@ -1,6 +1,6 @@
1
1
  namespace :test do
2
2
  task :vector do
3
- emit_vector 'int_vector', 'int', 'tests/vector/int_vector'
3
+ Rake::Task['run'].invoke 'tests/vector/vector_test.genconfig'
4
4
  src = [ 'tests/vector/int_vector.gen.c', 'tests/vector/vector_test.c' ]
5
5
  src.each do |src_file|
6
6
  sh "#{$CC} -x c -arch x86_64 -std=gnu99 -fblocks -c #{File.expand_path src_file} -o #{File.expand_path 'tests/vector/'+src_file.pathmap('%n')}.o"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Christopher Miller