ito 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +10 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +127 -0
- data/ito.gemspec +20 -0
- data/lib/ito.rb +17 -0
- data/lib/ito/railtie.rb +9 -0
- data/lib/ito/version.rb +3 -0
- data/test/dummy/.envrc +2 -0
- data/test/dummy/.ruby-version +1 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/config/manifest.js +3 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/javascripts/cable.js +13 -0
- data/test/dummy/app/assets/javascripts/channels/.keep +0 -0
- data/test/dummy/app/assets/javascripts/home.js +2 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/assets/stylesheets/home.css +4 -0
- data/test/dummy/app/channels/application_cable/channel.rb +4 -0
- data/test/dummy/app/channels/application_cable/connection.rb +4 -0
- data/test/dummy/app/controllers/application_controller.rb +2 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/controllers/welcome_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/home_helper.rb +2 -0
- data/test/dummy/app/jobs/application_job.rb +2 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/application_record.rb +3 -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/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/app/views/welcome/index.html.erb +1 -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/bin/setup +36 -0
- data/test/dummy/bin/update +31 -0
- data/test/dummy/bin/yarn +11 -0
- data/test/dummy/config.ru +5 -0
- data/test/dummy/config/application.rb +18 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cable.yml +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +61 -0
- data/test/dummy/config/environments/production.rb +94 -0
- data/test/dummy/config/environments/test.rb +46 -0
- data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/test/dummy/config/initializers/assets.rb +14 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/content_security_policy.rb +25 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +5 -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/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +33 -0
- data/test/dummy/config/puma.rb +34 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/config/spring.rb +6 -0
- data/test/dummy/config/storage.yml +34 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/package.json +5 -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/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/test/controllers/home_controller_test.rb +8 -0
- metadata +73 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 706bd8bf0946f441fbdd3a7d9dc2f5c29dd21d4a63a07a3d2a7fdce63ad5b575
|
4
|
+
data.tar.gz: 828f94e2def34769def8914e7da90fb6af05c1a9df29d01eb26b13756e8f70de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c848e43a86269b48f1da101d3f1a6da75627e2e8ca2fa44b43870bb66f47b20e92d9c52965bea9c776edfe22c5107e5bbec5fa783e7d0ce3c70c251563648f58
|
7
|
+
data.tar.gz: 4570b25763391f6853b034ad6e227875a7d761bc2ce681546e79b72dd1dde04542d3446aec62387fa09d277326639ee820835fef9c4250a8f65088fbe16bc0c8
|
data/.gitignore
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
3
|
+
|
4
|
+
# Declare your gem's dependencies in ito.gemspec.
|
5
|
+
# Bundler will treat runtime dependencies like base dependencies, and
|
6
|
+
# development dependencies will be added by default to the :development group.
|
7
|
+
gemspec
|
8
|
+
|
9
|
+
# Declare any dependencies that are still in development here instead of in
|
10
|
+
# your gemspec. These might include edge Rails or gems from your path or
|
11
|
+
# Git. Remember to move these dependencies to your gemspec before releasing
|
12
|
+
# your gem to rubygems.org.
|
13
|
+
|
14
|
+
# To use a debugger
|
15
|
+
# gem 'byebug', group: [:development, :test]
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ito (0.4.0)
|
5
|
+
rails (~> 5.2.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actioncable (5.2.0)
|
11
|
+
actionpack (= 5.2.0)
|
12
|
+
nio4r (~> 2.0)
|
13
|
+
websocket-driver (>= 0.6.1)
|
14
|
+
actionmailer (5.2.0)
|
15
|
+
actionpack (= 5.2.0)
|
16
|
+
actionview (= 5.2.0)
|
17
|
+
activejob (= 5.2.0)
|
18
|
+
mail (~> 2.5, >= 2.5.4)
|
19
|
+
rails-dom-testing (~> 2.0)
|
20
|
+
actionpack (5.2.0)
|
21
|
+
actionview (= 5.2.0)
|
22
|
+
activesupport (= 5.2.0)
|
23
|
+
rack (~> 2.0)
|
24
|
+
rack-test (>= 0.6.3)
|
25
|
+
rails-dom-testing (~> 2.0)
|
26
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
+
actionview (5.2.0)
|
28
|
+
activesupport (= 5.2.0)
|
29
|
+
builder (~> 3.1)
|
30
|
+
erubi (~> 1.4)
|
31
|
+
rails-dom-testing (~> 2.0)
|
32
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
+
activejob (5.2.0)
|
34
|
+
activesupport (= 5.2.0)
|
35
|
+
globalid (>= 0.3.6)
|
36
|
+
activemodel (5.2.0)
|
37
|
+
activesupport (= 5.2.0)
|
38
|
+
activerecord (5.2.0)
|
39
|
+
activemodel (= 5.2.0)
|
40
|
+
activesupport (= 5.2.0)
|
41
|
+
arel (>= 9.0)
|
42
|
+
activestorage (5.2.0)
|
43
|
+
actionpack (= 5.2.0)
|
44
|
+
activerecord (= 5.2.0)
|
45
|
+
marcel (~> 0.3.1)
|
46
|
+
activesupport (5.2.0)
|
47
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
48
|
+
i18n (>= 0.7, < 2)
|
49
|
+
minitest (~> 5.1)
|
50
|
+
tzinfo (~> 1.1)
|
51
|
+
arel (9.0.0)
|
52
|
+
builder (3.2.3)
|
53
|
+
concurrent-ruby (1.0.5)
|
54
|
+
crass (1.0.4)
|
55
|
+
erubi (1.7.1)
|
56
|
+
globalid (0.4.1)
|
57
|
+
activesupport (>= 4.2.0)
|
58
|
+
i18n (1.0.1)
|
59
|
+
concurrent-ruby (~> 1.0)
|
60
|
+
loofah (2.2.2)
|
61
|
+
crass (~> 1.0.2)
|
62
|
+
nokogiri (>= 1.5.9)
|
63
|
+
mail (2.7.0)
|
64
|
+
mini_mime (>= 0.1.1)
|
65
|
+
marcel (0.3.2)
|
66
|
+
mimemagic (~> 0.3.2)
|
67
|
+
method_source (0.9.0)
|
68
|
+
mimemagic (0.3.2)
|
69
|
+
mini_mime (1.0.0)
|
70
|
+
mini_portile2 (2.3.0)
|
71
|
+
minitest (5.11.3)
|
72
|
+
nio4r (2.3.1)
|
73
|
+
nokogiri (1.8.2)
|
74
|
+
mini_portile2 (~> 2.3.0)
|
75
|
+
rack (2.0.5)
|
76
|
+
rack-test (1.0.0)
|
77
|
+
rack (>= 1.0, < 3)
|
78
|
+
rails (5.2.0)
|
79
|
+
actioncable (= 5.2.0)
|
80
|
+
actionmailer (= 5.2.0)
|
81
|
+
actionpack (= 5.2.0)
|
82
|
+
actionview (= 5.2.0)
|
83
|
+
activejob (= 5.2.0)
|
84
|
+
activemodel (= 5.2.0)
|
85
|
+
activerecord (= 5.2.0)
|
86
|
+
activestorage (= 5.2.0)
|
87
|
+
activesupport (= 5.2.0)
|
88
|
+
bundler (>= 1.3.0)
|
89
|
+
railties (= 5.2.0)
|
90
|
+
sprockets-rails (>= 2.0.0)
|
91
|
+
rails-dom-testing (2.0.3)
|
92
|
+
activesupport (>= 4.2.0)
|
93
|
+
nokogiri (>= 1.6)
|
94
|
+
rails-html-sanitizer (1.0.4)
|
95
|
+
loofah (~> 2.2, >= 2.2.2)
|
96
|
+
railties (5.2.0)
|
97
|
+
actionpack (= 5.2.0)
|
98
|
+
activesupport (= 5.2.0)
|
99
|
+
method_source
|
100
|
+
rake (>= 0.8.7)
|
101
|
+
thor (>= 0.18.1, < 2.0)
|
102
|
+
rake (12.3.1)
|
103
|
+
sprockets (3.7.1)
|
104
|
+
concurrent-ruby (~> 1.0)
|
105
|
+
rack (> 1, < 3)
|
106
|
+
sprockets-rails (3.2.1)
|
107
|
+
actionpack (>= 4.0)
|
108
|
+
activesupport (>= 4.0)
|
109
|
+
sprockets (>= 3.0.0)
|
110
|
+
sqlite3 (1.3.13)
|
111
|
+
thor (0.20.0)
|
112
|
+
thread_safe (0.3.6)
|
113
|
+
tzinfo (1.2.5)
|
114
|
+
thread_safe (~> 0.1)
|
115
|
+
websocket-driver (0.7.0)
|
116
|
+
websocket-extensions (>= 0.1.0)
|
117
|
+
websocket-extensions (0.1.3)
|
118
|
+
|
119
|
+
PLATFORMS
|
120
|
+
ruby
|
121
|
+
|
122
|
+
DEPENDENCIES
|
123
|
+
ito!
|
124
|
+
sqlite3
|
125
|
+
|
126
|
+
BUNDLED WITH
|
127
|
+
1.16.1
|
data/ito.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
4
|
+
require 'ito/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = 'ito'
|
8
|
+
s.version = Ito::VERSION
|
9
|
+
s.authors = ['taki']
|
10
|
+
s.email = ['taki@users.noreply.github.com']
|
11
|
+
s.homepage = 'https://github.com/taki/ito'
|
12
|
+
s.summary = 'Authenticate using basic access authentication'
|
13
|
+
s.license = 'MIT'
|
14
|
+
s.files = `git ls-files -z`.split("\x0")
|
15
|
+
s.require_paths = ['lib']
|
16
|
+
|
17
|
+
s.add_dependency 'rails', '~> 5.2.0'
|
18
|
+
|
19
|
+
s.add_development_dependency 'sqlite3'
|
20
|
+
end
|
data/lib/ito.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'active_support/concern'
|
2
|
+
|
3
|
+
module Ito
|
4
|
+
extend ::ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
before_action :basic_auth
|
8
|
+
end
|
9
|
+
|
10
|
+
def basic_auth
|
11
|
+
authenticate_or_request_with_http_basic do |user_name, password|
|
12
|
+
user_name == ENV['USER_NAME'] && password == ENV['PASSWORD']
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
require 'ito/railtie' if defined?(Rails)
|
data/lib/ito/railtie.rb
ADDED
data/lib/ito/version.rb
ADDED
data/test/dummy/.envrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.1
|
data/test/dummy/Rakefile
ADDED
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require rails-ujs
|
14
|
+
//= require activestorage
|
15
|
+
//= require_tree .
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// Action Cable provides the framework to deal with WebSockets in Rails.
|
2
|
+
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
3
|
+
//
|
4
|
+
//= require action_cable
|
5
|
+
//= require_self
|
6
|
+
//= require_tree ./channels
|
7
|
+
|
8
|
+
(function() {
|
9
|
+
this.App || (this.App = {});
|
10
|
+
|
11
|
+
App.cable = ActionCable.createConsumer();
|
12
|
+
|
13
|
+
}).call(this);
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
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.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
File without changes
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= csrf_meta_tags %>
|
6
|
+
<%= csp_meta_tag %>
|
7
|
+
|
8
|
+
<%= stylesheet_link_tag 'application', media: 'all' %>
|
9
|
+
<%= javascript_include_tag 'application' %>
|
10
|
+
</head>
|
11
|
+
|
12
|
+
<body>
|
13
|
+
<%= yield %>
|
14
|
+
</body>
|
15
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>This is basic authencation sample.</h1>
|
data/test/dummy/bin/rake
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
include FileUtils
|
4
|
+
|
5
|
+
# path to your application root.
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
7
|
+
|
8
|
+
def system!(*args)
|
9
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
10
|
+
end
|
11
|
+
|
12
|
+
chdir APP_ROOT do
|
13
|
+
# This script is a starting point to setup your application.
|
14
|
+
# Add necessary setup steps to this file.
|
15
|
+
|
16
|
+
puts '== Installing dependencies =='
|
17
|
+
system! 'gem install bundler --conservative'
|
18
|
+
system('bundle check') || system!('bundle install')
|
19
|
+
|
20
|
+
# Install JavaScript dependencies if using Yarn
|
21
|
+
# system('bin/yarn')
|
22
|
+
|
23
|
+
# puts "\n== Copying sample files =="
|
24
|
+
# unless File.exist?('config/database.yml')
|
25
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
26
|
+
# end
|
27
|
+
|
28
|
+
puts "\n== Preparing database =="
|
29
|
+
system! 'bin/rails db:setup'
|
30
|
+
|
31
|
+
puts "\n== Removing old logs and tempfiles =="
|
32
|
+
system! 'bin/rails log:clear tmp:clear'
|
33
|
+
|
34
|
+
puts "\n== Restarting application server =="
|
35
|
+
system! 'bin/rails restart'
|
36
|
+
end
|