diff --git a/Gemfile.lock b/Gemfile.lock index 9e6d8d3e..63c64eae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -264,7 +264,7 @@ GEM mysql2 (0.5.5) net-http (0.3.2) uri - net-imap (0.4.19) + net-imap (0.5.8) date net-protocol net-pop (0.1.2) @@ -274,10 +274,10 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.3) - nokogiri (1.18.3) + nokogiri (1.18.8) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.18.3-x86_64-linux-gnu) + nokogiri (1.18.8-x86_64-linux-gnu) racc (~> 1.4) orm_adapter (0.5.0) paper_trail (15.1.0) @@ -310,7 +310,7 @@ GEM nio4r (~> 2.0) raabro (1.4.0) racc (1.8.1) - rack (2.2.12) + rack (2.2.14) rack-test (2.1.0) rack (>= 1.3) rails (7.0.8.7) diff --git a/app/assets/javascripts/form_fields/config_base.js b/app/assets/javascripts/form_fields/config_base.js index 16096e12..0aff91be 100644 --- a/app/assets/javascripts/form_fields/config_base.js +++ b/app/assets/javascripts/form_fields/config_base.js @@ -133,22 +133,24 @@ function form_field_config_base(form_field) { ] } else if (selected_value == "html") { form_field.widgets = [ - config_form_field_codemirror(form_field, "html", "application/x-erb") + config_form_field_codemirror(form_field, "html", "text/html") ] } else if (selected_value == "code") { form_field.widgets = [ - config_form_field_codemirror(form_field, "code", "text/x-ruby"), + config_form_field_codemirror(form_field, "code", "liquid"), config_form_field_condition(form_field, "condition", form_field.condition_options), - config_form_field_select(form_field, "code_type", [["number", "Número"], ["string", "Texto"], ["date", "Data"]], { required: false, default: "number" }) + config_form_field_select(form_field, "code_type", [["number", "Número"], ["string", "Texto"], ["date", "Data"]], { required: false, default: "number" }), + config_form_field_select(form_field, "template_type", [["Ruby", "Ruby"], ["Liquid", "Liquid"]], { required: true, default: "Liquid" }) ] } else if (selected_value == "email") { form_field.widgets = [ config_form_field_input(form_field, "to", "text", { - required: true, default: "<%= var(:application).email %>" + required: true, default: "{{ application.email }}" }), config_form_field_input(form_field, "subject", "text", { required: true }), - config_form_field_codemirror(form_field, "body", "application/x-erb", { required: true }), - config_form_field_condition(form_field, "condition", form_field.condition_options) + config_form_field_codemirror(form_field, "body", "liquid", { required: true }), + config_form_field_condition(form_field, "condition", form_field.condition_options), + config_form_field_select(form_field, "template_type", [["ERB", "ERB"], ["Liquid", "Liquid"]], { required: true, default: "Liquid" }) ] } else if (selected_value == "invalid") { form_field.widgets = [ diff --git a/app/assets/javascripts/form_fields/config_codemirror.js b/app/assets/javascripts/form_fields/config_codemirror.js index de64bda5..9c4353e7 100644 --- a/app/assets/javascripts/form_fields/config_codemirror.js +++ b/app/assets/javascripts/form_fields/config_codemirror.js @@ -30,8 +30,10 @@ function config_form_field_codemirror(form_field, field, mode, options) { smartIndent: true, lineNumbers: true, matchBrackets : true, - autofocus: true + autofocus: true, + lineWrapping: true }) + editor.setSize(null, '32em'); editor.on("change", function(cm, change){ form_field.data[field] = cm.getValue(); form_field.save_config(); diff --git a/app/assets/javascripts/form_fields/config_select.js b/app/assets/javascripts/form_fields/config_select.js index cc4ab8a8..d4babcf6 100644 --- a/app/assets/javascripts/form_fields/config_select.js +++ b/app/assets/javascripts/form_fields/config_select.js @@ -2,7 +2,10 @@ function config_form_field_select(form_field, field, selectable, options) { let r = (Math.random() + 1).toString(36).substring(7); let title = form_field.i18n(field); let id = `${form_field.baseid}_${field}_${r}` - let value = form_field.data[field] || options["default"] || ""; + let value = form_field.data[field] || ""; + if ((form_field.data[field] === undefined) && options["default"]) { + value = form_field.data[field] = options["default"]; + } let options_text = []; let found = null; @@ -56,7 +59,8 @@ function config_form_field_select(form_field, field, selectable, options) { }, validate: () => { let result = true; - if (options["required"] && !form_field.data[field]) { + uses_default = form_field.data[field] === undefined && options["default"]; + if (options["required"] && !form_field.data[field] && !uses_default) { let present_error = form_field.i18n_error(field + "_present_error"); $(`#${id}_error`).text(present_error) $(`#${id}_error`).show(); diff --git a/app/controllers/dismissals_controller.rb b/app/controllers/dismissals_controller.rb index 34bc22a1..8234a1e2 100644 --- a/app/controllers/dismissals_controller.rb +++ b/app/controllers/dismissals_controller.rb @@ -9,10 +9,12 @@ class DismissalsController < ApplicationController active_scaffold :dismissal do |config| # Enables advanced search A.K.A FieldSearch config.actions.swap :search, :field_search - config.field_search.columns = [:enrollment] + config.columns.add :enrollment, :level + config.field_search.columns = [:enrollment, :level, :date, :dismissal_reason] config.columns[:enrollment].search_ui = :text config.columns[:enrollment].search_sql = "enrollments.enrollment_number" config.columns[:date].search_sql = "dismissals.date" + config.columns[:level].search_sql = "enrollments.level" config.list.columns = [:enrollment, :dismissal_reason, :date, :obs] config.create.label = :create_dismissal_label @@ -21,9 +23,35 @@ class DismissalsController < ApplicationController config.columns[:date].options = { format: :monthyear } config.columns[:dismissal_reason].clear_link + config.show.columns = [:enrollment, :level, :dismissal_reason, :obs] + config.update.columns = [:enrollment, :date, :dismissal_reason, :obs] config.create.columns = [:enrollment, :date, :dismissal_reason, :obs] config.actions.exclude :deleted_records end + + def self.condition_for_level_column(column, value, like_pattern) + unless value.blank? + ["dismissals.id IN ( + SELECT dismissals.id + FROM enrollments + JOIN dismissals ON enrollments.id = dismissals.enrollment_id + WHERE enrollments.level_id = ? + )", value] + end + end + + def self.condition_for_date_column(column, value, like_pattern) + unless value.blank? || value["year"].to_i == 0 + date = Date.new(value["year"].to_i, value["month"].to_i, value["day"].to_i) + next_year = date.next_year + ["dismissals.id IN ( + SELECT dismissals.id + FROM enrollments + JOIN dismissals ON enrollments.id = dismissals.enrollment_id + WHERE dismissals.date >= ? AND dismissals.date < ? + )", date, next_year] + end + end end diff --git a/app/helpers/dismissals_helper.rb b/app/helpers/dismissals_helper.rb index 8f216fbc..edb8149d 100644 --- a/app/helpers/dismissals_helper.rb +++ b/app/helpers/dismissals_helper.rb @@ -5,7 +5,28 @@ # Helper for Dismissals module DismissalsHelper + def date_search_column(record, options) + month_year_widget record, options, :date, required: false, multiparameter: false, + date_options: { discard_month: true, prefix: options[:name] } + end + + def level_search_column(record, options) + local_options = { + include_blank: true + } + + select_tag( + record[:level], + options_from_collection_for_select(Level.order("name"), "id", "name"), + options.merge(local_options) + ) + end + def date_form_column(record, options) month_year_widget record, options, :date, required: false end + + def dismissal_level_show_column(record, column) + record.enrollment.level.name + end end diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index b7189a45..fbd72d97 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -20,7 +20,7 @@ def body_template_form_column(record, options) :body_template, "record_body_template_#{record.id}", "text/html", options.merge( value: record.body_template || - I18n.t("active_scaffold.notification.body_template_default") + I18n.t("active_scaffold.notification.body_template_default_liquid") ) ) end diff --git a/app/models/admissions/filled_form.rb b/app/models/admissions/filled_form.rb index a4ea7985..539647a9 100644 --- a/app/models/admissions/filled_form.rb +++ b/app/models/admissions/filled_form.rb @@ -6,6 +6,13 @@ class Admissions::FilledForm < ActiveRecord::Base has_paper_trail + CONSOLIDATE_DROPS = { + application: Admissions::AdmissionApplicationDrop, + process: Admissions::AdmissionProcessDrop, + committees: :value, + fields: :value, + } + attr_accessor :enable_submission has_one :admission_application, dependent: :restrict_with_exception, @@ -116,16 +123,21 @@ def consolidate(field_objects: nil, vars: nil) fields[form_field.name] = value next end - case form_field.field_type when Admissions::FormField::CODE - value = CodeEvaluator.evaluate_code(configuration["code"], **vars) + value = CodeEvaluator.evaluate_code( + configuration["code"], vars, + configuration["template_type"], CONSOLIDATE_DROPS + ) field_objects[form_field.name] = self.fields.new( form_field_id: form_field.id, value: value ) + value = Admissions::FilledFormField.convert_value(value, form_field.get_type) fields[form_field.name] = value when Admissions::FormField::EMAIL - formatter = ErbFormatter.new(vars) + formatter = CodeEvaluator.create_formatter( + vars, configuration["template_type"], CONSOLIDATE_DROPS + ) notification = { to: formatter.format(configuration["to"]), subject: formatter.format(configuration["subject"]), diff --git a/app/models/admissions/filled_form_field.rb b/app/models/admissions/filled_form_field.rb index 1e393bd1..089693bb 100644 --- a/app/models/admissions/filled_form_field.rb +++ b/app/models/admissions/filled_form_field.rb @@ -343,26 +343,7 @@ def set_model_place_field( end def get_type - case self.form_field.field_type - when Admissions::FormField::NUMBER - "number" - when Admissions::FormField::DATE - "date" - when Admissions::FormField::STUDENT_FIELD - configuration = self.form_field.config_hash - case configuration["field"] - when "birthdate", "identity_expedition_date" - "date" - else - "string" - end - when Admissions::FormField::CODE - configuration = self.form_field.config_hash - return configuration["code_type"] if configuration["code_type"].present? - "number" - else - "string" - end + self.form_field.get_type end def self.convert_value(value, type) diff --git a/app/models/admissions/form_field.rb b/app/models/admissions/form_field.rb index 5a58fb55..47489e2e 100644 --- a/app/models/admissions/form_field.rb +++ b/app/models/admissions/form_field.rb @@ -6,6 +6,11 @@ class Admissions::FormField < ActiveRecord::Base has_paper_trail + @@disable_erb_validation = false + LIQUID = record_i18n_attr("configurations.template_types.liquid") + ERB = record_i18n_attr("configurations.template_types.erb") + RUBY = record_i18n_attr("configurations.template_types.ruby") + HTML = record_i18n_attr("field_types.html") STRING = record_i18n_attr("field_types.string") NUMBER = record_i18n_attr("field_types.number") @@ -80,6 +85,9 @@ class Admissions::FormField < ActiveRecord::Base validates :name, presence: true validate :that_configuration_is_valid validate :that_field_type_is_valid_for_template + validate :cannot_create_new_erb_template, if: -> { + [Admissions::FormField::CODE, Admissions::FormField::EMAIL].include? self.field_type + } def config_hash JSON.parse(self.configuration || "{}") @@ -109,11 +117,13 @@ def that_configuration_is_valid validate_scholarity(config) when Admissions::FormField::CODE validate_conditions(config, "condition") + validate_presence(config, "template_type") unless @@disable_erb_validation when Admissions::FormField::EMAIL validate_presence(config, "to") validate_presence(config, "subject") validate_presence(config, "body") validate_conditions(config, "condition") + validate_presence(config, "template_type") unless @@disable_erb_validation end end @@ -222,6 +232,29 @@ def is_file_field? false end + def get_type + case self.field_type + when Admissions::FormField::NUMBER + "number" + when Admissions::FormField::DATE + "date" + when Admissions::FormField::STUDENT_FIELD + configuration = self.config_hash + case configuration["field"] + when "birthdate", "identity_expedition_date" + "date" + else + "string" + end + when Admissions::FormField::CODE + configuration = self.config_hash + return configuration["code_type"] if configuration["code_type"].present? + "number" + else + "string" + end + end + def self.search_name(field: nil, substring: false) field = "%#{field}%" if field.present? && substring Admissions::FormField.where( @@ -257,4 +290,55 @@ def self.full_search_name( def self.field_name_exists?(field, in_main: true, in_letter: false) self.full_search_name(field:, limit: 1, in_main:, in_letter:).present? end + + def self.disable_erb_validation! + @@disable_erb_validation = true + yield + @@disable_erb_validation = false + end + + # Returns a list for CODE and EMAIL types where: + # - the first element indicates that the template is from an unsafe template type (Ruby or ERB) + # - the remaining elements have the template value(s). + def template_values + config = self.config_hash + rescue JSON::ParserError, TypeError + return [false] + else + if self.field_type == Admissions::FormField::CODE + return [ + config["template_type"] == "Ruby", + I18n.transliterate(config["code"] || "").downcase + ] + elsif self.field_type == Admissions::FormField::EMAIL + return [ + config["template_type"] == "ERB", + I18n.transliterate(config["to"] || "").downcase, + I18n.transliterate(config["subject"] || "").downcase, + I18n.transliterate(config["body"] || "").downcase, + ] + else + return [false] + end + end + + private + def cannot_create_new_erb_template + return if @@disable_erb_validation + config = self.config_hash + rescue JSON::ParserError, TypeError + self.errors.add(:configuration, :invalid_format) + else + form_field = self.paper_trail.previous_version + current = self.template_values + return unless current[0] + while form_field.present? + old = form_field.template_values + if current == old && old[0] + return + end + form_field = form_field.paper_trail.previous_version + end + self.errors.add(:base, :cannot_create_new_erb_template) + end end diff --git a/app/models/assertion.rb b/app/models/assertion.rb index 925d2958..4444f1fa 100644 --- a/app/models/assertion.rb +++ b/app/models/assertion.rb @@ -46,7 +46,7 @@ def format_text(args=nil) columns: columns }.merge(Hash[unique_columns.zip(rows.first.values_at(*unique_columns.map { |col| columns.index(col) }))]) - formatter = FormatterFactory.create_formatter(bindings, self.template_type) + formatter = CodeEvaluator.create_formatter(bindings, self.template_type) formatter.format(self.assertion_template) end diff --git a/app/models/email_template.rb b/app/models/email_template.rb index c8755487..94fedd70 100644 --- a/app/models/email_template.rb +++ b/app/models/email_template.rb @@ -279,6 +279,7 @@ class EmailTemplate < ApplicationRecord new_removal_requests: [ClassEnrollmentRequestDrop], remove_insertion_requests: [ClassEnrollmentRequestDrop], existing_removal_requests: [ClassEnrollmentRequestDrop], + no_action: [ClassEnrollmentRequestDrop], message: :value, user: UserDrop, } @@ -297,6 +298,7 @@ class EmailTemplate < ApplicationRecord new_removal_requests: [ClassEnrollmentRequestDrop], remove_insertion_requests: [ClassEnrollmentRequestDrop], existing_removal_requests: [ClassEnrollmentRequestDrop], + no_action: [ClassEnrollmentRequestDrop], message: :value, user: UserDrop, } @@ -367,30 +369,10 @@ def update_mailer_headers(headers) headers[:skip_footer] = true end - def load_drop(variables, key, value) - if variables.key?(key) - cls = variables[key] - if cls == :value - result = value - elsif cls.kind_of?(Array) - result = value.map { |v| cls[0].new(v) } - else - result = cls.new(value) - end - else - result = value - end - result - end - def prepare_message(bindings) - if self.template_type == "Liquid" - builtin = BUILTIN_TEMPLATES[self.name] || {} - variables = builtin[:variables] || {} - bindings = bindings.map { |k, v| [k.to_s, load_drop(variables, k, v)] }.to_h - bindings["variables"] = VariablesDrop.new - end - formatter = FormatterFactory.create_formatter(bindings, self.template_type) + builtin = BUILTIN_TEMPLATES[self.name] || {} + drops = builtin[:variables] || {} + formatter = CodeEvaluator.create_formatter(bindings, self.template_type, drops) message = { to: formatter.format(self.to), subject: formatter.format(self.subject), diff --git a/app/models/notification.rb b/app/models/notification.rb index b254a92e..c944dacd 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -11,6 +11,14 @@ class Notification < ApplicationRecord LIQUID = record_i18n_attr("template_types.liquid") ERB = record_i18n_attr("template_types.erb") + NOTIFICATION_DROPS = { + data_consulta: :value, + ano_semestre_atual: :value, + numero_semestre_atual: :value, + ano_ultimo_semestre: :value, + numero_ultimo_semestre: :value, + } + TEMPLATE_TYPES = [LIQUID, ERB] DERIVATION_DEFS = { @@ -194,7 +202,7 @@ def execute(options = {}) bindings = {rows: [raw_result], columns: result[:columns]}.merge(params) bindings.merge!(Hash[result[:columns].zip(raw_result)]) - formatter = FormatterFactory.create_formatter(bindings, self.template_type) + formatter = CodeEvaluator.create_formatter(bindings, self.template_type, NOTIFICATION_DROPS) notification = { notification_id: self.id, @@ -226,7 +234,7 @@ def execute(options = {}) rows: result[:rows], columns: result[:columns] }.merge(params) - formatter = FormatterFactory.create_formatter(bindings, self.template_type) + formatter = CodeEvaluator.create_formatter(bindings, self.template_type, NOTIFICATION_DROPS) notifications << { notification_id: self.id, to: formatter.format(self.to_template), diff --git a/bin/autospec b/bin/autospec index 45b22c9d..64dcb9cb 100644 --- a/bin/autospec +++ b/bin/autospec @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'autospec' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('rspec-core', 'autospec') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'autospec' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rspec-core', 'autospec') diff --git a/bin/bundle b/bin/bundle index 9c6dfa01..66e9889e 100644 --- a/bin/bundle +++ b/bin/bundle @@ -1,3 +1,3 @@ -#!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -load Gem.bin_path('bundler', 'bundle') +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/bin/bundler b/bin/bundler index 70b99bc7..72c62ec0 100644 --- a/bin/bundler +++ b/bin/bundler @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'bundler' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('bundler', 'bundler') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'bundler' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('bundler', 'bundler') diff --git a/bin/coderay b/bin/coderay index 23174cf2..5be1c009 100644 --- a/bin/coderay +++ b/bin/coderay @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'coderay' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('coderay', 'coderay') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'coderay' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('coderay', 'coderay') diff --git a/bin/dot2ruby b/bin/dot2ruby index 7ddff7eb..5d351449 100644 --- a/bin/dot2ruby +++ b/bin/dot2ruby @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'dot2ruby' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('ruby-graphviz', 'dot2ruby') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'dot2ruby' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('ruby-graphviz', 'dot2ruby') diff --git a/bin/erd b/bin/erd index 37658b6b..fa3d1388 100644 --- a/bin/erd +++ b/bin/erd @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'erd' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('rails-erd', 'erd') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'erd' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rails-erd', 'erd') diff --git a/bin/erubis b/bin/erubis index a8630f5a..2c7348b8 100644 --- a/bin/erubis +++ b/bin/erubis @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'erubis' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('erubis', 'erubis') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'erubis' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('erubis', 'erubis') diff --git a/bin/gem2gv b/bin/gem2gv index e93fbfb8..e2ab701f 100644 --- a/bin/gem2gv +++ b/bin/gem2gv @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'gem2gv' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('ruby-graphviz', 'gem2gv') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'gem2gv' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('ruby-graphviz', 'gem2gv') diff --git a/bin/git2gv b/bin/git2gv index 72a0ccc5..210213ae 100644 --- a/bin/git2gv +++ b/bin/git2gv @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'git2gv' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('ruby-graphviz', 'git2gv') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'git2gv' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('ruby-graphviz', 'git2gv') diff --git a/bin/htmldiff b/bin/htmldiff index ad94d86c..c70e238d 100644 --- a/bin/htmldiff +++ b/bin/htmldiff @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'htmldiff' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('diff-lcs', 'htmldiff') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'htmldiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('diff-lcs', 'htmldiff') diff --git a/bin/ldiff b/bin/ldiff index a2722064..8e3524a9 100644 --- a/bin/ldiff +++ b/bin/ldiff @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'ldiff' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('diff-lcs', 'ldiff') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'ldiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('diff-lcs', 'ldiff') diff --git a/bin/racc b/bin/racc index 78311bbc..e87ea282 100644 --- a/bin/racc +++ b/bin/racc @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'racc' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('racc', 'racc') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'racc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('racc', 'racc') diff --git a/bin/racc2y b/bin/racc2y index b7959e3d..e5ff9979 100644 --- a/bin/racc2y +++ b/bin/racc2y @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'racc2y' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('racc', 'racc2y') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'racc2y' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('racc', 'racc2y') diff --git a/bin/rackup b/bin/rackup index b78d6fa1..8cc9953e 100644 --- a/bin/rackup +++ b/bin/rackup @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'rackup' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('rack', 'rackup') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rackup' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rack', 'rackup') diff --git a/bin/rails b/bin/rails index 4c8cea51..efc03774 100644 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,4 @@ -#!/usr/bin/env ruby -APP_PATH = File.expand_path("../config/application", __dir__) -require_relative "../config/boot" -require "rails/commands" +#!/usr/bin/env ruby +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/bin/rake b/bin/rake index 4ca7073f..4fbf10b9 100644 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,4 @@ -#!/usr/bin/env ruby -require_relative "../config/boot" -require "rake" -Rake.application.run +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/bin/rdoc b/bin/rdoc index 62cab4b2..f57260f3 100644 --- a/bin/rdoc +++ b/bin/rdoc @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'rdoc' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('rdoc', 'rdoc') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rdoc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rdoc', 'rdoc') diff --git a/bin/redcarpet b/bin/redcarpet index cffaf68d..37d58a8e 100644 --- a/bin/redcarpet +++ b/bin/redcarpet @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'redcarpet' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('redcarpet', 'redcarpet') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'redcarpet' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('redcarpet', 'redcarpet') diff --git a/bin/ri b/bin/ri index 99ed1836..90f2517d 100644 --- a/bin/ri +++ b/bin/ri @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'ri' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('rdoc', 'ri') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'ri' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rdoc', 'ri') diff --git a/bin/rspec b/bin/rspec index e09c27ea..0c86b5c6 100644 --- a/bin/rspec +++ b/bin/rspec @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'rspec' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('rspec-core', 'rspec') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rspec' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rspec-core', 'rspec') diff --git a/bin/ruby2gv b/bin/ruby2gv index 8cfbbf13..2aa7d331 100644 --- a/bin/ruby2gv +++ b/bin/ruby2gv @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'ruby2gv' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('ruby-graphviz', 'ruby2gv') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'ruby2gv' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('ruby-graphviz', 'ruby2gv') diff --git a/bin/sass b/bin/sass index 0d513126..d65bb10a 100644 --- a/bin/sass +++ b/bin/sass @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'sass' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('sass', 'sass') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sass' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sass', 'sass') diff --git a/bin/sass-convert b/bin/sass-convert index 5df7f130..ddde743f 100644 --- a/bin/sass-convert +++ b/bin/sass-convert @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'sass-convert' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('sass', 'sass-convert') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sass-convert' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sass', 'sass-convert') diff --git a/bin/scss b/bin/scss index f4bf6aab..9f5e435d 100644 --- a/bin/scss +++ b/bin/scss @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'scss' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('sass', 'scss') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'scss' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sass', 'scss') diff --git a/bin/sdoc b/bin/sdoc index 5836f9a9..9da297e6 100644 --- a/bin/sdoc +++ b/bin/sdoc @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'sdoc' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('sdoc', 'sdoc') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sdoc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sdoc', 'sdoc') diff --git a/bin/sdoc-merge b/bin/sdoc-merge index 6760b1ae..e29a7d95 100644 --- a/bin/sdoc-merge +++ b/bin/sdoc-merge @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'sdoc-merge' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('sdoc', 'sdoc-merge') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sdoc-merge' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sdoc', 'sdoc-merge') diff --git a/bin/setup b/bin/setup index 9e9856cf..ec47b79b 100644 --- a/bin/setup +++ b/bin/setup @@ -1,33 +1,33 @@ -#!/usr/bin/env ruby -require "fileutils" - -# path to your application root. -APP_ROOT = File.expand_path("..", __dir__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -FileUtils.chdir APP_ROOT do - # This script is a way to set up or update your development environment automatically. - # This script is idempotent, so that you can run it at any time and get an expectable outcome. - # Add necessary setup steps to this file. - - puts "== Installing dependencies ==" - system! "gem install bundler --conservative" - system("bundle check") || system!("bundle install") - - # puts "\n== Copying sample files ==" - # unless File.exist?("config/database.yml") - # FileUtils.cp "config/database.yml.sample", "config/database.yml" - # end - - puts "\n== Preparing database ==" - system! "bin/rails db:prepare" - - puts "\n== Removing old logs and tempfiles ==" - system! "bin/rails log:clear tmp:clear" - - puts "\n== Restarting application server ==" - system! "bin/rails restart" -end +#!/usr/bin/env ruby +require "fileutils" + +# path to your application root. +APP_ROOT = File.expand_path("..", __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + + puts "== Installing dependencies ==" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end + + puts "\n== Preparing database ==" + system! "bin/rails db:prepare" + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + puts "\n== Restarting application server ==" + system! "bin/rails restart" +end diff --git a/bin/sprockets b/bin/sprockets index 8b8774dc..09a1ad18 100644 --- a/bin/sprockets +++ b/bin/sprockets @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'sprockets' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('sprockets', 'sprockets') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sprockets' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sprockets', 'sprockets') diff --git a/bin/thor b/bin/thor index b5b2ddea..8421e001 100644 --- a/bin/thor +++ b/bin/thor @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'thor' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('thor', 'thor') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'thor' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('thor', 'thor') diff --git a/bin/tilt b/bin/tilt index 7b33d5b3..09fe73eb 100644 --- a/bin/tilt +++ b/bin/tilt @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'tilt' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('tilt', 'tilt') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'tilt' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('tilt', 'tilt') diff --git a/bin/xml2gv b/bin/xml2gv index df3d7b7d..1a5378e0 100644 --- a/bin/xml2gv +++ b/bin/xml2gv @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'xml2gv' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('ruby-graphviz', 'xml2gv') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'xml2gv' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('ruby-graphviz', 'xml2gv') diff --git a/bin/y2racc b/bin/y2racc index fb0dfd99..2a3f5cfe 100644 --- a/bin/y2racc +++ b/bin/y2racc @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'y2racc' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('racc', 'y2racc') +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'y2racc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('racc', 'y2racc') diff --git a/bin/yarn b/bin/yarn index 2d7081a5..ed2d3a3b 100644 --- a/bin/yarn +++ b/bin/yarn @@ -1,17 +1,17 @@ -#!/usr/bin/env ruby -APP_ROOT = File.expand_path('..', __dir__) -Dir.chdir(APP_ROOT) do - yarn = ENV["PATH"].split(File::PATH_SEPARATOR). - select { |dir| File.expand_path(dir) != __dir__ }. - product(["yarn", "yarn.cmd", "yarn.ps1"]). - map { |dir, file| File.expand_path(file, dir) }. - find { |file| File.executable?(file) } - - if yarn - exec yarn, *ARGV - else - $stderr.puts "Yarn executable was not detected in the system." - $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" - exit 1 - end +#!/usr/bin/env ruby +APP_ROOT = File.expand_path('..', __dir__) +Dir.chdir(APP_ROOT) do + yarn = ENV["PATH"].split(File::PATH_SEPARATOR). + select { |dir| File.expand_path(dir) != __dir__ }. + product(["yarn", "yarn.cmd", "yarn.ps1"]). + map { |dir, file| File.expand_path(file, dir) }. + find { |file| File.executable?(file) } + + if yarn + exec yarn, *ARGV + else + $stderr.puts "Yarn executable was not detected in the system." + $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" + exit 1 + end end \ No newline at end of file diff --git a/config/environments/test.rb b/config/environments/test.rb index 6e76dfcc..1443a599 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -61,6 +61,9 @@ # Raises error for missing translations. # config.i18n.raise_on_missing_translations = true + config.logger = ActiveSupport::Logger.new(STDOUT) if ENV['LOGS_ENABLED'] + config.log_level = :debug + # Annotate rendered view with file names. # config.action_view.annotate_rendered_view_with_filenames = true diff --git a/config/locales/admissions/form_field.pt-BR.yml b/config/locales/admissions/form_field.pt-BR.yml index eaa04f47..8b3a270a 100644 --- a/config/locales/admissions/form_field.pt-BR.yml +++ b/config/locales/admissions/form_field.pt-BR.yml @@ -105,30 +105,36 @@ pt-BR: scholarity_grade_interval: Intervalo do CR ou conceito scholarity_start_date: Data de Início scholarity_end_date: Data de Fim + template_type: Formato do template + template_types: + liquid: Liquid + erb: ERB + ruby: Ruby html: HTML html_description: Campo usado para exibir textos adicionais no formulário. code: Código code_description: > - Código em Ruby usado para consolidação. A última linha será salva + Código em Liquid usado para consolidação ( Ver detalhes ). O resultado será salvo. Cuidado com espaços em branco e quebras de linha. Use "-" nas tags para evitar problemas. Variáveis: @@ -136,15 +142,11 @@ pt-BR: @@ -153,24 +155,25 @@ pt-BR: body: Template do Corpo body_description: > - Os campos de template utilizam linguagem ERB. Ver detalhes . - Variáveis: <%= var(:variavel) %> + Os campos de template utilizam linguagem Liquid. Ver detalhes . + Variáveis: