├── .gitignore ├── Gemfile ├── MIT-LICENSE ├── README.md ├── Rakefile ├── app ├── assets │ ├── images │ │ ├── dir_icon.png │ │ ├── file_icon.png │ │ └── rails.png │ ├── javascripts │ │ ├── conductor.js │ │ └── conductor │ │ │ ├── codes.js │ │ │ ├── databases.js │ │ │ ├── db_task.js │ │ │ ├── editor.js │ │ │ ├── generators.js │ │ │ ├── index_code.js │ │ │ ├── installgems.js │ │ │ ├── recorder.js.erb │ │ │ ├── rollback.js │ │ │ └── tests.js │ └── stylesheets │ │ ├── conductor.css.erb │ │ └── conductor │ │ ├── annotations.css │ │ ├── code.css.erb │ │ ├── editor.css │ │ ├── recorder.css │ │ └── statistics.css ├── controllers │ └── conductor │ │ ├── annotations_controller.rb │ │ ├── app_controllers_controller.rb │ │ ├── application_controller.rb │ │ ├── codes_controller.rb │ │ ├── databases_controller.rb │ │ ├── editor_controller.rb │ │ ├── gemfiles_controller.rb │ │ ├── mailers_controller.rb │ │ ├── migrations_controller.rb │ │ ├── models_controller.rb │ │ ├── recorder_controller.rb │ │ ├── resources_controller.rb │ │ ├── routes_controller.rb │ │ ├── scaffolds_controller.rb │ │ ├── statistics_controller.rb │ │ ├── tests_controller.rb │ │ └── welcome_controller.rb ├── forms │ └── conductor │ │ ├── base_generator_form.rb │ │ ├── controller_generator_form.rb │ │ ├── mailer_generator_form.rb │ │ ├── model_generator_form.rb │ │ ├── resource_generator_form.rb │ │ └── scaffold_generator_form.rb ├── helpers │ └── conductor │ │ ├── application_helper.rb │ │ ├── routes_helper.rb │ │ └── scaffolds_helper.rb ├── models │ └── conductor │ │ ├── code.rb │ │ ├── code_statistics.rb │ │ ├── database.rb │ │ ├── migrations.rb │ │ └── scaffold.rb └── views │ ├── conductor │ ├── annotations │ │ └── index.html.erb │ ├── app_controllers │ │ └── new.html.erb │ ├── codes │ │ ├── edit.html.erb │ │ └── index.html.erb │ ├── databases │ │ ├── output.html.erb │ │ ├── output_no_websocket.html.erb │ │ └── show.html.erb │ ├── editor │ │ ├── _editor.html.erb │ │ ├── index.js.erb │ │ └── save.js.erb │ ├── gemfiles │ │ ├── install.html.erb │ │ └── install_no_websocket.html.erb │ ├── mailers │ │ └── new.html.erb │ ├── migrations │ │ ├── index.html.erb │ │ └── rollback.html.erb │ ├── models │ │ └── new.html.erb │ ├── recorder │ │ ├── destroy.js.erb │ │ └── index.js.erb │ ├── resources │ │ └── new.html.erb │ ├── routes │ │ └── index.html.erb │ ├── scaffolds │ │ └── new.html.erb │ ├── statistics │ │ └── index.html.erb │ ├── tests │ │ ├── show.html.erb │ │ └── show_no_websocket.html.erb │ └── welcome │ │ └── index.html.erb │ └── layouts │ └── conductor │ └── application.html.erb ├── bin └── rails ├── conductor.gemspec ├── config └── routes.rb ├── lib ├── assets │ └── javascripts │ │ └── recorder.js.erb ├── conductor.rb └── conductor │ ├── config.rb │ ├── engine.rb │ ├── filter.rb │ ├── middleware.rb │ ├── middleware_util.rb │ └── version.rb ├── log └── .gitignore ├── test ├── conductor_test.rb ├── controllers │ └── conductor │ │ ├── databases_controller_test.rb │ │ ├── fixtures_controller_test.rb │ │ ├── gemfile_controller_test.rb │ │ ├── test_controller_test.rb │ │ └── welcome_controller_test.rb ├── dummy │ ├── Gemfile │ ├── README.rdoc │ ├── Rakefile │ ├── app │ │ ├── assets │ │ │ ├── images │ │ │ │ └── .keep │ │ │ ├── javascripts │ │ │ │ ├── application.js │ │ │ │ ├── posts.js │ │ │ │ └── usuarios.js │ │ │ └── stylesheets │ │ │ │ ├── application.css │ │ │ │ ├── posts.css │ │ │ │ ├── scaffold.css │ │ │ │ └── usuarios.css │ │ ├── controllers │ │ │ ├── application_controller.rb │ │ │ ├── concerns │ │ │ │ └── .keep │ │ │ ├── posts_controller.rb │ │ │ └── usuarios_controller.rb │ │ ├── helpers │ │ │ ├── application_helper.rb │ │ │ ├── posts_helper.rb │ │ │ └── usuarios_helper.rb │ │ ├── mailers │ │ │ ├── .keep │ │ │ └── person.rb │ │ ├── models │ │ │ ├── .keep │ │ │ ├── concerns │ │ │ │ └── .keep │ │ │ └── user.rb │ │ └── views │ │ │ ├── layouts │ │ │ └── application.html.erb │ │ │ ├── person │ │ │ └── name.text.erb │ │ │ ├── posts │ │ │ ├── _form.html.erb │ │ │ ├── edit.html.erb │ │ │ ├── index.html.erb │ │ │ ├── new.html.erb │ │ │ └── show.html.erb │ │ │ └── usuarios │ │ │ ├── _form.html.erb │ │ │ ├── edit.html.erb │ │ │ ├── index.html.erb │ │ │ ├── new.html.erb │ │ │ └── show.html.erb │ ├── bin │ │ ├── bundle │ │ ├── rails │ │ └── rake │ ├── config.ru │ ├── config │ │ ├── application.rb │ │ ├── boot.rb │ │ ├── database.yml │ │ ├── environment.rb │ │ ├── environments │ │ │ ├── development.rb │ │ │ ├── production.rb │ │ │ └── test.rb │ │ ├── initializers │ │ │ ├── backtrace_silencers.rb │ │ │ ├── filter_parameter_logging.rb │ │ │ ├── inflections.rb │ │ │ ├── mime_types.rb │ │ │ ├── secret_token.rb │ │ │ ├── session_store.rb │ │ │ └── wrap_parameters.rb │ │ ├── locales │ │ │ └── en.yml │ │ └── routes.rb │ ├── db │ │ ├── .gitkeep │ │ ├── migrate │ │ │ └── 20130827165249_create_users.rb │ │ └── schema.rb │ ├── lib │ │ └── assets │ │ │ └── .keep │ ├── log │ │ └── .keep │ ├── public │ │ ├── 404.html │ │ ├── 422.html │ │ ├── 500.html │ │ └── favicon.ico │ └── test │ │ └── fixtures │ │ └── users.yml ├── helpers │ └── conductor │ │ ├── test_helper_test.rb │ │ └── welcome_helper_test.rb ├── integration │ └── navigation_test.rb ├── models │ ├── code_statistics_test.rb │ ├── database_test.rb │ └── migrations_test.rb └── test_helper.rb └── vendor └── assets ├── javascripts └── ace │ ├── ace.js │ ├── ext-modelist.js │ ├── mode-coffee.js │ ├── mode-css.js │ ├── mode-haml.js │ ├── mode-html.js │ ├── mode-html_completions.js │ ├── mode-html_ruby.js │ ├── mode-javascript.js │ ├── mode-json.js │ ├── mode-ruby.js │ ├── mode-sass.js │ ├── mode-scss.js │ ├── mode-yaml.js │ └── theme-textmate.js └── stylesheets └── github.css /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle/ 2 | Gemfile.lock 3 | pkg/ 4 | test/dummy/db/*.sqlite3 5 | test/dummy/db/*.sqlite3-journal 6 | test/dummy/log/*.log 7 | test/dummy/tmp/ 8 | test/dummy/.sass-cache 9 | .ruby-version 10 | .ruby-gemset 11 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | # Declare your gem's dependencies in conductor.gemspec. 4 | # Bundler will treat runtime dependencies like base dependencies, and 5 | # development dependencies will be added by default to the :development group. 6 | gemspec 7 | 8 | # Declare any dependencies that are still in development here instead of in 9 | # your gemspec. These might include edge Rails or gems from your path or 10 | # Git. Remember to move these dependencies to your gemspec before releasing 11 | # your gem to rubygems.org. 12 | 13 | # To use debugger 14 | # gem 'debugger' 15 | 16 | gem 'sdoc', require: false 17 | -------------------------------------------------------------------------------- /MIT-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013 YOURNAME 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Conductor 2 | 3 | Conductor is a Rails engine that lets you do through a web UI what you'd normally do with the rails shell command. 4 | 5 | ## Installation & Setup 6 | 7 | To install add the following line to the Gemfile in your Rails application : 8 | 9 | ```ruby 10 | group :development do 11 | gem 'conductor', github: 'rails/conductor' 12 | end 13 | ``` 14 | 15 | Conductor can now be accessed at /conductor when you're running off local host. 16 | 17 | ## Contributing 18 | 19 | 1. Fork it 20 | 2. Create your feature branch (`git checkout -b my-new-feature`) 21 | 3. Commit your changes (`git commit -am 'Add some feature'`) 22 | 4. Push to the branch (`git push origin my-new-feature`) 23 | 5. Create new Pull Request 24 | 25 | ## License 26 | 27 | Copyright © David Heinemeier Hansson 28 | 29 | Released under the [MIT License](http://www.opensource.org/licenses/MIT) 30 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | begin 3 | require 'bundler/setup' 4 | rescue LoadError 5 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 6 | end 7 | begin 8 | require 'rdoc/task' 9 | rescue LoadError 10 | require 'rdoc/rdoc' 11 | require 'rake/rdoctask' 12 | RDoc::Task = Rake::RDocTask 13 | end 14 | 15 | RDoc::Task.new(:rdoc) do |rdoc| 16 | rdoc.rdoc_dir = 'rdoc' 17 | rdoc.title = 'Conductor' 18 | rdoc.options << '--line-numbers' 19 | rdoc.rdoc_files.include('README.rdoc') 20 | rdoc.rdoc_files.include('lib/**/*.rb') 21 | end 22 | 23 | APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) 24 | load 'rails/tasks/engine.rake' 25 | 26 | 27 | 28 | Bundler::GemHelper.install_tasks 29 | 30 | require 'rake/testtask' 31 | 32 | Rake::TestTask.new(:test) do |t| 33 | t.libs << 'lib' 34 | t.libs << 'test' 35 | t.pattern = 'test/**/*_test.rb' 36 | t.verbose = false 37 | end 38 | 39 | 40 | task :default => :test 41 | -------------------------------------------------------------------------------- /app/assets/images/dir_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails/conductor/03e46dd24116d7f3525d3e3445c44f98c004451b/app/assets/images/dir_icon.png -------------------------------------------------------------------------------- /app/assets/images/file_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails/conductor/03e46dd24116d7f3525d3e3445c44f98c004451b/app/assets/images/file_icon.png -------------------------------------------------------------------------------- /app/assets/images/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails/conductor/03e46dd24116d7f3525d3e3445c44f98c004451b/app/assets/images/rails.png -------------------------------------------------------------------------------- /app/assets/javascripts/conductor.js: -------------------------------------------------------------------------------- 1 | //= require 'jquery' 2 | //= require 'jquery_ujs' -------------------------------------------------------------------------------- /app/assets/javascripts/conductor/codes.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | var editor = ace.edit("editor"); 3 | var textarea = $('#code_content'); 4 | textarea.hide(); 5 | var filePath = $('#code_path').val(); 6 | var modelist = ace.require('ace/ext/modelist'); 7 | var mode = modelist.getModeForPath(filePath).mode; 8 | editor.setTheme("ace/theme/textmate"); 9 | editor.getSession().setMode(mode); 10 | editor.getSession().setValue(textarea.val()); 11 | editor.getSession().on('change', function(){ 12 | textarea.val(editor.getSession().getValue()); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /app/assets/javascripts/conductor/databases.js: -------------------------------------------------------------------------------- 1 | // Place all the behaviors and hooks related to the matching controller here. 2 | // All this logic will automatically be available in application.js. 3 | $(document).ready(function(){ 4 | var editor = ace.edit("editor"); 5 | var textarea = $('#database_content'); 6 | textarea.hide(); 7 | editor.setTheme("ace/theme/textmate"); 8 | editor.getSession().setMode("ace/mode/yaml"); 9 | editor.getSession().setValue(textarea.val()); 10 | editor.getSession().on('change', function(){ 11 | textarea.val(editor.getSession().getValue()); 12 | }); 13 | }); 14 | 15 | -------------------------------------------------------------------------------- /app/assets/javascripts/conductor/db_task.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | var ws = new WebSocket("ws://" + location.host + "/conductor/database/websocket_database"); 3 | var editor = ace.edit("editor"); 4 | editor.renderer.setShowGutter(false); 5 | editor.setReadOnly(true); 6 | ws.onmessage = function(e) { 7 | editor.insert(e.data + "\n"); }; 8 | editor.setTheme("ace/theme/textmate"); 9 | editor.getSession().setMode("ace/mode/ruby"); 10 | }); -------------------------------------------------------------------------------- /app/assets/javascripts/conductor/editor.js: -------------------------------------------------------------------------------- 1 | //= require 'ace/ace' 2 | //= require 'ace/ext-modelist' 3 | //= require 'ace/theme-textmate' -------------------------------------------------------------------------------- /app/assets/javascripts/conductor/generators.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | var tableBody = $('#fieldsTable tbody'); 4 | var trContent = $('.field').html(); 5 | 6 | $('#addField').click(function() { 7 | tableBody.append("
$ rake notes
5 |<%= file %>
13 |<%= file %>
29 |<%= file %>
47 |$ rails generate controller NAME [action action] [options]
4 |7 | Stubs out a new controller and its views. 8 |
9 | 10 | <%= form_for(:app_controller, :url => app_controllers_path) do |form| %> 11 |
12 | <%= form.label :name, "Name (singular, ex: Post, Person, Product)".html_safe %>
13 | <%= form.text_field :name %>
14 |
<%= text_field_tag "app_controller[fields][][name]" %> | 23 |
33 | <%= form.check_box :skip_namespace %> Skip namespace
34 | <%= form.check_box :skip_helper %> Skip helper
35 | <%= form.check_box :skip_assets %> Skip assets
36 |
37 |
38 | <%= form.submit "Create controller" %> 39 |
40 | <% end %> 41 | 42 | 43 | <%= content_for :scripts do %> 44 | <%= javascript_include_tag "conductor/generators" %> 45 | <% end %> -------------------------------------------------------------------------------- /app/views/conductor/codes/edit.html.erb: -------------------------------------------------------------------------------- 1 |4 |
5 | <%= f.text_area :content %> 6 | <%= f.hidden_field :path %> 7 | 8 |9 | <%= f.submit "Save File" %> 10 |
11 | <% end %> 12 | <%= content_for :scripts do %> 13 | <%= javascript_include_tag "conductor/editor" %> 14 | <%= javascript_include_tag "conductor/codes" %> 15 | <% end %> 16 | -------------------------------------------------------------------------------- /app/views/conductor/codes/index.html.erb: -------------------------------------------------------------------------------- 1 | <%= stylesheet_link_tag "conductor/code" %> 2 |6 | | File Name | 7 |Modified | 8 |
---|---|---|
13 | | <%= link_to File.basename(path), code_path(path) %> | 14 |<%= File.new(path).mtime.to_s %> | 15 |
19 | | <%= link_to File.basename(path), edit_code_path(path) %> | 20 |<%= File.new(path).mtime.to_s %> | 21 |
30 | <%= f.text_field :name %> 31 | <%= f.hidden_field :path, :value => @path %> 32 |
33 |34 | <%= f.submit "Save File" %> 35 |
36 | <% end %> 37 |$ <%=session[:conductor_command_db].to_s%>
4 |$ <%=session[:conductor_command_db].to_s%>
4 |This server doesn't support websocket. Please wait some seconds and refresh the page <%= link_to("here",output_no_websocket_database_path)%>
7 |4 |
5 | <%= f.text_area :content %> 6 | 7 | 8 |9 | <%= f.submit "Save Database" %> 10 |
11 | 12 | <% end %> 13 |$ bundle install
4 |$ bundle install
4 |This server doesn't support websocket. Please wait some seconds and refresh the page <%= link_to("here",install_no_websocket_gemfile_path)%>
7 |$ rails generate mailer name
4 |8 | Stubs out a new mailer and its views. 9 |
10 | 11 | <%= form_for(:mailer, :url => mailers_path) do |form| %> 12 |
13 | <%= form.label :name, "Name (singular, ex: Post, Person, Product)".html_safe %>
14 | <%= form.text_field :name %>
15 |
<%= text_field_tag "mailer[fields][][name]" %> | 24 |
33 | <%= form.check_box :skip_namespace %> Skip namespace
34 |
37 | <%= form.submit "Create mailer" %> 38 |
39 | <% end %> 40 | 41 | <%= content_for :scripts do %> 42 | <%= javascript_include_tag "conductor/generators" %> 43 | <% end %> -------------------------------------------------------------------------------- /app/views/conductor/migrations/index.html.erb: -------------------------------------------------------------------------------- 1 |ID | 6 |Name | 7 |Status | 8 |9 | |
---|---|---|---|
<%= line[:id] %> | 13 |<%= line[:name] %> | 14 |<%= line[:status] %> | 15 |16 | <% if line[:status] == "up" %> 17 | <%= button_to "Down", down_migration_path(line[:id]), method: :put, data: { disable_with: 'Migrating...' } %> 18 | <% else %> 19 | <%= button_to "Up", up_migration_path(line[:id]), method: :put, data: { disable_with: 'Migrating...' } %> 20 | <% end %> 21 | | 22 |
Current version <%= @version%>
30 | -------------------------------------------------------------------------------- /app/views/conductor/migrations/rollback.html.erb: -------------------------------------------------------------------------------- 1 |$ rake db:rollback
4 |$ rails generate model NAME [field[:type][:index]] [options]
4 |8 | Stubs out a new model. 9 |
10 | 11 | <%= form_for(:model, :url => models_path) do |form| %> 12 |
13 | <%= form.label :name, "Name (singular, ex: Post, Person, Product)".html_safe %>
14 | <%= form.text_field :name %>
15 |
Name | 22 |Type | 23 |
---|---|
<%= text_field_tag "model[fields][][name]" %> | 28 |<%= select_tag "model[fields][][type]", options_for_select(Conductor::BaseGeneratorForm::DATA_TYPES) %> | 29 |
38 | <%= form.check_box :skip_namespace %> Skip namespace
39 | <%= form.check_box :skip_indexes %> Skip indexes
40 | <%= form.check_box :skip_fixture %> Skip fixture
41 | <%= form.check_box :skip_timestamps %> Skip timestamps
42 | <%= form.check_box :skip_migration %> Skip migration
43 |
46 | <%= form.submit "Create model" %> 47 |
48 | <% end %> 49 | 50 | <%= content_for :scripts do %> 51 | <%= javascript_include_tag "conductor/generators" %> 52 | <% end %> -------------------------------------------------------------------------------- /app/views/conductor/recorder/destroy.js.erb: -------------------------------------------------------------------------------- 1 | $('#<%= Conductor::CONTAINER %> div.spec pre').html('Cleared.'); -------------------------------------------------------------------------------- /app/views/conductor/recorder/index.js.erb: -------------------------------------------------------------------------------- 1 | $('#<%= Conductor::CONTAINER %> div.spec').toggle().html('<%= escape_javascript(flash[Conductor::SPEC]) + '\n end' if flash[Conductor::SPEC] %>
$ rails generate resource NAME [field[:type][:index]] [options]
4 |9 | Stubs out a new resource including an empty model and controller suitable 10 | for a restful, resource-oriented application. 11 |
12 | 13 | <%= form_for(:resource, :url => resources_path) do |form| %> 14 |
15 | <%= form.label :name, "Name (singular, ex: Post, Person, Product)".html_safe %>
16 | <%= form.text_field :name %>
17 |
Name | 24 |Type | 25 |
---|---|
<%= text_field_tag "resource[fields][][name]" %> | 30 |<%= select_tag "resource[fields][][type]", options_for_select(Conductor::BaseGeneratorForm::DATA_TYPES) %> | 31 |
40 | 41 |
42 | 43 | <%= form.check_box :skip_namespace %> Skip namespace52 | <%= form.submit "Create resource" %> 53 |
54 | <% end %> 55 | 56 | <%= content_for :scripts do %> 57 | <%= javascript_include_tag "conductor/generators" %> 58 | <% end %> -------------------------------------------------------------------------------- /app/views/conductor/routes/index.html.erb: -------------------------------------------------------------------------------- 1 |$ rake routes
4 |8 | Routes match in priority from top to bottom 9 |
10 | 11 | <%= @routes_inspector.format(ActionDispatch::Routing::HtmlTableFormatter.new(self)) %> -------------------------------------------------------------------------------- /app/views/conductor/scaffolds/new.html.erb: -------------------------------------------------------------------------------- 1 |$ rails generate scaffold NAME [field[:type][:index]] [options]
4 |8 | Scaffolds an entire resource, from model and migration to controller and 9 | views, along with a full test suite. The resource is ready to use as a 10 | starting point for your RESTful, resource-oriented application. 11 |
12 | 13 | <%= form_for(:scaffold, :url => scaffolds_path) do |f| %> 14 |
15 | <%= f.label :name, "Name (singular, ex: Post, Person, Product)".html_safe %>
16 | <%= f.text_field :name %>
17 |
Name | 24 |Type | 25 |
---|---|
<%= text_field_tag "scaffold[fields][][name]" %> | 30 |<%= select_tag "scaffold[fields][][type]", options_for_select(Conductor::BaseGeneratorForm::DATA_TYPES) %> | 31 |
40 | <%= f.check_box :skip_namespace %> <%= f.label :skip_namespace %>
41 | <%= f.check_box :skip_stylesheets %> <%= f.label :skip_stylesheets %>
42 | <%= f.check_box :skip_assets %> <%= f.label :skip_assets %>
43 | <%= f.check_box :skip_indexes %> <%= f.label :skip_indexes %>
44 | <%= f.check_box :skip_fixture %> <%= f.label :skip_fixture %>
45 | <%= f.check_box :skip_helper %> <%= f.label :skip_helper %>
46 | <%= f.check_box :skip_jbuilder %> <%= f.label :skip_jbuilder %>
47 | <%= f.check_box :skip_timestamps %> <%= f.label :skip_timestamps %>
48 | <%= f.check_box :skip_migration %> <%= f.label :skip_migration %>
49 |
52 | <%= f.submit "Create scaffold" %> 53 |
54 | <% end %> 55 | 56 | <%= content_for :scripts do %> 57 | <%= javascript_include_tag "conductor/generators" %> 58 | <% end %> -------------------------------------------------------------------------------- /app/views/conductor/statistics/index.html.erb: -------------------------------------------------------------------------------- 1 | <%= stylesheet_link_tag "conductor/statistics" %> 2 |$ rake stats
5 |Name | 11 |Lines | 12 |LOC | 13 |Classes | 14 |Methods | 15 |Methods/class | 16 |LOC/method | 17 |
---|---|---|---|---|---|---|
<%= line[:name] %> | 21 |<%= line[:lines] %> | 22 |<%= line[:codelines] %> | 23 |<%= line[:classes] %> | 24 |<%= line[:methods] %> | 25 |<%= line[:m_over_c] %> | 26 |<%= line[:loc_over_m] %> | 27 |
<%= line[:name] %> | 36 |<%= line[:lines] %> | 37 |<%= line[:codelines] %> | 38 |<%= line[:classes] %> | 39 |<%= line[:methods] %> | 40 |<%= line[:m_over_c] %> | 41 |<%= line[:loc_over_m] %> | 42 |
Code LOC | Test LOC | Code to Test Ratio |
---|---|---|
<%= @stats.code_loc %> | <%= @stats.tests_loc %> | 1:<%= @stats.code_to_test %> |
$ <%=session[:conductor_command_test].to_s%>
4 |$ <%=session[:conductor_command_test].to_s%>
4 |This server doesn't support websocket. Please wait some seconds and refresh the page <%= link_to("here",show_no_websocket_test_path)%>
7 |Conductor is a Rails engine that lets you do through a web UI what you'd normally do with the rails shell command.
4 |Copyright © David Heinemeier Hansson.
6 |Name | 7 |8 | | 9 | | 10 | |
---|---|---|---|
<%= post.name %> | 17 |<%= link_to 'Show', post %> | 18 |<%= link_to 'Edit', edit_post_path(post) %> | 19 |<%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are you sure?' } %> | 20 |
<%= notice %>
2 | 3 |4 | Name: 5 | <%= @post.name %> 6 |
7 | 8 | <%= link_to 'Edit', edit_post_path(@post) %> | 9 | <%= link_to 'Back', posts_path %> 10 | -------------------------------------------------------------------------------- /test/dummy/app/views/usuarios/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_for(@usuario) do |f| %> 2 | <% if @usuario.errors.any? %> 3 |Name | 7 |Password | 8 |9 | | 10 | | 11 | |
---|---|---|---|---|
<%= usuario.name %> | 18 |<%= usuario.password %> | 19 |<%= link_to 'Show', usuario %> | 20 |<%= link_to 'Edit', edit_usuario_path(usuario) %> | 21 |<%= link_to 'Destroy', usuario, method: :delete, data: { confirm: 'Are you sure?' } %> | 22 |
<%= notice %>
2 | 3 |4 | Name: 5 | <%= @usuario.name %> 6 |
7 | 8 |9 | Password: 10 | <%= @usuario.password %> 11 |
12 | 13 | <%= link_to 'Edit', edit_usuario_path(@usuario) %> | 14 | <%= link_to 'Back', usuarios_path %> 15 | -------------------------------------------------------------------------------- /test/dummy/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /test/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /test/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /test/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /test/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | Bundler.require(*Rails.groups) 6 | require "conductor" 7 | 8 | module Dummy 9 | class Application < Rails::Application 10 | # Settings in config/environments/* take precedence over those specified here. 11 | # Application configuration should go into files in config/initializers 12 | # -- all .rb files in that directory are automatically loaded. 13 | 14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 16 | # config.time_zone = 'Central Time (US & Canada)' 17 | 18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 20 | # config.i18n.default_locale = :de 21 | end 22 | end 23 | 24 | -------------------------------------------------------------------------------- /test/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) 5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__) 6 | -------------------------------------------------------------------------------- /test/dummy/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | development: 7 | adapter: sqlite3 8 | database: db/development.sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | # Warning: The database defined as "test" will be erased and 13 | # re-generated from your development database when you run "rake". 14 | # Do not set this db to the same as development or production. 15 | test: 16 | adapter: sqlite3 17 | database: db/test.sqlite3 18 | pool: 5 19 | timeout: 5000 20 | 21 | production: 22 | adapter: sqlite3 23 | database: db/production.sqlite3 24 | pool: 5 25 | timeout: 5000 26 | -------------------------------------------------------------------------------- /test/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Dummy::Application.initialize! 6 | -------------------------------------------------------------------------------- /test/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations 23 | # config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | end 30 | -------------------------------------------------------------------------------- /test/dummy/config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both thread web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 18 | # Add `rack-cache` to your Gemfile before enabling this. 19 | # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. 20 | # config.action_dispatch.rack_cache = true 21 | 22 | # Disable Rails's static asset server (Apache or nginx will already do this). 23 | config.serve_static_assets = false 24 | 25 | # Compress JavaScripts and CSS. 26 | config.assets.js_compressor = :uglifier 27 | # config.assets.css_compressor = :sass 28 | 29 | # Do not fallback to assets pipeline if a precompiled asset is missed. 30 | config.assets.compile = false 31 | 32 | # Generate digests for assets URLs. 33 | config.assets.digest = true 34 | 35 | # Version of your assets, change this if you want to expire all your assets. 36 | config.assets.version = '1.0' 37 | 38 | # Specifies the header that your server uses for sending files. 39 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 40 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 41 | 42 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 43 | # config.force_ssl = true 44 | 45 | # Set to :debug to see everything in the log. 46 | config.log_level = :info 47 | 48 | # Prepend all log lines with the following tags. 49 | # config.log_tags = [ :subdomain, :uuid ] 50 | 51 | # Use a different logger for distributed setups. 52 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 53 | 54 | # Use a different cache store in production. 55 | # config.cache_store = :mem_cache_store 56 | 57 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 58 | # config.action_controller.asset_host = "http://assets.example.com" 59 | 60 | # Precompile additional assets. 61 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 62 | # config.assets.precompile += %w( search.js ) 63 | 64 | # Ignore bad email addresses and do not raise email delivery errors. 65 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 66 | # config.action_mailer.raise_delivery_errors = false 67 | 68 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 69 | # the I18n.default_locale when a translation can not be found). 70 | config.i18n.fallbacks = true 71 | 72 | # Send deprecation notices to registered listeners. 73 | config.active_support.deprecation = :notify 74 | 75 | # Disable automatic flushing of the log to improve performance. 76 | # config.autoflush_log = false 77 | 78 | # Use default logging formatter so that PID and timestamp are not suppressed. 79 | config.log_formatter = ::Logger::Formatter.new 80 | end 81 | -------------------------------------------------------------------------------- /test/dummy/config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static asset server for tests with Cache-Control for performance. 16 | config.serve_static_assets = true 17 | config.static_cache_control = "public, max-age=3600" 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Print deprecation notices to the stderr. 35 | config.active_support.deprecation = :stderr 36 | end 37 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure your secret_key_base is kept private 11 | # if you're sharing your code publicly. 12 | Dummy::Application.config.secret_key_base = '4ee89a5cea579273fcdba466b09dfb412d53ee9fc2d13bc03c445fa822aa0c2c62a943daaaadc968c0db17ec9904f8a12c00db5609ec9287b62c87bd28cdc357' 13 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Dummy::Application.config.session_store :cookie_store, key: '_dummy_session' 4 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /test/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /test/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | end 3 | -------------------------------------------------------------------------------- /test/dummy/db/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails/conductor/03e46dd24116d7f3525d3e3445c44f98c004451b/test/dummy/db/.gitkeep -------------------------------------------------------------------------------- /test/dummy/db/migrate/20130827165249_create_users.rb: -------------------------------------------------------------------------------- 1 | class CreateUsers < ActiveRecord::Migration 2 | def change 3 | create_table :users do |t| 4 | t.string :firstname 5 | t.string :last 6 | t.string :name 7 | t.string :address 8 | t.string :phone 9 | t.string :gender 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /test/dummy/db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20130827165249) do 15 | 16 | create_table "users", force: true do |t| 17 | t.string "firstname" 18 | t.string "last" 19 | t.string "name" 20 | t.string "address" 21 | t.string "phone" 22 | t.string "gender" 23 | t.datetime "created_at" 24 | t.datetime "updated_at" 25 | end 26 | 27 | end 28 | -------------------------------------------------------------------------------- /test/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails/conductor/03e46dd24116d7f3525d3e3445c44f98c004451b/test/dummy/lib/assets/.keep -------------------------------------------------------------------------------- /test/dummy/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails/conductor/03e46dd24116d7f3525d3e3445c44f98c004451b/test/dummy/log/.keep -------------------------------------------------------------------------------- /test/dummy/public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |You may have mistyped the address or the page may have moved.
55 |If you are the application owner check the logs for more information.
57 | 58 | 59 | -------------------------------------------------------------------------------- /test/dummy/public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Maybe you tried to change something you didn't have access to.
55 |If you are the application owner check the logs for more information.
57 | 58 | 59 | -------------------------------------------------------------------------------- /test/dummy/public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |If you are the application owner check the logs for more information.
56 | 57 | 58 | -------------------------------------------------------------------------------- /test/dummy/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails/conductor/03e46dd24116d7f3525d3e3445c44f98c004451b/test/dummy/public/favicon.ico -------------------------------------------------------------------------------- /test/dummy/test/fixtures/users.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rails/conductor/03e46dd24116d7f3525d3e3445c44f98c004451b/test/dummy/test/fixtures/users.yml -------------------------------------------------------------------------------- /test/helpers/conductor/test_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | module Conductor 4 | class TestHelperTest < ActionView::TestCase 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /test/helpers/conductor/welcome_helper_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | module Conductor 4 | class WelcomeHelperTest < ActionView::TestCase 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /test/integration/navigation_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class NavigationTest < ActionDispatch::IntegrationTest 4 | fixtures :all 5 | 6 | # test "the truth" do 7 | # assert true 8 | # end 9 | end 10 | 11 | -------------------------------------------------------------------------------- /test/models/code_statistics_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | module Conductor 4 | class CodeStatisticsTest < ActiveSupport::TestCase 5 | def setup 6 | @stats = Conductor::CodeStatistics.new(['Models', 'app/models'], ['Controllers', 'app/controllers']) 7 | end 8 | 9 | def test_lines 10 | assert_equal 2, @stats.lines.size 11 | assert_equal 'Models', @stats.lines[0][:name] 12 | assert_equal 'Controllers', @stats.lines[1][:name] 13 | end 14 | 15 | def test_line 16 | models = @stats.lines.first 17 | 18 | assert_equal 'Models', models[:name] 19 | assert_equal 208, models[:lines] 20 | assert_equal 171, models[:codelines] 21 | assert_equal 6, models[:classes] 22 | assert_equal 23, models[:methods] 23 | assert_equal 3, models[:m_over_c] 24 | assert_equal 5, models[:loc_over_m] 25 | end 26 | 27 | def test_total_line 28 | total = @stats.total_line 29 | 30 | assert_equal "Total", total[:name] 31 | assert_equal 650, total[:lines] 32 | assert_equal 546, total[:codelines] 33 | assert_equal 23, total[:classes] 34 | assert_equal 73, total[:methods] 35 | assert_equal 3, total[:m_over_c] 36 | assert_equal 5, total[:loc_over_m] 37 | end 38 | 39 | def test_code_loc 40 | assert_equal 546, @stats.code_loc 41 | end 42 | 43 | def test_tests_loc 44 | assert_equal 0, @stats.tests_loc 45 | end 46 | 47 | def test_code_to_test 48 | assert_equal 0.0, @stats.code_to_test 49 | end 50 | end 51 | end 52 | 53 | -------------------------------------------------------------------------------- /test/models/database_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | module Conductor 4 | class DatabaseTest < ActiveSupport::TestCase 5 | def test_database 6 | assert_match(/# SQLite version 3.x/, Database.instance.to_s) 7 | end 8 | def test_database_change 9 | database = Database.instance 10 | content = database.to_s 11 | database.content = '# edit existing Database file' 12 | database.save 13 | assert_match(/# edit existing Database file/, database.content) 14 | ensure 15 | # restore the old content of the file 16 | File.open(Rails.root.join("config","database.yml"), 'w') { |file| file.write(content) } 17 | end 18 | end 19 | end -------------------------------------------------------------------------------- /test/models/migrations_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | module Conductor 4 | class MigrationTest < ActiveSupport::TestCase 5 | def test_migration_fail_when_schema_migration_does_not_exist 6 | connection_mock = Object.new 7 | def connection_mock.table_exists?(*) false end 8 | 9 | ActiveRecord::Base.stub :connection, connection_mock do 10 | assert_raise(Conductor::Migrations::MigrationError) do 11 | Migrations.list 12 | end 13 | end 14 | end 15 | def test_migration_list 16 | @migration = Migrations.list.first 17 | assert_equal "20130827165249", @migration[:id] 18 | assert_equal "********** NO FILE **********", @migration[:name] 19 | assert_equal "up", @migration[:status] 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | # Configure Rails Environment 2 | ENV["RAILS_ENV"] = "test" 3 | 4 | require File.expand_path("../dummy/config/environment.rb", __FILE__) 5 | require "rails/test_help" 6 | require "minitest/mock" 7 | 8 | Rails.backtrace_cleaner.remove_silencers! 9 | 10 | # Load support files 11 | Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } 12 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ace/ext-modelist.js: -------------------------------------------------------------------------------- 1 | ace.define('ace/ext/modelist', ['require', 'exports', 'module' ], function(require, exports, module) { 2 | 3 | 4 | var modes = []; 5 | function getModeForPath(path) { 6 | var mode = modesByName.text; 7 | var fileName = path.split(/[\/\\]/).pop(); 8 | for (var i = 0; i < modes.length; i++) { 9 | if (modes[i].supportsFile(fileName)) { 10 | mode = modes[i]; 11 | break; 12 | } 13 | } 14 | return mode; 15 | } 16 | 17 | var Mode = function(name, caption, extensions) { 18 | this.name = name; 19 | this.caption = caption; 20 | this.mode = "ace/mode/" + name; 21 | this.extensions = extensions; 22 | if (/\^/.test(extensions)) { 23 | var re = extensions.replace(/\|(\^)?/g, function(a, b){ 24 | return "$|" + (b ? "^" : "^.*\\."); 25 | }) + "$"; 26 | } else { 27 | var re = "^.*\\.(" + extensions + ")$"; 28 | } 29 | 30 | this.extRe = new RegExp(re, "gi"); 31 | }; 32 | 33 | Mode.prototype.supportsFile = function(filename) { 34 | return filename.match(this.extRe); 35 | }; 36 | var supportedModes = { 37 | ABAP: ["abap"], 38 | ActionScript:["as"], 39 | ADA: ["ada|adb"], 40 | Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"], 41 | AsciiDoc: ["asciidoc"], 42 | Assembly_x86:["asm"], 43 | AutoHotKey: ["ahk"], 44 | BatchFile: ["bat|cmd"], 45 | C9Search: ["c9search_results"], 46 | C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp"], 47 | Clojure: ["clj"], 48 | Cobol: ["CBL|COB"], 49 | coffee: ["coffee|cf|cson|^Cakefile"], 50 | ColdFusion: ["cfm"], 51 | CSharp: ["cs"], 52 | CSS: ["css"], 53 | Curly: ["curly"], 54 | D: ["d|di"], 55 | Dart: ["dart"], 56 | Diff: ["diff|patch"], 57 | Dot: ["dot"], 58 | Erlang: ["erl|hrl"], 59 | EJS: ["ejs"], 60 | Forth: ["frt|fs|ldr"], 61 | FTL: ["ftl"], 62 | Glsl: ["glsl|frag|vert"], 63 | golang: ["go"], 64 | Groovy: ["groovy"], 65 | HAML: ["haml"], 66 | Handlebars: ["hbs|handlebars|tpl|mustache"], 67 | Haskell: ["hs"], 68 | haXe: ["hx"], 69 | HTML: ["html|htm|xhtml"], 70 | HTML_Ruby: ["erb|rhtml|html.erb"], 71 | INI: ["ini|conf|cfg|prefs"], 72 | Jack: ["jack"], 73 | Jade: ["jade"], 74 | Java: ["java"], 75 | JavaScript: ["js|jsm"], 76 | JSON: ["json"], 77 | JSONiq: ["jq"], 78 | JSP: ["jsp"], 79 | JSX: ["jsx"], 80 | Julia: ["jl"], 81 | LaTeX: ["tex|latex|ltx|bib"], 82 | LESS: ["less"], 83 | Liquid: ["liquid"], 84 | Lisp: ["lisp"], 85 | LiveScript: ["ls"], 86 | LogiQL: ["logic|lql"], 87 | LSL: ["lsl"], 88 | Lua: ["lua"], 89 | LuaPage: ["lp"], 90 | Lucene: ["lucene"], 91 | Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"], 92 | MATLAB: ["matlab"], 93 | Markdown: ["md|markdown"], 94 | MEL: ["mel"], 95 | MySQL: ["mysql"], 96 | MUSHCode: ["mc|mush"], 97 | Nix: ["nix"], 98 | ObjectiveC: ["m|mm"], 99 | OCaml: ["ml|mli"], 100 | Pascal: ["pas|p"], 101 | Perl: ["pl|pm"], 102 | pgSQL: ["pgsql"], 103 | PHP: ["php|phtml"], 104 | Powershell: ["ps1"], 105 | Prolog: ["plg|prolog"], 106 | Properties: ["properties"], 107 | Protobuf: ["proto"], 108 | Python: ["py"], 109 | R: ["r"], 110 | RDoc: ["Rd"], 111 | RHTML: ["Rhtml"], 112 | Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"], 113 | Rust: ["rs"], 114 | SASS: ["sass"], 115 | SCAD: ["scad"], 116 | Scala: ["scala"], 117 | Scheme: ["scm|rkt"], 118 | SCSS: ["scss"], 119 | SH: ["sh|bash|^.bashrc"], 120 | SJS: ["sjs"], 121 | Space: ["space"], 122 | snippets: ["snippets"], 123 | Soy_Template:["soy"], 124 | SQL: ["sql"], 125 | Stylus: ["styl|stylus"], 126 | SVG: ["svg"], 127 | Tcl: ["tcl"], 128 | Tex: ["tex"], 129 | Text: ["txt"], 130 | Textile: ["textile"], 131 | Toml: ["toml"], 132 | Twig: ["twig"], 133 | Typescript: ["ts|typescript|str"], 134 | VBScript: ["vbs"], 135 | Velocity: ["vm"], 136 | Verilog: ["v|vh|sv|svh"], 137 | XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"], 138 | XQuery: ["xq"], 139 | YAML: ["yaml|yml"] 140 | }; 141 | 142 | var nameOverrides = { 143 | ObjectiveC: "Objective-C", 144 | CSharp: "C#", 145 | golang: "Go", 146 | C_Cpp: "C/C++", 147 | coffee: "CoffeeScript", 148 | HTML_Ruby: "HTML (Ruby)", 149 | FTL: "FreeMarker" 150 | }; 151 | var modesByName = {}; 152 | for (var name in supportedModes) { 153 | var data = supportedModes[name]; 154 | var displayName = (nameOverrides[name] || name).replace(/_/g, " "); 155 | var filename = name.toLowerCase(); 156 | var mode = new Mode(filename, displayName, data[0]); 157 | modesByName[filename] = mode; 158 | modes.push(mode); 159 | } 160 | 161 | module.exports = { 162 | getModeForPath: getModeForPath, 163 | modes: modes, 164 | modesByName: modesByName 165 | }; 166 | 167 | }); 168 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ace/mode-coffee.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/mode/coffee', ['require', 'exports', 'module' , 'ace/tokenizer', 'ace/mode/coffee_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/coffee', 'ace/range', 'ace/mode/text', 'ace/worker/worker_client', 'ace/lib/oop'], function(require, exports, module) { 32 | 33 | 34 | var Tokenizer = require("../tokenizer").Tokenizer; 35 | var Rules = require("./coffee_highlight_rules").CoffeeHighlightRules; 36 | var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent; 37 | var FoldMode = require("./folding/coffee").FoldMode; 38 | var Range = require("../range").Range; 39 | var TextMode = require("./text").Mode; 40 | var WorkerClient = require("../worker/worker_client").WorkerClient; 41 | var oop = require("../lib/oop"); 42 | 43 | function Mode() { 44 | this.HighlightRules = Rules; 45 | this.$outdent = new Outdent(); 46 | this.foldingRules = new FoldMode(); 47 | } 48 | 49 | oop.inherits(Mode, TextMode); 50 | 51 | (function() { 52 | 53 | var indenter = /(?:[({[=:]|[-=]>|\b(?:else|switch|try|catch(?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$/; 54 | var commentLine = /^(\s*)#/; 55 | var hereComment = /^\s*###(?!#)/; 56 | var indentation = /^\s*/; 57 | 58 | this.getNextLineIndent = function(state, line, tab) { 59 | var indent = this.$getIndent(line); 60 | var tokens = this.getTokenizer().getLineTokens(line, state).tokens; 61 | 62 | if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') && 63 | state === 'start' && indenter.test(line)) 64 | indent += tab; 65 | return indent; 66 | }; 67 | 68 | this.toggleCommentLines = function(state, doc, startRow, endRow){ 69 | console.log("toggle"); 70 | var range = new Range(0, 0, 0, 0); 71 | for (var i = startRow; i <= endRow; ++i) { 72 | var line = doc.getLine(i); 73 | if (hereComment.test(line)) 74 | continue; 75 | 76 | if (commentLine.test(line)) 77 | line = line.replace(commentLine, '$1'); 78 | else 79 | line = line.replace(indentation, '$'); 80 | 81 | range.end.row = range.start.row = i; 82 | range.end.column = line.length + 1; 83 | doc.replace(range, line); 84 | } 85 | }; 86 | 87 | this.checkOutdent = function(state, line, input) { 88 | return this.$outdent.checkOutdent(line, input); 89 | }; 90 | 91 | this.autoOutdent = function(state, doc, row) { 92 | this.$outdent.autoOutdent(doc, row); 93 | }; 94 | 95 | this.createWorker = function(session) { 96 | var worker = new WorkerClient(["ace"], "ace/mode/coffee_worker", "Worker"); 97 | worker.attachToDocument(session.getDocument()); 98 | 99 | worker.on("error", function(e) { 100 | session.setAnnotations([e.data]); 101 | }); 102 | 103 | worker.on("ok", function(e) { 104 | session.clearAnnotations(); 105 | }); 106 | 107 | return worker; 108 | }; 109 | 110 | this.$id = "ace/mode/coffee"; 111 | }).call(Mode.prototype); 112 | 113 | exports.Mode = Mode; 114 | 115 | }); 116 | 117 | ace.define('ace/mode/coffee_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { 118 | 119 | 120 | var oop = require("../lib/oop"); 121 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 122 | 123 | oop.inherits(CoffeeHighlightRules, TextHighlightRules); 124 | 125 | function CoffeeHighlightRules() { 126 | var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; 127 | 128 | var keywords = ( 129 | "this|throw|then|try|typeof|super|switch|return|break|by|continue|" + 130 | "catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" + 131 | "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" + 132 | "or|on|unless|until|and|yes" 133 | ); 134 | 135 | var langConstant = ( 136 | "true|false|null|undefined|NaN|Infinity" 137 | ); 138 | 139 | var illegal = ( 140 | "case|const|default|function|var|void|with|enum|export|implements|" + 141 | "interface|let|package|private|protected|public|static|yield|" + 142 | "__hasProp|slice|bind|indexOf" 143 | ); 144 | 145 | var supportClass = ( 146 | "Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" + 147 | "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + 148 | "SyntaxError|TypeError|URIError|" + 149 | "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + 150 | "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray" 151 | ); 152 | 153 | var supportFunction = ( 154 | "Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" + 155 | "encodeURIComponent|decodeURI|decodeURIComponent|String|" 156 | ); 157 | 158 | var variableLanguage = ( 159 | "window|arguments|prototype|document" 160 | ); 161 | 162 | var keywordMapper = this.createKeywordMapper({ 163 | "keyword": keywords, 164 | "constant.language": langConstant, 165 | "invalid.illegal": illegal, 166 | "language.support.class": supportClass, 167 | "language.support.function": supportFunction, 168 | "variable.language": variableLanguage 169 | }, "identifier"); 170 | 171 | var functionRule = { 172 | token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], 173 | regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*))?([\-=]>)/.source 174 | }; 175 | 176 | var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/; 177 | 178 | this.$rules = { 179 | start : [ 180 | { 181 | token : "constant.numeric", 182 | regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)" 183 | }, { 184 | stateName: "qdoc", 185 | token : "string", regex : "'''", next : [ 186 | {token : "string", regex : "'''", next : "start"}, 187 | {token : "constant.language.escape", regex : stringEscape}, 188 | {defaultToken: "string"} 189 | ] 190 | }, { 191 | stateName: "qqdoc", 192 | token : "string", 193 | regex : '"""', 194 | next : [ 195 | {token : "string", regex : '"""', next : "start"}, 196 | {token : "paren.string", regex : '#{', push : "start"}, 197 | {token : "constant.language.escape", regex : stringEscape}, 198 | {defaultToken: "string"} 199 | ] 200 | }, { 201 | stateName: "qstring", 202 | token : "string", regex : "'", next : [ 203 | {token : "string", regex : "'", next : "start"}, 204 | {token : "constant.language.escape", regex : stringEscape}, 205 | {defaultToken: "string"} 206 | ] 207 | }, { 208 | stateName: "qqstring", 209 | token : "string.start", regex : '"', next : [ 210 | {token : "string.end", regex : '"', next : "start"}, 211 | {token : "paren.string", regex : '#{', push : "start"}, 212 | {token : "constant.language.escape", regex : stringEscape}, 213 | {defaultToken: "string"} 214 | ] 215 | }, { 216 | stateName: "js", 217 | token : "string", regex : "`", next : [ 218 | {token : "string", regex : "`", next : "start"}, 219 | {token : "constant.language.escape", regex : stringEscape}, 220 | {defaultToken: "string"} 221 | ] 222 | }, { 223 | regex: "[{}]", onMatch: function(val, state, stack) { 224 | this.next = ""; 225 | if (val == "{" && stack.length) { 226 | stack.unshift("start", state); 227 | return "paren"; 228 | } 229 | if (val == "}" && stack.length) { 230 | stack.shift(); 231 | this.next = stack.shift(); 232 | if (this.next.indexOf("string") != -1) 233 | return "paren.string"; 234 | } 235 | return "paren"; 236 | } 237 | }, { 238 | token : "string.regex", 239 | regex : "///", 240 | next : "heregex" 241 | }, { 242 | token : "string.regex", 243 | regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/ 244 | }, { 245 | token : "comment", 246 | regex : "###(?!#)", 247 | next : "comment" 248 | }, { 249 | token : "comment", 250 | regex : "#.*" 251 | }, { 252 | token : ["punctuation.operator", "text", "identifier"], 253 | regex : "(\\.)(\\s*)(" + illegal + ")" 254 | }, { 255 | token : "punctuation.operator", 256 | regex : "\\." 257 | }, { 258 | token : ["keyword", "text", "language.support.class", 259 | "text", "keyword", "text", "language.support.class"], 260 | regex : "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?" 261 | }, { 262 | token : ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token), 263 | regex : "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex 264 | }, 265 | functionRule, 266 | { 267 | token : "variable", 268 | regex : "@(?:" + identifier + ")?" 269 | }, { 270 | token: keywordMapper, 271 | regex : identifier 272 | }, { 273 | token : "punctuation.operator", 274 | regex : "\\,|\\." 275 | }, { 276 | token : "storage.type", 277 | regex : "[\\-=]>" 278 | }, { 279 | token : "keyword.operator", 280 | regex : "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])" 281 | }, { 282 | token : "paren.lparen", 283 | regex : "[({[]" 284 | }, { 285 | token : "paren.rparen", 286 | regex : "[\\]})]" 287 | }, { 288 | token : "text", 289 | regex : "\\s+" 290 | }], 291 | 292 | 293 | heregex : [{ 294 | token : "string.regex", 295 | regex : '.*?///[imgy]{0,4}', 296 | next : "start" 297 | }, { 298 | token : "comment.regex", 299 | regex : "\\s+(?:#.*)?" 300 | }, { 301 | token : "string.regex", 302 | regex : "\\S+" 303 | }], 304 | 305 | comment : [{ 306 | token : "comment", 307 | regex : '###', 308 | next : "start" 309 | }, { 310 | defaultToken : "comment" 311 | }] 312 | }; 313 | this.normalizeRules(); 314 | } 315 | 316 | exports.CoffeeHighlightRules = CoffeeHighlightRules; 317 | }); 318 | 319 | ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { 320 | 321 | 322 | var Range = require("../range").Range; 323 | 324 | var MatchingBraceOutdent = function() {}; 325 | 326 | (function() { 327 | 328 | this.checkOutdent = function(line, input) { 329 | if (! /^\s+$/.test(line)) 330 | return false; 331 | 332 | return /^\s*\}/.test(input); 333 | }; 334 | 335 | this.autoOutdent = function(doc, row) { 336 | var line = doc.getLine(row); 337 | var match = line.match(/^(\s*\})/); 338 | 339 | if (!match) return 0; 340 | 341 | var column = match[1].length; 342 | var openBracePos = doc.findMatchingBracket({row: row, column: column}); 343 | 344 | if (!openBracePos || openBracePos.row == row) return 0; 345 | 346 | var indent = this.$getIndent(doc.getLine(openBracePos.row)); 347 | doc.replace(new Range(row, 0, row, column-1), indent); 348 | }; 349 | 350 | this.$getIndent = function(line) { 351 | return line.match(/^\s*/)[0]; 352 | }; 353 | 354 | }).call(MatchingBraceOutdent.prototype); 355 | 356 | exports.MatchingBraceOutdent = MatchingBraceOutdent; 357 | }); 358 | 359 | ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { 360 | 361 | 362 | var oop = require("../../lib/oop"); 363 | var BaseFoldMode = require("./fold_mode").FoldMode; 364 | var Range = require("../../range").Range; 365 | 366 | var FoldMode = exports.FoldMode = function() {}; 367 | oop.inherits(FoldMode, BaseFoldMode); 368 | 369 | (function() { 370 | 371 | this.getFoldWidgetRange = function(session, foldStyle, row) { 372 | var range = this.indentationBlock(session, row); 373 | if (range) 374 | return range; 375 | 376 | var re = /\S/; 377 | var line = session.getLine(row); 378 | var startLevel = line.search(re); 379 | if (startLevel == -1 || line[startLevel] != "#") 380 | return; 381 | 382 | var startColumn = line.length; 383 | var maxRow = session.getLength(); 384 | var startRow = row; 385 | var endRow = row; 386 | 387 | while (++row < maxRow) { 388 | line = session.getLine(row); 389 | var level = line.search(re); 390 | 391 | if (level == -1) 392 | continue; 393 | 394 | if (line[level] != "#") 395 | break; 396 | 397 | endRow = row; 398 | } 399 | 400 | if (endRow > startRow) { 401 | var endColumn = session.getLine(endRow).length; 402 | return new Range(startRow, startColumn, endRow, endColumn); 403 | } 404 | }; 405 | this.getFoldWidget = function(session, foldStyle, row) { 406 | var line = session.getLine(row); 407 | var indent = line.search(/\S/); 408 | var next = session.getLine(row + 1); 409 | var prev = session.getLine(row - 1); 410 | var prevIndent = prev.search(/\S/); 411 | var nextIndent = next.search(/\S/); 412 | 413 | if (indent == -1) { 414 | session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; 415 | return ""; 416 | } 417 | if (prevIndent == -1) { 418 | if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { 419 | session.foldWidgets[row - 1] = ""; 420 | session.foldWidgets[row + 1] = ""; 421 | return "start"; 422 | } 423 | } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { 424 | if (session.getLine(row - 2).search(/\S/) == -1) { 425 | session.foldWidgets[row - 1] = "start"; 426 | session.foldWidgets[row + 1] = ""; 427 | return ""; 428 | } 429 | } 430 | 431 | if (prevIndent!= -1 && prevIndent < indent) 432 | session.foldWidgets[row - 1] = "start"; 433 | else 434 | session.foldWidgets[row - 1] = ""; 435 | 436 | if (indent < nextIndent) 437 | return "start"; 438 | else 439 | return ""; 440 | }; 441 | 442 | }).call(FoldMode.prototype); 443 | 444 | }); -------------------------------------------------------------------------------- /vendor/assets/javascripts/ace/mode-html_completions.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/mode/html_completions', ['require', 'exports', 'module' , 'ace/token_iterator'], function(require, exports, module) { 32 | 33 | 34 | var TokenIterator = require("../token_iterator").TokenIterator; 35 | 36 | var commonAttributes = [ 37 | "accesskey", 38 | "class", 39 | "contenteditable", 40 | "contextmenu", 41 | "dir", 42 | "draggable", 43 | "dropzone", 44 | "hidden", 45 | "id", 46 | "lang", 47 | "spellcheck", 48 | "style", 49 | "tabindex", 50 | "title", 51 | "translate" 52 | ]; 53 | 54 | var eventAttributes = [ 55 | "onabort", 56 | "onblur", 57 | "oncancel", 58 | "oncanplay", 59 | "oncanplaythrough", 60 | "onchange", 61 | "onclick", 62 | "onclose", 63 | "oncontextmenu", 64 | "oncuechange", 65 | "ondblclick", 66 | "ondrag", 67 | "ondragend", 68 | "ondragenter", 69 | "ondragleave", 70 | "ondragover", 71 | "ondragstart", 72 | "ondrop", 73 | "ondurationchange", 74 | "onemptied", 75 | "onended", 76 | "onerror", 77 | "onfocus", 78 | "oninput", 79 | "oninvalid", 80 | "onkeydown", 81 | "onkeypress", 82 | "onkeyup", 83 | "onload", 84 | "onloadeddata", 85 | "onloadedmetadata", 86 | "onloadstart", 87 | "onmousedown", 88 | "onmousemove", 89 | "onmouseout", 90 | "onmouseover", 91 | "onmouseup", 92 | "onmousewheel", 93 | "onpause", 94 | "onplay", 95 | "onplaying", 96 | "onprogress", 97 | "onratechange", 98 | "onreset", 99 | "onscroll", 100 | "onseeked", 101 | "onseeking", 102 | "onselect", 103 | "onshow", 104 | "onstalled", 105 | "onsubmit", 106 | "onsuspend", 107 | "ontimeupdate", 108 | "onvolumechange", 109 | "onwaiting" 110 | ]; 111 | 112 | var globalAttributes = commonAttributes.concat(eventAttributes); 113 | 114 | var attributeMap = { 115 | "html": ["manifest"], 116 | "head": [], 117 | "title": [], 118 | "base": ["href", "target"], 119 | "link": ["href", "hreflang", "rel", "media", "type", "sizes"], 120 | "meta": ["http-equiv", "name", "content", "charset"], 121 | "style": ["type", "media", "scoped"], 122 | "script": ["charset", "type", "src", "defer", "async"], 123 | "noscript": ["href"], 124 | "body": ["onafterprint", "onbeforeprint", "onbeforeunload", "onhashchange", "onmessage", "onoffline", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload"], 125 | "section": [], 126 | "nav": [], 127 | "article": ["pubdate"], 128 | "aside": [], 129 | "h1": [], 130 | "h2": [], 131 | "h3": [], 132 | "h4": [], 133 | "h5": [], 134 | "h6": [], 135 | "header": [], 136 | "footer": [], 137 | "address": [], 138 | "main": [], 139 | "p": [], 140 | "hr": [], 141 | "pre": [], 142 | "blockquote": ["cite"], 143 | "ol": ["start", "reversed"], 144 | "ul": [], 145 | "li": ["value"], 146 | "dl": [], 147 | "dt": [], 148 | "dd": [], 149 | "figure": [], 150 | "figcaption": [], 151 | "div": [], 152 | "a": ["href", "target", "ping", "rel", "media", "hreflang", "type"], 153 | "em": [], 154 | "strong": [], 155 | "small": [], 156 | "s": [], 157 | "cite": [], 158 | "q": ["cite"], 159 | "dfn": [], 160 | "abbr": [], 161 | "data": [], 162 | "time": ["datetime"], 163 | "code": [], 164 | "var": [], 165 | "samp": [], 166 | "kbd": [], 167 | "sub": [], 168 | "sup": [], 169 | "i": [], 170 | "b": [], 171 | "u": [], 172 | "mark": [], 173 | "ruby": [], 174 | "rt": [], 175 | "rp": [], 176 | "bdi": [], 177 | "bdo": [], 178 | "span": [], 179 | "br": [], 180 | "wbr": [], 181 | "ins": ["cite", "datetime"], 182 | "del": ["cite", "datetime"], 183 | "img": ["alt", "src", "height", "width", "usemap", "ismap"], 184 | "iframe": ["name", "src", "height", "width", "sandbox", "seamless"], 185 | "embed": ["src", "height", "width", "type"], 186 | "object": ["param", "data", "type", "height" , "width", "usemap", "name", "form", "classid"], 187 | "param": ["name", "value"], 188 | "video": ["src", "autobuffer", "autoplay", "loop", "controls", "width", "height", "poster"], 189 | "audio": ["src", "autobuffer", "autoplay", "loop", "controls"], 190 | "source": ["src", "type", "media"], 191 | "track": ["kind", "src", "srclang", "label", "default"], 192 | "canvas": ["width", "height"], 193 | "map": ["name"], 194 | "area": ["shape", "coords", "href", "hreflang", "alt", "target", "media", "rel", "ping", "type"], 195 | "svg": [], 196 | "math": [], 197 | "table": ["summary"], 198 | "caption": [], 199 | "colgroup": ["span"], 200 | "col": ["span"], 201 | "tbody": [], 202 | "thead": [], 203 | "tfoot": [], 204 | "tr": [], 205 | "td": ["headers", "rowspan", "colspan"], 206 | "th": ["headers", "rowspan", "colspan", "scope"], 207 | "form": ["accept-charset", "action", "autocomplete", "enctype", "method", "name", "novalidate", "target"], 208 | "fieldset": ["disabled", "form", "name"], 209 | "legend": [], 210 | "label": ["form", "for"], 211 | "input": ["type", "accept", "alt", "autocomplete", "checked", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "height", "list", "max", "maxlength", "min", "multiple", "pattern", "placeholder", "readonly", "required", "size", "src", "step", "width", "files", "value"], 212 | "button": ["autofocus", "disabled", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "type"], 213 | "select": ["autofocus", "disabled", "form", "multiple", "name", "size"], 214 | "datalist": [], 215 | "optgroup": ["disabled", "label"], 216 | "option": ["disabled", "selected", "label", "value"], 217 | "textarea": ["autofocus", "disabled", "form", "maxlength", "name", "placeholder", "readonly", "required", "rows", "cols", "wrap"], 218 | "keygen": ["autofocus", "challenge", "disabled", "form", "keytype", "name"], 219 | "output": ["for", "form", "name"], 220 | "progress": ["value", "max"], 221 | "meter": ["value", "min", "max", "low", "high", "optimum"], 222 | "details": ["open"], 223 | "summary": [], 224 | "command": ["type", "label", "icon", "disabled", "checked", "radiogroup", "command"], 225 | "menu": ["type", "label"], 226 | "dialog": ["open"] 227 | }; 228 | 229 | var allElements = Object.keys(attributeMap); 230 | 231 | function hasType(token, type) { 232 | var tokenTypes = token.type.split('.'); 233 | return type.split('.').every(function(type){ 234 | return (tokenTypes.indexOf(type) !== -1); 235 | }); 236 | } 237 | 238 | function findTagName(session, pos) { 239 | var iterator = new TokenIterator(session, pos.row, pos.column); 240 | var token = iterator.getCurrentToken(); 241 | if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ 242 | do { 243 | token = iterator.stepBackward(); 244 | } while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text'))); 245 | } 246 | if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) 247 | return token.value; 248 | } 249 | 250 | var HtmlCompletions = function() { 251 | 252 | }; 253 | 254 | (function() { 255 | 256 | this.getCompletions = function(state, session, pos, prefix) { 257 | var token = session.getTokenAt(pos.row, pos.column); 258 | 259 | if (!token) 260 | return []; 261 | if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) 262 | return this.getTagCompletions(state, session, pos, prefix); 263 | if (hasType(token, 'text') || hasType(token, 'attribute-name')) 264 | return this.getAttributeCompetions(state, session, pos, prefix); 265 | 266 | return []; 267 | }; 268 | 269 | this.getTagCompletions = function(state, session, pos, prefix) { 270 | var elements = allElements; 271 | if (prefix) { 272 | elements = elements.filter(function(element){ 273 | return element.indexOf(prefix) === 0; 274 | }); 275 | } 276 | return elements.map(function(element){ 277 | return { 278 | value: element, 279 | meta: "tag" 280 | }; 281 | }); 282 | }; 283 | 284 | this.getAttributeCompetions = function(state, session, pos, prefix) { 285 | var tagName = findTagName(session, pos); 286 | if (!tagName) 287 | return []; 288 | var attributes = globalAttributes; 289 | if (tagName in attributeMap) { 290 | attributes = attributes.concat(attributeMap[tagName]); 291 | } 292 | if (prefix) { 293 | attributes = attributes.filter(function(attribute){ 294 | return attribute.indexOf(prefix) === 0; 295 | }); 296 | } 297 | return attributes.map(function(attribute){ 298 | return { 299 | caption: attribute, 300 | snippet: attribute + '="$0"', 301 | meta: "attribute" 302 | }; 303 | }); 304 | }; 305 | 306 | }).call(HtmlCompletions.prototype); 307 | 308 | exports.HtmlCompletions = HtmlCompletions; 309 | }); -------------------------------------------------------------------------------- /vendor/assets/javascripts/ace/mode-ruby.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/mode/ruby', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ruby_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/mode/folding/coffee'], function(require, exports, module) { 32 | 33 | 34 | var oop = require("../lib/oop"); 35 | var TextMode = require("./text").Mode; 36 | var Tokenizer = require("../tokenizer").Tokenizer; 37 | var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules; 38 | var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; 39 | var Range = require("../range").Range; 40 | var FoldMode = require("./folding/coffee").FoldMode; 41 | 42 | var Mode = function() { 43 | var highlighter = new RubyHighlightRules(); 44 | 45 | this.$tokenizer = new Tokenizer(highlighter.getRules()); 46 | this.$keywordList = highlighter.$keywordList; 47 | this.$outdent = new MatchingBraceOutdent(); 48 | this.foldingRules = new FoldMode(); 49 | }; 50 | oop.inherits(Mode, TextMode); 51 | 52 | (function() { 53 | 54 | 55 | this.lineCommentStart = "#"; 56 | 57 | this.getNextLineIndent = function(state, line, tab) { 58 | var indent = this.$getIndent(line); 59 | 60 | var tokenizedLine = this.$tokenizer.getLineTokens(line, state); 61 | var tokens = tokenizedLine.tokens; 62 | 63 | if (tokens.length && tokens[tokens.length-1].type == "comment") { 64 | return indent; 65 | } 66 | 67 | if (state == "start") { 68 | var match = line.match(/^.*[\{\(\[]\s*$/); 69 | var startingClassOrMethod = line.match(/^\s*(class|def)\s.*$/); 70 | var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/); 71 | var startingConditional = line.match(/^\s*(if|else)\s*/) 72 | if (match || startingClassOrMethod || startingDoBlock || startingConditional) { 73 | indent += tab; 74 | } 75 | } 76 | 77 | return indent; 78 | }; 79 | 80 | this.checkOutdent = function(state, line, input) { 81 | return /^\s+end$/.test(line + input) || /^\s+}$/.test(line + input) || /^\s+else$/.test(line + input); 82 | }; 83 | 84 | this.autoOutdent = function(state, doc, row) { 85 | var indent = this.$getIndent(doc.getLine(row)); 86 | var tab = doc.getTabString(); 87 | if (indent.slice(-tab.length) == tab) 88 | doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); 89 | }; 90 | 91 | }).call(Mode.prototype); 92 | 93 | exports.Mode = Mode; 94 | }); 95 | 96 | ace.define('ace/mode/ruby_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { 97 | 98 | 99 | var oop = require("../lib/oop"); 100 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 101 | var constantOtherSymbol = exports.constantOtherSymbol = { 102 | token : "constant.other.symbol.ruby", // symbol 103 | regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?" 104 | }; 105 | 106 | var qString = exports.qString = { 107 | token : "string", // single line 108 | regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" 109 | }; 110 | 111 | var qqString = exports.qqString = { 112 | token : "string", // single line 113 | regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' 114 | }; 115 | 116 | var tString = exports.tString = { 117 | token : "string", // backtick string 118 | regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]" 119 | }; 120 | 121 | var constantNumericHex = exports.constantNumericHex = { 122 | token : "constant.numeric", // hex 123 | regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b" 124 | }; 125 | 126 | var constantNumericFloat = exports.constantNumericFloat = { 127 | token : "constant.numeric", // float 128 | regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b" 129 | }; 130 | 131 | var RubyHighlightRules = function() { 132 | 133 | var builtinFunctions = ( 134 | "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" + 135 | "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" + 136 | "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" + 137 | "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" + 138 | "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" + 139 | "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" + 140 | "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" + 141 | "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" + 142 | "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" + 143 | "gsub!|get_via_redirect|host!|https?|https!|include|Integer|lambda|link_to|" + 144 | "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" + 145 | "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" + 146 | "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" + 147 | "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" + 148 | "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" + 149 | "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" + 150 | "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" + 151 | "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" + 152 | "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" + 153 | "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" + 154 | "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" + 155 | "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" + 156 | "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" + 157 | "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" + 158 | "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" + 159 | "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" + 160 | "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" + 161 | "translate|localize|extract_locale_from_tld|caches_page|expire_page|caches_action|expire_action|" + 162 | "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" + 163 | "has_many|has_one|belongs_to|has_and_belongs_to_many" 164 | ); 165 | 166 | var keywords = ( 167 | "alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" + 168 | "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" + 169 | "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield" 170 | ); 171 | 172 | var buildinConstants = ( 173 | "true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" + 174 | "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING" 175 | ); 176 | 177 | var builtinVariables = ( 178 | "\$DEBUG|\$defout|\$FILENAME|\$LOAD_PATH|\$SAFE|\$stdin|\$stdout|\$stderr|\$VERBOSE|" + 179 | "$!|root_url|flash|session|cookies|params|request|response|logger|self" 180 | ); 181 | 182 | var keywordMapper = this.$keywords = this.createKeywordMapper({ 183 | "keyword": keywords, 184 | "constant.language": buildinConstants, 185 | "variable.language": builtinVariables, 186 | "support.function": builtinFunctions, 187 | "invalid.deprecated": "debugger" // TODO is this a remnant from js mode? 188 | }, "identifier"); 189 | 190 | this.$rules = { 191 | "start" : [ 192 | { 193 | token : "comment", 194 | regex : "#.*$" 195 | }, { 196 | token : "comment", // multi line comment 197 | regex : "^=begin(?:$|\\s.*$)", 198 | next : "comment" 199 | }, { 200 | token : "string.regexp", 201 | regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" 202 | }, 203 | 204 | qString, 205 | qqString, 206 | tString, 207 | 208 | { 209 | token : "text", // namespaces aren't symbols 210 | regex : "::" 211 | }, { 212 | token : "variable.instance", // instance variable 213 | regex : "@{1,2}[a-zA-Z_\\d]+" 214 | }, { 215 | token : "support.class", // class name 216 | regex : "[A-Z][a-zA-Z_\\d]+" 217 | }, 218 | 219 | constantOtherSymbol, 220 | constantNumericHex, 221 | constantNumericFloat, 222 | 223 | { 224 | token : "constant.language.boolean", 225 | regex : "(?:true|false)\\b" 226 | }, { 227 | token : keywordMapper, 228 | regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" 229 | }, { 230 | token : "punctuation.separator.key-value", 231 | regex : "=>" 232 | }, { 233 | stateName: "heredoc", 234 | onMatch : function(value, currentState, stack) { 235 | var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; 236 | var tokens = value.split(this.splitRegex); 237 | stack.push(next, tokens[3]); 238 | return [ 239 | {type:"constant", value: tokens[1]}, 240 | {type:"string", value: tokens[2]}, 241 | {type:"support.class", value: tokens[3]}, 242 | {type:"string", value: tokens[4]} 243 | ]; 244 | }, 245 | regex : "(<<-?)(['\"`]?)([\\w]+)(['\"`]?)", 246 | rules: { 247 | heredoc: [{ 248 | onMatch: function(value, currentState, stack) { 249 | if (value == stack[1]) { 250 | stack.shift(); 251 | stack.shift(); 252 | return "support.class"; 253 | } 254 | return "string"; 255 | }, 256 | regex: ".*$", 257 | next: "start" 258 | }], 259 | indentedHeredoc: [{ 260 | token: "string", 261 | regex: "^ +" 262 | }, { 263 | onMatch: function(value, currentState, stack) { 264 | if (value == stack[1]) { 265 | stack.shift(); 266 | stack.shift(); 267 | return "support.class"; 268 | } 269 | return "string"; 270 | }, 271 | regex: ".*$", 272 | next: "start" 273 | }] 274 | } 275 | }, { 276 | token : "keyword.operator", 277 | regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" 278 | }, { 279 | token : "paren.lparen", 280 | regex : "[[({]" 281 | }, { 282 | token : "paren.rparen", 283 | regex : "[\\])}]" 284 | }, { 285 | token : "text", 286 | regex : "\\s+" 287 | } 288 | ], 289 | "comment" : [ 290 | { 291 | token : "comment", // closing comment 292 | regex : "^=end(?:$|\\s.*$)", 293 | next : "start" 294 | }, { 295 | token : "comment", // comment spanning whole line 296 | regex : ".+" 297 | } 298 | ] 299 | }; 300 | 301 | this.normalizeRules(); 302 | }; 303 | 304 | oop.inherits(RubyHighlightRules, TextHighlightRules); 305 | 306 | exports.RubyHighlightRules = RubyHighlightRules; 307 | }); 308 | 309 | ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { 310 | 311 | 312 | var Range = require("../range").Range; 313 | 314 | var MatchingBraceOutdent = function() {}; 315 | 316 | (function() { 317 | 318 | this.checkOutdent = function(line, input) { 319 | if (! /^\s+$/.test(line)) 320 | return false; 321 | 322 | return /^\s*\}/.test(input); 323 | }; 324 | 325 | this.autoOutdent = function(doc, row) { 326 | var line = doc.getLine(row); 327 | var match = line.match(/^(\s*\})/); 328 | 329 | if (!match) return 0; 330 | 331 | var column = match[1].length; 332 | var openBracePos = doc.findMatchingBracket({row: row, column: column}); 333 | 334 | if (!openBracePos || openBracePos.row == row) return 0; 335 | 336 | var indent = this.$getIndent(doc.getLine(openBracePos.row)); 337 | doc.replace(new Range(row, 0, row, column-1), indent); 338 | }; 339 | 340 | this.$getIndent = function(line) { 341 | return line.match(/^\s*/)[0]; 342 | }; 343 | 344 | }).call(MatchingBraceOutdent.prototype); 345 | 346 | exports.MatchingBraceOutdent = MatchingBraceOutdent; 347 | }); 348 | 349 | ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { 350 | 351 | 352 | var oop = require("../../lib/oop"); 353 | var BaseFoldMode = require("./fold_mode").FoldMode; 354 | var Range = require("../../range").Range; 355 | 356 | var FoldMode = exports.FoldMode = function() {}; 357 | oop.inherits(FoldMode, BaseFoldMode); 358 | 359 | (function() { 360 | 361 | this.getFoldWidgetRange = function(session, foldStyle, row) { 362 | var range = this.indentationBlock(session, row); 363 | if (range) 364 | return range; 365 | 366 | var re = /\S/; 367 | var line = session.getLine(row); 368 | var startLevel = line.search(re); 369 | if (startLevel == -1 || line[startLevel] != "#") 370 | return; 371 | 372 | var startColumn = line.length; 373 | var maxRow = session.getLength(); 374 | var startRow = row; 375 | var endRow = row; 376 | 377 | while (++row < maxRow) { 378 | line = session.getLine(row); 379 | var level = line.search(re); 380 | 381 | if (level == -1) 382 | continue; 383 | 384 | if (line[level] != "#") 385 | break; 386 | 387 | endRow = row; 388 | } 389 | 390 | if (endRow > startRow) { 391 | var endColumn = session.getLine(endRow).length; 392 | return new Range(startRow, startColumn, endRow, endColumn); 393 | } 394 | }; 395 | this.getFoldWidget = function(session, foldStyle, row) { 396 | var line = session.getLine(row); 397 | var indent = line.search(/\S/); 398 | var next = session.getLine(row + 1); 399 | var prev = session.getLine(row - 1); 400 | var prevIndent = prev.search(/\S/); 401 | var nextIndent = next.search(/\S/); 402 | 403 | if (indent == -1) { 404 | session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; 405 | return ""; 406 | } 407 | if (prevIndent == -1) { 408 | if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { 409 | session.foldWidgets[row - 1] = ""; 410 | session.foldWidgets[row + 1] = ""; 411 | return "start"; 412 | } 413 | } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { 414 | if (session.getLine(row - 2).search(/\S/) == -1) { 415 | session.foldWidgets[row - 1] = "start"; 416 | session.foldWidgets[row + 1] = ""; 417 | return ""; 418 | } 419 | } 420 | 421 | if (prevIndent!= -1 && prevIndent < indent) 422 | session.foldWidgets[row - 1] = "start"; 423 | else 424 | session.foldWidgets[row - 1] = ""; 425 | 426 | if (indent < nextIndent) 427 | return "start"; 428 | else 429 | return ""; 430 | }; 431 | 432 | }).call(FoldMode.prototype); 433 | 434 | }); 435 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ace/mode-yaml.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/mode/yaml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/yaml_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/folding/coffee'], function(require, exports, module) { 32 | 33 | 34 | var oop = require("../lib/oop"); 35 | var TextMode = require("./text").Mode; 36 | var Tokenizer = require("../tokenizer").Tokenizer; 37 | var YamlHighlightRules = require("./yaml_highlight_rules").YamlHighlightRules; 38 | var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; 39 | var FoldMode = require("./folding/coffee").FoldMode; 40 | 41 | var Mode = function() { 42 | this.$tokenizer = new Tokenizer(new YamlHighlightRules().getRules()); 43 | this.$outdent = new MatchingBraceOutdent(); 44 | this.foldingRules = new FoldMode(); 45 | }; 46 | oop.inherits(Mode, TextMode); 47 | 48 | (function() { 49 | 50 | this.lineCommentStart = "#"; 51 | 52 | this.getNextLineIndent = function(state, line, tab) { 53 | var indent = this.$getIndent(line); 54 | 55 | if (state == "start") { 56 | var match = line.match(/^.*[\{\(\[]\s*$/); 57 | if (match) { 58 | indent += tab; 59 | } 60 | } 61 | 62 | return indent; 63 | }; 64 | 65 | this.checkOutdent = function(state, line, input) { 66 | return this.$outdent.checkOutdent(line, input); 67 | }; 68 | 69 | this.autoOutdent = function(state, doc, row) { 70 | this.$outdent.autoOutdent(doc, row); 71 | }; 72 | 73 | 74 | }).call(Mode.prototype); 75 | 76 | exports.Mode = Mode; 77 | 78 | }); 79 | 80 | ace.define('ace/mode/yaml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) { 81 | 82 | 83 | var oop = require("../lib/oop"); 84 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; 85 | 86 | var YamlHighlightRules = function() { 87 | this.$rules = { 88 | "start" : [ 89 | { 90 | token : "comment", 91 | regex : "#.*$" 92 | }, { 93 | token : "list.markup", 94 | regex : /^(?:-{3}|\.{3})\s*(?=#|$)/ 95 | }, { 96 | token : "list.markup", 97 | regex : /^\s*[\-?](?:$|\s)/ 98 | }, { 99 | token: "constant", 100 | regex: "!![\\w//]+" 101 | }, { 102 | token: "constant.language", 103 | regex: "[&\\*][a-zA-Z0-9-_]+" 104 | }, { 105 | token: ["meta.tag", "keyword"], 106 | regex: /^(\s*\w.*?)(\:(?:\s+|$))/ 107 | },{ 108 | token: ["meta.tag", "keyword"], 109 | regex: /(\w+?)(\s*\:(?:\s+|$))/ 110 | }, { 111 | token : "keyword.operator", 112 | regex : "<<\\w*:\\w*" 113 | }, { 114 | token : "keyword.operator", 115 | regex : "-\\s*(?=[{])" 116 | }, { 117 | token : "string", // single line 118 | regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' 119 | }, { 120 | token : "string", // multi line string start 121 | regex : '[\\|>]\\w*', 122 | next : "qqstring" 123 | }, { 124 | token : "string", // single quoted string 125 | regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" 126 | }, { 127 | token : "constant.numeric", // float 128 | regex : /[+\-]?[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?\b/ 129 | }, { 130 | token : "constant.numeric", // other number 131 | regex : /[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/ 132 | }, { 133 | token : "constant.language.boolean", 134 | regex : "(?:true|false|TRUE|FALSE|True|False|yes|no)\\b" 135 | }, { 136 | token : "invalid.illegal", // comments are not allowed 137 | regex : "\\/\\/.*$" 138 | }, { 139 | token : "paren.lparen", 140 | regex : "[[({]" 141 | }, { 142 | token : "paren.rparen", 143 | regex : "[\\])}]" 144 | } 145 | ], 146 | "qqstring" : [ 147 | { 148 | token : "string", 149 | regex : '(?=(?:(?:\\\\.)|(?:[^:]))*?:)', 150 | next : "start" 151 | }, { 152 | token : "string", 153 | regex : '.+' 154 | } 155 | ]}; 156 | 157 | }; 158 | 159 | oop.inherits(YamlHighlightRules, TextHighlightRules); 160 | 161 | exports.YamlHighlightRules = YamlHighlightRules; 162 | }); 163 | 164 | ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) { 165 | 166 | 167 | var Range = require("../range").Range; 168 | 169 | var MatchingBraceOutdent = function() {}; 170 | 171 | (function() { 172 | 173 | this.checkOutdent = function(line, input) { 174 | if (! /^\s+$/.test(line)) 175 | return false; 176 | 177 | return /^\s*\}/.test(input); 178 | }; 179 | 180 | this.autoOutdent = function(doc, row) { 181 | var line = doc.getLine(row); 182 | var match = line.match(/^(\s*\})/); 183 | 184 | if (!match) return 0; 185 | 186 | var column = match[1].length; 187 | var openBracePos = doc.findMatchingBracket({row: row, column: column}); 188 | 189 | if (!openBracePos || openBracePos.row == row) return 0; 190 | 191 | var indent = this.$getIndent(doc.getLine(openBracePos.row)); 192 | doc.replace(new Range(row, 0, row, column-1), indent); 193 | }; 194 | 195 | this.$getIndent = function(line) { 196 | return line.match(/^\s*/)[0]; 197 | }; 198 | 199 | }).call(MatchingBraceOutdent.prototype); 200 | 201 | exports.MatchingBraceOutdent = MatchingBraceOutdent; 202 | }); 203 | 204 | ace.define('ace/mode/folding/coffee', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode', 'ace/range'], function(require, exports, module) { 205 | 206 | 207 | var oop = require("../../lib/oop"); 208 | var BaseFoldMode = require("./fold_mode").FoldMode; 209 | var Range = require("../../range").Range; 210 | 211 | var FoldMode = exports.FoldMode = function() {}; 212 | oop.inherits(FoldMode, BaseFoldMode); 213 | 214 | (function() { 215 | 216 | this.getFoldWidgetRange = function(session, foldStyle, row) { 217 | var range = this.indentationBlock(session, row); 218 | if (range) 219 | return range; 220 | 221 | var re = /\S/; 222 | var line = session.getLine(row); 223 | var startLevel = line.search(re); 224 | if (startLevel == -1 || line[startLevel] != "#") 225 | return; 226 | 227 | var startColumn = line.length; 228 | var maxRow = session.getLength(); 229 | var startRow = row; 230 | var endRow = row; 231 | 232 | while (++row < maxRow) { 233 | line = session.getLine(row); 234 | var level = line.search(re); 235 | 236 | if (level == -1) 237 | continue; 238 | 239 | if (line[level] != "#") 240 | break; 241 | 242 | endRow = row; 243 | } 244 | 245 | if (endRow > startRow) { 246 | var endColumn = session.getLine(endRow).length; 247 | return new Range(startRow, startColumn, endRow, endColumn); 248 | } 249 | }; 250 | this.getFoldWidget = function(session, foldStyle, row) { 251 | var line = session.getLine(row); 252 | var indent = line.search(/\S/); 253 | var next = session.getLine(row + 1); 254 | var prev = session.getLine(row - 1); 255 | var prevIndent = prev.search(/\S/); 256 | var nextIndent = next.search(/\S/); 257 | 258 | if (indent == -1) { 259 | session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : ""; 260 | return ""; 261 | } 262 | if (prevIndent == -1) { 263 | if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { 264 | session.foldWidgets[row - 1] = ""; 265 | session.foldWidgets[row + 1] = ""; 266 | return "start"; 267 | } 268 | } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { 269 | if (session.getLine(row - 2).search(/\S/) == -1) { 270 | session.foldWidgets[row - 1] = "start"; 271 | session.foldWidgets[row + 1] = ""; 272 | return ""; 273 | } 274 | } 275 | 276 | if (prevIndent!= -1 && prevIndent < indent) 277 | session.foldWidgets[row - 1] = "start"; 278 | else 279 | session.foldWidgets[row - 1] = ""; 280 | 281 | if (indent < nextIndent) 282 | return "start"; 283 | else 284 | return ""; 285 | }; 286 | 287 | }).call(FoldMode.prototype); 288 | 289 | }); 290 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ace/theme-textmate.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Distributed under the BSD license: 3 | * 4 | * Copyright (c) 2010, Ajax.org B.V. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of Ajax.org B.V. nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * ***** END LICENSE BLOCK ***** */ 30 | 31 | ace.define('ace/theme/textmate', ['require', 'exports', 'module' , 'ace/lib/dom'], function(require, exports, module) { 32 | 33 | 34 | exports.isDark = false; 35 | exports.cssClass = "ace-tm"; 36 | exports.cssText = ".ace-tm .ace_gutter {\ 37 | background: #f0f0f0;\ 38 | color: #333;\ 39 | }\ 40 | .ace-tm .ace_print-margin {\ 41 | width: 1px;\ 42 | background: #e8e8e8;\ 43 | }\ 44 | .ace-tm .ace_fold {\ 45 | background-color: #6B72E6;\ 46 | }\ 47 | .ace-tm {\ 48 | background-color: #FFFFFF;\ 49 | }\ 50 | .ace-tm .ace_cursor {\ 51 | border-left: 2px solid black;\ 52 | }\ 53 | .ace-tm .ace_overwrite-cursors .ace_cursor {\ 54 | border-left: 0px;\ 55 | border-bottom: 1px solid black;\ 56 | }\ 57 | .ace-tm .ace_invisible {\ 58 | color: rgb(191, 191, 191);\ 59 | }\ 60 | .ace-tm .ace_storage,\ 61 | .ace-tm .ace_keyword {\ 62 | color: blue;\ 63 | }\ 64 | .ace-tm .ace_constant {\ 65 | color: rgb(197, 6, 11);\ 66 | }\ 67 | .ace-tm .ace_constant.ace_buildin {\ 68 | color: rgb(88, 72, 246);\ 69 | }\ 70 | .ace-tm .ace_constant.ace_language {\ 71 | color: rgb(88, 92, 246);\ 72 | }\ 73 | .ace-tm .ace_constant.ace_library {\ 74 | color: rgb(6, 150, 14);\ 75 | }\ 76 | .ace-tm .ace_invalid {\ 77 | background-color: rgba(255, 0, 0, 0.1);\ 78 | color: red;\ 79 | }\ 80 | .ace-tm .ace_support.ace_function {\ 81 | color: rgb(60, 76, 114);\ 82 | }\ 83 | .ace-tm .ace_support.ace_constant {\ 84 | color: rgb(6, 150, 14);\ 85 | }\ 86 | .ace-tm .ace_support.ace_type,\ 87 | .ace-tm .ace_support.ace_class {\ 88 | color: rgb(109, 121, 222);\ 89 | }\ 90 | .ace-tm .ace_keyword.ace_operator {\ 91 | color: rgb(104, 118, 135);\ 92 | }\ 93 | .ace-tm .ace_string {\ 94 | color: rgb(3, 106, 7);\ 95 | }\ 96 | .ace-tm .ace_comment {\ 97 | color: rgb(76, 136, 107);\ 98 | }\ 99 | .ace-tm .ace_comment.ace_doc {\ 100 | color: rgb(0, 102, 255);\ 101 | }\ 102 | .ace-tm .ace_comment.ace_doc.ace_tag {\ 103 | color: rgb(128, 159, 191);\ 104 | }\ 105 | .ace-tm .ace_constant.ace_numeric {\ 106 | color: rgb(0, 0, 205);\ 107 | }\ 108 | .ace-tm .ace_variable {\ 109 | color: rgb(49, 132, 149);\ 110 | }\ 111 | .ace-tm .ace_xml-pe {\ 112 | color: rgb(104, 104, 91);\ 113 | }\ 114 | .ace-tm .ace_entity.ace_name.ace_function {\ 115 | color: #0000A2;\ 116 | }\ 117 | .ace-tm .ace_heading {\ 118 | color: rgb(12, 7, 255);\ 119 | }\ 120 | .ace-tm .ace_list {\ 121 | color:rgb(185, 6, 144);\ 122 | }\ 123 | .ace-tm .ace_meta.ace_tag {\ 124 | color:rgb(0, 22, 142);\ 125 | }\ 126 | .ace-tm .ace_string.ace_regex {\ 127 | color: rgb(255, 0, 0)\ 128 | }\ 129 | .ace-tm .ace_marker-layer .ace_selection {\ 130 | background: rgb(181, 213, 255);\ 131 | }\ 132 | .ace-tm.ace_multiselect .ace_selection.ace_start {\ 133 | box-shadow: 0 0 3px 0px white;\ 134 | border-radius: 2px;\ 135 | }\ 136 | .ace-tm .ace_marker-layer .ace_step {\ 137 | background: rgb(252, 255, 0);\ 138 | }\ 139 | .ace-tm .ace_marker-layer .ace_stack {\ 140 | background: rgb(164, 229, 101);\ 141 | }\ 142 | .ace-tm .ace_marker-layer .ace_bracket {\ 143 | margin: -1px 0 0 -1px;\ 144 | border: 1px solid rgb(192, 192, 192);\ 145 | }\ 146 | .ace-tm .ace_marker-layer .ace_active-line {\ 147 | background: rgba(0, 0, 0, 0.07);\ 148 | }\ 149 | .ace-tm .ace_gutter-active-line {\ 150 | background-color : #dcdcdc;\ 151 | }\ 152 | .ace-tm .ace_marker-layer .ace_selected-word {\ 153 | background: rgb(250, 250, 255);\ 154 | border: 1px solid rgb(200, 200, 250);\ 155 | }\ 156 | .ace-tm .ace_indent-guide {\ 157 | background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\ 158 | }\ 159 | "; 160 | 161 | var dom = require("../lib/dom"); 162 | dom.importCssString(exports.cssText, exports.cssClass); 163 | }); 164 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/github.css: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/github",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-github",t.cssText='/* CSS style content from github\'s default pygments highlighter template.Cursor and selection styles from textmate.css. */.ace-github .ace_gutter {background: #e8e8e8;color: #AAA;}.ace-github {background: #fff;color: #000;}.ace-github .ace_keyword {font-weight: bold;}.ace-github .ace_string {color: #D14;}.ace-github .ace_variable.ace_class {color: teal;}.ace-github .ace_constant.ace_numeric {color: #099;}.ace-github .ace_constant.ace_buildin {color: #0086B3;}.ace-github .ace_support.ace_function {color: #0086B3;}.ace-github .ace_comment {color: #998;font-style: italic;}.ace-github .ace_variable.ace_language {color: #0086B3;}.ace-github .ace_paren {font-weight: bold;}.ace-github .ace_boolean {font-weight: bold;}.ace-github .ace_string.ace_regexp {color: #009926;font-weight: normal;}.ace-github .ace_variable.ace_instance {color: teal;}.ace-github .ace_constant.ace_language {font-weight: bold;}.ace-github .ace_cursor {border-left: 2px solid black;}.ace-github .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid black;}.ace-github .ace_marker-layer .ace_active-line {background: rgb(255, 255, 204);}.ace-github .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-github.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;border-radius: 2px;}/* bold keywords cause cursor issues for some fonts *//* this disables bold style for editor and keeps for static highlighter */.ace-github.ace_nobold .ace_line > span {font-weight: normal !important;}.ace-github .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-github .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-github .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-github .ace_gutter-active-line {background-color : rgba(0, 0, 0, 0.07);}.ace-github .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-github .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-github .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) --------------------------------------------------------------------------------