compass_ae_console 1.0.0 → 1.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.
- data/README.md +15 -1
- data/app/controllers/compass_ae_console/erp_app/desktop/base_controller.rb +14 -15
- data/lib/compass_ae_console.rb +1 -0
- data/lib/compass_ae_console/engine.rb +5 -0
- data/lib/compass_ae_console/version.rb +8 -2
- data/public/javascripts/erp_app/desktop/applications/compass_ae_console/module.js +1 -5
- metadata +48 -71
- data/public/images/console_background.png +0 -0
data/README.md
CHANGED
@@ -2,4 +2,18 @@
|
|
2
2
|
|
3
3
|
#Compass Console
|
4
4
|
|
5
|
-
Compass Console is an application that sits on top of the Compass AE framework that allows the user to interact with their rails application with a simulated rails console.
|
5
|
+
Compass Console is an application that sits on top of the Compass AE framework that allows the user to interact with their rails application with a simulated rails console.
|
6
|
+
|
7
|
+
##Getting Started
|
8
|
+
|
9
|
+
There is a gem to help you get started
|
10
|
+
|
11
|
+
Install the gem
|
12
|
+
|
13
|
+
gem install compass_ae_starter_kit
|
14
|
+
|
15
|
+
Or
|
16
|
+
|
17
|
+
clone the repository [Compass AE Starter Kit](https://github.com/portablemind/compass_ae_starter_kit)
|
18
|
+
|
19
|
+
git clone https://github.com/portablemind/compass_ae_starter_kit
|
@@ -60,36 +60,35 @@ module CompassAeConsole
|
|
60
60
|
#****************************************************************************
|
61
61
|
def highlight_class(klass)
|
62
62
|
klass.columns.map do |column|
|
63
|
-
|
63
|
+
"<font color='yellow'>#{column.name}</font><font color='lightgray'>:</font><font color='gold'>#{column.type}</font>"
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
67
|
def hightlight_instance(instance)
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
68
|
+
"".tap do |buffer|
|
69
|
+
instance.attributes.keys.sort.each do |model_attribute_key|
|
70
|
+
Rails.logger.debug("key:#{model_attribute_key}")
|
71
|
+
buffer << "<font color='yellow'>#{model_attribute_key}</font> <font color='lightgray'>=</font><font color='gold'>#{instance.attributes[model_attribute_key]}</font> <font color='lightgray'>, </font>"
|
72
|
+
end
|
73
73
|
end
|
74
|
-
return buffer
|
75
74
|
end
|
76
75
|
#****************************************************************************
|
77
76
|
|
78
77
|
def evaluate_command(command_message)
|
79
|
-
|
78
|
+
Rails.logger.debug("evaluate_command(#{command_message}")
|
80
79
|
begin
|
81
80
|
result_eval = $session_binding.eval(command_message)
|
82
81
|
if(result_eval.respond_to?("superclass") && result_eval.superclass == ActiveRecord::Base)
|
83
82
|
result = render_active_record_model(result_eval)
|
83
|
+
elsif(result_eval.class.respond_to?("superclass") && result_eval.class.superclass == ActiveRecord::Base)
|
84
|
+
result = render_array([result_eval])
|
84
85
|
elsif (result_eval.is_a? Array)
|
85
86
|
result = render_array(result_eval)
|
86
87
|
elsif (result_eval.is_a? Hash)
|
87
88
|
result = render_hash(result_eval)
|
88
89
|
else
|
89
|
-
#result="#{result_eval.class.to_s} #{result_eval.to_s}<br>"
|
90
90
|
result = "#{result_eval.to_s}<br>"
|
91
91
|
end
|
92
|
-
|
93
92
|
rescue Exception => e
|
94
93
|
result = "<font color='red'>#{e.to_s}</font>"
|
95
94
|
end
|
@@ -98,19 +97,19 @@ module CompassAeConsole
|
|
98
97
|
end
|
99
98
|
#****************************************************************************
|
100
99
|
def render_active_record_model(result_eval)
|
101
|
-
|
100
|
+
Rails.logger.debug("render_active_record_model:#{result_eval}")
|
102
101
|
"<font color='YellowGreen'>#{result_eval.class} </font><br>#{highlight_class(result_eval)} "
|
103
102
|
end
|
104
103
|
#****************************************************************************
|
105
104
|
def render_array(result_eval)
|
106
105
|
result="#{result_eval.class.to_s}<br>"
|
107
|
-
|
106
|
+
Rails.logger.debug("render_array:#{result_eval}")
|
108
107
|
count=0
|
109
108
|
result_eval.each do |array_element|
|
110
109
|
if(array_element.is_a? ActiveRecord::Base)
|
111
|
-
result<< "<font color='YellowGreen'>#{array_element.class}<font color='yellow'>[</font><font color='white'>#{count}</font><font color='yellow'>]</font> </font>#{hightlight_instance(array_element)} <br><br>"
|
110
|
+
result << "<font color='YellowGreen'>#{array_element.class}<font color='yellow'>[</font><font color='white'>#{count}</font><font color='yellow'>]</font> </font>#{hightlight_instance(array_element)} <br><br>"
|
112
111
|
else
|
113
|
-
result<<"<font color='YellowGreen'>#{array_element.class}<font color='yellow'>[</font><font color='white'>#{count}</font><font color='yellow'>]</font> </font>#{array_element} <br><br>"
|
112
|
+
result << "<font color='YellowGreen'>#{array_element.class}<font color='yellow'>[</font><font color='white'>#{count}</font><font color='yellow'>]</font> </font>#{array_element} <br><br>"
|
114
113
|
end
|
115
114
|
count=count+1
|
116
115
|
end
|
@@ -118,7 +117,7 @@ module CompassAeConsole
|
|
118
117
|
end
|
119
118
|
#****************************************************************************
|
120
119
|
def render_hash(result_eval)
|
121
|
-
|
120
|
+
Rails.logger.debug("render_hash:#{result_eval}")
|
122
121
|
result="#{result_eval.class.to_s}<br>"
|
123
122
|
count=0
|
124
123
|
result_eval.keys.each do |hash_key|
|
data/lib/compass_ae_console.rb
CHANGED
@@ -5,6 +5,11 @@ module CompassAeConsole
|
|
5
5
|
initializer "compass_console.merge_public" do |app|
|
6
6
|
app.middleware.insert_before Rack::Lock, ::ActionDispatch::Static, "#{root}/public"
|
7
7
|
end
|
8
|
+
|
9
|
+
engine = self
|
10
|
+
config.to_prepare do
|
11
|
+
ErpBaseErpSvcs.register_compass_ae_engine(engine)
|
12
|
+
end
|
8
13
|
|
9
14
|
end
|
10
15
|
end
|
@@ -56,10 +56,9 @@ function update_history_panel(text){
|
|
56
56
|
//---------------------------------
|
57
57
|
var console_history_panel ={
|
58
58
|
xtype: 'panel',
|
59
|
-
|
60
59
|
id : 'console_history_panel',
|
61
60
|
region: 'center',
|
62
|
-
bodyStyle: "background-
|
61
|
+
bodyStyle: "background-color:#000;",
|
63
62
|
autoScroll:true,
|
64
63
|
html : startup_heading
|
65
64
|
}
|
@@ -69,7 +68,6 @@ var console_history_panel ={
|
|
69
68
|
var console_text_area ={
|
70
69
|
xtype: 'textarea',
|
71
70
|
region : 'south',
|
72
|
-
style: "{background-image:url(/images/console_background.png)}",
|
73
71
|
autoscroll: true,
|
74
72
|
id: "console_text_area",
|
75
73
|
enableKeyEvents: true,
|
@@ -77,8 +75,6 @@ var console_text_area ={
|
|
77
75
|
afterrender: function(field) {
|
78
76
|
field.focus();
|
79
77
|
},
|
80
|
-
|
81
|
-
|
82
78
|
// use key-up for textarea since ENTER does not affect focus traversal
|
83
79
|
keyup: function(field, e){
|
84
80
|
//console.log("textarea keyup:"+e);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass_ae_console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,63 +9,41 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: erp_app
|
16
|
-
requirement: &
|
16
|
+
requirement: &76182450 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - =
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 3.0.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *76182450
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: erp_dev_svcs
|
27
|
-
requirement: &
|
27
|
+
requirement: &76180580 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
|
-
- -
|
30
|
+
- - =
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 3.0.1
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: rails
|
38
|
-
requirement: &2157183640 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 3.1.0
|
44
|
-
type: :runtime
|
45
|
-
prerelease: false
|
46
|
-
version_requirements: *2157183640
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: rspec-rails
|
49
|
-
requirement: &2157182360 !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ~>
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '2.5'
|
55
|
-
type: :development
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: *2157182360
|
35
|
+
version_requirements: *76180580
|
58
36
|
- !ruby/object:Gem::Dependency
|
59
37
|
name: sqlite3
|
60
|
-
requirement: &
|
38
|
+
requirement: &76203360 !ruby/object:Gem::Requirement
|
61
39
|
none: false
|
62
40
|
requirements:
|
63
|
-
- -
|
41
|
+
- - ~>
|
64
42
|
- !ruby/object:Gem::Version
|
65
|
-
version:
|
43
|
+
version: 1.3.5
|
66
44
|
type: :development
|
67
45
|
prerelease: false
|
68
|
-
version_requirements: *
|
46
|
+
version_requirements: *76203360
|
69
47
|
description: Compass AE Console is an application that sits on top of the Compass
|
70
48
|
AE framework that allows the user to interact with their rails application with
|
71
49
|
a simulated rails console.
|
@@ -75,7 +53,6 @@ executables: []
|
|
75
53
|
extensions: []
|
76
54
|
extra_rdoc_files: []
|
77
55
|
files:
|
78
|
-
- public/images/console_background.png
|
79
56
|
- public/javascripts/erp_app/desktop/applications/compass_ae_console/module.js
|
80
57
|
- app/controllers/compass_ae_console/erp_app/desktop/base_controller.rb
|
81
58
|
- config/routes.rb
|
@@ -86,32 +63,32 @@ files:
|
|
86
63
|
- GPL-3-LICENSE
|
87
64
|
- Rakefile
|
88
65
|
- README.md
|
89
|
-
- spec/
|
66
|
+
- spec/spec_helper.rb
|
67
|
+
- spec/dummy/public/422.html
|
68
|
+
- spec/dummy/public/404.html
|
69
|
+
- spec/dummy/public/500.html
|
70
|
+
- spec/dummy/public/favicon.ico
|
71
|
+
- spec/dummy/config.ru
|
90
72
|
- spec/dummy/app/assets/stylesheets/application.css
|
91
|
-
- spec/dummy/app/
|
92
|
-
- spec/dummy/app/helpers/application_helper.rb
|
73
|
+
- spec/dummy/app/assets/javascripts/application.js
|
93
74
|
- spec/dummy/app/views/layouts/application.html.erb
|
94
|
-
- spec/dummy/
|
75
|
+
- spec/dummy/app/helpers/application_helper.rb
|
76
|
+
- spec/dummy/app/controllers/application_controller.rb
|
77
|
+
- spec/dummy/config/routes.rb
|
78
|
+
- spec/dummy/config/locales/en.yml
|
95
79
|
- spec/dummy/config/boot.rb
|
96
|
-
- spec/dummy/config/
|
97
|
-
- spec/dummy/config/environment.rb
|
80
|
+
- spec/dummy/config/application.rb
|
98
81
|
- spec/dummy/config/environments/spec.rb
|
99
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
100
|
-
- spec/dummy/config/initializers/inflections.rb
|
101
82
|
- spec/dummy/config/initializers/mime_types.rb
|
102
|
-
- spec/dummy/config/initializers/secret_token.rb
|
103
83
|
- spec/dummy/config/initializers/session_store.rb
|
84
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
104
85
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
105
|
-
- spec/dummy/config/
|
106
|
-
- spec/dummy/config/
|
107
|
-
- spec/dummy/config.
|
108
|
-
- spec/dummy/
|
109
|
-
- spec/dummy/public/422.html
|
110
|
-
- spec/dummy/public/500.html
|
111
|
-
- spec/dummy/public/favicon.ico
|
86
|
+
- spec/dummy/config/initializers/inflections.rb
|
87
|
+
- spec/dummy/config/initializers/secret_token.rb
|
88
|
+
- spec/dummy/config/environment.rb
|
89
|
+
- spec/dummy/config/database.yml
|
112
90
|
- spec/dummy/Rakefile
|
113
91
|
- spec/dummy/script/rails
|
114
|
-
- spec/spec_helper.rb
|
115
92
|
homepage: http://development.compassagile.com
|
116
93
|
licenses: []
|
117
94
|
post_install_message:
|
@@ -137,29 +114,29 @@ signing_key:
|
|
137
114
|
specification_version: 3
|
138
115
|
summary: Rails Console for Compass AE Desktop
|
139
116
|
test_files:
|
140
|
-
- spec/
|
117
|
+
- spec/spec_helper.rb
|
118
|
+
- spec/dummy/public/422.html
|
119
|
+
- spec/dummy/public/404.html
|
120
|
+
- spec/dummy/public/500.html
|
121
|
+
- spec/dummy/public/favicon.ico
|
122
|
+
- spec/dummy/config.ru
|
141
123
|
- spec/dummy/app/assets/stylesheets/application.css
|
142
|
-
- spec/dummy/app/
|
143
|
-
- spec/dummy/app/helpers/application_helper.rb
|
124
|
+
- spec/dummy/app/assets/javascripts/application.js
|
144
125
|
- spec/dummy/app/views/layouts/application.html.erb
|
145
|
-
- spec/dummy/
|
126
|
+
- spec/dummy/app/helpers/application_helper.rb
|
127
|
+
- spec/dummy/app/controllers/application_controller.rb
|
128
|
+
- spec/dummy/config/routes.rb
|
129
|
+
- spec/dummy/config/locales/en.yml
|
146
130
|
- spec/dummy/config/boot.rb
|
147
|
-
- spec/dummy/config/
|
148
|
-
- spec/dummy/config/environment.rb
|
131
|
+
- spec/dummy/config/application.rb
|
149
132
|
- spec/dummy/config/environments/spec.rb
|
150
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
151
|
-
- spec/dummy/config/initializers/inflections.rb
|
152
133
|
- spec/dummy/config/initializers/mime_types.rb
|
153
|
-
- spec/dummy/config/initializers/secret_token.rb
|
154
134
|
- spec/dummy/config/initializers/session_store.rb
|
135
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
155
136
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
156
|
-
- spec/dummy/config/
|
157
|
-
- spec/dummy/config/
|
158
|
-
- spec/dummy/config.
|
159
|
-
- spec/dummy/
|
160
|
-
- spec/dummy/public/422.html
|
161
|
-
- spec/dummy/public/500.html
|
162
|
-
- spec/dummy/public/favicon.ico
|
137
|
+
- spec/dummy/config/initializers/inflections.rb
|
138
|
+
- spec/dummy/config/initializers/secret_token.rb
|
139
|
+
- spec/dummy/config/environment.rb
|
140
|
+
- spec/dummy/config/database.yml
|
163
141
|
- spec/dummy/Rakefile
|
164
142
|
- spec/dummy/script/rails
|
165
|
-
- spec/spec_helper.rb
|
Binary file
|