js-routes 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -51,3 +51,4 @@ pkg
51
51
  .ruby-version
52
52
 
53
53
  Gemfile.lock
54
+ gemfiles/*.lock
@@ -5,6 +5,9 @@ rvm:
5
5
  - jruby-19mode
6
6
  - ruby-head
7
7
  - jruby-head
8
+ gemfile:
9
+ - gemfiles/rails32.gemfile
10
+ - gemfiles/rails40.gemfile
8
11
  notifications:
9
12
  email:
10
13
  - agresso@gmail.com
@@ -0,0 +1,10 @@
1
+ appraise "rails32" do
2
+ gem "rails", "~> 3.2.14"
3
+ gem "js-routes", :path => "../"
4
+ end
5
+
6
+ appraise "rails40" do
7
+ gem "rails", "4.0.0"
8
+ gem "minitest", "~> 4.0"
9
+ gem "js-routes", :path => "../"
10
+ end
data/Rakefile CHANGED
@@ -1,5 +1,4 @@
1
1
  # encoding: utf-8
2
-
3
2
  require 'rubygems'
4
3
  require 'bundler'
5
4
  begin
@@ -12,14 +11,10 @@ end
12
11
  require 'bundler/gem_tasks'
13
12
  require 'rspec/core'
14
13
  require 'rspec/core/rake_task'
14
+ require 'appraisal'
15
15
 
16
- RSpec::Core::RakeTask.new(:spec) do |spec|
17
- spec.pattern = FileList['spec/**/*_spec.rb'].sort_by do|n|
18
- # we need to run post_rails_init_spec as the latest
19
- # because it cause unrevertable changes to runtime
20
- n.include?("post_rails_init_spec") ? 1 : 0
21
- end
22
- end
16
+ RSpec::Core::RakeTask.new(:spec)
23
17
 
24
- task :default => :spec
18
+ task :test_all => :appraisal # test all rails
25
19
 
20
+ task :default => :spec
data/Readme.md CHANGED
@@ -61,7 +61,8 @@ Available options:
61
61
  * Default: blank
62
62
  * `camel_case` (version >= 0.8.8) - Generate camel case route names.
63
63
  * Default: false
64
- * `url_links` (version >= 0.8.9) - Generate additional url links, where url_links value is beginning of url routes (ex: http[s]://example.com).
64
+ * `url_links` (version >= 0.8.9) - Generate `*_url` links (in addition to default `*_path`), where url_links value is beginning of url routes
65
+ * Example: http[s]://example.com
65
66
  * Default: false
66
67
 
67
68
  You can generate routes files on the application side like this:
@@ -126,7 +127,7 @@ Spork.trap_method(JsRoutes, :generate!)
126
127
  There are some alternatives available. Most of them has only basic feature and don't reach the level of quality I accept.
127
128
  Advantages of this one are:
128
129
 
129
- * Rails3 support
130
+ * Rails3 & Rails4 support
130
131
  * Rich options set
131
132
  * Support Rails `#to_param` convention for seo optimized paths
132
133
  * Well tested
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "~> 3.2.14"
6
+ gem "js-routes", :path=>"../"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "rails", "4.0.0"
6
+ gem "minitest", "~> 4.0"
7
+ gem "js-routes", :path=>"../"
8
+
9
+ gemspec :path=>"../"
@@ -23,10 +23,11 @@ Gem::Specification.new do |s|
23
23
  s.summary = %q{Brings Rails named routes to javascript}
24
24
 
25
25
  s.add_runtime_dependency(%q<rails>, [">= 3.2"])
26
- s.add_development_dependency(%q<rspec>, ["~> 2.10.0"])
26
+ s.add_development_dependency(%q<rspec>, [">= 2.14.0"])
27
27
  s.add_development_dependency(%q<bundler>, [">= 1.1.0"])
28
28
  s.add_development_dependency(%q<guard>, [">= 0"])
29
29
  s.add_development_dependency(%q<guard-coffeescript>, [">= 0"])
30
+ s.add_development_dependency(%q<appraisal>, [">= 0.5.2"])
30
31
  if defined?(JRUBY_VERSION)
31
32
  s.add_development_dependency(%q<therubyrhino>, [">= 0"])
32
33
  else
@@ -10,26 +10,26 @@ class JsRoutes
10
10
  DEFAULT_PATH = File.join('app','assets','javascripts','routes.js')
11
11
 
12
12
  DEFAULTS = {
13
- :namespace => "Routes",
14
- :exclude => [],
15
- :include => //,
16
- :file => DEFAULT_PATH,
17
- :prefix => nil,
18
- :url_links => nil,
19
- :camel_case => false,
20
- :default_url_options => {}
13
+ namespace: "Routes",
14
+ exclude: [],
15
+ include: //,
16
+ file: DEFAULT_PATH,
17
+ prefix: nil,
18
+ url_links: nil,
19
+ camel_case: false,
20
+ default_url_options: {}
21
21
  }
22
22
 
23
23
  # We encode node symbols as integer to reduce the routes.js file size
24
24
  NODE_TYPES = {
25
- :GROUP => 1,
26
- :CAT => 2,
27
- :SYMBOL => 3,
28
- :OR => 4,
29
- :STAR => 5,
30
- :LITERAL => 6,
31
- :SLASH => 7,
32
- :DOT => 8
25
+ GROUP: 1,
26
+ CAT: 2,
27
+ SYMBOL: 3,
28
+ OR: 4,
29
+ STAR: 5,
30
+ LITERAL: 6,
31
+ SLASH: 7,
32
+ DOT: 8
33
33
  }
34
34
 
35
35
  LAST_OPTIONS_KEY = "options".freeze
@@ -71,7 +71,7 @@ class JsRoutes
71
71
  # full environment will be available during asset compilation.
72
72
  # This is required to ensure routes are loaded.
73
73
  def assert_usable_configuration!
74
- unless Rails.application.config.assets.initialize_on_precompile
74
+ if 3 == Rails::VERSION::MAJOR && !Rails.application.config.assets.initialize_on_precompile
75
75
  raise("Cannot precompile js-routes unless environment is initialized. Please set config.assets.initialize_on_precompile to true.")
76
76
  end
77
77
  true
@@ -101,8 +101,8 @@ class JsRoutes
101
101
 
102
102
  def deprecated_default_format
103
103
  if @options.key?(:default_format)
104
- warn("default_format option is deprecated. Use default_url_options = {:format => <format>} instead")
105
- {:format => @options[:default_format]}
104
+ warn("default_format option is deprecated. Use default_url_options = { format: <format> } instead")
105
+ { format: @options[:default_format] }
106
106
  else
107
107
  {}
108
108
  end
@@ -2,7 +2,7 @@ class JsRoutes
2
2
  class Engine < Rails::Engine
3
3
  JS_ROUTES_ASSET = 'js-routes'
4
4
 
5
- initializer 'js-routes.dependent_on_routes', :after => "sprockets.environment" do
5
+ initializer 'js-routes.dependent_on_routes', after: "sprockets.environment" do
6
6
  if Rails.application.assets.respond_to?(:register_preprocessor)
7
7
  routes = Rails.root.join('config','routes.rb')
8
8
  Rails.application.assets.register_preprocessor 'application/javascript', :'js-routes_dependent_on_routes' do |ctx,data|
@@ -1,3 +1,3 @@
1
1
  class JsRoutes
2
- VERSION = "0.9.3"
2
+ VERSION = "0.9.4"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  namespace :js do
2
2
  desc "Make a js file that will have functions that will return restful routes/urls."
3
- task :routes => :environment do
3
+ task routes: :environment do
4
4
  require "js-routes"
5
5
 
6
6
  JsRoutes.generate!
@@ -20,7 +20,7 @@ describe JsRoutes do
20
20
  end
21
21
 
22
22
  it "routes should be sorted in alphabetical order" do
23
- subject.index("book_path").should <= subject.index("inboxes_path")
23
+ expect(subject.index("book_path")).to be <= subject.index("inboxes_path")
24
24
  end
25
25
  end
26
26
 
@@ -39,7 +39,7 @@ describe JsRoutes do
39
39
  if Rails.application.instance_variable_get("@initialized")
40
40
  pending
41
41
  end
42
- File.exists?(name).should be_false
42
+ expect(File.exists?(name)).to be_false
43
43
  end
44
44
 
45
45
  after(:all) do
@@ -18,11 +18,11 @@ describe JsRoutes, "options" do
18
18
  let(:_options) { {:exclude => /^admin_/} }
19
19
 
20
20
  it "should exclude specified routes from file" do
21
- evaljs("Routes.admin_users_path").should be_nil
21
+ expect(evaljs("Routes.admin_users_path")).to be_nil
22
22
  end
23
23
 
24
24
  it "should not exclude routes not under specified pattern" do
25
- evaljs("Routes.inboxes_path()").should_not be_nil
25
+ expect(evaljs("Routes.inboxes_path()")).not_to be_nil
26
26
  end
27
27
  end
28
28
  context "when include is specified" do
@@ -30,11 +30,11 @@ describe JsRoutes, "options" do
30
30
  let(:_options) { {:include => /^admin_/} }
31
31
 
32
32
  it "should exclude specified routes from file" do
33
- evaljs("Routes.admin_users_path()").should_not be_nil
33
+ expect(evaljs("Routes.admin_users_path()")).not_to be_nil
34
34
  end
35
35
 
36
36
  it "should not exclude routes not under specified pattern" do
37
- evaljs("Routes.inboxes_path").should be_nil
37
+ expect(evaljs("Routes.inboxes_path")).to be_nil
38
38
  end
39
39
  end
40
40
 
@@ -43,12 +43,12 @@ describe JsRoutes, "options" do
43
43
  let(:_options) { {:prefix => "/myprefix/" } }
44
44
 
45
45
  it "should render routing with prefix" do
46
- evaljs("Routes.inbox_path(1)").should == "/myprefix#{routes.inbox_path(1)}"
46
+ expect(evaljs("Routes.inbox_path(1)")).to eq("/myprefix#{routes.inbox_path(1)}")
47
47
  end
48
48
 
49
49
  it "should render routing with prefix set in JavaScript" do
50
50
  evaljs("Routes.options.prefix = '/newprefix/'")
51
- evaljs("Routes.inbox_path(1)").should == "/newprefix#{routes.inbox_path(1)}"
51
+ expect(evaljs("Routes.inbox_path(1)")).to eq("/newprefix#{routes.inbox_path(1)}")
52
52
  end
53
53
 
54
54
  end
@@ -58,7 +58,7 @@ describe JsRoutes, "options" do
58
58
  let(:_options) { {:prefix => "http://localhost:3000" } }
59
59
 
60
60
  it "should render routing with prefix" do
61
- evaljs("Routes.inbox_path(1)").should == _options[:prefix] + routes.inbox_path(1)
61
+ expect(evaljs("Routes.inbox_path(1)")).to eq(_options[:prefix] + routes.inbox_path(1))
62
62
  end
63
63
  end
64
64
 
@@ -67,12 +67,12 @@ describe JsRoutes, "options" do
67
67
  let(:_options) { {:prefix => "/myprefix" } }
68
68
 
69
69
  it "should render routing with prefix" do
70
- evaljs("Routes.inbox_path(1)").should == "/myprefix#{routes.inbox_path(1)}"
70
+ expect(evaljs("Routes.inbox_path(1)")).to eq("/myprefix#{routes.inbox_path(1)}")
71
71
  end
72
72
 
73
73
  it "should render routing with prefix set in JavaScript" do
74
74
  evaljs("Routes.options.prefix = '/newprefix'")
75
- evaljs("Routes.inbox_path(1)").should == "/newprefix#{routes.inbox_path(1)}"
75
+ expect(evaljs("Routes.inbox_path(1)")).to eq("/newprefix#{routes.inbox_path(1)}")
76
76
  end
77
77
 
78
78
  end
@@ -82,31 +82,31 @@ describe JsRoutes, "options" do
82
82
  let(:_warnings) { nil }
83
83
 
84
84
  it "should render routing with default_format" do
85
- evaljs("Routes.inbox_path(1)").should == routes.inbox_path(1, :format => "json")
85
+ expect(evaljs("Routes.inbox_path(1)")).to eq(routes.inbox_path(1, :format => "json"))
86
86
  end
87
87
 
88
88
  it "should override default_format when spefified implicitly" do
89
- evaljs("Routes.inbox_path(1, {format: 'xml'})").should == routes.inbox_path(1, :format => "xml")
89
+ expect(evaljs("Routes.inbox_path(1, {format: 'xml'})")).to eq(routes.inbox_path(1, :format => "xml"))
90
90
  end
91
91
 
92
92
  it "should override nullify implicitly when specified implicitly" do
93
- evaljs("Routes.inbox_path(1, {format: null})").should == routes.inbox_path(1)
93
+ expect(evaljs("Routes.inbox_path(1, {format: null})")).to eq(routes.inbox_path(1))
94
94
  end
95
95
 
96
96
  it "shouldn't include the format when {:format => false} is specified" do
97
- evaljs("Routes.no_format_path()").should == routes.no_format_path
97
+ expect(evaljs("Routes.no_format_path()")).to eq(routes.no_format_path)
98
98
  end
99
99
 
100
100
  it "shouldn't require the format" do
101
- evaljs("Routes.json_only_path()").should == routes.json_only_path(:format => 'json')
101
+ expect(evaljs("Routes.json_only_path()")).to eq(routes.json_only_path(:format => 'json'))
102
102
  end
103
103
  end
104
104
 
105
105
  describe "when namespace option is specified" do
106
106
  let(:_options) { {:namespace => "PHM"} }
107
107
  it "should use this namespace for routing" do
108
- evaljs("window.Routes").should be_nil
109
- evaljs("PHM.inbox_path").should_not be_nil
108
+ expect(evaljs("window.Routes")).to be_nil
109
+ expect(evaljs("PHM.inbox_path")).not_to be_nil
110
110
  end
111
111
  end
112
112
 
@@ -115,14 +115,14 @@ describe JsRoutes, "options" do
115
115
  let(:_presetup) { "window.PHM = {}" }
116
116
  let(:_options) { {:namespace => "PHM.Routes"} }
117
117
  it "should use this namespace for routing" do
118
- evaljs("PHM.Routes.inbox_path").should_not be_nil
118
+ expect(evaljs("PHM.Routes.inbox_path")).not_to be_nil
119
119
  end
120
120
  end
121
121
 
122
122
  context "but undefined on client" do
123
123
  let(:_options) { {:namespace => "PHM.Routes"} }
124
124
  it "should initialize namespace" do
125
- evaljs("window.PHM.Routes.inbox_path").should_not be_nil
125
+ expect(evaljs("window.PHM.Routes.inbox_path")).not_to be_nil
126
126
  end
127
127
  end
128
128
 
@@ -130,8 +130,8 @@ describe JsRoutes, "options" do
130
130
  let(:_presetup) { "window.PHM = { Utils: {} };" }
131
131
  let(:_options) { {:namespace => "PHM.Routes"} }
132
132
  it "should not overwrite existing parts" do
133
- evaljs("window.PHM.Utils").should_not be_nil
134
- evaljs("window.PHM.Routes.inbox_path").should_not be_nil
133
+ expect(evaljs("window.PHM.Utils")).not_to be_nil
134
+ expect(evaljs("window.PHM.Routes.inbox_path")).not_to be_nil
135
135
  end
136
136
  end
137
137
  end
@@ -140,7 +140,7 @@ describe JsRoutes, "options" do
140
140
  context "with optional route parts" do
141
141
  let(:_options) { {:default_url_options => {:optional_id => "12", :format => "json"}}}
142
142
  it "should use this opions to fill optional parameters" do
143
- evaljs("Routes.things_path()").should == routes.things_path(:optional_id => 12, :format => "json")
143
+ expect(evaljs("Routes.things_path()")).to eq(routes.things_path(:optional_id => 12, :format => "json"))
144
144
  end
145
145
  end
146
146
 
@@ -148,7 +148,7 @@ describe JsRoutes, "options" do
148
148
  let(:_options) { {:default_url_options => {:inbox_id => "12"}} }
149
149
  it "should use this opions to fill optional parameters" do
150
150
  pending
151
- evaljs("Routes.inbox_messages_path()").should == routes.inbox_messages_path(:inbox_id => 12)
151
+ expect(evaljs("Routes.inbox_messages_path()")).to eq(routes.inbox_messages_path(:inbox_id => 12))
152
152
  end
153
153
  end
154
154
  end
@@ -157,18 +157,18 @@ describe JsRoutes, "options" do
157
157
  context "with default option" do
158
158
  let(:_options) { Hash.new }
159
159
  it "should use snake case routes" do
160
- evaljs("Routes.inbox_path(1)").should == routes.inbox_path(1)
161
- evaljs("Routes.inboxPath").should be_nil
160
+ expect(evaljs("Routes.inbox_path(1)")).to eq(routes.inbox_path(1))
161
+ expect(evaljs("Routes.inboxPath")).to be_nil
162
162
  end
163
163
  end
164
164
 
165
165
  context "with true" do
166
166
  let(:_options) { { :camel_case => true } }
167
167
  it "should generate camel case routes" do
168
- evaljs("Routes.inbox_path").should be_nil
169
- evaljs("Routes.inboxPath").should_not be_nil
170
- evaljs("Routes.inboxPath(1)").should == routes.inbox_path(1)
171
- evaljs("Routes.inboxMessagesPath(10)").should == routes.inbox_messages_path(:inbox_id => 10)
168
+ expect(evaljs("Routes.inbox_path")).to be_nil
169
+ expect(evaljs("Routes.inboxPath")).not_to be_nil
170
+ expect(evaljs("Routes.inboxPath(1)")).to eq(routes.inbox_path(1))
171
+ expect(evaljs("Routes.inboxMessagesPath(10)")).to eq(routes.inbox_messages_path(:inbox_id => 10))
172
172
  end
173
173
  end
174
174
  end
@@ -177,19 +177,19 @@ describe JsRoutes, "options" do
177
177
  context "with default option" do
178
178
  let(:_options) { Hash.new }
179
179
  it "should generate only path links" do
180
- evaljs("Routes.inbox_path(1)").should == routes.inbox_path(1)
181
- evaljs("Routes.inbox_url").should be_nil
180
+ expect(evaljs("Routes.inbox_path(1)")).to eq(routes.inbox_path(1))
181
+ expect(evaljs("Routes.inbox_url")).to be_nil
182
182
  end
183
183
  end
184
184
 
185
185
  context "with host" do
186
186
  let(:_options) { { :url_links => "http://localhost" } }
187
187
  it "should generate path and url links" do
188
- evaljs("Routes.inbox_path").should_not be_nil
189
- evaljs("Routes.inbox_url").should_not be_nil
190
- evaljs("Routes.inbox_path(1)").should == routes.inbox_path(1)
191
- evaljs("Routes.inbox_url(1)").should == "http://localhost#{routes.inbox_path(1)}"
192
- evaljs("Routes.inbox_url(1, { test_key: \"test_val\" })").should == "http://localhost#{routes.inbox_path(1, :test_key => "test_val")}"
188
+ expect(evaljs("Routes.inbox_path")).not_to be_nil
189
+ expect(evaljs("Routes.inbox_url")).not_to be_nil
190
+ expect(evaljs("Routes.inbox_path(1)")).to eq(routes.inbox_path(1))
191
+ expect(evaljs("Routes.inbox_url(1)")).to eq("http://localhost#{routes.inbox_path(1)}")
192
+ expect(evaljs("Routes.inbox_url(1, { test_key: \"test_val\" })")).to eq("http://localhost#{routes.inbox_path(1, :test_key => "test_val")}")
193
193
  end
194
194
  end
195
195
 
@@ -202,20 +202,20 @@ describe JsRoutes, "options" do
202
202
  context "with host and camel_case" do
203
203
  let(:_options) { { :camel_case => true, :url_links => "http://localhost" } }
204
204
  it "should generate path and url links" do
205
- evaljs("Routes.inboxPath").should_not be_nil
206
- evaljs("Routes.inboxUrl").should_not be_nil
207
- evaljs("Routes.inboxPath(1)").should == routes.inbox_path(1)
208
- evaljs("Routes.inboxUrl(1)").should == "http://localhost#{routes.inbox_path(1)}"
205
+ expect(evaljs("Routes.inboxPath")).not_to be_nil
206
+ expect(evaljs("Routes.inboxUrl")).not_to be_nil
207
+ expect(evaljs("Routes.inboxPath(1)")).to eq(routes.inbox_path(1))
208
+ expect(evaljs("Routes.inboxUrl(1)")).to eq("http://localhost#{routes.inbox_path(1)}")
209
209
  end
210
210
  end
211
211
 
212
212
  context "with host and prefix" do
213
213
  let(:_options) { { :prefix => "/api", :url_links => "https://example.com" } }
214
214
  it "should generate path and url links" do
215
- evaljs("Routes.inbox_path").should_not be_nil
216
- evaljs("Routes.inbox_url").should_not be_nil
217
- evaljs("Routes.inbox_path(1)").should == "/api#{routes.inbox_path(1)}"
218
- evaljs("Routes.inbox_url(1)").should == "https://example.com/api#{routes.inbox_path(1)}"
215
+ expect(evaljs("Routes.inbox_path")).not_to be_nil
216
+ expect(evaljs("Routes.inbox_url")).not_to be_nil
217
+ expect(evaljs("Routes.inbox_path(1)")).to eq("/api#{routes.inbox_path(1)}")
218
+ expect(evaljs("Routes.inbox_url(1)")).to eq("https://example.com/api#{routes.inbox_path(1)}")
219
219
  end
220
220
  end
221
221
  end
@@ -6,111 +6,114 @@ describe JsRoutes, "compatibility with Rails" do
6
6
  evaljs(JsRoutes.generate({}))
7
7
  end
8
8
 
9
-
10
9
  it "should generate collection routing" do
11
- evaljs("Routes.inboxes_path()").should == routes.inboxes_path()
10
+ expect(evaljs("Routes.inboxes_path()")).to eq(routes.inboxes_path())
12
11
  end
13
12
 
14
13
  it "should generate member routing" do
15
- evaljs("Routes.inbox_path(1)").should == routes.inbox_path(1)
14
+ expect(evaljs("Routes.inbox_path(1)")).to eq(routes.inbox_path(1))
16
15
  end
17
16
 
18
17
  it "should support 0 as a member parameter" do
19
- evaljs("Routes.inbox_path(0)").should == routes.inbox_path(0)
18
+ expect(evaljs("Routes.inbox_path(0)")).to eq(routes.inbox_path(0))
20
19
  end
21
20
 
22
21
  it "should generate nested routing with one parameter" do
23
- evaljs("Routes.inbox_messages_path(1)").should == routes.inbox_messages_path(1)
22
+ expect(evaljs("Routes.inbox_messages_path(1)")).to eq(routes.inbox_messages_path(1))
24
23
  end
25
24
 
26
25
  it "should generate nested routing" do
27
- evaljs("Routes.inbox_message_path(1,2)").should == routes.inbox_message_path(1, 2)
26
+ expect(evaljs("Routes.inbox_message_path(1,2)")).to eq(routes.inbox_message_path(1, 2))
28
27
  end
29
28
 
30
29
  it "should generate routing with format" do
31
- evaljs("Routes.inbox_path(1, {format: 'json'})").should == routes.inbox_path(1, :format => "json")
32
- end
33
-
34
- it "should support simple get parameters" do
35
- evaljs("Routes.inbox_path(1, {format: 'json', lang: 'ua', q: 'hello'})").should == routes.inbox_path(1, :lang => "ua", :q => "hello", :format => "json")
36
- end
37
-
38
- it "should support array get parameters" do
39
- evaljs("Routes.inbox_path(1, {hello: ['world', 'mars']})").should == routes.inbox_path(1, :hello => [:world, :mars])
40
- end
41
-
42
- it "should support nested get parameters" do
43
- evaljs("Routes.inbox_path(1, {format: 'json', env: 'test', search: { category_ids: [2,5], q: 'hello'}})").should ==
44
- routes.inbox_path(1, :env => 'test', :search => {:category_ids => [2,5], :q => "hello"}, :format => "json")
45
- end
46
-
47
- it "should support null and undefined parameters" do
48
- evaljs("Routes.inboxes_path({uri: null, key: undefined})").should == routes.inboxes_path(:uri => nil, :key => nil)
49
- end
50
-
51
- it "should escape get parameters" do
52
- evaljs("Routes.inboxes_path({uri: 'http://example.com'})").should == routes.inboxes_path(:uri => 'http://example.com')
30
+ expect(evaljs("Routes.inbox_path(1, {format: 'json'})")).to eq(routes.inbox_path(1, :format => "json"))
53
31
  end
54
32
 
55
33
  it "should support routes with reserved javascript words as parameters" do
56
- evaljs("Routes.object_path(1, 2)").should == routes.object_path(1,2)
34
+ expect(evaljs("Routes.object_path(1, 2)")).to eq(routes.object_path(1,2))
57
35
  end
58
36
 
59
37
  it "should support url anchor given as parameter" do
60
- evaljs("Routes.inbox_path(1, {anchor: 'hello'})").should == routes.inbox_path(1, :anchor => "hello")
38
+ expect(evaljs("Routes.inbox_path(1, {anchor: 'hello'})")).to eq(routes.inbox_path(1, :anchor => "hello"))
61
39
  end
62
40
 
63
41
  it "should support url anchor and get parameters" do
64
- evaljs("Routes.inbox_path(1, {expanded: true, anchor: 'hello'})").should == routes.inbox_path(1, :expanded => true, :anchor => "hello")
42
+ expect(evaljs("Routes.inbox_path(1, {expanded: true, anchor: 'hello'})")).to eq(routes.inbox_path(1, :expanded => true, :anchor => "hello"))
65
43
  end
66
44
 
67
45
  it "should support engine routes" do
68
- evaljs("Routes.blog_app_posts_path()").should == blog_routes.posts_path()
46
+ expect(evaljs("Routes.blog_app_posts_path()")).to eq(blog_routes.posts_path())
69
47
  end
70
48
 
71
49
  it "should support engine routes with parameter" do
72
- evaljs("Routes.blog_app_post_path(1)").should == blog_routes.post_path(1)
50
+ expect(evaljs("Routes.blog_app_post_path(1)")).to eq(blog_routes.post_path(1))
73
51
  end
74
52
 
75
53
  it "shouldn't require the format" do
76
- evaljs("Routes.json_only_path({format: 'json'})").should == routes.json_only_path(:format => 'json')
54
+ expect(evaljs("Routes.json_only_path({format: 'json'})")).to eq(routes.json_only_path(:format => 'json'))
77
55
  end
78
56
 
79
57
  it "should support utf-8 route" do
80
- evaljs("Routes.hello_path()").should == routes.hello_path
58
+ expect(evaljs("Routes.hello_path()")).to eq(routes.hello_path)
81
59
  end
82
60
 
83
61
  it "should support root_path" do
84
- evaljs("Routes.root_path()").should == routes.root_path
62
+ expect(evaljs("Routes.root_path()")).to eq(routes.root_path)
85
63
  end
86
64
 
65
+ describe "get paramters" do
66
+ it "should support simple get parameters" do
67
+ expect(evaljs("Routes.inbox_path(1, {format: 'json', lang: 'ua', q: 'hello'})")).to eq(routes.inbox_path(1, :lang => "ua", :q => "hello", :format => "json"))
68
+ end
69
+
70
+ it "should support array get parameters" do
71
+ expect(evaljs("Routes.inbox_path(1, {hello: ['world', 'mars']})")).to eq(routes.inbox_path(1, :hello => [:world, :mars]))
72
+ end
73
+
74
+ it "should support nested get parameters" do
75
+ expect(evaljs("Routes.inbox_path(1, {format: 'json', env: 'test', search: { category_ids: [2,5], q: 'hello'}})")).to eq(
76
+ routes.inbox_path(1, :env => 'test', :search => {:category_ids => [2,5], :q => "hello"}, :format => "json")
77
+ )
78
+ end
79
+
80
+ it "should support null and undefined parameters" do
81
+ expect(evaljs("Routes.inboxes_path({uri: null, key: undefined})")).to eq(routes.inboxes_path(:uri => nil, :key => nil))
82
+ end
83
+
84
+ it "should escape get parameters" do
85
+ expect(evaljs("Routes.inboxes_path({uri: 'http://example.com'})")).to eq(routes.inboxes_path(:uri => 'http://example.com'))
86
+ end
87
+ end
88
+
89
+
87
90
  context "routes globbing" do
88
91
  it "should be supported as parameters" do
89
- evaljs("Routes.book_path('thrillers', 1)").should == routes.book_path('thrillers', 1)
92
+ expect(evaljs("Routes.book_path('thrillers', 1)")).to eq(routes.book_path('thrillers', 1))
90
93
  end
91
94
 
92
95
  it "should support routes globbing as array" do
93
- evaljs("Routes.book_path(['thrillers'], 1)").should == routes.book_path(['thrillers'], 1)
96
+ expect(evaljs("Routes.book_path(['thrillers'], 1)")).to eq(routes.book_path(['thrillers'], 1))
94
97
  end
95
98
 
96
99
  it "should bee support routes globbing as array" do
97
- evaljs("Routes.book_path([1, 2, 3], 1)").should == routes.book_path([1, 2, 3], 1)
100
+ expect(evaljs("Routes.book_path([1, 2, 3], 1)")).to eq(routes.book_path([1, 2, 3], 1))
98
101
  end
99
102
 
100
103
  it "should bee support routes globbing as hash" do
101
- evaljs("Routes.book_path('a_test/b_test/c_test', 1)").should == routes.book_path('a_test/b_test/c_test', 1)
104
+ expect(evaljs("Routes.book_path('a_test/b_test/c_test', 1)")).to eq(routes.book_path('a_test/b_test/c_test', 1))
102
105
  end
103
106
 
104
107
  it "should support routes globbing as array with optional params" do
105
- evaljs("Routes.book_path([1, 2, 3, 5], 1, {c: '1'})").should == routes.book_path([1, 2, 3, 5], 1, { :c => "1" })
108
+ expect(evaljs("Routes.book_path([1, 2, 3, 5], 1, {c: '1'})")).to eq(routes.book_path([1, 2, 3, 5], 1, { :c => "1" }))
106
109
  end
107
110
 
108
111
  it "should support routes globbing in book_title route as array" do
109
- evaljs("Routes.book_title_path('john', ['thrillers', 'comedian'])").should == routes.book_title_path('john', ['thrillers', 'comedian'])
112
+ expect(evaljs("Routes.book_title_path('john', ['thrillers', 'comedian'])")).to eq(routes.book_title_path('john', ['thrillers', 'comedian']))
110
113
  end
111
114
 
112
115
  it "should support routes globbing in book_title route as array with optional params" do
113
- evaljs("Routes.book_title_path('john', ['thrillers', 'comedian'], {some_key: 'some_value'})").should == routes.book_title_path('john', ['thrillers', 'comedian'], {:some_key => 'some_value'})
116
+ expect(evaljs("Routes.book_title_path('john', ['thrillers', 'comedian'], {some_key: 'some_value'})")).to eq(routes.book_title_path('john', ['thrillers', 'comedian'], {:some_key => 'some_value'}))
114
117
  end
115
118
  end
116
119
 
@@ -123,9 +126,9 @@ describe JsRoutes, "compatibility with Rails" do
123
126
 
124
127
  shared_examples_for "serialization" do
125
128
  it "should support serialization of objects" do
126
- evaljs("window.jQuery.param(#{_value.to_json})").should == _value.to_param
127
- evaljs("Routes.inboxes_path(#{_value.to_json})").should == routes.inboxes_path(_value)
128
- evaljs("Routes.inbox_path(1, #{_value.to_json})").should == routes.inbox_path(1, _value)
129
+ expect(evaljs("window.jQuery.param(#{_value.to_json})")).to eq(_value.to_param)
130
+ expect(evaljs("Routes.inboxes_path(#{_value.to_json})")).to eq(routes.inboxes_path(_value))
131
+ expect(evaljs("Routes.inbox_path(1, #{_value.to_json})")).to eq(routes.inbox_path(1, _value))
129
132
  end
130
133
  end
131
134
  context "when parameters is a hash" do
@@ -145,33 +148,33 @@ describe JsRoutes, "compatibility with Rails" do
145
148
  context "using optional path fragments" do
146
149
  context "including not optional parts" do
147
150
  it "should include everything that is not optional" do
148
- evaljs("Routes.foo_path()").should == routes.foo_path
151
+ expect(evaljs("Routes.foo_path()")).to eq(routes.foo_path)
149
152
  end
150
153
  end
151
154
 
152
155
  context "but not including them" do
153
156
  it "should not include the optional parts" do
154
- evaljs("Routes.things_path()").should == routes.things_path
157
+ expect(evaljs("Routes.things_path()")).to eq(routes.things_path)
155
158
  end
156
159
 
157
160
  it "should not require the optional parts as arguments" do
158
161
  #TODO: fix this inconsistence
159
162
  pending
160
- evaljs("Routes.thing_path(null, 5)").should == routes.thing_path(nil, 5)
163
+ expect(evaljs("Routes.thing_path(null, 5)")).to eq(routes.thing_path(nil, 5))
161
164
  end
162
165
 
163
166
  it "should treat undefined as non-given optional part" do
164
- evaljs("Routes.thing_path(5, {optional_id: undefined})").should == routes.thing_path(5, :optional_id => nil)
167
+ expect(evaljs("Routes.thing_path(5, {optional_id: undefined})")).to eq(routes.thing_path(5, :optional_id => nil))
165
168
  end
166
169
 
167
170
  it "should treat null as non-given optional part" do
168
- evaljs("Routes.thing_path(5, {optional_id: null})").should == routes.thing_path(5, :optional_id => nil)
171
+ expect(evaljs("Routes.thing_path(5, {optional_id: null})")).to eq(routes.thing_path(5, :optional_id => nil))
169
172
  end
170
173
  end
171
174
 
172
175
  context "and including them" do
173
176
  it "should include the optional parts" do
174
- evaljs("Routes.things_path({optional_id: 5})").should == routes.things_path(:optional_id => 5)
177
+ expect(evaljs("Routes.things_path({optional_id: 5})")).to eq(routes.things_path(:optional_id => 5))
175
178
  end
176
179
  end
177
180
  end
@@ -179,20 +182,20 @@ describe JsRoutes, "compatibility with Rails" do
179
182
  context "when wrong parameters given" do
180
183
 
181
184
  it "should throw Exception if not enough parameters" do
182
- lambda {
185
+ expect {
183
186
  evaljs("Routes.inbox_path()")
184
- }.should raise_error(js_error_class)
187
+ }.to raise_error(js_error_class)
185
188
  end
186
189
  it "should throw Exception if required parameter is not defined" do
187
- lambda {
190
+ expect {
188
191
  evaljs("Routes.inbox_path(null)")
189
- }.should raise_error(js_error_class)
192
+ }.to raise_error(js_error_class)
190
193
  end
191
194
 
192
195
  it "should throw Exceptions if when there is too many parameters" do
193
- lambda {
196
+ expect {
194
197
  evaljs("Routes.inbox_path(1,2)")
195
- }.should raise_error(js_error_class)
198
+ }.to raise_error(js_error_class)
196
199
  end
197
200
  end
198
201
 
@@ -201,7 +204,7 @@ describe JsRoutes, "compatibility with Rails" do
201
204
  evaljs("Array.prototype.indexOf = null")
202
205
  end
203
206
  it "should still work correctly" do
204
- evaljs("Routes.inboxes_path()").should == routes.inboxes_path()
207
+ expect(evaljs("Routes.inboxes_path()")).to eq(routes.inboxes_path())
205
208
  end
206
209
  end
207
210
 
@@ -210,44 +213,44 @@ describe JsRoutes, "compatibility with Rails" do
210
213
  let(:inbox) {Struct.new(:id, :to_param).new(1,"my")}
211
214
 
212
215
  it "should use id property of the object in path" do
213
- evaljs("Routes.inbox_path({id: 1})").should == routes.inbox_path(1)
216
+ expect(evaljs("Routes.inbox_path({id: 1})")).to eq(routes.inbox_path(1))
214
217
  end
215
218
 
216
219
  it "should prefer to_param property over id property" do
217
- evaljs("Routes.inbox_path({id: 1, to_param: 'my'})").should == routes.inbox_path(inbox)
220
+ expect(evaljs("Routes.inbox_path({id: 1, to_param: 'my'})")).to eq(routes.inbox_path(inbox))
218
221
  end
219
222
 
220
223
  it "should call to_param if it is a function" do
221
- evaljs("Routes.inbox_path({id: 1, to_param: function(){ return 'my';}})").should == routes.inbox_path(inbox)
224
+ expect(evaljs("Routes.inbox_path({id: 1, to_param: function(){ return 'my';}})")).to eq(routes.inbox_path(inbox))
222
225
  end
223
226
 
224
227
  it "should call id if it is a function" do
225
- evaljs("Routes.inbox_path({id: function() { return 1;}})").should == routes.inbox_path(1)
228
+ expect(evaljs("Routes.inbox_path({id: function() { return 1;}})")).to eq(routes.inbox_path(1))
226
229
  end
227
230
 
228
231
  it "should support options argument" do
229
- evaljs(
232
+ expect(evaljs(
230
233
  "Routes.inbox_message_path({id:1, to_param: 'my'}, {id:2}, {custom: true, format: 'json'})"
231
- ).should == routes.inbox_message_path(inbox, 2, :custom => true, :format => "json")
234
+ )).to eq(routes.inbox_message_path(inbox, 2, :custom => true, :format => "json"))
232
235
  end
233
236
 
234
237
  context "when globbing" do
235
238
  it "should prefer to_param property over id property" do
236
- evaljs("Routes.book_path({id: 1, to_param: 'my'}, 1)").should == routes.book_path(inbox, 1)
239
+ expect(evaljs("Routes.book_path({id: 1, to_param: 'my'}, 1)")).to eq(routes.book_path(inbox, 1))
237
240
  end
238
241
 
239
242
  it "should call to_param if it is a function" do
240
- evaljs("Routes.book_path({id: 1, to_param: function(){ return 'my';}}, 1)").should == routes.book_path(inbox, 1)
243
+ expect(evaljs("Routes.book_path({id: 1, to_param: function(){ return 'my';}}, 1)")).to eq(routes.book_path(inbox, 1))
241
244
  end
242
245
 
243
246
  it "should call id if it is a function" do
244
- evaljs("Routes.book_path({id: function() { return 'technical';}}, 1)").should == routes.book_path('technical', 1)
247
+ expect(evaljs("Routes.book_path({id: function() { return 'technical';}}, 1)")).to eq(routes.book_path('technical', 1))
245
248
  end
246
249
 
247
250
  it "should support options argument" do
248
- evaljs(
251
+ expect(evaljs(
249
252
  "Routes.book_path({id:1, to_param: 'my'}, {id:2}, {custom: true, format: 'json'})"
250
- ).should == routes.book_path(inbox, 2, :custom => true, :format => "json")
253
+ )).to eq(routes.book_path(inbox, 2, :custom => true, :format => "json"))
251
254
  end
252
255
  end
253
256
  end
@@ -1,50 +1,48 @@
1
+
2
+ # we need to run post_rails_init_spec as the latest
3
+ # because it cause unrevertable changes to runtime
4
+ # what is why I added "zzz_last" in the beginning
1
5
  require 'spec_helper'
2
6
  require "fileutils"
3
7
 
4
8
  describe "after Rails initialization" do
5
- let(:name) { "#{File.dirname(__FILE__)}/../routes.js" }
9
+ NAME = "#{File.dirname(__FILE__)}/../routes.js"
6
10
 
7
11
  before(:all) do
8
-
9
- FileUtils.rm_f(name)
10
- JsRoutes.generate!(name)
11
-
12
-
12
+ FileUtils.rm_f(NAME)
13
+ JsRoutes.generate!(NAME)
13
14
  Rails.application.initialize!
14
15
  end
15
16
 
16
17
  after(:all) do
17
- FileUtils.rm_f(name)
18
+ FileUtils.rm_f(NAME)
18
19
  end
19
20
 
20
21
  it "should generate routes file" do
21
- File.exists?(name).should be_true
22
+ expect(File.exists?(NAME)).to be_true
22
23
  end
23
24
 
24
25
  context "JsRoutes::Engine" do
25
-
26
- let(:test_asset_path) {
27
- Rails.root.join('app','assets','javascripts','test.js')
28
- }
26
+ TEST_ASSET_PATH = Rails.root.join('app','assets','javascripts','test.js')
29
27
 
30
28
  before(:all) do
31
- File.open(test_asset_path,'w') do |f|
29
+ File.open(TEST_ASSET_PATH,'w') do |f|
32
30
  f.puts "function() {}"
33
31
  end
34
32
  end
35
33
  after(:all) do
36
- FileUtils.rm_f(test_asset_path)
34
+ FileUtils.rm_f(TEST_ASSET_PATH)
37
35
  end
38
36
 
39
37
  it "should have registered a preprocessor" do
40
38
  pps = Rails.application.assets.preprocessors
41
39
  js_pps = pps['application/javascript']
42
- js_pps.map(&:name).should include('Sprockets::Processor (js-routes_dependent_on_routes)')
40
+ expect(js_pps.map(&:name)).to include('Sprockets::Processor (js-routes_dependent_on_routes)')
43
41
  end
44
42
 
45
43
  context "the preprocessor" do
46
44
  before(:each) do
47
- ctx.should_receive(:depend_on).with(Rails.root.join('config','routes.rb'))
45
+ expect(ctx).to receive(:depend_on).with(Rails.root.join('config','routes.rb'))
48
46
  end
49
47
  let!(:ctx) do
50
48
  Sprockets::Context.new(Rails.application.assets,
@@ -55,21 +53,25 @@ describe "after Rails initialization" do
55
53
  context "when dealing with js-routes.js" do
56
54
 
57
55
 
58
- context "with Rails 3.1.1" do
56
+ context "with Rails" do
59
57
  context "and initialize on precompile" do
60
58
  before(:each) do
61
59
  Rails.application.config.assets.initialize_on_precompile = true
62
60
  end
63
61
  it "should render some javascript" do
64
- ctx.evaluate('js-routes.js').should =~ /window\.Routes/
62
+ expect(ctx.evaluate('js-routes.js')).to match(/window\.Routes/)
65
63
  end
66
64
  end
67
65
  context "and not initialize on precompile" do
68
66
  before(:each) do
69
67
  Rails.application.config.assets.initialize_on_precompile = false
70
68
  end
71
- it "should raise an exception" do
72
- lambda { ctx.evaluate('js-routes.js') }.should raise_error(/Cannot precompile/)
69
+ it "should raise an exception if 3 version" do
70
+ if 3 == Rails::VERSION::MAJOR
71
+ expect { ctx.evaluate('js-routes.js') }.to raise_error(/Cannot precompile/)
72
+ else
73
+ expect(ctx.evaluate('js-routes.js')).to match(/window\.Routes/)
74
+ end
73
75
  end
74
76
  end
75
77
 
@@ -82,8 +84,8 @@ describe "after Rails initialization" do
82
84
  it "should not depend on routes.rb" do
83
85
  ctx = Sprockets::Context.new(Rails.application.assets,
84
86
  'test.js',
85
- test_asset_path)
86
- ctx.should_not_receive(:depend_on)
87
+ TEST_ASSET_PATH)
88
+ expect(ctx).not_to receive(:depend_on)
87
89
  ctx.evaluate('test.js')
88
90
  end
89
91
  end
@@ -15,16 +15,20 @@ else
15
15
  JS_LIB_CLASS = V8
16
16
  end
17
17
 
18
- def jscontext
19
- @context ||= JS_LIB_CLASS::Context.new
18
+ def jscontext(force = false)
19
+ if force
20
+ @jscontext = JS_LIB_CLASS::Context.new
21
+ else
22
+ @jscontext ||= JS_LIB_CLASS::Context.new
23
+ end
20
24
  end
21
25
 
22
26
  def js_error_class
23
27
  JS_LIB_CLASS::JSError
24
28
  end
25
29
 
26
- def evaljs(string)
27
- jscontext.eval(string)
30
+ def evaljs(string, force = false)
31
+ jscontext(force).eval(string)
28
32
  end
29
33
 
30
34
  def routes
@@ -102,11 +106,10 @@ Rails.configuration.active_support.deprecation = :log
102
106
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
103
107
 
104
108
  RSpec.configure do |config|
105
-
106
- config.before(:each) do
107
- evaljs("var window = this;")
108
- jscontext[:log] = lambda {|context, value| puts value.inspect}
109
+ config.expect_with :rspec do |c|
110
+ c.syntax = :expect
109
111
  end
112
+
110
113
  config.before(:all) do
111
114
  # compile all js files begin
112
115
  Dir["#{File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))}/**/*.coffee"].each do |coffee|
@@ -115,4 +118,9 @@ RSpec.configure do |config|
115
118
  # compile all js files end
116
119
  draw_routes
117
120
  end
121
+
122
+ config.before :each do
123
+ evaljs("var window = this;", true)
124
+ jscontext[:log] = lambda {|context, value| puts value.inspect}
125
+ end
118
126
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: js-routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Bogdan Gusiev
@@ -13,99 +14,129 @@ dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rails
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '3.2'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - '>='
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '3.2'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rspec
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - ~>
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
- version: 2.10.0
37
+ version: 2.14.0
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - ~>
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
- version: 2.10.0
45
+ version: 2.14.0
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: bundler
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - '>='
51
+ - - ! '>='
46
52
  - !ruby/object:Gem::Version
47
53
  version: 1.1.0
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - '>='
59
+ - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: 1.1.0
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: guard
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - '>='
67
+ - - ! '>='
60
68
  - !ruby/object:Gem::Version
61
69
  version: '0'
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - '>='
75
+ - - ! '>='
67
76
  - !ruby/object:Gem::Version
68
77
  version: '0'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: guard-coffeescript
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - '>='
83
+ - - ! '>='
74
84
  - !ruby/object:Gem::Version
75
85
  version: '0'
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - '>='
91
+ - - ! '>='
81
92
  - !ruby/object:Gem::Version
82
93
  version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: appraisal
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: 0.5.2
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 0.5.2
83
110
  - !ruby/object:Gem::Dependency
84
111
  name: debugger
85
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
86
114
  requirements:
87
- - - '>='
115
+ - - ! '>='
88
116
  - !ruby/object:Gem::Version
89
117
  version: '0'
90
118
  type: :development
91
119
  prerelease: false
92
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
93
122
  requirements:
94
- - - '>='
123
+ - - ! '>='
95
124
  - !ruby/object:Gem::Version
96
125
  version: '0'
97
126
  - !ruby/object:Gem::Dependency
98
127
  name: therubyracer
99
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
100
130
  requirements:
101
- - - '>='
131
+ - - ! '>='
102
132
  - !ruby/object:Gem::Version
103
133
  version: '0'
104
134
  type: :development
105
135
  prerelease: false
106
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
107
138
  requirements:
108
- - - '>='
139
+ - - ! '>='
109
140
  - !ruby/object:Gem::Version
110
141
  version: '0'
111
142
  description: Generates javascript file that defines all Rails named routes as javascript
@@ -120,12 +151,15 @@ files:
120
151
  - .gitignore
121
152
  - .rspec
122
153
  - .travis.yml
154
+ - Appraisals
123
155
  - Gemfile
124
156
  - Guardfile
125
157
  - LICENSE.txt
126
158
  - Rakefile
127
159
  - Readme.md
128
160
  - app/assets/javascripts/js-routes.js.erb
161
+ - gemfiles/rails32.gemfile
162
+ - gemfiles/rails40.gemfile
129
163
  - js-routes.gemspec
130
164
  - lib/js-routes.rb
131
165
  - lib/js_routes.rb
@@ -136,31 +170,35 @@ files:
136
170
  - lib/tasks/js_routes.rake
137
171
  - spec/js_routes/generated_javascript_spec.rb
138
172
  - spec/js_routes/options_spec.rb
139
- - spec/js_routes/post_rails_init_spec.rb
140
173
  - spec/js_routes/rails_routes_compatibility_spec.rb
174
+ - spec/js_routes/zzz_last_post_rails_init_spec.rb
141
175
  - spec/spec_helper.rb
142
176
  homepage: http://github.com/railsware/js-routes
143
177
  licenses:
144
178
  - MIT
145
- metadata: {}
146
179
  post_install_message:
147
180
  rdoc_options: []
148
181
  require_paths:
149
182
  - lib
150
183
  required_ruby_version: !ruby/object:Gem::Requirement
184
+ none: false
151
185
  requirements:
152
- - - '>='
186
+ - - ! '>='
153
187
  - !ruby/object:Gem::Version
154
188
  version: '0'
189
+ segments:
190
+ - 0
191
+ hash: -2158756967123699365
155
192
  required_rubygems_version: !ruby/object:Gem::Requirement
193
+ none: false
156
194
  requirements:
157
- - - '>='
195
+ - - ! '>='
158
196
  - !ruby/object:Gem::Version
159
197
  version: '0'
160
198
  requirements: []
161
199
  rubyforge_project:
162
- rubygems_version: 2.0.0
200
+ rubygems_version: 1.8.25
163
201
  signing_key:
164
- specification_version: 4
202
+ specification_version: 3
165
203
  summary: Brings Rails named routes to javascript
166
204
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: be32b22dcc7600a2141329061740f8fe7e9ff6e5
4
- data.tar.gz: 64d3981fdf7cb0889ae9005c15821a6ff13b3997
5
- SHA512:
6
- metadata.gz: 50da4f85cb59aaadc6e76cecbee608617a899d22b996c4d99590c2cac89e16981087282cfc56c727939ae40018afb9b3e8eb24baad57c09f915d89ff4a2a07fe
7
- data.tar.gz: a503183633ad8570afbaa81124d3337ebc51420313b1d16d6a9d064a592882c1d413b42aa5fc5d13c113ada16a983d554a579efa5e882f2ed23a9d25428fd99d