Permalink
Browse files

Rewrite to match current form helpers interface

  • Loading branch information...
1 parent ea73062 commit 231fb81c7e88d91fdf2a5f2d79044db15a0c3fdb @scudco committed Mar 2, 2014
View
@@ -6,7 +6,7 @@ gemspec
# Duplicating this in Gemfile until thoughtbot pushes latest version
# that supports Bundler `platform` directive for rbx support in travis-ci
# Once appraisal 1.0.0 is released, this line can be removed
-gem 'appraisal', github: 'thoughtbot/appraisal', ref: '6d599f'
+gem 'appraisal', '~> 1.0.0.beta3'
platforms :rbx do
gem 'racc'
View
@@ -10,7 +10,7 @@ to evaluate the suitability of this list given their user base.
## UPGRADING
-[**An important message about upgrading from 1.0**](UPGRADING.md)
+[**An important message about upgrading from 1.x**](UPGRADING.md)
## Installation
@@ -36,7 +36,13 @@ country_select("user", "country")
Supplying priority countries to be placed at the top of the list:
```ruby
-country_select("user", "country", [ "GB", "FR", "DE" ])
+country_select("user", "country", priority_countries: ["GB", "FR", "DE"])
+```
+
+Supplying only certain countries:
+
+```ruby
+country_select("user", "country", only: ["GB", "FR", "DE"])
```
### ISO 3166-1 alpha-2 codes
@@ -68,15 +74,7 @@ resistant to country names changing.
The locale can be overridden locally:
```ruby
-country_select("user", "country_code", ['US'], locale: 'es')
-```
-
-```ruby
-country_select("user", "country_code")
-```
-
-```ruby
-country_select("user", "country_code", [ "GB", "FR", "DE" ])
+country_select("user", "country_code", locale: 'es')
```
#### Getting the Country Name from the countries gem
@@ -105,13 +103,8 @@ The relevant view file lives [here](https://github.com/scudco/country_select_tes
```shell
bundle
-bundle exec rspec
-```
-
-### Running with multiple versions of actionpack
-
-```shell
bundle exec appraisal
+bundle exec rake appraisal:integration
```
Copyright (c) 2008 Michael Koziarski, released under the MIT license
View
@@ -32,6 +32,26 @@ lowercased country codes stored in the `country_code` column:
UPDATE users SET country_code = UPPER(country_code);
```
+## Priority countries are now in the options hash
+
+The priority countries syntax has changed from
+
+```ruby
+ country_select(:user, :country_code, ["GB","FR"])
+```
+
+to
+
+```ruby
+ country_select(:user, :country_code, priority_countries: ["GB","FR"])
+```
+
+## You can choose to only display a chosen set of countries
+
+```ruby
+ country_select(:user, :country_code, only: ["LV","SG"])
+```
+
## Ruby 1.9+
`country_select` will no longer be tested in Ruby `< 1.9`.
@@ -2,7 +2,7 @@
source "https://rubygems.org"
-gem "appraisal", :github=>"thoughtbot/appraisal", :ref=>"6d599f"
+gem "appraisal", "~> 1.0.0.beta3"
gem "actionpack", "~> 4.0.0"
platforms :rbx do
@@ -1,13 +1,3 @@
-GIT
- remote: git://github.com/thoughtbot/appraisal.git
- revision: 6d599ff1f2418d199ba2357b7c0297a63521ab13
- ref: 6d599f
- specs:
- appraisal (1.0.0.beta2)
- bundler
- rake
- thor (>= 0.14.0)
-
PATH
remote: ../
specs:
@@ -17,19 +7,23 @@ PATH
GEM
remote: https://rubygems.org/
specs:
- actionpack (4.0.0)
- activesupport (= 4.0.0)
+ actionpack (4.0.3)
+ activesupport (= 4.0.3)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
- activesupport (4.0.0)
+ activesupport (4.0.3)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
- atomic (1.1.10)
+ appraisal (1.0.0.beta3)
+ bundler
+ rake
+ thor (>= 0.14.0)
+ atomic (1.1.15)
builder (3.1.4)
coderay (1.0.9)
countries (0.9.3)
@@ -38,10 +32,10 @@ GEM
diff-lcs (1.2.4)
erubis (2.7.0)
ffi2-generators (0.1.1)
- i18n (0.6.4)
+ i18n (0.6.9)
method_source (0.8.1)
minitest (4.7.5)
- multi_json (1.7.7)
+ multi_json (1.8.4)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
@@ -51,7 +45,7 @@ GEM
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
- rake (10.1.0)
+ rake (10.1.1)
rspec (2.13.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
@@ -264,16 +258,16 @@ GEM
rubysl-zlib (2.0.1)
slop (3.4.5)
thor (0.18.1)
- thread_safe (0.1.0)
- atomic
- tzinfo (0.3.37)
+ thread_safe (0.2.0)
+ atomic (>= 1.1.7, < 2)
+ tzinfo (0.3.38)
PLATFORMS
ruby
DEPENDENCIES
actionpack (~> 4.0.0)
- appraisal!
+ appraisal (~> 1.0.0.beta3)
country_select!
pry (~> 0)
psych
@@ -2,7 +2,7 @@
source "https://rubygems.org"
-gem "appraisal", :github=>"thoughtbot/appraisal", :ref=>"6d599f"
+gem "appraisal", "~> 1.0.0.beta3"
gem "actionpack", "~> 4.1.0.beta1"
platforms :rbx do
@@ -1,13 +1,3 @@
-GIT
- remote: git://github.com/thoughtbot/appraisal.git
- revision: 6d599ff1f2418d199ba2357b7c0297a63521ab13
- ref: 6d599f
- specs:
- appraisal (1.0.0.beta2)
- bundler
- rake
- thor (>= 0.14.0)
-
PATH
remote: .././
specs:
@@ -17,22 +7,26 @@ PATH
GEM
remote: https://rubygems.org/
specs:
- actionpack (4.1.0.beta1)
- actionview (= 4.1.0.beta1)
- activesupport (= 4.1.0.beta1)
+ actionpack (4.1.0.rc1)
+ actionview (= 4.1.0.rc1)
+ activesupport (= 4.1.0.rc1)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
- actionview (4.1.0.beta1)
- activesupport (= 4.1.0.beta1)
+ actionview (4.1.0.rc1)
+ activesupport (= 4.1.0.rc1)
builder (~> 3.1)
erubis (~> 2.7.0)
- activesupport (4.1.0.beta1)
+ activesupport (4.1.0.rc1)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
- atomic (1.1.14)
+ appraisal (1.0.0.beta3)
+ bundler
+ rake
+ thor (>= 0.14.0)
+ atomic (1.1.15)
builder (3.2.2)
coderay (1.1.0)
countries (0.9.3)
@@ -44,7 +38,7 @@ GEM
i18n (0.6.9)
json (1.8.1)
method_source (0.8.2)
- minitest (5.2.2)
+ minitest (5.3.0)
pry (0.9.12.4)
coderay (~> 1.0)
method_source (~> 0.8)
@@ -267,8 +261,8 @@ GEM
rubysl-zlib (2.0.1)
slop (3.4.7)
thor (0.18.1)
- thread_safe (0.1.3)
- atomic
+ thread_safe (0.2.0)
+ atomic (>= 1.1.7, < 2)
tzinfo (1.1.0)
thread_safe (~> 0.1)
@@ -277,7 +271,7 @@ PLATFORMS
DEPENDENCIES
actionpack (~> 4.1.0.beta1)
- appraisal!
+ appraisal (~> 1.0.0.beta3)
country_select!
pry (~> 0)
psych
Oops, something went wrong.

0 comments on commit 231fb81

Please sign in to comment.