Browse Source

fix source,readme,gemspec,和其他發現未修改的部分

motephyr 10 years ago
parent
commit
fd8a203134

+ 2 - 6
Gemfile

@@ -1,11 +1,7 @@
-# rails plugin new china_city --dummy-path=spec/dummy --skip-test-unit --mountable
-if ENV['TRAVIS']
   source 'https://rubygems.org'
-else
-  source 'http://ruby.taobao.org'
-end
 
-# Declare your gem's dependencies in china_city.gemspec.
+
+# Declare your gem's dependencies in taiwan_city.gemspec.
 # Bundler will treat runtime dependencies like base dependencies, and
 # development dependencies will be added by default to the :development group.
 gemspec

+ 4 - 4
Gemfile.lock

@@ -1,7 +1,7 @@
 PATH
   remote: .
   specs:
-    china_city (0.0.4)
+    taiwan_city (0.0.1)
       jquery-rails
       rails (>= 3.1.0)
 
@@ -81,7 +81,7 @@ GEM
       cliver (~> 0.2.1)
       multi_json (~> 1.0)
       websocket-driver (>= 0.2.0)
-    polyglot (0.3.3)
+    polyglot (0.3.4)
     rack (1.3.10)
     rack-cache (1.2)
       rack (>= 0.4)
@@ -130,7 +130,7 @@ GEM
     treetop (1.4.15)
       polyglot
       polyglot (>= 0.3.1)
-    tzinfo (0.3.37)
+    tzinfo (0.3.39)
     websocket-driver (0.2.3)
     xpath (2.0.0)
       nokogiri (~> 1.3)
@@ -141,10 +141,10 @@ PLATFORMS
 DEPENDENCIES
   appraisal
   capybara
-  china_city!
   coffee-rails
   jquery-rails
   launchy
   poltergeist
   rspec-rails
   sqlite3
+  taiwan_city!

+ 6 - 8
README.md

@@ -1,8 +1,6 @@
-# TaiwanCity 省市区级联选择
+# TaiwanCity 台灣縣市下拉列表 
 
-[![Build Status](https://travis-ci.org/saberma/taiwan_city.png?branch=master)](https://travis-ci.org/saberma/taiwan_city)
-
-![taiwan_city](http://cl.ly/image/3c212i1e3b1T/ScreenFlow.mp4.gif)
+此rubygem 程式結構以[china_city](https://github.com/saberma/china_city)做參考,保留大部分原文說明。只在不同處做修改
 
 支持 Rails3.1, Rails3.2, Rails4.0。
 
@@ -10,7 +8,7 @@
 
 ## 简介
 
-这是一个基于 Rails Engine 开发的插件,为 Rails 项目增加省市区三级(或者省市 二级)选择框,可用于实现收货地址等信息的录入
+这是一个基于 Rails Engine 开发的插件,為 Rails 專案增加縣,市區二級下拉列表
 
 ## 安装
 
@@ -44,7 +42,7 @@
 
 请留意:所有选择框都要有 `city-select` class,并都包含于 class='city-group' 的 DOM 元素之下。
 
-选择后的值为国家地区编码,如深圳市的为 `440300`,可通过调用 `TaiwanCity.get('440300')` 将编码转化为城市名称
+選擇後的值為台灣的郵遞區號
 
 ## 贡献
 
@@ -67,6 +65,6 @@ bundle install
 rake appraisal:rails31 spec
 ```
 
-## 类似项目
+## 感謝作者
 
-* https://github.com/Kehao/area_cn_select
+* [saberma](https://github.com/saberma)

+ 1 - 1
app/controllers/taiwan_city/data_controller.rb

@@ -1,4 +1,4 @@
-require_dependency "china_city/application_controller"
+require_dependency "taiwan_city/application_controller"
 
 module TaiwanCity
   class DataController < ApplicationController

+ 2 - 2
app/views/layouts/taiwan_city/application.html.erb

@@ -2,8 +2,8 @@
 <html>
   <head>
     <title>TaiwanCity</title>
-    <%= stylesheet_link_tag    "china_city/application", media: "all" %>
-    <%= javascript_include_tag "china_city/application" %>
+    <%= stylesheet_link_tag    "taiwan_city/application", media: "all" %>
+    <%= javascript_include_tag "taiwan_city/application" %>
     <%= csrf_meta_tags %>
 
   <body>

+ 2 - 2
lib/china_city.rb → lib/taiwan_city.rb

@@ -2,11 +2,11 @@
 require "taiwan_city/engine"
 
 module TaiwanCity
-  TAIWAN = '000000' # 全国
+  TAIWAN = '000' # 全国
   PATTERN = /(\d{2})(\d{2})(\d{2})/
 
   class << self
-    def list(parent_id = '000000')
+    def list(parent_id = '000')
       result = []
       return result if parent_id.blank?
       province_id = province(parent_id)

+ 1 - 1
lib/taiwan_city/version.rb

@@ -1,3 +1,3 @@
 module TaiwanCity
-  VERSION = "0.0.4"
+  VERSION = "0.0.1"
 end

+ 1 - 1
spec/controllers/taiwan_city/data_controller_spec.rb

@@ -4,7 +4,7 @@ describe TaiwanCity::DataController do
 
   describe "GET 'show'" do
     it "returns http success" do
-      get 'show', id: '000000', use_route: 'china_city'
+      get 'show', id: '000', use_route: 'taiwan_city'
       response.should be_success
     end
   end

+ 5 - 5
taiwan_city.gemspec

@@ -7,11 +7,11 @@ require "taiwan_city/version"
 Gem::Specification.new do |s|
   s.name        = "taiwan_city"
   s.version     = TaiwanCity::VERSION
-  s.authors     = ["saberma"]
-  s.email       = ["mahb45@gmail.com"]
-  s.homepage    = "https://github.com/saberma/taiwan_city"
-  s.summary     = "a gem to help you select chinese area"
-  s.description = "a gem to help you select chinese area like province, city and district"
+  s.authors     = ["motephyr"]
+  s.email       = ["motephyr@gmail.com"]
+  s.homepage    = "https://github.com/motephyr/taiwan_city"
+  s.summary     = "a gem to help you select taiwan area"
+  s.description = "a gem to help you select taiwan area like city and district"
   s.license     = 'MIT'
 
   s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]