chosen-rails 0.9.11.1 → 0.9.11.2

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (C) 2011-2012 by Tse-Ching Ho
1
+ Copyright (C) 2011-2013 by Tse-Ching Ho
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/Rakefile CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env rake
2
- require "bundler/gem_tasks"
2
+ require 'bundler/gem_tasks'
3
3
  require File.expand_path('../lib/chosen-rails/source_file', __FILE__)
4
4
 
5
5
  desc "Update with Harvest's Chosen Library"
6
- task "update-chosen" do
6
+ task 'update-chosen' do
7
7
  files = SourceFile.new
8
8
  files.fetch
9
9
  files.convert
data/chosen-rails.gemspec CHANGED
@@ -2,24 +2,24 @@
2
2
  require File.expand_path('../lib/chosen-rails/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
- gem.authors = ["Tse-Ching Ho"]
6
- gem.email = ["tsechingho@gmail.com"]
5
+ gem.authors = ['Tse-Ching Ho']
6
+ gem.email = ['tsechingho@gmail.com']
7
7
  gem.description = %q{Chosen is a javascript library of select box enhancer for jQuery and Protoype. This gem integrates Chosen with Rails asset pipeline for easy of use.}
8
8
  gem.summary = %q{Integrate Chosen javascript library with Rails asset pipeline}
9
- gem.homepage = "https://github.com/tsechingho/chosen-rails"
9
+ gem.homepage = 'https://github.com/tsechingho/chosen-rails'
10
10
 
11
11
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
12
  gem.files = `git ls-files`.split("\n")
13
13
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
14
- gem.name = "chosen-rails"
15
- gem.require_paths = ["lib"]
14
+ gem.name = 'chosen-rails'
15
+ gem.require_paths = ['lib']
16
16
  gem.version = Chosen::Rails::VERSION
17
17
 
18
- gem.add_dependency "railties", ">= 3.0"
19
- gem.add_dependency "coffee-rails", ">= 3.2"
20
- gem.add_dependency "sass-rails", ">= 3.2"
18
+ gem.add_dependency 'railties', '>= 3.0'
19
+ gem.add_dependency 'coffee-rails', '>= 3.2'
20
+ gem.add_dependency 'sass-rails', '>= 3.2'
21
21
 
22
- gem.add_development_dependency "bundler", ">= 1.0"
23
- gem.add_development_dependency "rails", ">= 3.0"
24
- gem.add_development_dependency "thor", "~> 0.14"
22
+ gem.add_development_dependency 'bundler', '>= 1.0'
23
+ gem.add_development_dependency 'rails', '>= 3.0'
24
+ gem.add_development_dependency 'thor', '>= 0.14'
25
25
  end
data/lib/chosen-rails.rb CHANGED
@@ -1,11 +1,11 @@
1
- require "chosen-rails/version"
1
+ require 'chosen-rails/version'
2
2
 
3
3
  module Chosen
4
4
  module Rails
5
- if ::Rails.version < "3.1"
6
- require "chosen-rails/railtie"
5
+ if ::Rails.version < '3.1'
6
+ require 'chosen-rails/railtie'
7
7
  else
8
- require "chosen-rails/engine"
8
+ require 'chosen-rails/engine'
9
9
  end
10
10
  end
11
11
  end
@@ -1,41 +1,49 @@
1
- require "thor"
1
+ require 'thor'
2
2
 
3
3
  class SourceFile < Thor
4
4
  include Thor::Actions
5
5
 
6
- desc "fetch source files", "fetch source files from GitHub"
6
+ desc 'fetch source files', 'fetch source files from GitHub'
7
7
  def fetch
8
- self.destination_root = "vendor/assets"
9
- remote = "https://github.com/harvesthq/chosen"
10
- get "#{remote}/raw/master/chosen/chosen-sprite.png", "images/chosen-sprite.png"
11
- get "#{remote}/raw/master/chosen/chosen.css", "stylesheets/chosen.css"
12
- get "#{remote}/raw/master/coffee/lib/abstract-chosen.coffee", "javascripts/lib/abstract-chosen.coffee"
13
- get "#{remote}/raw/master/coffee/lib/select-parser.coffee", "javascripts/lib/select-parser.coffee"
14
- get "#{remote}/raw/master/coffee/chosen.jquery.coffee", "javascripts/chosen.jquery.coffee"
15
- get "#{remote}/raw/master/coffee/chosen.proto.coffee", "javascripts/chosen.proto.coffee"
16
- get "#{remote}/raw/master/VERSION", "VERSION"
17
- inside destination_root do
18
- version = File.read("VERSION").sub("\n", "")
19
- gsub_file "../../lib/chosen-rails/version.rb", /VERSION\s=\s"(\d|\.)+"$/ do |match|
20
- %Q{VERSION = "#{version}"}
21
- end
22
- end
8
+ self.destination_root = 'vendor/assets'
9
+ remote = 'https://github.com/harvesthq/chosen'
10
+ get "#{remote}/raw/master/chosen/chosen-sprite.png", 'images/chosen-sprite.png'
11
+ get "#{remote}/raw/master/chosen/chosen-sprite@2x.png", 'images/chosen-sprite@2x.png'
12
+ get "#{remote}/raw/master/chosen/chosen.css", 'stylesheets/chosen.css'
13
+ get "#{remote}/raw/master/coffee/lib/abstract-chosen.coffee", 'javascripts/lib/abstract-chosen.coffee'
14
+ get "#{remote}/raw/master/coffee/lib/select-parser.coffee", 'javascripts/lib/select-parser.coffee'
15
+ get "#{remote}/raw/master/coffee/chosen.jquery.coffee", 'javascripts/chosen.jquery.coffee'
16
+ get "#{remote}/raw/master/coffee/chosen.proto.coffee", 'javascripts/chosen.proto.coffee'
17
+ get "#{remote}/raw/master/VERSION", 'VERSION'
18
+ bump_version
23
19
  end
24
20
 
25
- desc "convert css to sass file", "convert css to sass file by sass-convert"
21
+ desc 'convert css to sass file', 'convert css to sass file by sass-convert'
26
22
  def convert
27
- self.destination_root = "vendor/assets"
23
+ self.destination_root = 'vendor/assets'
28
24
  inside destination_root do
29
- run("sass-convert -F css -T sass stylesheets/chosen.css stylesheets/chosen.css.sass")
25
+ run('sass-convert -F css -T sass stylesheets/chosen.css stylesheets/chosen.css.sass')
30
26
  gsub_file 'stylesheets/chosen.css.sass', '(chosen-sprite.png)', "('chosen-sprite.png')"
27
+ gsub_file 'stylesheets/chosen.css.sass', '(chosen-sprite@2x.png)', "('chosen-sprite@2x.png')"
31
28
  gsub_file 'stylesheets/chosen.css.sass', ' url', ' image-url'
32
29
  end
33
30
  end
34
31
 
35
- desc "clean up useless files", "clean up useless files"
32
+ desc 'clean up useless files', 'clean up useless files'
36
33
  def cleanup
37
- self.destination_root = "vendor/assets"
38
- remove_file "stylesheets/chosen.css"
39
- remove_file "VERSION"
34
+ self.destination_root = 'vendor/assets'
35
+ remove_file 'stylesheets/chosen.css'
36
+ remove_file 'VERSION'
37
+ end
38
+
39
+ protected
40
+
41
+ def bump_version
42
+ inside destination_root do
43
+ version = File.read('VERSION').sub("\n", '')
44
+ gsub_file '../../lib/chosen-rails/version.rb', /CHOSEN_VERSION\s=\s'(\d|\.)+'$/ do |match|
45
+ %Q{CHOSEN_VERSION = '#{version}'}
46
+ end
47
+ end
40
48
  end
41
49
  end
@@ -1,6 +1,6 @@
1
1
  module Chosen
2
2
  module Rails
3
- VERSION = "0.9.11.1"
4
- CHOSEN_VERSION = "0.9.11"
3
+ VERSION = '0.9.11.2'
4
+ CHOSEN_VERSION = '0.9.11'
5
5
  end
6
6
  end
@@ -7,9 +7,17 @@ $ = jQuery
7
7
 
8
8
  $.fn.extend({
9
9
  chosen: (options) ->
10
+ ua = navigator.userAgent.toLowerCase();
11
+
12
+ match = /(msie) ([\w.]+)/.exec( ua ) || [];
13
+
14
+ browser =
15
+ name: match[ 1 ] || ""
16
+ version: match[ 2 ] || "0"
17
+
10
18
  # Do no harm and return as soon as possible for unsupported browsers, namely IE6 and IE7
11
19
  # Continue on if running IE document type but in compatibility mode
12
- return this if $.browser.msie and ($.browser.version is "6.0" or ($.browser.version is "7.0" and document.documentMode is 7 ))
20
+ return this if browser.name is "msie" and (browser.version is "6.0" or (browser.version is "7.0" and document.documentMode is 7 ))
13
21
  this.each((input_field) ->
14
22
  $this = $ this
15
23
  $this.data('chosen', new Chosen(this, options)) unless $this.hasClass "chzn-done"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chosen-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.11.1
4
+ version: 0.9.11.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,14 +9,14 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-08 00:00:00.000000000 Z
12
+ date: 2013-01-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ">="
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '3.0'
22
22
  type: :runtime
@@ -24,7 +24,7 @@ dependencies:
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ">="
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.0'
30
30
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ">="
35
+ - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
37
  version: '3.2'
38
38
  type: :runtime
@@ -40,7 +40,7 @@ dependencies:
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ">="
43
+ - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '3.2'
46
46
  - !ruby/object:Gem::Dependency
@@ -48,7 +48,7 @@ dependencies:
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ">="
51
+ - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
53
  version: '3.2'
54
54
  type: :runtime
@@ -56,7 +56,7 @@ dependencies:
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ">="
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.2'
62
62
  - !ruby/object:Gem::Dependency
@@ -64,7 +64,7 @@ dependencies:
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ">="
67
+ - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: '1.0'
70
70
  type: :development
@@ -72,7 +72,7 @@ dependencies:
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ">="
75
+ - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: '1.0'
78
78
  - !ruby/object:Gem::Dependency
@@ -80,7 +80,7 @@ dependencies:
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
83
- - - ">="
83
+ - - ! '>='
84
84
  - !ruby/object:Gem::Version
85
85
  version: '3.0'
86
86
  type: :development
@@ -88,7 +88,7 @@ dependencies:
88
88
  version_requirements: !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
91
- - - ">="
91
+ - - ! '>='
92
92
  - !ruby/object:Gem::Version
93
93
  version: '3.0'
94
94
  - !ruby/object:Gem::Dependency
@@ -96,7 +96,7 @@ dependencies:
96
96
  requirement: !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
99
- - - "~>"
99
+ - - ! '>='
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0.14'
102
102
  type: :development
@@ -104,7 +104,7 @@ dependencies:
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
- - - "~>"
107
+ - - ! '>='
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0.14'
110
110
  description: Chosen is a javascript library of select box enhancer for jQuery and
@@ -115,7 +115,7 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - ".gitignore"
118
+ - .gitignore
119
119
  - Gemfile
120
120
  - LICENSE
121
121
  - README.md
@@ -127,6 +127,7 @@ files:
127
127
  - lib/chosen-rails/source_file.rb
128
128
  - lib/chosen-rails/version.rb
129
129
  - vendor/assets/images/chosen-sprite.png
130
+ - vendor/assets/images/chosen-sprite@2x.png
130
131
  - vendor/assets/javascripts/chosen-jquery.js
131
132
  - vendor/assets/javascripts/chosen-prototype.js
132
133
  - vendor/assets/javascripts/chosen.jquery.coffee
@@ -143,15 +144,21 @@ require_paths:
143
144
  required_ruby_version: !ruby/object:Gem::Requirement
144
145
  none: false
145
146
  requirements:
146
- - - ">="
147
+ - - ! '>='
147
148
  - !ruby/object:Gem::Version
148
149
  version: '0'
150
+ segments:
151
+ - 0
152
+ hash: 2483525102989245458
149
153
  required_rubygems_version: !ruby/object:Gem::Requirement
150
154
  none: false
151
155
  requirements:
152
- - - ">="
156
+ - - ! '>='
153
157
  - !ruby/object:Gem::Version
154
158
  version: '0'
159
+ segments:
160
+ - 0
161
+ hash: 2483525102989245458
155
162
  requirements: []
156
163
  rubyforge_project:
157
164
  rubygems_version: 1.8.24