tiny-pro-sys 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.
Potentially problematic release.
This version of tiny-pro-sys might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/tiny-pro-sys.gemspec +12 -0
- data/web-console-4.3.0/CHANGELOG.markdown +201 -0
- data/web-console-4.3.0/MIT-LICENSE +20 -0
- data/web-console-4.3.0/README.markdown +193 -0
- data/web-console-4.3.0/Rakefile +29 -0
- data/web-console-4.3.0/lib/web-console.rb +151 -0
- data/web-console-4.3.0/lib/web_console/context.rb +45 -0
- data/web-console-4.3.0/lib/web_console/errors.rb +9 -0
- data/web-console-4.3.0/lib/web_console/evaluator.rb +42 -0
- data/web-console-4.3.0/lib/web_console/exception_mapper.rb +56 -0
- data/web-console-4.3.0/lib/web_console/extensions.rb +34 -0
- data/web-console-4.3.0/lib/web_console/injector.rb +32 -0
- data/web-console-4.3.0/lib/web_console/interceptor.rb +17 -0
- data/web-console-4.3.0/lib/web_console/locales/en.yml +15 -0
- data/web-console-4.3.0/lib/web_console/middleware.rb +137 -0
- data/web-console-4.3.0/lib/web_console/permissions.rb +42 -0
- data/web-console-4.3.0/lib/web_console/railtie.rb +88 -0
- data/web-console-4.3.0/lib/web_console/request.rb +46 -0
- data/web-console-4.3.0/lib/web_console/session.rb +80 -0
- data/web-console-4.3.0/lib/web_console/source_location.rb +12 -0
- data/web-console-4.3.0/lib/web_console/tasks/extensions.rake +62 -0
- data/web-console-4.3.0/lib/web_console/tasks/templates.rake +50 -0
- data/web-console-4.3.0/lib/web_console/template.rb +24 -0
- data/web-console-4.3.0/lib/web_console/templates/_inner_console_markup.html.erb +8 -0
- data/web-console-4.3.0/lib/web_console/templates/_markup.html.erb +5 -0
- data/web-console-4.3.0/lib/web_console/templates/_prompt_box_markup.html.erb +2 -0
- data/web-console-4.3.0/lib/web_console/templates/console.js.erb +1024 -0
- data/web-console-4.3.0/lib/web_console/templates/error_page.js.erb +69 -0
- data/web-console-4.3.0/lib/web_console/templates/index.html.erb +12 -0
- data/web-console-4.3.0/lib/web_console/templates/layouts/inlined_string.erb +1 -0
- data/web-console-4.3.0/lib/web_console/templates/layouts/javascript.erb +5 -0
- data/web-console-4.3.0/lib/web_console/templates/main.js.erb +1 -0
- data/web-console-4.3.0/lib/web_console/templates/regular_page.js.erb +24 -0
- data/web-console-4.3.0/lib/web_console/templates/style.css.erb +182 -0
- data/web-console-4.3.0/lib/web_console/testing/erb_precompiler.rb +27 -0
- data/web-console-4.3.0/lib/web_console/testing/fake_middleware.rb +44 -0
- data/web-console-4.3.0/lib/web_console/testing/helper.rb +11 -0
- data/web-console-4.3.0/lib/web_console/version.rb +5 -0
- data/web-console-4.3.0/lib/web_console/view.rb +58 -0
- data/web-console-4.3.0/lib/web_console/whiny_request.rb +33 -0
- data/web-console-4.3.0/lib/web_console.rb +37 -0
- metadata +82 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
namespace :ext do
|
|
4
|
+
rootdir = Pathname("extensions")
|
|
5
|
+
|
|
6
|
+
desc "Build Chrome Extension"
|
|
7
|
+
task chrome: "chrome:build"
|
|
8
|
+
|
|
9
|
+
namespace :chrome do
|
|
10
|
+
dist = Pathname("dist/crx")
|
|
11
|
+
extdir = rootdir.join(dist)
|
|
12
|
+
manifest_json = rootdir.join("chrome/manifest.json")
|
|
13
|
+
|
|
14
|
+
directory extdir
|
|
15
|
+
|
|
16
|
+
task build: [ extdir, "lib:templates" ] do
|
|
17
|
+
cd rootdir do
|
|
18
|
+
cp_r [ "img/", "tmp/lib/" ], dist
|
|
19
|
+
`cd chrome && git ls-files`.split("\n").each do |src|
|
|
20
|
+
dest = dist.join(src)
|
|
21
|
+
mkdir_p dest.dirname
|
|
22
|
+
cp Pathname("chrome").join(src), dest
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Generate a .crx file.
|
|
28
|
+
task crx: [ :build, :npm ] do
|
|
29
|
+
out = "crx-web-console-#{JSON.parse(File.read(manifest_json))["version"]}.crx"
|
|
30
|
+
cd(extdir) { sh "node \"$(npm bin)/crx\" pack ./ -p ../crx-web-console.pem -o ../#{out}" }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Generate a .zip file for Chrome Web Store.
|
|
34
|
+
task zip: [ :build ] do
|
|
35
|
+
version = JSON.parse(File.read(manifest_json))["version"]
|
|
36
|
+
cd(extdir) { sh "zip -r ../crx-web-console-#{version}.zip ./" }
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
desc "Launch a browser with the chrome extension."
|
|
40
|
+
task run: [ :build ] do
|
|
41
|
+
cd(rootdir) { sh "sh ./script/run_chrome.sh --load-extension=#{dist}" }
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
task :npm do
|
|
46
|
+
cd(rootdir) { sh "npm install --silent" }
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
namespace :lib do
|
|
50
|
+
templates = Pathname("lib/web_console/templates")
|
|
51
|
+
tmplib = rootdir.join("tmp/lib/")
|
|
52
|
+
js_erb = FileList.new(templates.join("**/*.js.erb"))
|
|
53
|
+
dirs = js_erb.pathmap("%{^#{templates},#{tmplib}}d")
|
|
54
|
+
|
|
55
|
+
task templates: dirs + js_erb.pathmap("%{^#{templates},#{tmplib}}X")
|
|
56
|
+
|
|
57
|
+
dirs.each { |d| directory d }
|
|
58
|
+
rule ".js" => [ "%{^#{tmplib},#{templates}}X.js.erb" ] do |t|
|
|
59
|
+
File.write(t.name, WebConsole::Testing::ERBPrecompiler.new(t.source).build)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "net/http"
|
|
4
|
+
|
|
5
|
+
namespace :templates do
|
|
6
|
+
desc "Run tests for templates"
|
|
7
|
+
task test: [ :daemonize, :npm, :rackup, :wait, :mocha, :kill, :exit ]
|
|
8
|
+
task serve: [ :npm, :rackup ]
|
|
9
|
+
|
|
10
|
+
workdir = Pathname(EXPANDED_CWD).join("test/templates")
|
|
11
|
+
pid = Pathname(Dir.tmpdir).join("web_console_test.pid")
|
|
12
|
+
runner = URI.parse("http://#{ENV['IP'] || '127.0.0.1'}:#{ENV['PORT'] || 29292}/html/test_runner.html")
|
|
13
|
+
rackup = "rackup --host #{runner.host} --port #{runner.port}"
|
|
14
|
+
result = nil
|
|
15
|
+
|
|
16
|
+
def need_to_wait?(uri)
|
|
17
|
+
Net::HTTP.start(uri.host, uri.port) { |http| http.get(uri.path) }
|
|
18
|
+
rescue Errno::ECONNREFUSED
|
|
19
|
+
retry if yield
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
task :daemonize do
|
|
23
|
+
rackup += " -D --pid #{pid}"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
task :npm do
|
|
27
|
+
Dir.chdir(workdir) { system "npm install --silent" }
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
task :rackup do
|
|
31
|
+
Dir.chdir(workdir) { system rackup }
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
task :wait do
|
|
35
|
+
cnt = 0
|
|
36
|
+
need_to_wait?(runner) { sleep 1; cnt += 1; cnt < 5 }
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
task :mocha do
|
|
40
|
+
Dir.chdir(workdir) { result = system("npx mocha-headless-chrome -f #{runner} -r dot") }
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
task :kill do
|
|
44
|
+
system "kill #{File.read pid}"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
task :exit do
|
|
48
|
+
exit result
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module WebConsole
|
|
4
|
+
# A facade that handles template rendering and composition.
|
|
5
|
+
#
|
|
6
|
+
# It introduces template helpers to ease the inclusion of scripts only on
|
|
7
|
+
# Rails error pages.
|
|
8
|
+
class Template
|
|
9
|
+
# Lets you customize the default templates folder location.
|
|
10
|
+
cattr_accessor :template_paths, default: [ File.expand_path("../templates", __FILE__) ]
|
|
11
|
+
|
|
12
|
+
def initialize(env, session)
|
|
13
|
+
@env = env
|
|
14
|
+
@session = session
|
|
15
|
+
@mount_point = Middleware.mount_point
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Render a template (inferred from +template_paths+) as a plain string.
|
|
19
|
+
def render(template)
|
|
20
|
+
view = View.with_empty_template_cache.with_view_paths(template_paths, instance_values)
|
|
21
|
+
view.render(template: template, layout: false)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|