short_rails 1.0.0 → 2.0.2

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.
Files changed (55) hide show
  1. checksums.yaml +5 -13
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +57 -40
  4. data/Rakefile +7 -29
  5. data/app/assets/config/short_rails_manifest.js +1 -0
  6. data/app/assets/stylesheets/short_rails/application.css +6 -4
  7. data/app/controllers/short_rails/short_urls_controller.rb +51 -22
  8. data/app/jobs/short_rails/application_job.rb +4 -0
  9. data/app/mailers/short_rails/application_mailer.rb +6 -0
  10. data/app/models/short_rails/application_record.rb +5 -0
  11. data/app/models/short_rails/short_url.rb +12 -3
  12. data/app/views/layouts/short_rails/application.html.erb +4 -3
  13. data/config/routes.rb +4 -4
  14. data/db/migrate/{20121123124825_create_short_rails_short_urls.rb → 20211116084848_create_short_rails_short_urls.rb} +2 -1
  15. data/lib/short_rails/version.rb +1 -1
  16. data/lib/short_rails.rb +7 -0
  17. metadata +31 -109
  18. data/app/assets/javascripts/short_rails/application.js +0 -15
  19. data/db/migrate/20130108094545_add_url_short_param_to_short_urls.rb +0 -5
  20. data/test/dummy/README.rdoc +0 -261
  21. data/test/dummy/Rakefile +0 -7
  22. data/test/dummy/app/assets/javascripts/application.js +0 -15
  23. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  24. data/test/dummy/app/controllers/application_controller.rb +0 -3
  25. data/test/dummy/app/helpers/application_helper.rb +0 -2
  26. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  27. data/test/dummy/config/application.rb +0 -59
  28. data/test/dummy/config/boot.rb +0 -10
  29. data/test/dummy/config/database.yml +0 -25
  30. data/test/dummy/config/environment.rb +0 -5
  31. data/test/dummy/config/environments/development.rb +0 -37
  32. data/test/dummy/config/environments/production.rb +0 -67
  33. data/test/dummy/config/environments/test.rb +0 -37
  34. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  35. data/test/dummy/config/initializers/inflections.rb +0 -15
  36. data/test/dummy/config/initializers/mime_types.rb +0 -5
  37. data/test/dummy/config/initializers/secret_token.rb +0 -7
  38. data/test/dummy/config/initializers/session_store.rb +0 -8
  39. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  40. data/test/dummy/config/locales/en.yml +0 -5
  41. data/test/dummy/config/routes.rb +0 -3
  42. data/test/dummy/config.ru +0 -4
  43. data/test/dummy/db/development.sqlite3 +0 -0
  44. data/test/dummy/db/migrate/20121123133344_create_short_rails_short_urls.short_rails.rb +0 -12
  45. data/test/dummy/db/migrate/20130108094709_add_url_short_param_to_short_urls.short_rails.rb +0 -6
  46. data/test/dummy/db/schema.rb +0 -24
  47. data/test/dummy/log/development.log +0 -8830
  48. data/test/dummy/public/404.html +0 -26
  49. data/test/dummy/public/422.html +0 -26
  50. data/test/dummy/public/500.html +0 -25
  51. data/test/dummy/public/favicon.ico +0 -0
  52. data/test/dummy/script/rails +0 -6
  53. data/test/integration/navigation_test.rb +0 -10
  54. data/test/short_rails_test.rb +0 -7
  55. data/test/test_helper.rb +0 -15
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YzQ4MTQwZmY4MTI1NDA2MDBlMjA4NmRjMjJiNzJjZjM4OTdmZGE1ZQ==
5
- data.tar.gz: !binary |-
6
- YTNlNzhjMDhjNmFmYWExMGJmN2MxNmU2YWZjZmQzOGUwMDM2OGFjYw==
2
+ SHA256:
3
+ metadata.gz: b300c630b3179712d6bfed4c05e4f7c9d82ba9aaa6c9cc6c407195fa2c3b48ee
4
+ data.tar.gz: 5ffcc9e96a686efd5e2c9b937cc4bd1664081762b04620791b16a0bd41acea8f
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YjJhMTA3YTQ4NWQ1NGE0MTY5YzIyZTQ2ZWNmMWZlOGU4YTA4NGI5MmJhZDhh
10
- N2M5OGM3NDcyNjBjYTdmNGQwZmZkNmFkNWU0OGQyODI2MzgzMGYyMGQxYjVl
11
- MzBmMjRlZDUxNjdhMWJlMDQzYTAyMjY5ZWQyMmVjNDljMGIzYTY=
12
- data.tar.gz: !binary |-
13
- M2Q5OGRlYjZmY2QxZmFmODcyMjE2NzE4MjMwOTk0MWI4Y2MwZGVhYTgwMDkx
14
- NmUxZGJjYTBkZTY3Y2FkMDI5ZDNhZjgzMjlhNWRjNjU3MmY1ZDNmYWM2OTkz
15
- M2QxMTI4MmEzMjFjMjY3NjkwZDJmZWNjMmJiOTliMjQ1YzIzMjY=
6
+ metadata.gz: 52138bb5f8c1b8fa9ffe16c496b4e4064076268e7193da9926dcf08c42f4ff8de307e542a2f83f993cccefa1198ed55507a3235d0dee1a00d6e7eb78bfc1a1f7
7
+ data.tar.gz: 8b35f5e2703d06be4fdddaf30a4c8fc744dc8b07700fcaa04f8836fde454e252b1a05c52befcd73257433d921e1d6d07afa49e8aa91aaf88a2067c456aec4a7e
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2015 Sourcepole
1
+ Copyright 2012-2021 Sourcepole
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,65 +1,82 @@
1
1
  # ShortRails
2
2
 
3
- URL shortener for Rails.
3
+ URL shortener for Rails 6.
4
4
 
5
- ## Installation:
5
+ ## Installation
6
6
 
7
7
  Add this line to your application's Gemfile:
8
-
9
- gem 'short_rails'
8
+ ```ruby
9
+ gem 'short_rails'
10
+ ```
10
11
 
11
12
  And then execute:
12
-
13
- $ bundle
13
+ ```bash
14
+ $ bundle
15
+ ```
14
16
 
15
17
  Or install it yourself as:
16
-
17
- $ gem install short_rails
18
+ ```bash
19
+ $ gem install short_rails
20
+ ```
18
21
 
19
22
  ## Configuration
20
23
 
21
- Mount engine in config/routes.rb
22
-
23
- Rails.application.routes.draw do
24
- mount ShortRails::Engine => "/s"
25
- end
24
+ Mount engine in `config/routes.rb`:
25
+ ```ruby
26
+ Rails.application.routes.draw do
27
+ mount ShortRails::Engine => "/s"
28
+ end
29
+ ```
30
+
31
+ Copy engine migrations to application:
32
+ ```bash
33
+ $ bin/rails short_rails:install:migrations
34
+ $ bin/rails db:migrate
35
+ ```
36
+
37
+ Configure optional host whitelist (default: `nil`, disabled) in initializer (e.g. `config/initializers/short_rails.rb`):
38
+ ```ruby
39
+ ShortRails.setup do |config|
40
+ config.host_whitelist = ['example.com', '127.0.0.1']
41
+ end
42
+ ```
26
43
 
27
- Copy engine migrations to application
28
-
29
- $ rake short_rails:install:migrations
30
- $ rake db:migrate
44
+ ## Usage
31
45
 
32
- Run standalone dummy app
46
+ * `POST /s`: Create short URL
47
+
48
+ Submit data:
49
+ * `base_url`: base URL without parameters (e.g. `http://example.com/path`)
50
+ * `base_url_short_param`: optional parameter for short id on redirect (e.g. `s`)
51
+ * URL parameters
33
52
 
34
- $ cd test/dummy/
35
- $ rails s
53
+ Example request:
54
+ ```bash
55
+ curl -F base_url=http://example.com/path -F base_url_short_param=s -F x=1 -F y=2 http://localhost:3000/s
56
+ ```
36
57
 
37
- http://localhost:3000/s
58
+ Returns short id as text (e.g. `abc123`)
38
59
 
39
- ## Usage
60
+ * `GET /s/abc123`: Open short URL
40
61
 
41
- * POST /s
42
- submit data:
43
- - 'base_url': base URL without parameters (e.g. "http://example.com/path")
44
- - 'base_url_short_param': optional parameter for short id on redirect (e.g. "s")
45
- - url parameters
62
+ If `base_url_short_param` has been set, redirect to `<base_url>?<base_url_short_param>=<short id>` (e.g. `http://example.com/path?s=abc123`), otherwise redirect to full URL.
46
63
 
47
- returns short id (e.g. 'abc123')
64
+ * `GET /s/abc123/params`: Get full URL parameters as JSON
48
65
 
49
- * GET /s/abc123
50
- if 'base_url_short_param' has been set, redirect to
66
+ * `GET /s/abc123/qrcode`: Get QR code as PNG image
51
67
 
52
- "<base_url>?<base_url_short_param>=<short id>"
53
- (e.g. "http://example.com/path?s=abc123")
68
+ Parameters:
69
+ * `width` (optional): image width (max 2048), will be clamped to minimum QR code width
70
+ * `height` (optional): image height (max 2048), will be clamped to minimum QR code height
54
71
 
55
- else redirect to full URL
72
+ ## Development
56
73
 
57
- * GET /s/abc123/params
58
- get full URL parameters as JSON
74
+ Run standalone dummy app at http://localhost:3000/s:
75
+ ```bash
76
+ $ cd test/dummy/
77
+ $ bin/rails s
78
+ ```
59
79
 
60
- * GET /s/abc123/qrcode
61
- parameters:
62
- - 'width' (optional): image width (max 2048), will be clamped to minimum QR code width
63
- - 'height' (optional): image height (max 2048), will be clamped to minimum QR code height
80
+ ## License
64
81
 
65
- get QR code as PNG image
82
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -1,40 +1,18 @@
1
- #!/usr/bin/env rake
2
- begin
3
- require 'bundler/setup'
4
- rescue LoadError
5
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
- end
7
- begin
8
- require 'rdoc/task'
9
- rescue LoadError
10
- require 'rdoc/rdoc'
11
- require 'rake/rdoctask'
12
- RDoc::Task = Rake::RDocTask
13
- end
14
-
15
- RDoc::Task.new(:rdoc) do |rdoc|
16
- rdoc.rdoc_dir = 'rdoc'
17
- rdoc.title = 'ShortRails'
18
- rdoc.options << '--line-numbers'
19
- rdoc.rdoc_files.include('README.rdoc')
20
- rdoc.rdoc_files.include('lib/**/*.rb')
21
- end
22
-
23
- APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
- load 'rails/tasks/engine.rake'
1
+ require "bundler/setup"
25
2
 
3
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
26
5
 
6
+ load "rails/tasks/statistics.rake"
27
7
 
28
- Bundler::GemHelper.install_tasks
8
+ require "bundler/gem_tasks"
29
9
 
30
- require 'rake/testtask'
10
+ require "rake/testtask"
31
11
 
32
12
  Rake::TestTask.new(:test) do |t|
33
- t.libs << 'lib'
34
13
  t.libs << 'test'
35
14
  t.pattern = 'test/**/*_test.rb'
36
15
  t.verbose = false
37
16
  end
38
17
 
39
-
40
- task :default => :test
18
+ task default: :test
@@ -0,0 +1 @@
1
+ //= link_directory ../stylesheets/short_rails .css
@@ -3,11 +3,13 @@
3
3
  * listed below.
4
4
  *
5
5
  * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
7
  *
8
- * You're free to add application-wide styles to this file and they'll appear at the top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
10
12
  *
11
- *= require_self
12
13
  *= require_tree .
14
+ *= require_self
13
15
  */
@@ -1,12 +1,18 @@
1
- require_dependency "short_rails/application_controller"
2
-
3
1
  module ShortRails
4
2
  class ShortUrlsController < ApplicationController
3
+ skip_before_action :verify_authenticity_token
5
4
 
6
5
  # GET ':id'
7
6
  # redirect to base URL
8
7
  def show
9
8
  short_url = ShortUrl.find_by_short(params[:short])
9
+ if short_url.nil?
10
+ head :not_found
11
+ return
12
+ end
13
+
14
+ # update updated_at timestamp
15
+ short_url.touch
10
16
 
11
17
  if short_url.url_short_param.nil?
12
18
  # redirect to full URL
@@ -24,15 +30,15 @@ module ShortRails
24
30
  def create
25
31
  begin
26
32
  short = SecureRandom.base64(6).tr("+/=", "xyz").downcase
27
- end while ShortUrl.where(:short => short).exists?
33
+ end while ShortUrl.where(short: short).exists?
28
34
 
29
- url_params = params.except(:action, :controller, :base_url, :base_url_short_param)
30
- short_url = ShortUrl.new(:short => short, :url => params[:base_url], :url_short_param => params[:base_url_short_param], :params => url_params)
35
+ url_params = params.except(:action, :controller, :base_url, :base_url_short_param).permit!.to_hash
36
+ short_url = ShortUrl.new(short: short, url: params[:base_url], params: url_params, url_short_param: params[:base_url_short_param])
31
37
  if short_url.save
32
38
  # return short id
33
- render :text => short
39
+ render plain: short
34
40
  else
35
- head :no_content
41
+ head :bad_request
36
42
  end
37
43
  end
38
44
 
@@ -40,24 +46,32 @@ module ShortRails
40
46
  # get parameters for full URL
41
47
  def parameters
42
48
  short_url = ShortUrl.find_by_short(params[:short])
49
+ if short_url.nil?
50
+ head :not_found
51
+ return
52
+ end
53
+
54
+ # update updated_at timestamp
55
+ short_url.touch
43
56
 
44
- render :text => short_url.params.to_json
57
+ render json: short_url.params
45
58
  end
46
59
 
47
60
  # GET ':id/qrcode'
48
61
  # get QR code containing this short URL
49
62
  def qrcode
50
- require 'rqrcode_png'
63
+ require 'rqrcode'
51
64
 
52
- if ShortUrl.find_by_short(params[:short]).nil?
53
- render :text => "ERROR: Could not generate QR code", :status => :bad_request
65
+ short_url = ShortUrl.find_by_short(params[:short])
66
+ if short_url.nil?
67
+ render plain: "ERROR: Could not generate QR code", status: :not_found
54
68
  return
55
69
  end
56
70
 
57
71
  width = params[:width].to_i
58
72
  height = params[:height].to_i
59
73
  if width > 2048 || height > 2048
60
- render :text => "ERROR: Requested image size is too large", :status => :bad_request
74
+ render plain: "ERROR: Requested image size is too large", status: :bad_request
61
75
  return
62
76
  end
63
77
 
@@ -66,24 +80,37 @@ module ShortRails
66
80
  version = 3
67
81
  while qr.nil? && version < 40
68
82
  begin
69
- qr = RQRCode::QRCode.new( short_url_url, :size => version, :level => :h )
83
+ qr = RQRCode::QRCode.new(short_url_url, size: version, level: :h)
70
84
  rescue
71
85
  # current version has not enough capacity, try next version
72
86
  version += 1
73
87
  end
74
88
  end
75
89
  if qr.nil?
76
- render :text => "ERROR: Could not generate QR code", :status => :bad_request
90
+ render plain: "ERROR: Could not generate QR code", status: :bad_request
77
91
  return
78
92
  end
79
- qr_image = qr.to_img
80
93
 
81
94
  qr_size = 17 + 4 * version
82
- # default size is QR code pixels with a border of 1/10 that size
83
- img_size =(qr_size + qr_size/10 * 2)
84
- # clamp to min default size
85
- width = [width, img_size].max
86
- height = [height, img_size].max
95
+ # min size is QR code pixels with a border of 4 QR code pixels
96
+ border_modules = 4
97
+ min_size = (qr_size + border_modules * 2)
98
+ if params[:width].nil? && params[:height].nil?
99
+ # default size with 3 image pixels per QR code pixel
100
+ img_size = 3 * min_size
101
+ width = img_size
102
+ height = img_size
103
+ else
104
+ # clamp to min default size
105
+ width = [width, min_size].max
106
+ height = [height, min_size].max
107
+ img_size = [width, height].min
108
+ end
109
+
110
+ qr_image = qr.as_png(
111
+ size: img_size,
112
+ border_modules: border_modules
113
+ )
87
114
 
88
115
  if width > img_size || height > img_size
89
116
  # calculate image size to fit scaled QR code to requested size
@@ -100,8 +127,10 @@ module ShortRails
100
127
  end
101
128
  end
102
129
 
103
- send_data qr_image.to_string, :type => 'image/png', :disposition => 'inline', :filename => "#{params[:short]}.png"
104
- end
130
+ # update updated_at timestamp
131
+ short_url.touch
105
132
 
133
+ send_data qr_image.to_s, type: 'image/png', disposition: 'inline', filename: "#{params[:short]}.png"
134
+ end
106
135
  end
107
136
  end
@@ -0,0 +1,4 @@
1
+ module ShortRails
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module ShortRails
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: 'from@example.com'
4
+ layout 'mailer'
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module ShortRails
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -1,7 +1,16 @@
1
1
  module ShortRails
2
- class ShortUrl < ActiveRecord::Base
3
- attr_accessible :short, :url, :url_short_param, :params
4
-
2
+ class ShortUrl < ApplicationRecord
5
3
  serialize :params
4
+
5
+ validate :url_host_in_whitelist
6
+
7
+ def url_host_in_whitelist
8
+ unless ShortRails.host_whitelist.nil?
9
+ uri = URI.parse(url)
10
+ unless ShortRails.host_whitelist.include?(uri.host)
11
+ errors.add(:url, "is not in host whitelist")
12
+ end
13
+ end
14
+ end
6
15
  end
7
16
  end
@@ -1,10 +1,11 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>ShortRails</title>
5
- <%= stylesheet_link_tag "short_rails/application", :media => "all" %>
6
- <%= javascript_include_tag "short_rails/application" %>
4
+ <title>Short rails</title>
7
5
  <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+
8
+ <%= stylesheet_link_tag "short_rails/application", media: "all" %>
8
9
  </head>
9
10
  <body>
10
11
 
data/config/routes.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  ShortRails::Engine.routes.draw do
2
- match ':short' => 'short_urls#show', :as => :short_url
3
- match ':short/params' => 'short_urls#parameters', :as => :short_url_params
4
- match ':short/qrcode' => 'short_urls#qrcode', :as => :short_url_qrcode
2
+ get ':short' => 'short_urls#show', as: :short_url
3
+ get ':short/params' => 'short_urls#parameters', as: :short_url_params
4
+ get ':short/qrcode' => 'short_urls#qrcode', as: :short_url_qrcode
5
5
 
6
- root :to => 'short_urls#create', :via => :post
6
+ root to: 'short_urls#create', via: :post
7
7
  end
@@ -1,9 +1,10 @@
1
- class CreateShortRailsShortUrls < ActiveRecord::Migration
1
+ class CreateShortRailsShortUrls < ActiveRecord::Migration[6.1]
2
2
  def change
3
3
  create_table :short_rails_short_urls do |t|
4
4
  t.string :short, :null => false, :index => true
5
5
  t.string :url, :null => false
6
6
  t.text :params
7
+ t.string :url_short_param
7
8
 
8
9
  t.timestamps
9
10
  end
@@ -1,3 +1,3 @@
1
1
  module ShortRails
2
- VERSION = "1.0.0"
2
+ VERSION = '2.0.2'
3
3
  end
data/lib/short_rails.rb CHANGED
@@ -1,4 +1,11 @@
1
+ require "short_rails/version"
1
2
  require "short_rails/engine"
2
3
 
3
4
  module ShortRails
5
+ mattr_accessor :host_whitelist
6
+ @@host_whitelist = nil
7
+
8
+ def self.setup
9
+ yield self
10
+ end
4
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: short_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathias Walker
@@ -9,51 +9,43 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-09 00:00:00.000000000 Z
12
+ date: 2022-07-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 3.2.13
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ~>
20
+ version: 6.1.4
21
+ - - ">="
26
22
  - !ruby/object:Gem::Version
27
- version: 3.2.13
28
- - !ruby/object:Gem::Dependency
29
- name: rqrcode_png
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ! '>='
33
- - !ruby/object:Gem::Version
34
- version: '0'
23
+ version: 6.1.4.1
35
24
  type: :runtime
36
25
  prerelease: false
37
26
  version_requirements: !ruby/object:Gem::Requirement
38
27
  requirements:
39
- - - ! '>='
28
+ - - "~>"
29
+ - !ruby/object:Gem::Version
30
+ version: 6.1.4
31
+ - - ">="
40
32
  - !ruby/object:Gem::Version
41
- version: '0'
33
+ version: 6.1.4.1
42
34
  - !ruby/object:Gem::Dependency
43
- name: sqlite3
35
+ name: rqrcode
44
36
  requirement: !ruby/object:Gem::Requirement
45
37
  requirements:
46
- - - ! '>='
38
+ - - "~>"
47
39
  - !ruby/object:Gem::Version
48
- version: '0'
49
- type: :development
40
+ version: '2.1'
41
+ type: :runtime
50
42
  prerelease: false
51
43
  version_requirements: !ruby/object:Gem::Requirement
52
44
  requirements:
53
- - - ! '>='
45
+ - - "~>"
54
46
  - !ruby/object:Gem::Version
55
- version: '0'
56
- description: URL shortener for Rails
47
+ version: '2.1'
48
+ description: URL shortener for Rails 6
57
49
  email:
58
50
  - info@sourcepole.ch
59
51
  executables: []
@@ -63,58 +55,25 @@ files:
63
55
  - MIT-LICENSE
64
56
  - README.md
65
57
  - Rakefile
66
- - app/assets/javascripts/short_rails/application.js
58
+ - app/assets/config/short_rails_manifest.js
67
59
  - app/assets/stylesheets/short_rails/application.css
68
60
  - app/controllers/short_rails/application_controller.rb
69
61
  - app/controllers/short_rails/short_urls_controller.rb
70
62
  - app/helpers/short_rails/application_helper.rb
63
+ - app/jobs/short_rails/application_job.rb
64
+ - app/mailers/short_rails/application_mailer.rb
65
+ - app/models/short_rails/application_record.rb
71
66
  - app/models/short_rails/short_url.rb
72
67
  - app/views/layouts/short_rails/application.html.erb
73
68
  - config/routes.rb
74
- - db/migrate/20121123124825_create_short_rails_short_urls.rb
75
- - db/migrate/20130108094545_add_url_short_param_to_short_urls.rb
69
+ - db/migrate/20211116084848_create_short_rails_short_urls.rb
76
70
  - lib/short_rails.rb
77
71
  - lib/short_rails/engine.rb
78
72
  - lib/short_rails/version.rb
79
73
  - lib/tasks/short_rails_tasks.rake
80
- - test/dummy/README.rdoc
81
- - test/dummy/Rakefile
82
- - test/dummy/app/assets/javascripts/application.js
83
- - test/dummy/app/assets/stylesheets/application.css
84
- - test/dummy/app/controllers/application_controller.rb
85
- - test/dummy/app/helpers/application_helper.rb
86
- - test/dummy/app/views/layouts/application.html.erb
87
- - test/dummy/config.ru
88
- - test/dummy/config/application.rb
89
- - test/dummy/config/boot.rb
90
- - test/dummy/config/database.yml
91
- - test/dummy/config/environment.rb
92
- - test/dummy/config/environments/development.rb
93
- - test/dummy/config/environments/production.rb
94
- - test/dummy/config/environments/test.rb
95
- - test/dummy/config/initializers/backtrace_silencers.rb
96
- - test/dummy/config/initializers/inflections.rb
97
- - test/dummy/config/initializers/mime_types.rb
98
- - test/dummy/config/initializers/secret_token.rb
99
- - test/dummy/config/initializers/session_store.rb
100
- - test/dummy/config/initializers/wrap_parameters.rb
101
- - test/dummy/config/locales/en.yml
102
- - test/dummy/config/routes.rb
103
- - test/dummy/db/development.sqlite3
104
- - test/dummy/db/migrate/20121123133344_create_short_rails_short_urls.short_rails.rb
105
- - test/dummy/db/migrate/20130108094709_add_url_short_param_to_short_urls.short_rails.rb
106
- - test/dummy/db/schema.rb
107
- - test/dummy/log/development.log
108
- - test/dummy/public/404.html
109
- - test/dummy/public/422.html
110
- - test/dummy/public/500.html
111
- - test/dummy/public/favicon.ico
112
- - test/dummy/script/rails
113
- - test/integration/navigation_test.rb
114
- - test/short_rails_test.rb
115
- - test/test_helper.rb
116
- homepage: http://www.sourcepole.ch
117
- licenses: []
74
+ homepage: https://sourcepole.ch
75
+ licenses:
76
+ - MIT
118
77
  metadata: {}
119
78
  post_install_message:
120
79
  rdoc_options: []
@@ -122,54 +81,17 @@ require_paths:
122
81
  - lib
123
82
  required_ruby_version: !ruby/object:Gem::Requirement
124
83
  requirements:
125
- - - ! '>='
84
+ - - ">="
126
85
  - !ruby/object:Gem::Version
127
- version: '0'
86
+ version: 2.6.0
128
87
  required_rubygems_version: !ruby/object:Gem::Requirement
129
88
  requirements:
130
- - - ! '>='
89
+ - - ">="
131
90
  - !ruby/object:Gem::Version
132
91
  version: '0'
133
92
  requirements: []
134
- rubyforge_project:
135
- rubygems_version: 2.2.2
93
+ rubygems_version: 3.3.16
136
94
  signing_key:
137
95
  specification_version: 4
138
96
  summary: URL shortener
139
- test_files:
140
- - test/short_rails_test.rb
141
- - test/test_helper.rb
142
- - test/dummy/config/environment.rb
143
- - test/dummy/config/environments/development.rb
144
- - test/dummy/config/environments/production.rb
145
- - test/dummy/config/environments/test.rb
146
- - test/dummy/config/application.rb
147
- - test/dummy/config/initializers/session_store.rb
148
- - test/dummy/config/initializers/wrap_parameters.rb
149
- - test/dummy/config/initializers/mime_types.rb
150
- - test/dummy/config/initializers/backtrace_silencers.rb
151
- - test/dummy/config/initializers/secret_token.rb
152
- - test/dummy/config/initializers/inflections.rb
153
- - test/dummy/config/locales/en.yml
154
- - test/dummy/config/boot.rb
155
- - test/dummy/config/database.yml
156
- - test/dummy/config/routes.rb
157
- - test/dummy/README.rdoc
158
- - test/dummy/log/development.log
159
- - test/dummy/Rakefile
160
- - test/dummy/script/rails
161
- - test/dummy/config.ru
162
- - test/dummy/app/views/layouts/application.html.erb
163
- - test/dummy/app/controllers/application_controller.rb
164
- - test/dummy/app/helpers/application_helper.rb
165
- - test/dummy/app/assets/javascripts/application.js
166
- - test/dummy/app/assets/stylesheets/application.css
167
- - test/dummy/db/migrate/20130108094709_add_url_short_param_to_short_urls.short_rails.rb
168
- - test/dummy/db/migrate/20121123133344_create_short_rails_short_urls.short_rails.rb
169
- - test/dummy/db/schema.rb
170
- - test/dummy/db/development.sqlite3
171
- - test/dummy/public/422.html
172
- - test/dummy/public/favicon.ico
173
- - test/dummy/public/500.html
174
- - test/dummy/public/404.html
175
- - test/integration/navigation_test.rb
97
+ test_files: []