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-2.1.4 lib/run_loop/cli/locale.rb
run_loop_tcc-2.1.4 lib/run_loop/cli/locale.rb
run_loop_tcc-2.1.3 lib/run_loop/cli/locale.rb
run_loop-2.1.3 lib/run_loop/cli/locale.rb
run_loop-2.1.2 lib/run_loop/cli/locale.rb
run_loop-2.1.1 lib/run_loop/cli/locale.rb
run_loop-2.1.1.pre5 lib/run_loop/cli/locale.rb
run_loop-2.1.1.pre4 lib/run_loop/cli/locale.rb
run_loop-2.1.1.pre3 lib/run_loop/cli/locale.rb
run_loop-2.1.1.pre2 lib/run_loop/cli/locale.rb
run_loop-2.1.1.pre1 lib/run_loop/cli/locale.rb
run_loop-2.1.0 lib/run_loop/cli/locale.rb
run_loop-2.1.0.pre1 lib/run_loop/cli/locale.rb
run_loop-2.0.10.pre1 lib/run_loop/cli/locale.rb
run_loop-2.0.9 lib/run_loop/cli/locale.rb
run_loop-2.0.8 lib/run_loop/cli/locale.rb
run_loop-2.0.7 lib/run_loop/cli/locale.rb
run_loop-2.0.6 lib/run_loop/cli/locale.rb
run_loop-2.0.5 lib/run_loop/cli/locale.rb