rails-js-routes 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/.travis.yml +3 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +127 -0
- data/MIT-LICENSE +20 -0
- data/README.md +161 -0
- data/Rakefile +25 -0
- data/app/assets/javascripts/routes.js +327 -0
- data/lib/rails/js/routes.rb +10 -0
- data/lib/rails/js/routes/engine.rb +12 -0
- data/lib/rails/js/routes/version.rb +7 -0
- data/lib/rails/js/routes/view_helpers.rb +25 -0
- data/rails-js-routes.gemspec +24 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +14 -0
- data/test/dummy/app/assets/javascripts/testing.js +2 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/controllers/testing_controller.rb +6 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/testing_helper.rb +2 -0
- data/test/dummy/app/mailers/.keep +0 -0
- data/test/dummy/app/models/.keep +0 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +15 -0
- data/test/dummy/app/views/testing/index.html.erb +0 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +22 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +83 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/assets.rb +3 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/spec/javascripts/route_dispatch_spec.js +165 -0
- data/test/dummy/spec/javascripts/spec_helper.js +31 -0
- data/test/dummy/spec/teaspoon_env.rb +13 -0
- data/test/dummy/test/helpers/testing_helper_test.rb +4 -0
- data/test/teaspoon_env.rb +24 -0
- data/test/test_helper.rb +18 -0
- data/test/testing_controller_test.rb +12 -0
- metadata +178 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
// Teaspoon includes some support files, but you can use anything from your own support path too.
|
2
|
+
// require support/jasmine-jquery-1.7.0
|
3
|
+
// require support/jasmine-jquery-2.0.0
|
4
|
+
// require support/sinon
|
5
|
+
// require support/your-support-file
|
6
|
+
//
|
7
|
+
// PhantomJS (Teaspoons default driver) doesn't have support for Function.prototype.bind, which has caused confusion.
|
8
|
+
// Use this polyfill to avoid the confusion.
|
9
|
+
//= require support/bind-poly
|
10
|
+
//
|
11
|
+
// Deferring execution
|
12
|
+
// If you're using CommonJS, RequireJS or some other asynchronous library you can defer execution. Call
|
13
|
+
// Teaspoon.execute() after everything has been loaded. Simple example of a timeout:
|
14
|
+
//
|
15
|
+
// Teaspoon.defer = true
|
16
|
+
// setTimeout(Teaspoon.execute, 1000)
|
17
|
+
//
|
18
|
+
// Matching files
|
19
|
+
// By default Teaspoon will look for files that match _spec.{js,js.coffee,.coffee}. Add a filename_spec.js file in your
|
20
|
+
// spec path and it'll be included in the default suite automatically. If you want to customize suites, check out the
|
21
|
+
// configuration in config/initializers/teaspoon.rb
|
22
|
+
//
|
23
|
+
// Manifest
|
24
|
+
// If you'd rather require your spec files manually (to control order for instance) you can disable the suite matcher in
|
25
|
+
// the configuration and use this file as a manifest.
|
26
|
+
//
|
27
|
+
// For more information: http://github.com/modeset/teaspoon
|
28
|
+
//
|
29
|
+
// You can require your own javascript files here. By default this will include everything in application, however you
|
30
|
+
// may get better load performance if you require the specific files that are being used in the spec that tests them.
|
31
|
+
//= require application
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Set RAILS_ROOT and load the environment if it's not already loaded.
|
2
|
+
unless defined?(Rails)
|
3
|
+
ENV["RAILS_ROOT"] = File.expand_path("../../", __FILE__)
|
4
|
+
require File.expand_path("../../config/environment", __FILE__)
|
5
|
+
end
|
6
|
+
|
7
|
+
Teaspoon.configure do |config|
|
8
|
+
|
9
|
+
config.suite do |suite|
|
10
|
+
suite.use_framework :jasmine, "1.3.1"
|
11
|
+
suite.matcher = "{spec/javascripts,app/assets}/**/*_spec.{js,js.coffee,coffee}"
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Set RAILS_ROOT and load the environment if it's not already loaded.
|
2
|
+
# unless defined?(Rails)
|
3
|
+
# ENV["RAILS_ROOT"] = File.expand_path("../../", __FILE__)
|
4
|
+
# require File.expand_path("../../config/environment", __FILE__)
|
5
|
+
# end
|
6
|
+
|
7
|
+
Teaspoon.configure do |config|
|
8
|
+
|
9
|
+
config.mount_at = "/tests"
|
10
|
+
config.asset_paths = ["test/javascripts", "test/javascripts/stylesheets"]
|
11
|
+
config.fixture_paths = ["test/fixtures/javascripts"]
|
12
|
+
|
13
|
+
# Default suite
|
14
|
+
config.suite do |suite|
|
15
|
+
suite.use_framework :jasmine, "1.3.1"
|
16
|
+
suite.matcher = "{test/javascripts}/**/*test.{js}"
|
17
|
+
suite.helper = "test_helper"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Server
|
21
|
+
config.driver = "phantomjs"
|
22
|
+
config.server_port = 31337
|
23
|
+
config.color = true
|
24
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
require "coveralls"
|
7
|
+
|
8
|
+
Coveralls.wear!
|
9
|
+
|
10
|
+
Rails.backtrace_cleaner.remove_silencers!
|
11
|
+
|
12
|
+
# Load support files
|
13
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
14
|
+
|
15
|
+
# Load fixtures from the engine
|
16
|
+
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
17
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
18
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TestingControllerTest < ActionController::TestCase
|
4
|
+
|
5
|
+
# Tests if the view_helper 'rails_js' is working
|
6
|
+
# Tests if the file 'rails.js' gets included via sprockets
|
7
|
+
test "get #index" do
|
8
|
+
get :index
|
9
|
+
|
10
|
+
assert_response :success
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,178 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails-js-routes
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Finn-Lenanrt Heemeyer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sqlite3
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: teaspoon
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.8'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.8'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: poltergeist
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.5'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.5'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: coveralls
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.7'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.7'
|
83
|
+
description: Divide your javascript like you divide your ruby code. Put it in controllers
|
84
|
+
and actions and write clean, scalable code.
|
85
|
+
email: finn@heemeyer.net
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- .gitignore
|
91
|
+
- .travis.yml
|
92
|
+
- Gemfile
|
93
|
+
- Gemfile.lock
|
94
|
+
- MIT-LICENSE
|
95
|
+
- README.md
|
96
|
+
- Rakefile
|
97
|
+
- app/assets/javascripts/routes.js
|
98
|
+
- lib/rails/js/routes.rb
|
99
|
+
- lib/rails/js/routes/engine.rb
|
100
|
+
- lib/rails/js/routes/version.rb
|
101
|
+
- lib/rails/js/routes/view_helpers.rb
|
102
|
+
- rails-js-routes.gemspec
|
103
|
+
- test/dummy/README.rdoc
|
104
|
+
- test/dummy/Rakefile
|
105
|
+
- test/dummy/app/assets/images/.keep
|
106
|
+
- test/dummy/app/assets/javascripts/application.js
|
107
|
+
- test/dummy/app/assets/javascripts/testing.js
|
108
|
+
- test/dummy/app/assets/stylesheets/application.css
|
109
|
+
- test/dummy/app/controllers/application_controller.rb
|
110
|
+
- test/dummy/app/controllers/concerns/.keep
|
111
|
+
- test/dummy/app/controllers/testing_controller.rb
|
112
|
+
- test/dummy/app/helpers/application_helper.rb
|
113
|
+
- test/dummy/app/helpers/testing_helper.rb
|
114
|
+
- test/dummy/app/mailers/.keep
|
115
|
+
- test/dummy/app/models/.keep
|
116
|
+
- test/dummy/app/models/concerns/.keep
|
117
|
+
- test/dummy/app/views/layouts/application.html.erb
|
118
|
+
- test/dummy/app/views/testing/index.html.erb
|
119
|
+
- test/dummy/bin/bundle
|
120
|
+
- test/dummy/bin/rails
|
121
|
+
- test/dummy/bin/rake
|
122
|
+
- test/dummy/config.ru
|
123
|
+
- test/dummy/config/application.rb
|
124
|
+
- test/dummy/config/boot.rb
|
125
|
+
- test/dummy/config/database.yml
|
126
|
+
- test/dummy/config/environment.rb
|
127
|
+
- test/dummy/config/environments/development.rb
|
128
|
+
- test/dummy/config/environments/production.rb
|
129
|
+
- test/dummy/config/environments/test.rb
|
130
|
+
- test/dummy/config/initializers/assets.rb
|
131
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
132
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
133
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
134
|
+
- test/dummy/config/initializers/inflections.rb
|
135
|
+
- test/dummy/config/initializers/mime_types.rb
|
136
|
+
- test/dummy/config/initializers/session_store.rb
|
137
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
138
|
+
- test/dummy/config/locales/en.yml
|
139
|
+
- test/dummy/config/routes.rb
|
140
|
+
- test/dummy/config/secrets.yml
|
141
|
+
- test/dummy/db/test.sqlite3
|
142
|
+
- test/dummy/lib/assets/.keep
|
143
|
+
- test/dummy/public/404.html
|
144
|
+
- test/dummy/public/422.html
|
145
|
+
- test/dummy/public/500.html
|
146
|
+
- test/dummy/public/favicon.ico
|
147
|
+
- test/dummy/spec/javascripts/route_dispatch_spec.js
|
148
|
+
- test/dummy/spec/javascripts/spec_helper.js
|
149
|
+
- test/dummy/spec/teaspoon_env.rb
|
150
|
+
- test/dummy/test/helpers/testing_helper_test.rb
|
151
|
+
- test/teaspoon_env.rb
|
152
|
+
- test/test_helper.rb
|
153
|
+
- test/testing_controller_test.rb
|
154
|
+
homepage: http://rubygems.org/gems/rails-js-routes
|
155
|
+
licenses:
|
156
|
+
- MIT
|
157
|
+
metadata: {}
|
158
|
+
post_install_message:
|
159
|
+
rdoc_options: []
|
160
|
+
require_paths:
|
161
|
+
- lib
|
162
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
|
+
requirements:
|
169
|
+
- - '>='
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: '0'
|
172
|
+
requirements: []
|
173
|
+
rubyforge_project:
|
174
|
+
rubygems_version: 2.3.0
|
175
|
+
signing_key:
|
176
|
+
specification_version: 4
|
177
|
+
summary: A new approach to structure your javascript in non single-page Rails apps
|
178
|
+
test_files: []
|