Permalink
Browse files

Use Bundler to build this gem.

  • Loading branch information...
1 parent b9ef0ef commit a1132c1351feee820bd5d70859f1e42d4e3dd119 @twada committed Jan 20, 2012
Showing with 360 additions and 313 deletions.
  1. +5 −5 .gitignore
  2. +4 −0 Gemfile
  3. +26 −30 Rakefile
  4. +1 −4 lib/twowaysql.rb
  5. +295 −274 lib/twowaysql/parser.rb
  6. +3 −0 lib/twowaysql/version.rb
  7. +26 −0 twowaysql.gemspec
View
@@ -1,7 +1,7 @@
+*.gem
+.ditz-config
+.bundle
+Gemfile.lock
+lib/twowaysql/parser.output
pkg/*
-doc/*
coverage/*
-website/issues/*
-website/coverage/*
-lib/twowaysql/parser.output
-.ditz-config
View
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in twowaysql.gemspec
+gemspec
View
@@ -1,35 +1,31 @@
-%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
-require File.dirname(__FILE__) + '/lib/twowaysql'
+require "bundler/gem_tasks"
-# Generate all the Rake tasks
-# Run 'rake -T' to see list of generated tasks (from gem root directory)
-$hoe = Hoe.new('twowaysql', TwoWaySQL::VERSION) do |p|
- p.developer('Takuto Wada', 'takuto.wada@gmail.com')
+namespace :racc do
+ @grammar = "lib/twowaysql/parser"
+ @generate_parser = "racc -o #{@grammar}.rb #{@grammar}.y"
+ @debug_parser = "racc -v -o #{@grammar}.rb -g #{@grammar}.y"
+ @revert_generated = "git checkout #{@grammar}.rb"
+
+ desc 'Regenerate parser'
+ task :gen do
+ `#{@generate_parser}`
+ end
- ## added manually
- desc = "Template Engine for SQL"
- p.description = desc
- p.summary = desc
- p.url = "http://twowaysql.rubyforge.org"
+ desc 'Debug parser'
+ task :debug do
+ `#{@debug_parser}`
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
- p.rubyforge_name = p.name # TODO this is default value
- # p.extra_deps = [
- # ['activesupport','>= 2.0.2'],
- # ]
- p.extra_dev_deps = [
- ['newgem', ">= #{::Newgem::VERSION}"]
- ]
-
- p.clean_globs |= %w[**/.DS_Store tmp *.log]
- path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
- p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
- p.rsync_args = '-av --delete --ignore-errors'
-end
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
+ require 'twowaysql'
+ template = TwoWaySQL::Template.parse($stdin, :debug => true)
+ template.merge({})
-require 'newgem/tasks' # load /tasks/*.rake
-Dir['tasks/**/*.rake'].each { |t| load t }
+ `#{@revert_generated}`
+ end
-# TODO - want other tests/tasks run by default? Add them to the list
-remove_task :default
-task :default => [:spec, :features]
+ desc 'Update tab file'
+ task :tab do
+ `#{@debug_parser}`
+ `#{@revert_generated}`
+ end
+end
View
@@ -1,10 +1,7 @@
-$:.unshift(File.dirname(__FILE__)) unless
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
-
+require "twowaysql/version"
require 'twowaysql/node'
require 'twowaysql/parser'
require 'twowaysql/template'
module TwoWaySQL
- VERSION = '0.4.1'
end
Oops, something went wrong.

0 comments on commit a1132c1

Please sign in to comment.