From 048830a4b4a0b7f14d86b22975e5475f9ea3b01c Mon Sep 17 00:00:00 2001 From: chanshunli Date: Fri, 15 May 2015 11:29:06 +0800 Subject: [PATCH 1/3] use 2.0.0, bundle ok --- .rvmrc | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .rvmrc diff --git a/.rvmrc b/.rvmrc new file mode 100644 index 0000000..82c40cb --- /dev/null +++ b/.rvmrc @@ -0,0 +1,2 @@ +rvm use 2.0.0@description --create +rvm_trust_rvmrcs_flag=1 From dfa0e1339ccb5b368392f596514fe80f9f862819 Mon Sep 17 00:00:00 2001 From: chanshunli Date: Fri, 15 May 2015 12:50:41 +0800 Subject: [PATCH 2/3] fix line.split(comment:) , and use ruby 2.0.0 --- lib/activities/parse_column.rb | 4 ++-- lib/activities/parse_create_table_with_comment.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/activities/parse_column.rb b/lib/activities/parse_column.rb index a7a176a..940a74d 100644 --- a/lib/activities/parse_column.rb +++ b/lib/activities/parse_column.rb @@ -35,10 +35,10 @@ def build_column(col) column[:column_type] = col['column_type'].to_s if col['column_type'] code_line = code_lines.detect {|line| - code, _ = line.split("#") + code, _ = line.split("comment:") code and code.include?(method_name) and code.include?(col['column_name'].to_s) } - comment = code_line.split("#")[1] if code_line + comment = code_line.split("comment:")[1] if code_line column[:comment] = comment if comment column diff --git a/lib/activities/parse_create_table_with_comment.rb b/lib/activities/parse_create_table_with_comment.rb index 78dac1b..3e191d9 100644 --- a/lib/activities/parse_create_table_with_comment.rb +++ b/lib/activities/parse_create_table_with_comment.rb @@ -35,11 +35,11 @@ def call def build_column(col) column = super code_line = code_lines.detect {|line| - code, _ = line.split("#") + code, _ = line.split("comment:") code and code.include?(col['column_name'].to_s) } - comment = code_line.split("#")[1] if code_line + comment = code_line.split("comment:")[1] if code_line column[:comment] = comment if comment column From c1c2078c4a5e1921ef28b00d4fc6c818e4b0c820 Mon Sep 17 00:00:00 2001 From: chanshunli Date: Fri, 19 Jun 2015 03:13:15 +0800 Subject: [PATCH 3/3] Rack::Server.start 's app => Description::BBpp Group for Rack::* --- Gemfile | 2 +- Gemfile.lock | 8 ++++++++ bin/describle | 4 ++-- lib/description.rb | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 15921fb..1e14ac7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ # source 'https://rubygems.org' source 'http://ruby.taobao.org' - +gem 'pry' gem 'dun' gem 'ground', git: 'git://github.com/baya/ground.git', ref: 'bd4f89f0073c' gem 'sexp_path' diff --git a/Gemfile.lock b/Gemfile.lock index 5d367bd..4e6935f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,14 +10,21 @@ GIT GEM remote: http://ruby.taobao.org/ specs: + coderay (1.1.0) dun (0.0.1) json (1.8.0) + method_source (0.8.2) + pry (0.10.1) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) rack (1.5.2) ruby_parser (3.2.2) sexp_processor (~> 4.1) sexp_path (0.5.1) sexp_processor (~> 4.2) sexp_processor (4.3.0) + slop (3.6.0) PLATFORMS ruby @@ -26,5 +33,6 @@ DEPENDENCIES dun ground! json + pry ruby_parser sexp_path diff --git a/bin/describle b/bin/describle index 1247383..cd2886a 100755 --- a/bin/describle +++ b/bin/describle @@ -1,5 +1,5 @@ #!/usr/bin/env ruby - +require 'pry' lib_dir = File.join(File.dirname(__FILE__), '..', 'lib') $: << lib_dir require 'description' @@ -40,7 +40,7 @@ migration_files.each {|file| -Rack::Server.start(app: Description::App, +Rack::Server.start(app: Description::BBpp, Port: options[:port], server: options[:server] ) diff --git a/lib/description.rb b/lib/description.rb index 32119fc..dfc345c 100644 --- a/lib/description.rb +++ b/lib/description.rb @@ -20,7 +20,7 @@ module Description Table_Set = [] - App = Ground 'description' do + BBpp = Ground 'description' do use Rack::ShowExceptions use Rack::ConditionalGet use Rack::ETag