Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Organize codegen-related bits under codegen/*

  • Loading branch information...
commit 1fe16895aee94db1535a196d19c4dc552105fb13 1 parent 9379879
Michael Klishin michaelklishin authored
4 .gitmodules
View
@@ -1,3 +1,3 @@
-[submodule "vendor/rabbitmq-codegen"]
- path = vendor/rabbitmq-codegen
+[submodule "codegen/rabbitmq-codegen"]
+ path = codegen/rabbitmq-codegen
url = git://github.com/rabbitmq/rabbitmq-codegen.git
0  __init__.py → codegen/__init__.py
View
File renamed without changes
0  amqp_0.9.1_changes.json → codegen/amqp_0.9.1_changes.json
View
File renamed without changes
4 codegen.py → codegen/codegen.py
View
@@ -6,7 +6,7 @@
import os, sys, re
-sys.path.append(os.path.join("vendor", "rabbitmq-codegen"))
+sys.path.append(os.path.join("codegen", "rabbitmq-codegen"))
from amqp_codegen import *
try:
@@ -61,7 +61,7 @@ def new_init(self, arg):
# method.accepted_by("server")
# method.accepted_by("client", "server")
-accepted_by_update = json.loads(file("amqp_0.9.1_changes.json").read())
+accepted_by_update = json.loads(file("codegen/amqp_0.9.1_changes.json").read())
def accepted_by(self, *receivers):
def get_accepted_by(self):
0  codegen_helpers.py → codegen/codegen_helpers.py
View
File renamed without changes
1  codegen/rabbitmq-codegen
@@ -0,0 +1 @@
+Subproject commit 75979144742917478d0b944d2b3092370f8d33fd
6 generate.rb
View
@@ -5,14 +5,14 @@ def sh(*args)
system(*args)
end
-spec = "vendor/rabbitmq-codegen/amqp-rabbitmq-0.9.1.json"
+spec = "codegen/rabbitmq-codegen/amqp-rabbitmq-0.9.1.json"
unless File.exist?(spec)
sh "git submodule update --init"
end
path = "lib/amq/protocol/client.rb"
-sh "./codegen.py client #{spec} #{path}"
+puts "Running ./codegen/codegen.py client #{spec} #{path}"
+sh "./codegen/codegen.py client #{spec} #{path}"
if File.file?(path)
- sh "./post-processing.rb #{path}"
sh "ruby -c #{path}"
end
25 post-processing.rb
View
@@ -1,25 +0,0 @@
-#!/usr/bin/env ruby
-# encoding: utf-8
-
-# helpers
-def pass; end
-
-# main
-buffer = ARGF.inject(String.new) do |buffer, line|
- # line filters
- line.gsub!(/\s*\n$/, "\n")
- line.gsub!("'", '"')
- line.gsub!('u"', '"') if line =~ /^\s*# \[/
-
- buffer += line
-end
-
-# buffer filters
-buffer.gsub!(/\n{2,}/m, "\n\n")
-pass while buffer.gsub!(/(\n( *) end)\n{2,}(\2end)/m, "\\1\n\\3")
-
-# Make sure there's only one \n at the end
-pass while buffer.chomp!
-buffer += "\n"
-
-puts buffer
Please sign in to comment.
Something went wrong with that request. Please try again.