From 645f4d6194aeb41c2e31cd60732bcda5a4ffd87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Sundstr=C3=B6m?= Date: Wed, 6 Jun 2012 00:02:47 -0700 Subject: [PATCH 1/2] Added detection for the Pike language: http://pike.ida.liu.se/ --- lib/linguist/languages.yml | 8 ++++++++ test/fixtures/rsif.pike | 22 ++++++++++++++++++++++ test/test_blob.rb | 3 +++ 3 files changed, 33 insertions(+) create mode 100755 test/fixtures/rsif.pike diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 1e49c997..b6597bb9 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -916,6 +916,14 @@ Perl: - .psgi - .t +Pike: + type: programming + color: "#066ab2" + lexer: C + primary_extension: .pike + extensions: + - .pmod + PowerShell: type: programming ace_mode: powershell diff --git a/test/fixtures/rsif.pike b/test/fixtures/rsif.pike new file mode 100755 index 00000000..5cf1d632 --- /dev/null +++ b/test/fixtures/rsif.pike @@ -0,0 +1,22 @@ +#! /usr/bin/env pike +// -*- pike -*- $Id$ +#pike __REAL_VERSION__ + +inherit Tools.Standalone.process_files; +string version = ("$Revision$"/" ")[1]; +string description = "Replaces strings in files."; +string usage = #"[options] + +rsif (\"replace string in file\") replaces all occurrences of the +string with the string in listed files. The name of the +files that were changed are written to stdout. Directories may be +given instead of files, in which case all the files in that directory +will be processed. Available options: +" + default_flag_docs; + +int want_args = 2; + +string process( string input, string from, string to ) { + if( has_value( input, from ) ) + return replace( input, from, to ); +} diff --git a/test/test_blob.rb b/test/test_blob.rb index ce2df0ec..38d4b31c 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -444,6 +444,9 @@ class TestBlob < Test::Unit::TestCase # XML assert_equal Language['XSLT'], blob("test.xslt").language + + # Pike: http://pike.ida.liu.se/ + assert_equal Language['Pike'], blob("rsif.pike").language end def test_lexer From 7b9e0afef9e7b79faf87fbabce21a32652a32116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Sundstr=C3=B6m?= Date: Thu, 21 Feb 2013 23:23:00 -0800 Subject: [PATCH 2/2] Reverted pike tests until such time as we have a pike lexer here. --- test/fixtures/rsif.pike | 22 ---------------------- test/test_blob.rb | 3 --- 2 files changed, 25 deletions(-) delete mode 100755 test/fixtures/rsif.pike diff --git a/test/fixtures/rsif.pike b/test/fixtures/rsif.pike deleted file mode 100755 index 5cf1d632..00000000 --- a/test/fixtures/rsif.pike +++ /dev/null @@ -1,22 +0,0 @@ -#! /usr/bin/env pike -// -*- pike -*- $Id$ -#pike __REAL_VERSION__ - -inherit Tools.Standalone.process_files; -string version = ("$Revision$"/" ")[1]; -string description = "Replaces strings in files."; -string usage = #"[options] - -rsif (\"replace string in file\") replaces all occurrences of the -string with the string in listed files. The name of the -files that were changed are written to stdout. Directories may be -given instead of files, in which case all the files in that directory -will be processed. Available options: -" + default_flag_docs; - -int want_args = 2; - -string process( string input, string from, string to ) { - if( has_value( input, from ) ) - return replace( input, from, to ); -} diff --git a/test/test_blob.rb b/test/test_blob.rb index 38d4b31c..ce2df0ec 100644 --- a/test/test_blob.rb +++ b/test/test_blob.rb @@ -444,9 +444,6 @@ class TestBlob < Test::Unit::TestCase # XML assert_equal Language['XSLT'], blob("test.xslt").language - - # Pike: http://pike.ida.liu.se/ - assert_equal Language['Pike'], blob("rsif.pike").language end def test_lexer