Permalink
Browse files

CoffeeSecript implementation, Guard for compilation, cleanup and fix …

…tests with encodeURIComponent
  • Loading branch information...
1 parent 1918009 commit cba96b84cb8318e7fe370a64d55ee3b9cba639c7 @le0pard le0pard committed Mar 17, 2013
Showing with 299 additions and 302 deletions.
  1. +3 −1 .gitignore
  2. +7 −1 .travis.yml
  3. +2 −8 Gemfile
  4. +0 −106 Gemfile.lock
  5. +3 −0 Guardfile
  6. +10 −9 Readme.md
  7. +9 −46 js-routes.gemspec
  8. +120 −121 lib/routes.js
  9. +134 −0 lib/routes.js.coffee
  10. +3 −3 spec/js_routes/rails_routes_compatibility_spec.rb
  11. +8 −7 spec/spec_helper.rb
View
@@ -15,7 +15,7 @@ log
# jeweler generated
pkg
-# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
+# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
#
# * Create a file at ~/.gitignore
# * Include files you want ignored
@@ -48,3 +48,5 @@ pkg
# For rubinius:
#*.rbc
.rvmrc
+
+Gemfile.lock
View
@@ -1,10 +1,16 @@
+language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
+ - 2.0.0
+ - ruby-head
notifications:
- email:
+ email:
- agresso@gmail.com
branches:
only:
- master
+matrix:
+ allow_failures:
+ - rvm: ruby-head
View
10 Gemfile
@@ -1,10 +1,4 @@
source "http://rubygems.org"
-gem "rails", ">= 3.2"
-
-group :development do
- gem "therubyracer"
- gem "rspec", "~> 2.10.0"
- gem "bundler", "~> 1.1.0"
- gem "jeweler", "~> 1.6.2"
-end
+# Specify your gem's dependencies in js-routes.gemspec
+gemspec
View
@@ -1,106 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- actionmailer (3.2.1)
- actionpack (= 3.2.1)
- mail (~> 2.4.0)
- actionpack (3.2.1)
- activemodel (= 3.2.1)
- activesupport (= 3.2.1)
- builder (~> 3.0.0)
- erubis (~> 2.7.0)
- journey (~> 1.0.1)
- rack (~> 1.4.0)
- rack-cache (~> 1.1)
- rack-test (~> 0.6.1)
- sprockets (~> 2.1.2)
- activemodel (3.2.1)
- activesupport (= 3.2.1)
- builder (~> 3.0.0)
- activerecord (3.2.1)
- activemodel (= 3.2.1)
- activesupport (= 3.2.1)
- arel (~> 3.0.0)
- tzinfo (~> 0.3.29)
- activeresource (3.2.1)
- activemodel (= 3.2.1)
- activesupport (= 3.2.1)
- activesupport (3.2.1)
- i18n (~> 0.6)
- multi_json (~> 1.0)
- arel (3.0.0)
- builder (3.0.0)
- diff-lcs (1.1.3)
- erubis (2.7.0)
- git (1.2.5)
- hike (1.2.1)
- i18n (0.6.0)
- jeweler (1.6.4)
- bundler (~> 1.0)
- git (>= 1.2.5)
- rake
- journey (1.0.1)
- json (1.6.5)
- libv8 (3.3.10.4)
- mail (2.4.1)
- i18n (>= 0.4.0)
- mime-types (~> 1.16)
- treetop (~> 1.4.8)
- mime-types (1.17.2)
- multi_json (1.0.4)
- polyglot (0.3.3)
- rack (1.4.1)
- rack-cache (1.1)
- rack (>= 0.4)
- rack-ssl (1.3.2)
- rack
- rack-test (0.6.1)
- rack (>= 1.0)
- rails (3.2.1)
- actionmailer (= 3.2.1)
- actionpack (= 3.2.1)
- activerecord (= 3.2.1)
- activeresource (= 3.2.1)
- activesupport (= 3.2.1)
- bundler (~> 1.0)
- railties (= 3.2.1)
- railties (3.2.1)
- actionpack (= 3.2.1)
- activesupport (= 3.2.1)
- rack-ssl (~> 1.3.2)
- rake (>= 0.8.7)
- rdoc (~> 3.4)
- thor (~> 0.14.6)
- rake (0.9.2)
- rdoc (3.12)
- json (~> 1.4)
- rspec (2.10.0)
- rspec-core (~> 2.10.0)
- rspec-expectations (~> 2.10.0)
- rspec-mocks (~> 2.10.0)
- rspec-core (2.10.1)
- rspec-expectations (2.10.0)
- diff-lcs (~> 1.1.3)
- rspec-mocks (2.10.1)
- sprockets (2.1.2)
- hike (~> 1.2)
- rack (~> 1.0)
- tilt (~> 1.1, != 1.3.0)
- therubyracer (0.9.10)
- libv8 (~> 3.3.10)
- thor (0.14.6)
- tilt (1.3.3)
- treetop (1.4.10)
- polyglot
- polyglot (>= 0.3.1)
- tzinfo (0.3.31)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bundler (~> 1.1.0)
- jeweler (~> 1.6.2)
- rails (>= 3.2)
- rspec (~> 2.10.0)
- therubyracer
View
@@ -0,0 +1,3 @@
+guard 'coffeescript', :output => 'lib', :all_on_start => true do
+ watch(%r{^lib/(.+\.coffee)$})
+end
View
@@ -1,4 +1,5 @@
# JsRoutes
+[![Build Status](https://travis-ci.org/railsware/js-routes.png)](https://travis-ci.org/railsware/js-routes)
Generates javascript file that defines all Rails named routes as javascript helpers
@@ -26,7 +27,7 @@ Also in order to flush asset pipeline cache sometimes you might need to run:
rake tmp:cache:clear
```
-This cache is not flushed on server restart in development environment.
+This cache is not flushed on server restart in development environment.
**Important:** If routes.js file is not updated after some configuration change you need to run this command again.
@@ -46,17 +47,17 @@ Available options:
* Note that currently only optional parameters (like `:format`) can be defaulted.
* Example: {:format => "json"}
* Default: {}
-* `exclude` - Array of regexps to exclude from js routes.
+* `exclude` - Array of regexps to exclude from js routes.
* Note that regexp applied to **named route** not to *URL*
* Default: []
-* `include` - Array of regexps to include in js routes.
+* `include` - Array of regexps to include in js routes.
* Note that regexp applied to **named route** not to *URL*
* Default: []
-* `namespace` - global object used to access routes.
+* `namespace` - global object used to access routes.
* Supports nested namespace like `MyProject.routes`
* Default: `Routes`
-* `prefix` - String representing a url path to prepend to all paths.
- * Example: `http://yourdomain.com`. This will cause route helpers to generate full path only.
+* `prefix` - String representing a url path to prepend to all paths.
+ * Example: `http://yourdomain.com`. This will cause route helpers to generate full path only.
* Default: blank
@@ -105,7 +106,7 @@ jQuery.extend(window, Routes)
## What about security?
-js-routes itself do not have security holes. It makes URLs
+js-routes itself do not have security holes. It makes URLs
without access protection more reachable by potential attacker.
In order to prevent this use `:exclude` option for sensitive urls like `/admin_/`
@@ -119,7 +120,7 @@ Spork.trap_method(JsRoutes, :generate!)
## Advantages over alternatives
-There are some alternatives available. Most of them has only basic feature and don't reach the level of quality I accept.
+There are some alternatives available. Most of them has only basic feature and don't reach the level of quality I accept.
Advantages of this one are:
* Rails3 support
@@ -129,4 +130,4 @@ Advantages of this one are:
#### Thanks to [Contributors](https://github.com/railsware/js-routes/contributors)
-#### Have fun
+#### Have fun
View
@@ -15,57 +15,20 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = [
"LICENSE.txt"
]
- s.files = [
- ".document",
- ".rspec",
- ".travis.yml",
- "Gemfile",
- "Gemfile.lock",
- "LICENSE.txt",
- "Rakefile",
- "Readme.md",
- "VERSION",
- "app/assets/javascripts/js-routes.js.erb",
- "js-routes.gemspec",
- "lib/js-routes.rb",
- "lib/js_routes.rb",
- "lib/js_routes/engine.rb",
- "lib/routes.js",
- "lib/tasks/js_routes.rake",
- "spec/js_routes/generated_javascript_spec.rb",
- "spec/js_routes/options_spec.rb",
- "spec/js_routes/post_rails_init_spec.rb",
- "spec/js_routes/rails_routes_compatibility_spec.rb",
- "spec/spec_helper.rb"
- ]
+ s.files = `git ls-files`.split("\n")
s.homepage = %q{http://github.com/railsware/js-routes}
s.licenses = ["MIT"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.6.0}
s.summary = %q{Brings Rails named routes to javascript}
- if s.respond_to? :specification_version then
- s.specification_version = 3
-
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<rails>, [">= 3.2"])
- s.add_development_dependency(%q<therubyracer>, [">= 0"])
- s.add_development_dependency(%q<rspec>, ["~> 2.10.0"])
- s.add_development_dependency(%q<bundler>, ["~> 1.1.0"])
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
- else
- s.add_dependency(%q<rails>, [">= 3.2"])
- s.add_dependency(%q<therubyracer>, [">= 0"])
- s.add_dependency(%q<rspec>, ["~> 2.10.0"])
- s.add_dependency(%q<bundler>, ["~> 1.1.0"])
- s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
- end
- else
- s.add_dependency(%q<rails>, [">= 3.2"])
- s.add_dependency(%q<therubyracer>, [">= 0"])
- s.add_dependency(%q<rspec>, ["~> 2.10.0"])
- s.add_dependency(%q<bundler>, ["~> 1.1.0"])
- s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
- end
+ s.add_runtime_dependency(%q<rails>, [">= 3.2"])
+ s.add_development_dependency(%q<therubyracer>, [">= 0"])
+ s.add_development_dependency(%q<rspec>, ["~> 2.10.0"])
+ s.add_development_dependency(%q<bundler>, [">= 1.1.0"])
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
+ s.add_development_dependency(%q<guard>, [">= 0"])
+ s.add_development_dependency(%q<rb-fsevent>, [">= 0"])
+ s.add_development_dependency(%q<guard-coffeescript>, [">= 0"])
end
Oops, something went wrong.

0 comments on commit cba96b8

Please sign in to comment.