country_state_select 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2NlYzIwZGViOWMxMzM2ZjNmODAzZGI2MTY2Y2Y5MGRjNTE4NzU3Mg==
4
+ MGVhNDNiOGM3ODA0MmE5OGJjZTE1YzA3ZjgyODE2OTdlMTIyZjk3NQ==
5
5
  data.tar.gz: !binary |-
6
- NDFmZmJhYjk5YTE1ZTZjZDNhMGMxNDg2MDM3MmU5MzRkZjQwMWE3Mg==
6
+ N2MyZWRhYTJiYzhiNTI3MmQ2NjE5YjQ0NDI4ZDFhMzgyZjJiZGU0Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2NhNTMwYTQxMWMwNWM0NDNiZTIwOThlMzAyOTZlMjQ5NzkyMmE2Yzk4YWJk
10
- NzM2NGU2OWIzNjI3ZWYxMWMyNjU3MDc4ZmY2YWU0MmU3ZDI1YTQxZjM1OGE5
11
- Y2VhMWY0NDcyNTc5MDBlZmMyOTYzMDczMjVhMDJmZGFkNDc0MGQ=
9
+ NmIwMmQ2Yzg4ZjE1ZjcwZmY1MGE5NzI1NmYyNGJiYjEyN2FhZTBjZWRlNDNk
10
+ MGQzMGYwODdiMzk5ODEyZWFiMzcwM2ZjNzdkMmJiZGU1MTZlYTlmOGEzNmIz
11
+ OWM2ZDVmYzk1ZGZkZTA4NzAyMjAzMDI4ZmEyZmJhOGEzY2E0NzE=
12
12
  data.tar.gz: !binary |-
13
- MDFjNGU4MTRjNmY2MWU4YzE1NDBkMTNkZGM5NzA5ODgwZjE1MDliMzIwM2Yz
14
- NTUyZTZiYjNiMjBjMDIyMGY2M2M4NzNhNDBlMWUxNjZmMDJiZGNjMTNkOWVl
15
- OWY4YjBkMzQ1YjUwZjY4MWM4NTQ1NTE4NDk4MDgxMjFlZmRjN2Y=
13
+ NzY2ZjVlNzYwZmY5NWRiODYxYWMyOWE5ZTNlYWU0YTdhMzk5ODM3NWU0MzUw
14
+ NDNkYzM0YmJmN2E3YWI3MDM0MzE0OGEyZjE4MWFjZGI5YTQ3N2JlOWQyOWM5
15
+ NjhmMWEyMjcwYzNmN2M0NWRmMTRkMDg0ZjdhYmE4NjBmZmYwYjA=
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.2
6
+
7
+
8
+ © 2014 GitHub, Inc.
9
+ Terms
10
+ Privacy
11
+ Security
12
+ Contact
13
+
data/README.md CHANGED
@@ -5,7 +5,7 @@ Country State Select is library which gives you all the country names and when y
5
5
  #Getting Started
6
6
 
7
7
  Country State Select is released as a Ruby Gem. The gem is to be installed within a Ruby
8
- or Rails application. To install, simply add the following to your Gemfile:
8
+ or Rails application. To install, simply add the following to your Gemfile.
9
9
 
10
10
  gem 'country_state_select'
11
11
 
@@ -39,6 +39,11 @@ Run bundle install and don't forget to restart your server after you install a n
39
39
 
40
40
  ##Version History
41
41
 
42
+ 1.0.1
43
+
44
+ Added method 'countries_except' inside this can put all the countries which you do not want in to the country select option just you have to fetch countries by
45
+ CountryStateSelect.countries_except('CountryName1','CountryName2'....)
46
+
42
47
  1.0.0
43
48
 
44
49
  It is the stable version which have all the feature
@@ -29,9 +29,15 @@ module CountryStateSelect
29
29
  INDIAN_STATES.merge(INDIAN_TERRIOTORY).merge(USA_STATE_LIST).merge(CANADIAN_STATES).merge(UK_STATES)
30
30
  end
31
31
 
32
- module Rails
33
-
32
+ #this method will provide the user to opetion to skip any countries in drop down list
33
+ def self.countries_except(*except)
34
+ countries = []
35
+ COUNTRIES.each do |country|
36
+ countries<< country unless country.in?(except)
37
+ end
38
+ return countries
34
39
  end
40
+
35
41
  end
36
42
 
37
43
  case ::Rails.version.to_s
@@ -43,4 +49,4 @@ case ::Rails.version.to_s
43
49
  require 'country_state_select/railtie'
44
50
  else
45
51
  raise 'Unsupported rails version'
46
- end
52
+ end
@@ -1,3 +1,3 @@
1
1
  module CountryStateSelect
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  <div class="field">
23
23
  <%= f.label :country_id %><br>
24
- <%= f.select :country_name, CountryStateSelect::Constant::COUNTRIES, {}, id: 'country_id', :class=>'chosen-select' %>
24
+ <%= f.select :country_name, CountryStateSelect.countries_except(''), {}, id: 'country_id', :class=>'chosen-select' %>
25
25
 
26
26
  </div>
27
27
  <div class="field">
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: country_state_select
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arvind Vyas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-03 00:00:00.000000000 Z
11
+ date: 2014-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - .gitignore
63
+ - .travis.yml
63
64
  - Gemfile
64
65
  - LICENSE.txt
65
66
  - README.md