Class: ConvenientService::Examples::Rails::Gemfile::Services::AssertValidRubySyntax
- Inherits:
-
Object
- Object
- ConvenientService::Examples::Rails::Gemfile::Services::AssertValidRubySyntax
- Includes:
- RailsService::Config
- Defined in:
- lib/convenient_service/examples/rails/gemfile/services/assert_valid_ruby_syntax.rb
Instance Method Summary collapse
Instance Method Details
#result ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/convenient_service/examples/rails/gemfile/services/assert_valid_ruby_syntax.rb', line 13 def result ## # NOTE: `> /dev/null 2>&1` is used to hide output. # https://unix.stackexchange.com/a/119650/394253 # check_ruby_syntax_result = Services::RunShellCommand.result(command: "ruby -c #{file.path} > /dev/null 2>&1") return error("`#{content}` contains invalid Ruby syntax") unless check_ruby_syntax_result.success? success end |