js_from_routes 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8202e9323cb738556cdc4e126c7c343eaae6b01d52a72bdff00eb93b7ab925af
4
- data.tar.gz: 3caa18595ef98a85e8dd7f162e0f530d708a464c2bcc1fd823b4cfbaea947af7
3
+ metadata.gz: 11da4a678c4081b4ce6d99bac78e007f819cf5fecd2321af94c2e7962e557a71
4
+ data.tar.gz: 3c81aa21374aae94ec47493f70ed978938061a9d1a03ca9bba481939e853c7ab
5
5
  SHA512:
6
- metadata.gz: 3bba34efe8b9a91114708326e556dcdfe7549231d61aeb366bb16759471615f8aedb87692eab8420b0039695b359e02da5be4f974c604a535a4ae19efa131ecc
7
- data.tar.gz: f54793177eb17df4e42548775f1dbd935b366f838d49488947100f606008eefc48d96b6ad38c0611d95bc5d267c52a24aead758856ddfdd0c87adc3b745e46bf
6
+ metadata.gz: 8d71a098de83a7feab5bae4ce682c981a32d9d296db8392dc441371ce4f53b3237beefc155f670e69960af30d6780144bd426f6727fcf98d3a7260ac63c7fc12
7
+ data.tar.gz: 70347defa686e95bae4264eda364e514eef9fa623078957a17825dc1c8894f77c0079b19c70f001586344980c5fe29c57812aaef0f74ba2ac8b92f910c39dc5e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## JsFromRoutes 1.0.3 (2021-03-10) ##
2
+
3
+ * Use `~/` instead of `@/` in the default template imports.
4
+
5
+
1
6
  ## JsFromRoutes 1.0.2 (2021-03-10) ##
2
7
 
3
8
  * Ensure a default `template.js.erb` ships with the gem.
data/README.md CHANGED
@@ -10,6 +10,9 @@ JS From Rails Routes
10
10
  </p>
11
11
  </h1>
12
12
 
13
+ [Vite Rails]: https://vite-ruby.netlify.app/
14
+ [aliases]: https://vite-ruby.netlify.app/guide/development.html#import-aliases-%F0%9F%91%89
15
+
13
16
  _JS from Routes_ helps you by automatically generating path and API helpers from
14
17
  Rails route definitions, allowing you to save development effort and focus on
15
18
  the things that matter.
@@ -78,8 +81,8 @@ bin/rake js_from_routes:generate
78
81
  which can generate code such as:
79
82
 
80
83
  ```js
81
- import { formatUrl } from '@helpers/UrlHelper'
82
- import { request } from '@services/ApiService'
84
+ import { formatUrl } from '~/helpers/UrlHelper'
85
+ import { request } from '~/services/ApiService'
83
86
 
84
87
  export default {
85
88
  downloadPath: options =>
@@ -108,7 +111,7 @@ VideoClipsRequests.update(newVideo)
108
111
  const path = VideoClipsRequests.downloadPath(newVideo)
109
112
  ```
110
113
 
111
- Check the [examples](https://github.com/ElMassimo/js_from_routes/blob/master/spec/support/sample_app/app/javascript/Videos.vue) for ideas on how to [use it](https://github.com/ElMassimo/js_from_routes/blob/master/spec/support/sample_app/app/javascript/Videos.vue), and how you can [configure](https://github.com/ElMassimo/js_from_routes/blob/master/spec/support/sample_app/config/webpack/aliases.js#L11) Webpack to your convenience.
114
+ Check the [examples](https://github.com/ElMassimo/js_from_routes/blob/master/spec/support/sample_app/app/javascript/Videos.vue) for ideas on how to [use it](https://github.com/ElMassimo/js_from_routes/blob/master/spec/support/sample_app/app/javascript/Videos.vue), and how you can configure it to your convenience.
112
115
 
113
116
  Read on to find out how to customize the generated code to suit your needs.
114
117
 
@@ -133,7 +136,9 @@ the JS code read more naturally.
133
136
 
134
137
  The directory where the generated files are created.
135
138
 
136
- Tip: It's highly recommended to [add a webpack alias](https://github.com/ElMassimo/js_from_routes/blob/master/spec/support/sample_app/config/webpack/aliases.js#L11), to simplify [imports](https://github.com/ElMassimo/js_from_routes/blob/master/spec/support/sample_app/app/javascript/Videos.vue#2).
139
+ Tip: It's highly recommended to [add a webpack alias](https://github.com/ElMassimo/js_from_routes/blob/webpack/spec/support/sample_app/config/webpack/aliases.js#L11), to simplify [imports](https://github.com/ElMassimo/js_from_routes/blob/master/spec/support/sample_app/app/javascript/Videos.vue#2).
140
+
141
+ If you use [Vite Rails], the [aliases] are already configured for you.
137
142
 
138
143
  ##### [`template_path`](https://github.com/ElMassimo/js_from_routes/blob/master/lib/js_from_routes/generator.rb#L79)
139
144
 
@@ -165,9 +170,9 @@ In order to optimize file generation, the generated JS files are split by
165
170
  controller, and add a cache key based on the routes to avoid rewriting the file
166
171
  if the route definition hasn't changed.
167
172
 
168
- When the Webpack development server is running, it detects when a new file is
169
- generated, automatically triggering a new build, which can now use the generated
170
- request methods or path helpers 😃
173
+ When the Vite.js or Webpack development server is running, it detects when a new
174
+ file is generated, automatically triggering a new build, which can now use the
175
+ generated request methods or path helpers 😃
171
176
 
172
177
  ### Take this idea 💡
173
178
 
@@ -3,5 +3,5 @@
3
3
  # Splitting the generator file allows consumers to skip the Railtie if desired:
4
4
  # - gem 'js_from_routes', require: false
5
5
  # - require 'js_from_routes/generator'
6
- require 'js_from_routes/generator'
7
- require 'js_from_routes/railtie'
6
+ require "js_from_routes/generator"
7
+ require "js_from_routes/railtie"
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'digest'
4
- require 'erubi'
5
- require 'fileutils'
3
+ require "digest"
4
+ require "erubi"
5
+ require "fileutils"
6
6
 
7
7
  # Public: Automatically generates JS for Rails routes with { export: true }.
8
8
  # Generates one file per controller, and one function per route.
@@ -59,19 +59,19 @@ module JsFromRoutes
59
59
 
60
60
  # Public: The path for the action. Example: '/users/:id/edit'
61
61
  def path
62
- @route.path.spec.to_s.chomp('(.:format)')
62
+ @route.path.spec.to_s.chomp("(.:format)")
63
63
  end
64
64
 
65
65
  # Public: The name of the JS helper for the action. Example: 'destroyAll'
66
66
  def helper
67
67
  action = @route.requirements.fetch(:action).camelize(:lower)
68
68
  name = @mappings.fetch(action, action)
69
- path_only? ? "#{ name }Path" : name
69
+ path_only? ? "#{name}Path" : name
70
70
  end
71
71
 
72
72
  # Internal: Useful as a cache key for the route, and for debugging purposes.
73
73
  def inspect
74
- "#{ verb } #{ helper } #{ path }"
74
+ "#{verb} #{helper} #{path}"
75
75
  end
76
76
  end
77
77
 
@@ -79,10 +79,10 @@ module JsFromRoutes
79
79
  # Public: Configuration of the code generator.
80
80
  def config
81
81
  @config ||= OpenStruct.new(
82
- file_suffix: 'Requests.js',
83
- output_folder: ::Rails.root&.join('app', 'javascript', 'requests'),
84
- template_path: File.expand_path('template.js.erb', __dir__),
85
- helper_mappings: { 'index' => 'list', 'show' => 'get' },
82
+ file_suffix: "Requests.js",
83
+ output_folder: ::Rails.root&.join("app", "javascript", "requests"),
84
+ template_path: File.expand_path("template.js.erb", __dir__),
85
+ helper_mappings: {"index" => "list", "show" => "get"}
86
86
  )
87
87
  yield(@config) if block_given?
88
88
  @config
@@ -90,7 +90,7 @@ module JsFromRoutes
90
90
 
91
91
  # Public: Generates code for the specified routes with { export: true }.
92
92
  def generate!(app_or_routes = Rails.application)
93
- raise ArgumentError, 'A Rails app must be defined, or you must specify a custom `output_folder`' if config.output_folder.blank?
93
+ raise ArgumentError, "A Rails app must be defined, or you must specify a custom `output_folder`" if config.output_folder.blank?
94
94
  rails_routes = app_or_routes.is_a?(::Rails::Engine) ? app_or_routes.routes.routes : app_or_routes
95
95
  @compiled_template = nil # Clear on every code reload in case the template changed.
96
96
  exported_routes_by_controller(rails_routes).each do |controller, controller_routes|
@@ -99,7 +99,7 @@ module JsFromRoutes
99
99
  end
100
100
  end
101
101
 
102
- private
102
+ private
103
103
 
104
104
  # Internal: Returns exported routes grouped by controller name.
105
105
  def exported_routes_by_controller(routes)
@@ -112,7 +112,7 @@ module JsFromRoutes
112
112
 
113
113
  # Internal: Name of the JS file with helpers for the the given controller.
114
114
  def filename_for(controller)
115
- config.output_folder.join("#{ controller.camelize }#{ config.file_suffix }".tr_s(':', '/'))
115
+ config.output_folder.join("#{controller.camelize}#{config.file_suffix}".tr_s(":", "/"))
116
116
  end
117
117
 
118
118
  # Internal: Returns a String with the JS generated for a controller's routes.
@@ -134,8 +134,8 @@ module JsFromRoutes
134
134
  # Yields to receive the rendered file content when it needs to.
135
135
  def write_if_changed(name, cache_key)
136
136
  FileUtils.mkdir_p(name.dirname)
137
- cache_key_comment = "// JsFromRoutes CacheKey #{ cache_key }\n"
138
- File.open(name, 'a+') { |file|
137
+ cache_key_comment = "// JsFromRoutes CacheKey #{cache_key}\n"
138
+ File.open(name, "a+") { |file|
139
139
  if file.gets != cache_key_comment
140
140
  file.truncate(0)
141
141
  file.write(cache_key_comment)
@@ -6,7 +6,7 @@ class JsFromRoutes::Railtie < Rails::Railtie
6
6
 
7
7
  if Rails.env.development?
8
8
  # Allows to automatically trigger code generation after updating routes.
9
- initializer 'js_from_routes.reloader' do |app|
9
+ initializer "js_from_routes.reloader" do |app|
10
10
  app.config.to_prepare do
11
11
  JsFromRoutes.generate!(app)
12
12
  end
@@ -16,7 +16,7 @@ class JsFromRoutes::Railtie < Rails::Railtie
16
16
  # Suitable when triggering code generation manually.
17
17
  rake_tasks do |app|
18
18
  namespace :js_from_routes do
19
- desc 'Generates JavaScript files from Rails routes, one file per controller, and one function per route.'
19
+ desc "Generates JavaScript files from Rails routes, one file per controller, and one function per route."
20
20
  task generate: :environment do
21
21
  JsFromRoutes.generate!(app)
22
22
  end
@@ -2,11 +2,11 @@
2
2
  // DO NOT MODIFY: This file was automatically generated by JsFromRoutes.
3
3
  <%
4
4
  if routes.any?(&:path_only?)
5
- %>import { formatUrl } from '@/helpers/UrlHelper'<%
5
+ %>import { formatUrl } from '~/helpers/UrlHelper'<%
6
6
  end
7
7
  %><% if routes.any?(&:path_only?) && routes.any?(&:request_method?) %><%= "\n" %><% end %><%
8
8
  if routes.any?(&:request_method?)
9
- %>import { request } from '@/services/ApiService'<%
9
+ %>import { request } from '~/services/ApiService'<%
10
10
  end
11
11
  %>
12
12
 
@@ -4,5 +4,5 @@
4
4
  # Generates one file per controller, and one function per route.
5
5
  module JsFromRoutes
6
6
  # Public: This library adheres to semantic versioning.
7
- VERSION = '1.0.2'
7
+ VERSION = "1.0.3"
8
8
  end
@@ -1,17 +1,16 @@
1
- require 'support/sample_app/config/application'
2
- require 'support/sample_app/config/routes'
3
-
1
+ require "support/sample_app/config/application"
2
+ require "support/sample_app/config/routes"
4
3
 
5
4
  describe JsFromRoutes do
6
- ORIGINAL_TEMPLATE_PATH = JsFromRoutes.config.template_path
5
+ original_template_path = JsFromRoutes.config.template_path
7
6
 
8
- let(:output_dir) { Pathname.new File.expand_path('../support/generated', __dir__) }
9
- let(:sample_dir) { Rails.root.join('app', 'javascript', 'requests') }
10
- let(:different_template_path) { File.expand_path('../support/jquery_template.js.erb', __dir__) }
7
+ let(:output_dir) { Pathname.new File.expand_path("../support/generated", __dir__) }
8
+ let(:sample_dir) { Rails.root.join("app", "javascript", "requests") }
9
+ let(:different_template_path) { File.expand_path("../support/jquery_template.js.erb", __dir__) }
11
10
  let(:controllers_with_exported_routes) { %w[Comments UserPreferences VideoClips] }
12
11
 
13
12
  def file_for(dir, name)
14
- dir.join("#{ name }Requests.js")
13
+ dir.join("#{name}Requests.js")
15
14
  end
16
15
 
17
16
  def sample_file_for(name)
@@ -28,22 +27,26 @@ describe JsFromRoutes do
28
27
  expect(Rails.application.routes.routes).to be_present
29
28
 
30
29
  # Remove directory from a previous test run.
31
- FileUtils.remove_dir(output_dir) rescue nil
30
+ begin
31
+ FileUtils.remove_dir(output_dir)
32
+ rescue
33
+ nil
34
+ end
32
35
 
33
36
  # Change the configuration to use a different directory.
34
37
  JsFromRoutes.config do |config|
35
38
  config.output_folder = output_dir
36
- config.template_path = ORIGINAL_TEMPLATE_PATH
39
+ config.template_path = original_template_path
37
40
  end
38
41
  end
39
42
 
40
43
  # NOTE: We do a manual snapshot test for now, more tests coming in the future.
41
- it 'should generate the files as expected' do
44
+ it "should generate the files as expected" do
42
45
  expect(JsFromRoutes).to receive(:render_template).exactly(3).times.and_call_original
43
46
  JsFromRoutes.generate!
44
47
 
45
48
  # It does not generate routes that don't have `export: true`.
46
- expect(output_file_for('Welcome').exist?).to eq false
49
+ expect(output_file_for("Welcome").exist?).to eq false
47
50
 
48
51
  # It generates one file per controller with exported routes.
49
52
  controllers_with_exported_routes.each do |file_name|
@@ -67,9 +70,9 @@ describe JsFromRoutes do
67
70
  JsFromRoutes.generate!
68
71
  end
69
72
 
70
- it 'should have a rake task available' do
73
+ it "should have a rake task available" do
71
74
  Rails.application.load_tasks
72
75
  expect(JsFromRoutes).to receive(:render_template).exactly(3).times
73
- expect { Rake::Task['js_from_routes:generate'].invoke }.not_to raise_error
76
+ expect { Rake::Task["js_from_routes:generate"].invoke }.not_to raise_error
74
77
  end
75
78
  end
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,7 @@
1
- require 'simplecov'
2
- SimpleCov.start { add_filter '/spec/' }
1
+ require "simplecov"
2
+ SimpleCov.start { add_filter "/spec/" }
3
3
 
4
- require 'rails'
5
- require 'js_from_routes'
6
- require 'rspec/given'
7
- require 'pry-byebug'
4
+ require "rails"
5
+ require "js_from_routes"
6
+ require "rspec/given"
7
+ require "pry-byebug"
@@ -1,2 +1,17 @@
1
1
  class VideoClipsController < ApplicationController
2
+ def trending
3
+ render json: [
4
+ {title: "Smoke Signals"},
5
+ {title: "Camino Libre"},
6
+ {title: "Sin Querer"},
7
+ {title: "Tabula Rasa"},
8
+ {title: "Raindance"},
9
+ {title: "Ragamuffin"},
10
+ {title: "Vals Venezolano Nº 2"},
11
+ {title: "Xaranga do Vovô"},
12
+ {title: "Café 1930"},
13
+ {title: "Milonga (Uruguay)"},
14
+ {title: "Divagando"}
15
+ ]
16
+ end
2
17
  end
@@ -1,4 +1,4 @@
1
1
  class ApplicationMailer < ActionMailer::Base
2
- default from: 'from@example.com'
3
- layout 'mailer'
2
+ default from: "from@example.com"
3
+ layout "mailer"
4
4
  end
@@ -1,7 +1,6 @@
1
- require_relative 'boot'
1
+ require_relative "boot"
2
2
 
3
3
  require "action_controller/railtie"
4
- require "sprockets/railtie"
5
4
 
6
5
  # Require the gems listed in Gemfile, including any gems
7
6
  # you've limited to :test, :development, or :production.
@@ -9,10 +8,6 @@ Bundler.require(*Rails.groups)
9
8
 
10
9
  module SampleApp
11
10
  class Application < Rails::Application
12
- # Initialize configuration defaults for originally generated Rails version.
13
- config.load_defaults 6.0
14
-
15
- # Settings in config/environments/* take precedence over those specified here.
16
11
  # Application configuration can go into files in config/initializers
17
12
  # -- all .rb files in that directory are automatically loaded after loading
18
13
  # the framework and any gems in your application.
@@ -1,4 +1,3 @@
1
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
1
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2
2
 
3
- require 'bundler/setup' # Set up gems listed in the Gemfile.
4
- require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
3
+ require "bundler/setup" # Set up gems listed in the Gemfile.
@@ -1,5 +1,5 @@
1
1
  # Load the Rails application.
2
- require_relative 'application'
2
+ require_relative "application"
3
3
 
4
4
  # Initialize the Rails application.
5
5
  Rails.application.initialize!
@@ -16,14 +16,6 @@ Rails.application.configure do
16
16
  # Print deprecation notices to the Rails logger.
17
17
  config.active_support.deprecation = :log
18
18
 
19
- # Debug mode disables concatenation and preprocessing of assets.
20
- # This option may cause significant delays in view rendering with a large
21
- # number of complex assets.
22
- config.assets.debug = true
23
-
24
- # Suppress logger output for asset requests.
25
- config.assets.quiet = true
26
-
27
19
  # Raises error for missing translations.
28
20
  # config.action_view.raise_on_missing_translations = true
29
21
 
@@ -10,9 +10,16 @@
10
10
  # policy.img_src :self, :https, :data
11
11
  # policy.object_src :none
12
12
  # policy.script_src :self, :https
13
+ # Allow @vite/client to hot reload changes in development
14
+ # policy.script_src *policy.script_src, :unsafe_eval, "http://localhost:3036" if Rails.env.development?
15
+
16
+ # You may need to enable this in production as well depending on your setup.
17
+ # policy.script_src *policy.script_src, :blob if Rails.env.test?
13
18
  # policy.style_src :self, :https
14
19
  # # If you are using webpack-dev-server then specify webpack-dev-server host
15
20
  # policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
21
+ # Allow @vite/client to hot reload changes in development
22
+ # policy.connect_src *policy.connect_src, "ws://#{ ViteRuby.config.host_with_port }" if Rails.env.development?
16
23
 
17
24
  # # Specify URI for violation reports
18
25
  # # policy.report_uri "/csp-violation-report-endpoint"
@@ -4,13 +4,13 @@
4
4
  # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
5
  # and maximum; this matches the default thread size of Active Record.
6
6
  #
7
- max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
- min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
7
+ max_threads_count = ENV.fetch("RAILS_MAX_THREADS", 5)
8
+ min_threads_count = ENV.fetch("RAILS_MIN_THREADS", max_threads_count)
9
9
  threads min_threads_count, max_threads_count
10
10
 
11
11
  # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
12
12
  #
13
- port ENV.fetch("PORT") { 3000 }
13
+ port ENV.fetch("PORT", 3000)
14
14
 
15
15
  # Specifies the `environment` that Puma will run in.
16
16
  #
@@ -1,5 +1,5 @@
1
1
  Rails.application.routes.draw do
2
- root to: 'welcome#home'
2
+ root to: "welcome#home"
3
3
 
4
4
  resources :welcome
5
5
 
@@ -8,7 +8,7 @@ Rails.application.routes.draw do
8
8
  patch :add_to_playlist, on: :member
9
9
  patch :remove_from_playlist, on: :member
10
10
  get :trending, on: :collection
11
- get '/thumbnail/:thumbnail_id', as: :thumbnail, action: :thumbnail, on: :member
11
+ get "/thumbnail/:thumbnail_id", as: :thumbnail, action: :thumbnail, on: :member
12
12
 
13
13
  resources :comments, only: [:show, :index], shallow: true, export: true
14
14
  end
@@ -16,7 +16,7 @@ Rails.application.routes.draw do
16
16
  resources :user_preferences, only: [], export: true do
17
17
  patch :switch_to_classic_navbar, on: :collection
18
18
  get :switch_to_beta_navbar, on: :collection, export: false
19
- get '/switch_to_classic/:page', action: :switch_to_classic, on: :collection, export: :path_only
20
- get '/switch_to_beta/:page', action: :switch_to_beta, on: :collection, as: :switch_to_beta_page, export: :path_only
19
+ get "/switch_to_classic/:page", action: :switch_to_classic, on: :collection, export: :path_only
20
+ get "/switch_to_beta/:page", action: :switch_to_beta, on: :collection, as: :switch_to_beta_page, export: :path_only
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: js_from_routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini
@@ -16,42 +16,118 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '5.1'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '8'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '0'
29
+ version: '5.1'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '8'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: bundler
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - ">="
37
+ - - "~>"
32
38
  - !ruby/object:Gem::Version
33
- version: '0'
39
+ version: '2'
34
40
  type: :development
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
- - - ">="
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '2'
47
+ - !ruby/object:Gem::Dependency
48
+ name: listen
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.2'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
39
59
  - !ruby/object:Gem::Version
40
- version: '0'
60
+ version: '3.2'
61
+ - !ruby/object:Gem::Dependency
62
+ name: pry-byebug
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '3.9'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '3.9'
41
75
  - !ruby/object:Gem::Dependency
42
76
  name: rake
43
77
  requirement: !ruby/object:Gem::Requirement
44
78
  requirements:
45
- - - ">="
79
+ - - "~>"
46
80
  - !ruby/object:Gem::Version
47
- version: '0'
81
+ version: '13'
48
82
  type: :development
49
83
  prerelease: false
50
84
  version_requirements: !ruby/object:Gem::Requirement
51
85
  requirements:
52
- - - ">="
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '13'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rspec-given
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '3.8'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '3.8'
103
+ - !ruby/object:Gem::Dependency
104
+ name: simplecov
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "<"
108
+ - !ruby/object:Gem::Version
109
+ version: '0.18'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "<"
115
+ - !ruby/object:Gem::Version
116
+ version: '0.18'
117
+ - !ruby/object:Gem::Dependency
118
+ name: standard
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '1.0'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
53
129
  - !ruby/object:Gem::Version
54
- version: '0'
130
+ version: '1.0'
55
131
  description: js_from_routes helps you by automatically generating path and API helpers
56
132
  from Rails route definitions, allowing you to save development effort and focus
57
133
  on the things that matter.
@@ -83,7 +159,6 @@ files:
83
159
  - spec/support/sample_app/config/environments/development.rb
84
160
  - spec/support/sample_app/config/environments/test.rb
85
161
  - spec/support/sample_app/config/initializers/application_controller_renderer.rb
86
- - spec/support/sample_app/config/initializers/assets.rb
87
162
  - spec/support/sample_app/config/initializers/backtrace_silencers.rb
88
163
  - spec/support/sample_app/config/initializers/content_security_policy.rb
89
164
  - spec/support/sample_app/config/initializers/cookies_serializer.rb
@@ -93,7 +168,6 @@ files:
93
168
  - spec/support/sample_app/config/initializers/wrap_parameters.rb
94
169
  - spec/support/sample_app/config/puma.rb
95
170
  - spec/support/sample_app/config/routes.rb
96
- - spec/support/sample_app/node_modules/node-sass/src/libsass/extconf.rb
97
171
  homepage: https://github.com/ElMassimo/js_from_routes
98
172
  licenses:
99
173
  - MIT
@@ -138,8 +212,6 @@ test_files:
138
212
  - spec/support/sample_app/config/initializers/mime_types.rb
139
213
  - spec/support/sample_app/config/initializers/filter_parameter_logging.rb
140
214
  - spec/support/sample_app/config/initializers/wrap_parameters.rb
141
- - spec/support/sample_app/config/initializers/assets.rb
142
215
  - spec/support/sample_app/config/initializers/cookies_serializer.rb
143
216
  - spec/support/sample_app/config/initializers/content_security_policy.rb
144
217
  - spec/support/sample_app/config/initializers/inflections.rb
145
- - spec/support/sample_app/node_modules/node-sass/src/libsass/extconf.rb
@@ -1,14 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Version of your assets, change this if you want to expire all your assets.
4
- Rails.application.config.assets.version = '1.0'
5
-
6
- # Add additional assets to the asset load path.
7
- # Rails.application.config.assets.paths << Emoji.images_path
8
- # Add Yarn node_modules folder to the asset load path.
9
- Rails.application.config.assets.paths << Rails.root.join('node_modules')
10
-
11
- # Precompile additional assets.
12
- # application.js, application.css, and all non-JS/CSS in the app/assets
13
- # folder are already added.
14
- # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -1,6 +0,0 @@
1
- require 'mkmf'
2
- # .. more stuff
3
- #$LIBPATH.push(Config::CONFIG['libdir'])
4
- $CFLAGS << " #{ENV["CFLAGS"]}"
5
- $LIBS << " #{ENV["LIBS"]}"
6
- create_makefile("libsass")