Welcome to mirror list, hosted at ThFree Co, Russian Federation.

string.rb « lexeme « expression « pipeline « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 798cea34db61cf59289234c3e02b049e202f2e9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

module Gitlab
  module Ci
    module Pipeline
      module Expression
        module Lexeme
          class String < Lexeme::Value
            PATTERN = /("(?<string>.*?)")|('(?<string>.*?)')/.freeze

            def evaluate(variables = {})
              @value.to_s
            end

            def inspect
              @value.inspect
            end

            def self.build(string)
              new(string.match(PATTERN)[:string])
            end
          end
        end
      end
    end
  end
end