Sha256: 96c1e4e33c71c477f3c1ed827b32f3d7e30e560eda86ecce0927943933730542

Contents?: true

Size: 786 Bytes

Versions: 79

Compression:

Stored size: 786 Bytes

Contents

require "thor"
require "run_loop"
require "run_loop/cli/errors"

module RunLoop
  module CLI
    class Locale < Thor

      desc "print-alert-regexes", "Print privacy alert regular expressions"

      def print_alert_regexes
        dir = File.expand_path(File.dirname(__FILE__))
        scripts_dir = File.join(dir, "..", "..", "..", "scripts")
        on_alert = File.join(scripts_dir, "lib", "on_alert.js")

        lines = []
        File.read(on_alert).force_encoding("UTF-8").split($-0).each do |line|
          if line[/\[\".+\", \/.+\/\]/, 0]
            line.chomp!
            if line[-1,1] == ","
              line = line[0, line.length - 1]
            end
            lines << line
          end
        end

        puts lines.join(",#{$-0}")
      end
    end
  end
end

Version data entries

79 entries across 79 versions & 2 rubygems

Version Path
run_loop-4.9.1 lib/run_loop/cli/locale.rb
run_loop-4.9.0 lib/run_loop/cli/locale.rb
run_loop-4.8.1 lib/run_loop/cli/locale.rb
run_loop-4.8.0 lib/run_loop/cli/locale.rb
run_loop-4.7.0 lib/run_loop/cli/locale.rb
run_loop-4.6.3 lib/run_loop/cli/locale.rb
run_loop-4.6.1 lib/run_loop/cli/locale.rb
run_loop-4.6.0 lib/run_loop/cli/locale.rb
run_loop-4.5.7 lib/run_loop/cli/locale.rb
run_loop-4.5.6 lib/run_loop/cli/locale.rb
run_loop-4.5.5 lib/run_loop/cli/locale.rb
run_loop-4.5.4 lib/run_loop/cli/locale.rb
run_loop-4.5.3 lib/run_loop/cli/locale.rb
run_loop-4.5.2 lib/run_loop/cli/locale.rb
run_loop-4.5.1 lib/run_loop/cli/locale.rb
run_loop-4.5.0 lib/run_loop/cli/locale.rb
run_loop-4.4.2 lib/run_loop/cli/locale.rb
run_loop-4.4.1 lib/run_loop/cli/locale.rb
run_loop-2.3.2 lib/run_loop/cli/locale.rb
run_loop-4.3.0 lib/run_loop/cli/locale.rb