Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleanup code, replace " with '

  • Loading branch information...
commit 1e743d4c83a81f82cea0ddbc61cc3946eaeaa348 1 parent be2d556
@tsechingho authored
View
4 Rakefile
@@ -1,9 +1,9 @@
#!/usr/bin/env rake
-require "bundler/gem_tasks"
+require 'bundler/gem_tasks'
require File.expand_path('../lib/chosen-rails/source_file', __FILE__)
desc "Update with Harvest's Chosen Library"
-task "update-chosen" do
+task 'update-chosen' do
files = SourceFile.new
files.fetch
files.convert
View
22 chosen-rails.gemspec
@@ -2,24 +2,24 @@
require File.expand_path('../lib/chosen-rails/version', __FILE__)
Gem::Specification.new do |gem|
- gem.authors = ["Tse-Ching Ho"]
- gem.email = ["tsechingho@gmail.com"]
+ gem.authors = ['Tse-Ching Ho']
+ gem.email = ['tsechingho@gmail.com']
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.}
gem.summary = %q{Integrate Chosen javascript library with Rails asset pipeline}
- gem.homepage = "https://github.com/tsechingho/chosen-rails"
+ gem.homepage = 'https://github.com/tsechingho/chosen-rails'
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
- gem.name = "chosen-rails"
- gem.require_paths = ["lib"]
+ gem.name = 'chosen-rails'
+ gem.require_paths = ['lib']
gem.version = Chosen::Rails::VERSION
- gem.add_dependency "railties", ">= 3.0"
- gem.add_dependency "coffee-rails", ">= 3.2"
- gem.add_dependency "sass-rails", ">= 3.2"
+ gem.add_dependency 'railties', '>= 3.0'
+ gem.add_dependency 'coffee-rails', '>= 3.2'
+ gem.add_dependency 'sass-rails', '>= 3.2'
- gem.add_development_dependency "bundler", ">= 1.0"
- gem.add_development_dependency "rails", ">= 3.0"
- gem.add_development_dependency "thor", "~> 0.14"
+ gem.add_development_dependency 'bundler', '>= 1.0'
+ gem.add_development_dependency 'rails', '>= 3.0'
+ gem.add_development_dependency 'thor', '~> 0.14'
end
View
8 lib/chosen-rails.rb
@@ -1,11 +1,11 @@
-require "chosen-rails/version"
+require 'chosen-rails/version'
module Chosen
module Rails
- if ::Rails.version < "3.1"
- require "chosen-rails/railtie"
+ if ::Rails.version < '3.1'
+ require 'chosen-rails/railtie'
else
- require "chosen-rails/engine"
+ require 'chosen-rails/engine'
end
end
end
View
44 lib/chosen-rails/source_file.rb
@@ -1,43 +1,43 @@
-require "thor"
+require 'thor'
class SourceFile < Thor
include Thor::Actions
- desc "fetch source files", "fetch source files from GitHub"
+ desc 'fetch source files', 'fetch source files from GitHub'
def fetch
- self.destination_root = "vendor/assets"
- remote = "https://github.com/harvesthq/chosen"
- get "#{remote}/raw/master/chosen/chosen-sprite.png", "images/chosen-sprite.png"
- get "#{remote}/raw/master/chosen/chosen-sprite@2x.png", "images/chosen-sprite@2x.png"
- get "#{remote}/raw/master/chosen/chosen.css", "stylesheets/chosen.css"
- get "#{remote}/raw/master/coffee/lib/abstract-chosen.coffee", "javascripts/lib/abstract-chosen.coffee"
- get "#{remote}/raw/master/coffee/lib/select-parser.coffee", "javascripts/lib/select-parser.coffee"
- get "#{remote}/raw/master/coffee/chosen.jquery.coffee", "javascripts/chosen.jquery.coffee"
- get "#{remote}/raw/master/coffee/chosen.proto.coffee", "javascripts/chosen.proto.coffee"
- get "#{remote}/raw/master/VERSION", "VERSION"
+ self.destination_root = 'vendor/assets'
+ remote = 'https://github.com/harvesthq/chosen'
+ get "#{remote}/raw/master/chosen/chosen-sprite.png", 'images/chosen-sprite.png'
+ get "#{remote}/raw/master/chosen/chosen-sprite@2x.png", 'images/chosen-sprite@2x.png'
+ get "#{remote}/raw/master/chosen/chosen.css", 'stylesheets/chosen.css'
+ get "#{remote}/raw/master/coffee/lib/abstract-chosen.coffee", 'javascripts/lib/abstract-chosen.coffee'
+ get "#{remote}/raw/master/coffee/lib/select-parser.coffee", 'javascripts/lib/select-parser.coffee'
+ get "#{remote}/raw/master/coffee/chosen.jquery.coffee", 'javascripts/chosen.jquery.coffee'
+ get "#{remote}/raw/master/coffee/chosen.proto.coffee", 'javascripts/chosen.proto.coffee'
+ get "#{remote}/raw/master/VERSION", 'VERSION'
inside destination_root do
- version = File.read("VERSION").sub("\n", "")
- gsub_file "../../lib/chosen-rails/version.rb", /VERSION\s=\s"(\d|\.)+"$/ do |match|
- %Q{VERSION = "#{version}"}
+ version = File.read('VERSION').sub("\n", '')
+ gsub_file '../../lib/chosen-rails/version.rb', /VERSION\s=\s'(\d|\.)+'$/ do |match|
+ %Q{VERSION = '#{version}'}
end
end
end
- desc "convert css to sass file", "convert css to sass file by sass-convert"
+ desc 'convert css to sass file', 'convert css to sass file by sass-convert'
def convert
- self.destination_root = "vendor/assets"
+ self.destination_root = 'vendor/assets'
inside destination_root do
- run("sass-convert -F css -T sass stylesheets/chosen.css stylesheets/chosen.css.sass")
+ run('sass-convert -F css -T sass stylesheets/chosen.css stylesheets/chosen.css.sass')
gsub_file 'stylesheets/chosen.css.sass', '(chosen-sprite.png)', "('chosen-sprite.png')"
gsub_file 'stylesheets/chosen.css.sass', '(chosen-sprite@2x.png)', "('chosen-sprite@2x.png')"
gsub_file 'stylesheets/chosen.css.sass', ' url', ' image-url'
end
end
- desc "clean up useless files", "clean up useless files"
+ desc 'clean up useless files', 'clean up useless files'
def cleanup
- self.destination_root = "vendor/assets"
- remove_file "stylesheets/chosen.css"
- remove_file "VERSION"
+ self.destination_root = 'vendor/assets'
+ remove_file 'stylesheets/chosen.css'
+ remove_file 'VERSION'
end
end
View
4 lib/chosen-rails/version.rb
@@ -1,6 +1,6 @@
module Chosen
module Rails
- VERSION = "0.9.11.1"
- CHOSEN_VERSION = "0.9.11"
+ VERSION = '0.9.11.1'
+ CHOSEN_VERSION = '0.9.11'
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.