rails_client_checker 0.0.1
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/Gemfile +4 -0
- data/Gemfile.lock +17 -0
- data/LICENSE +20 -0
- data/README.md +153 -0
- data/Rakefile +1 -0
- data/app/assets/javascripts/browser-update.js +288 -0
- data/app/assets/javascripts/check.js +159 -0
- data/app/assets/javascripts/client_checker_dummy.js +1 -0
- data/app/assets/javascripts/custom_checkers.js +1 -0
- data/app/assets/javascripts/jquery.min.js +2 -0
- data/app/assets/javascripts/pusher.min.js +106 -0
- data/app/assets/stylesheets/rails_client_checker/check.css +59 -0
- data/app/controllers/rails_client_checker/checker_controller.rb +25 -0
- data/app/helpers/rails_client_checker/checker_helper.rb +27 -0
- data/app/views/rails_client_checker/checker/_noscript.html.erb +3 -0
- data/app/views/rails_client_checker/checker/check.html.erb +49 -0
- data/config/initializers/assets.rb +1 -0
- data/config/routes.rb +5 -0
- data/lib/generators/rails_client_checker/initializer_generator.rb +11 -0
- data/lib/generators/rails_client_checker/templates/initializer.rb +32 -0
- data/lib/generators/rails_client_checker/view_generator.rb +18 -0
- data/lib/rails_client_checker/configuration.rb +27 -0
- data/lib/rails_client_checker/engine.rb +5 -0
- data/lib/rails_client_checker/version.rb +3 -0
- data/lib/rails_client_checker.rb +6 -0
- data/rails_client_checker.gemspec +36 -0
- metadata +103 -0
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.assets.precompile += %w( client_checker_dummy.js )
|
data/config/routes.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
module RailsClientChecker
|
2
|
+
class InitializerGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path("../templates", __FILE__)
|
4
|
+
|
5
|
+
desc "This generator creates an initializer configuration file for rails_client_checker at config/initializers"
|
6
|
+
def create_initializer_file
|
7
|
+
copy_file "initializer.rb", "config/initializers/rails_client_checker.rb"
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
RailsClientChecker.setup do |config|
|
2
|
+
# Set the checker page title
|
3
|
+
# Default: "Rails app client checker"
|
4
|
+
#
|
5
|
+
# config.title = "My cool Rails app checker page"
|
6
|
+
|
7
|
+
# Set the application name that appears in checker final report
|
8
|
+
# Default: "this website"
|
9
|
+
#
|
10
|
+
# config.appname = "CoolApp"
|
11
|
+
|
12
|
+
# Disable default checkers or enable optional checkers
|
13
|
+
# These checkers are enabled by default: browser, cookies, assets
|
14
|
+
#
|
15
|
+
# config.checkers.delete "cookies"
|
16
|
+
# config.checkers.delete "assets"
|
17
|
+
# config.checkers.delete "browser"
|
18
|
+
#
|
19
|
+
# Optional checkers: pusher
|
20
|
+
# If you enable pusher checker, you need to have it properly configured in your app
|
21
|
+
# For more information about pusher, check https://github.com/pusher/pusher-http-ruby
|
22
|
+
#
|
23
|
+
# config.checkers << "pusher"
|
24
|
+
|
25
|
+
# Set the support page link that appears in the failure report message
|
26
|
+
# Default: there is no default, the "Contact us" message won't appear
|
27
|
+
# If you set a support page link, a message will appear in the failure report saying:
|
28
|
+
# "You can also <a>contact us</a> for more help."
|
29
|
+
#
|
30
|
+
# config.support_page = "Any valid URL, you can also use any ENV variable as well"
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module RailsClientChecker
|
2
|
+
class ViewGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path("../../../../app/views/rails_client_checker/checker", __FILE__)
|
4
|
+
|
5
|
+
desc "This generator copies the checker page view so that you can customize the page html"
|
6
|
+
def copy_view
|
7
|
+
empty_directory "app/views/rails_client_checker/checker"
|
8
|
+
copy_file "check.html.erb", "app/views/rails_client_checker/checker/check.html.erb"
|
9
|
+
copy_file "_noscript.html.erb", "app/views/rails_client_checker/checker/_noscript.html.erb"
|
10
|
+
end
|
11
|
+
|
12
|
+
desc "This generator copies the checker stylesheet so that you can customize the css"
|
13
|
+
def copy_stylesheet
|
14
|
+
copy_file "../../../assets/stylesheets/rails_client_checker/check.css", "app/assets/stylesheets/rails_client_checker/check.css"
|
15
|
+
puts "You MUST restart your rails server before your modifications to the above files can take effect"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module RailsClientChecker
|
2
|
+
class Configuration
|
3
|
+
|
4
|
+
attr_accessor :checkers, :title, :appname, :support_page
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
@checkers = %w(browser cookies assets)
|
8
|
+
@title = "Rails app client checker"
|
9
|
+
@appname = "this website"
|
10
|
+
@support_page = ""
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
class << self
|
16
|
+
attr_accessor :config_instance
|
17
|
+
|
18
|
+
def config
|
19
|
+
self.config_instance ||= Configuration.new
|
20
|
+
end
|
21
|
+
|
22
|
+
def setup
|
23
|
+
yield config
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
# developemnt instructions:
|
4
|
+
# 1- Do your modifications
|
5
|
+
# 2- Increase version number in lib/rails_client_checker/version.rb
|
6
|
+
# 3- gem build rails_client_checker.gemspec
|
7
|
+
# 4a- test the code by pointing Gemfile entry to rails_client_checker path
|
8
|
+
# 4b- test by: gem install rails_client_checker-VERSION.gem then upgrade version in Gemfile
|
9
|
+
# 5- git add, commit and push
|
10
|
+
# 6- gem push rails_client_checker-VERSION.gem
|
11
|
+
|
12
|
+
|
13
|
+
lib = File.expand_path('../lib', __FILE__)
|
14
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
15
|
+
require 'rails_client_checker/version'
|
16
|
+
|
17
|
+
Gem::Specification.new do |spec|
|
18
|
+
spec.name = "rails_client_checker"
|
19
|
+
spec.version = RailsClientChecker::VERSION
|
20
|
+
spec.authors = ["Hossam Hammady"]
|
21
|
+
spec.email = ["github@hammady.net"]
|
22
|
+
spec.description = %q{Offer end-users a configurable /check route to check their browsers compatibility with your Rails application,
|
23
|
+
with the ability to enable/disable standard checker modules or even add their own module logic in Javascript.
|
24
|
+
Standard checkers are: browser name/version, cookies, asset loading and Pusher connectivity.}
|
25
|
+
spec.summary = %q{Offer end-users of Rails applications a configurable /check route to check their browsers compatibility.}
|
26
|
+
spec.homepage = "https://github.com/hammady/rails_client_checker"
|
27
|
+
spec.license = "MIT"
|
28
|
+
|
29
|
+
spec.files = `git ls-files`.split($/)
|
30
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
31
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
32
|
+
spec.require_paths = ["lib"]
|
33
|
+
|
34
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
35
|
+
spec.add_development_dependency 'rake', '~> 0'
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails_client_checker
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Hossam Hammady
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: "Offer end-users a configurable /check route to check their browsers
|
42
|
+
compatibility with your Rails application,\n\t with the ability to enable/disable
|
43
|
+
standard checker modules or even add their own module logic in Javascript.\n \t
|
44
|
+
\ Standard checkers are: browser name/version, cookies, asset loading and Pusher
|
45
|
+
connectivity."
|
46
|
+
email:
|
47
|
+
- github@hammady.net
|
48
|
+
executables: []
|
49
|
+
extensions: []
|
50
|
+
extra_rdoc_files: []
|
51
|
+
files:
|
52
|
+
- Gemfile
|
53
|
+
- Gemfile.lock
|
54
|
+
- LICENSE
|
55
|
+
- README.md
|
56
|
+
- Rakefile
|
57
|
+
- app/assets/javascripts/browser-update.js
|
58
|
+
- app/assets/javascripts/check.js
|
59
|
+
- app/assets/javascripts/client_checker_dummy.js
|
60
|
+
- app/assets/javascripts/custom_checkers.js
|
61
|
+
- app/assets/javascripts/jquery.min.js
|
62
|
+
- app/assets/javascripts/pusher.min.js
|
63
|
+
- app/assets/stylesheets/rails_client_checker/check.css
|
64
|
+
- app/controllers/rails_client_checker/checker_controller.rb
|
65
|
+
- app/helpers/rails_client_checker/checker_helper.rb
|
66
|
+
- app/views/rails_client_checker/checker/_noscript.html.erb
|
67
|
+
- app/views/rails_client_checker/checker/check.html.erb
|
68
|
+
- config/initializers/assets.rb
|
69
|
+
- config/routes.rb
|
70
|
+
- lib/generators/rails_client_checker/initializer_generator.rb
|
71
|
+
- lib/generators/rails_client_checker/templates/initializer.rb
|
72
|
+
- lib/generators/rails_client_checker/view_generator.rb
|
73
|
+
- lib/rails_client_checker.rb
|
74
|
+
- lib/rails_client_checker/configuration.rb
|
75
|
+
- lib/rails_client_checker/engine.rb
|
76
|
+
- lib/rails_client_checker/version.rb
|
77
|
+
- rails_client_checker.gemspec
|
78
|
+
homepage: https://github.com/hammady/rails_client_checker
|
79
|
+
licenses:
|
80
|
+
- MIT
|
81
|
+
metadata: {}
|
82
|
+
post_install_message:
|
83
|
+
rdoc_options: []
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
requirements: []
|
97
|
+
rubyforge_project:
|
98
|
+
rubygems_version: 2.4.6
|
99
|
+
signing_key:
|
100
|
+
specification_version: 4
|
101
|
+
summary: Offer end-users of Rails applications a configurable /check route to check
|
102
|
+
their browsers compatibility.
|
103
|
+
test_files: []
|