rake_ui 0.1.0
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.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +43 -0
- data/Rakefile +55 -0
- data/app/assets/images/rake_ui/ajax-loader.gif +0 -0
- data/app/assets/javascripts/jquery.js +6883 -0
- data/app/assets/javascripts/jquery_ujs.js +160 -0
- data/app/assets/javascripts/rake_ui/application.js +9 -0
- data/app/assets/javascripts/rake_ui/rake_tasks.js +2 -0
- data/app/assets/stylesheets/rake_ui/application.css +13 -0
- data/app/assets/stylesheets/rake_ui/rake_tasks.css +4 -0
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/controllers/rake_ui/application_controller.rb +4 -0
- data/app/controllers/rake_ui/rake_tasks_controller.rb +28 -0
- data/app/helpers/rake_ui/application_helper.rb +7 -0
- data/app/helpers/rake_ui/rake_tasks_helper.rb +4 -0
- data/app/models/rake_ui/rake_task.rb +14 -0
- data/app/views/layouts/rake_ui/application.html.erb +14 -0
- data/app/views/rake_ui/rake_tasks/create.js +2 -0
- data/app/views/rake_ui/rake_tasks/index.html +16 -0
- data/app/views/rake_ui/rake_tasks/index.html.erb +48 -0
- data/app/views/rake_ui/rake_tasks/new.html.erb +0 -0
- data/app/views/rake_ui/rake_tasks/server.js +64 -0
- data/app/views/rake_ui/rake_tasks/server2.js +12 -0
- data/config/initializers/rake_tasks.rb +27 -0
- data/config/initializers/rake_ui.rb +1 -0
- data/config/routes.rb +4 -0
- data/lib/rake_ui.rb +5 -0
- data/lib/rake_ui/engine.rb +5 -0
- data/lib/rake_ui/version.rb +3 -0
- data/lib/tasks/rake_ui_tasks.rake +8 -0
- metadata +81 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
var spawn = require('child_process').spawn;
|
2
|
+
var tail = spawn("tail", ["-f", "/Users/rbrant/Sites/rake_ui/test/dummy/log/rake.log"]);
|
3
|
+
|
4
|
+
http = require('http');
|
5
|
+
http.createServer(function (req, res) {
|
6
|
+
|
7
|
+
res.writeHead(200, {'Content-Type': "text/plain;charset=UTF-8"});
|
8
|
+
tail.stdout.on("data", function (data) {
|
9
|
+
res.write(data);
|
10
|
+
});
|
11
|
+
|
12
|
+
}).listen(1337);
|
@@ -0,0 +1,27 @@
|
|
1
|
+
out = %x[ rake -T].split "\n"
|
2
|
+
tasks = out.inject([]){|memo, line| memo << line if line.include?('rake'); memo}
|
3
|
+
|
4
|
+
split_tasks = tasks.inject([]){ |memo,t|
|
5
|
+
if t.include?('#')
|
6
|
+
cmd, dsc = t.split('#').map(&:strip).flatten
|
7
|
+
memo << { :id => SecureRandom.hex(10), :cmd => cmd, :desc => dsc }
|
8
|
+
else
|
9
|
+
memo << { :id => SecureRandom.hex(10), :cmd => t.strip, :desc => 'No description' }
|
10
|
+
end
|
11
|
+
memo
|
12
|
+
}
|
13
|
+
|
14
|
+
# split each task into the task and the description
|
15
|
+
dump_path = File.join(Rails.root, "db")
|
16
|
+
FileUtils::mkdir_p(dump_path)
|
17
|
+
dump_file_path = File.join(dump_path, "rake_tasks.json")
|
18
|
+
|
19
|
+
# remove existing
|
20
|
+
FileUtils.rm_rf dump_file_path
|
21
|
+
|
22
|
+
RAKE_TASKS = split_tasks.to_json
|
23
|
+
|
24
|
+
# store as json
|
25
|
+
File.open(dump_file_path, "w") { |f|
|
26
|
+
f.puts split_tasks.to_json
|
27
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
RakeUiCfg = YAML::load(File.open(File.expand_path("#{Rails.root}/config/rake_ui.yml",__FILE__)))
|
data/config/routes.rb
ADDED
data/lib/rake_ui.rb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
# // node /data/projects/rake_ui/app/views/rake_ui/rake_tasks/server.js -host=192.168.10.107 -log=/data/projects/entos/log/rake.log
|
2
|
+
RakeUiCfg = YAML::load(File.open(File.expand_path("#{Rails.root}/config/rake_ui.yml",__FILE__)))
|
3
|
+
|
4
|
+
desc "Start the Node server"
|
5
|
+
task :start_node_server do
|
6
|
+
Kernel.system "node #{RakeUi::Engine.root}/app/views/rake_ui/rake_tasks/server.js -host=#{RakeUiCfg['host']} -log=#{RakeUiCfg['log']}"
|
7
|
+
end
|
8
|
+
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rake_ui
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- wxianfeng
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-11-05 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: run Rails rake tasks from web GUI.for rails 3.x
|
15
|
+
email:
|
16
|
+
- wang.fl1429@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- app/models/rake_ui/rake_task.rb
|
22
|
+
- app/controllers/rake_ui/rake_tasks_controller.rb
|
23
|
+
- app/controllers/rake_ui/application_controller.rb
|
24
|
+
- app/assets/images/rake_ui/ajax-loader.gif
|
25
|
+
- app/assets/stylesheets/scaffold.css
|
26
|
+
- app/assets/stylesheets/rake_ui/application.css
|
27
|
+
- app/assets/stylesheets/rake_ui/rake_tasks.css
|
28
|
+
- app/assets/javascripts/jquery.js
|
29
|
+
- app/assets/javascripts/jquery_ujs.js
|
30
|
+
- app/assets/javascripts/rake_ui/application.js
|
31
|
+
- app/assets/javascripts/rake_ui/rake_tasks.js
|
32
|
+
- app/views/layouts/rake_ui/application.html.erb
|
33
|
+
- app/views/rake_ui/rake_tasks/new.html.erb
|
34
|
+
- app/views/rake_ui/rake_tasks/server2.js
|
35
|
+
- app/views/rake_ui/rake_tasks/create.js
|
36
|
+
- app/views/rake_ui/rake_tasks/server.js
|
37
|
+
- app/views/rake_ui/rake_tasks/index.html.erb
|
38
|
+
- app/views/rake_ui/rake_tasks/index.html
|
39
|
+
- app/helpers/rake_ui/rake_tasks_helper.rb
|
40
|
+
- app/helpers/rake_ui/application_helper.rb
|
41
|
+
- config/routes.rb
|
42
|
+
- config/initializers/rake_tasks.rb
|
43
|
+
- config/initializers/rake_ui.rb
|
44
|
+
- lib/tasks/rake_ui_tasks.rake
|
45
|
+
- lib/rake_ui/version.rb
|
46
|
+
- lib/rake_ui/engine.rb
|
47
|
+
- lib/rake_ui.rb
|
48
|
+
- MIT-LICENSE
|
49
|
+
- Rakefile
|
50
|
+
- README.rdoc
|
51
|
+
homepage: https://github.com/wxianfeng/rake_ui/tree/wxianfeng
|
52
|
+
licenses: []
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
hash: 2408376268316987371
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ! '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
hash: 2408376268316987371
|
75
|
+
requirements: []
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 1.8.24
|
78
|
+
signing_key:
|
79
|
+
specification_version: 3
|
80
|
+
summary: run Rails rake tasks from web GUI.for rails 3.x
|
81
|
+
test_files: []
|