Compare commits

..

6 Commits

Author SHA1 Message Date
Brandon Black
a4d12cc8e4 Release v5.0.0 (#3388)
* bumping version to v5.0.0

* updating license information

* reverting accidental changes to language ids cc @twp

* Updating grammars
2016-12-22 16:55:22 -08:00
Brandon Black
a1165b74b1 reverting accidental changes to language ids cc @twp 2016-12-15 13:56:09 -08:00
Brandon Black
0fa1fa5581 fixing groff reference 2016-12-14 10:19:39 -08:00
Arfon Smith
d8b91bd5c4 The grand language renaming bonanza (#3278)
* Removing FORTRAN samples because OS X case-insensitive filesystems :-\

* Adding Fotran samples back

* FORTRAN -> Fortran

* Groff -> Roff

* GAS -> Unix Assembly

* Cucumber -> Gherkin

* Nimrod -> Nim

* Ragel in Ruby Host -> Ragel

* Jade -> Pug

* VimL -> Vim script
2016-12-13 13:39:27 -08:00
Paul Chaignon
9b941a34f0 Use filenames as a definitive answer (#2006)
* Separate find_by_extension and find_by_filename
find_by_extension now takes a path as argument and not only the file extension.
Currently only find_by_extension is used as a strategy.

* Add find_by_filename as first strategy
2016-12-12 12:34:33 -08:00
Paul Chaignon
9d8392dab8 Remove deprecated code (#3359)
* Remove deprecated find_by_shebang

* Remove deprecated ace_modes function

* Remove deprecated primary_extension function

Gists don't have a language dropdown anymore

* Remove deprecated Linguist::Language.detect function

* Remove deprecated search_term field
2016-12-12 12:24:19 -08:00
79 changed files with 578 additions and 300 deletions

View File

@@ -390,7 +390,6 @@ vendor/grammars/language-inform7:
- source.inform7
vendor/grammars/language-javascript:
- source.js
- source.js.embedded.html
- source.js.regexp
- source.js.regexp.replacement
vendor/grammars/language-jsoniq:

View File

@@ -59,8 +59,9 @@ class << Linguist
# Strategies are called in turn until a single Language is returned.
STRATEGIES = [
Linguist::Strategy::Modeline,
Linguist::Shebang,
Linguist::Strategy::Filename,
Linguist::Shebang,
Linguist::Strategy::Extension,
Linguist::Heuristics,
Linguist::Classifier
]

View File

@@ -11,6 +11,7 @@ require 'linguist/samples'
require 'linguist/file_blob'
require 'linguist/blob_helper'
require 'linguist/strategy/filename'
require 'linguist/strategy/extension'
require 'linguist/strategy/modeline'
require 'linguist/shebang'
@@ -90,17 +91,6 @@ module Linguist
language
end
# Public: Detects the Language of the blob.
#
# blob - an object that includes the Linguist `BlobHelper` interface;
# see Linguist::LazyBlob and Linguist::FileBlob for examples
#
# Returns Language or nil.
def self.detect(blob)
warn "[DEPRECATED] `Linguist::Language.detect` is deprecated. Use `Linguist.detect`. #{caller[0]}"
Linguist.detect(blob)
end
# Public: Get all Languages
#
# Returns an Array of Languages
@@ -140,46 +130,46 @@ module Linguist
# Public: Look up Languages by filename.
#
# The behaviour of this method recently changed.
# See the second example below.
#
# filename - The path String.
#
# Examples
#
# Language.find_by_filename('Cakefile')
# # => [#<Language name="CoffeeScript">]
# Language.find_by_filename('foo.rb')
# # => [#<Language name="Ruby">]
# # => []
#
# Returns all matching Languages or [] if none were found.
def self.find_by_filename(filename)
basename = File.basename(filename)
# find the first extension with language definitions
extname = FileBlob.new(filename).extensions.detect do |e|
!@extension_index[e].empty?
end
(@filename_index[basename] + @extension_index[extname]).compact.uniq
@filename_index[basename]
end
# Public: Look up Languages by file extension.
#
# extname - The extension String.
# The behaviour of this method recently changed.
# See the second example below.
#
# filename - The path String.
#
# Examples
#
# Language.find_by_extension('.rb')
# Language.find_by_extension('dummy.rb')
# # => [#<Language name="Ruby">]
#
# Language.find_by_extension('rb')
# # => [#<Language name="Ruby">]
# # => []
#
# Returns all matching Languages or [] if none were found.
def self.find_by_extension(extname)
extname = ".#{extname}" unless extname.start_with?(".")
@extension_index[extname.downcase]
end
def self.find_by_extension(filename)
# find the first extension with language definitions
extname = FileBlob.new(filename.downcase).extensions.detect do |e|
!@extension_index[e].empty?
end
# DEPRECATED
def self.find_by_shebang(data)
@interpreter_index[Shebang.interpreter(data)]
@extension_index[extname]
end
# Public: Look up Languages by interpreter.
@@ -259,18 +249,6 @@ module Linguist
@colors ||= all.select(&:color).sort_by { |lang| lang.name.downcase }
end
# Public: A List of languages compatible with Ace.
#
# TODO: Remove this method in a 5.x release. Every language now needs an ace_mode
# key, so this function isn't doing anything unique anymore.
#
# Returns an Array of Languages.
def self.ace_modes
warn "This method will be deprecated in a future 5.x release. Every language now has an `ace_mode` set."
warn caller
@ace_modes ||= all.select(&:ace_mode).sort_by { |lang| lang.name.downcase }
end
# Internal: Initialize a new Language
#
# attributes - A hash of attributes
@@ -362,17 +340,6 @@ module Linguist
# Returns an Array of String names
attr_reader :aliases
# Deprecated: Get code search term
#
# Examples
#
# # => "ruby"
# # => "python"
# # => "perl"
#
# Returns the name String
attr_reader :search_term
# Public: Get language_id (used in GitHub search)
#
# Examples
@@ -457,22 +424,6 @@ module Linguist
# Returns the extensions Array
attr_reader :filenames
# Deprecated: Get primary extension
#
# Defaults to the first extension but can be overridden
# in the languages.yml.
#
# The primary extension can not be nil. Tests should verify this.
#
# This method is only used by app/helpers/gists_helper.rb for creating
# the language dropdown. It really should be using `name` instead.
# Would like to drop primary extension.
#
# Returns the extension String.
def primary_extension
extensions.first
end
# Public: Get URL escaped name.
#
# Examples

View File

@@ -14,8 +14,6 @@
# listed alphabetically)
# interpreters - An Array of associated interpreters
# searchable - Boolean flag to enable searching (defaults to true)
# search_term - Deprecated: Some languages may be indexed under a
# different alias. Avoid defining new exceptions.
# language_id - Integer used as a language-name-independent indexed field so that we can rename
# languages in Linguist without reindexing all the code on GitHub. Must not be
# changed for existing languages without the explicit permission of GitHub staff.
@@ -121,7 +119,6 @@ ASN.1:
ASP:
type: programming
color: "#6a40fd"
search_term: aspx-vb
tm_scope: text.html.asp
aliases:
- aspx
@@ -154,7 +151,6 @@ ActionScript:
type: programming
tm_scope: source.actionscript.3
color: "#882B0F"
search_term: as3
aliases:
- actionscript 3
- actionscript3
@@ -291,7 +287,6 @@ AspectJ:
Assembly:
type: programming
color: "#6E4C13"
search_term: nasm
aliases:
- nasm
extensions:
@@ -349,7 +344,6 @@ Awk:
language_id: 28
Batchfile:
type: programming
search_term: bat
aliases:
- bat
- batch
@@ -474,7 +468,6 @@ C#:
codemirror_mode: clike
codemirror_mime_type: text/x-csharp
tm_scope: source.cs
search_term: csharp
color: "#178600"
aliases:
- csharp
@@ -489,7 +482,6 @@ C++:
ace_mode: c_cpp
codemirror_mode: clike
codemirror_mime_type: text/x-c++src
search_term: cpp
color: "#f34b7d"
aliases:
- cpp
@@ -719,7 +711,6 @@ ColdFusion:
type: programming
ace_mode: coldfusion
color: "#ed2cd6"
search_term: cfm
aliases:
- cfm
- cfml
@@ -733,7 +724,6 @@ ColdFusion CFC:
type: programming
group: ColdFusion
ace_mode: coldfusion
search_term: cfc
aliases:
- cfc
extensions:
@@ -854,16 +844,6 @@ Csound Score:
tm_scope: source.csound-score
ace_mode: text
language_id: 75
Cucumber:
type: programming
extensions:
- ".feature"
tm_scope: text.gherkin.feature
aliases:
- gherkin
ace_mode: text
color: "#5B2063"
language_id: 76
Cuda:
type: programming
extensions:
@@ -956,7 +936,6 @@ DTrace:
language_id: 85
Darcs Patch:
type: data
search_term: dpatch
aliases:
- dpatch
extensions:
@@ -1187,7 +1166,6 @@ Erlang:
F#:
type: programming
color: "#b845fc"
search_term: fsharp
aliases:
- fsharp
extensions:
@@ -1208,23 +1186,6 @@ FLUX:
tm_scope: none
ace_mode: text
language_id: 106
FORTRAN:
type: programming
color: "#4d41b1"
extensions:
- ".f90"
- ".f"
- ".f03"
- ".f08"
- ".f77"
- ".f95"
- ".for"
- ".fpp"
tm_scope: source.fortran.modern
ace_mode: text
codemirror_mode: fortran
codemirror_mime_type: text/x-fortran
language_id: 107
Factor:
type: programming
color: "#636746"
@@ -1294,6 +1255,23 @@ Forth:
codemirror_mode: forth
codemirror_mime_type: text/x-forth
language_id: 114
Fortran:
type: programming
color: "#4d41b1"
extensions:
- ".f90"
- ".f"
- ".f03"
- ".f08"
- ".f77"
- ".f95"
- ".for"
- ".fpp"
tm_scope: source.fortran.modern
ace_mode: text
codemirror_mode: fortran
codemirror_mime_type: text/x-fortran
language_id: 107
FreeMarker:
type: programming
color: "#0050b2"
@@ -1339,15 +1317,6 @@ GAP:
tm_scope: source.gap
ace_mode: text
language_id: 119
GAS:
type: programming
group: Assembly
extensions:
- ".s"
- ".ms"
tm_scope: source.assembly
ace_mode: assembly_x86
language_id: 120
GCC Machine Description:
type: programming
extensions:
@@ -1449,7 +1418,6 @@ Gentoo Eclass:
language_id: 128
Gettext Catalog:
type: prose
search_term: pot
searchable: false
aliases:
- pot
@@ -1459,6 +1427,16 @@ Gettext Catalog:
tm_scope: source.po
ace_mode: text
language_id: 129
Gherkin:
type: programming
extensions:
- ".feature"
tm_scope: text.gherkin.feature
aliases:
- cucumber
ace_mode: text
color: "#5B2063"
language_id: 76
Glyph:
type: programming
color: "#e4cc98"
@@ -1562,45 +1540,6 @@ Graphviz (DOT):
- ".gv"
ace_mode: text
language_id: 140
Groff:
type: markup
color: "#ecdebe"
extensions:
- ".man"
- ".1"
- ".1in"
- ".1m"
- ".1x"
- ".2"
- ".3"
- ".3in"
- ".3m"
- ".3qt"
- ".3x"
- ".4"
- ".5"
- ".6"
- ".7"
- ".8"
- ".9"
- ".l"
- ".me"
- ".ms"
- ".n"
- ".rno"
- ".roff"
- ".tmac"
filenames:
- mmn
- mmt
tm_scope: text.roff
aliases:
- nroff
- troff
ace_mode: text
codemirror_mode: troff
codemirror_mime_type: text/troff
language_id: 141
Groovy:
type: programming
ace_mode: groovy
@@ -1861,7 +1800,6 @@ INI:
language_id: 163
IRC log:
type: data
search_term: irc
aliases:
- irc
- irc logs
@@ -2011,17 +1949,6 @@ JSX:
codemirror_mode: jsx
codemirror_mime_type: text/jsx
language_id: 178
Jade:
group: HTML
type: markup
extensions:
- ".jade"
- ".pug"
tm_scope: text.jade
ace_mode: jade
codemirror_mode: pug
codemirror_mime_type: text/x-pug
language_id: 179
Jasmin:
type: programming
ace_mode: java
@@ -2041,7 +1968,6 @@ Java:
Java Server Pages:
type: programming
group: Java
search_term: jsp
aliases:
- jsp
extensions:
@@ -2298,7 +2224,6 @@ Literate CoffeeScript:
group: CoffeeScript
ace_mode: text
wrap: true
search_term: litcoffee
aliases:
- litcoffee
extensions:
@@ -2307,7 +2232,6 @@ Literate CoffeeScript:
Literate Haskell:
type: programming
group: Haskell
search_term: lhs
aliases:
- lhaskell
- lhs
@@ -2569,7 +2493,6 @@ Max:
aliases:
- max/msp
- maxmsp
search_term: max/msp
extensions:
- ".maxpat"
- ".maxhelp"
@@ -2621,7 +2544,6 @@ MiniD:
language_id: 231
Mirah:
type: programming
search_term: mirah
color: "#c7a938"
extensions:
- ".druby"
@@ -2778,7 +2700,7 @@ Nginx:
codemirror_mime_type: text/x-nginx-conf
color: "#9469E9"
language_id: 248
Nimrod:
Nim:
type: programming
color: "#37775b"
extensions:
@@ -2972,7 +2894,7 @@ OpenSCAD:
- ".scad"
tm_scope: none
ace_mode: scad
language_id: 431
language_id: 266
OpenType Feature File:
type: data
aliases:
@@ -2981,7 +2903,7 @@ OpenType Feature File:
- ".fea"
tm_scope: source.opentype
ace_mode: text
language_id: 266
language_id: 374317347
Org:
type: prose
wrap: true
@@ -3201,7 +3123,7 @@ Perl6:
language_id: 283
Pic:
type: markup
group: Groff
group: Roff
tm_scope: source.pic
extensions:
- ".pic"
@@ -3355,6 +3277,17 @@ Public Key:
codemirror_mode: asciiarmor
codemirror_mime_type: application/pgp
language_id: 298
Pug:
group: HTML
type: markup
extensions:
- ".jade"
- ".pug"
tm_scope: text.jade
ace_mode: jade
codemirror_mode: pug
codemirror_mime_type: text/x-pug
language_id: 179
Puppet:
type: programming
color: "#302B6D"
@@ -3419,7 +3352,7 @@ Python:
- ".wsgi"
- ".xpy"
filenames:
- .gclient
- ".gclient"
- BUCK
- BUILD
- SConscript
@@ -3587,7 +3520,7 @@ Racket:
tm_scope: source.racket
ace_mode: lisp
language_id: 316
Ragel in Ruby Host:
Ragel:
type: programming
color: "#9d5200"
extensions:
@@ -3608,7 +3541,6 @@ Rascal:
language_id: 173616037
Raw token data:
type: data
search_term: raw
aliases:
- raw
extensions:
@@ -3671,6 +3603,44 @@ RobotFramework:
tm_scope: text.robot
ace_mode: text
language_id: 324
Roff:
type: markup
color: "#ecdebe"
extensions:
- ".man"
- ".1"
- ".1in"
- ".1m"
- ".1x"
- ".2"
- ".3"
- ".3in"
- ".3m"
- ".3qt"
- ".3x"
- ".4"
- ".5"
- ".6"
- ".7"
- ".8"
- ".9"
- ".l"
- ".me"
- ".ms"
- ".n"
- ".rno"
- ".roff"
- ".tmac"
filenames:
- mmn
- mmt
tm_scope: text.roff
aliases:
- nroff
ace_mode: text
codemirror_mode: troff
codemirror_mime_type: text/troff
language_id: 141
Rouge:
type: programming
ace_mode: clojure
@@ -3955,7 +3925,6 @@ Self:
language_id: 345
Shell:
type: programming
search_term: bash
color: "#89e051"
aliases:
- sh
@@ -4067,14 +4036,14 @@ SourcePawn:
- ".sma"
tm_scope: source.sp
ace_mode: text
language_id: 432
language_id: 354
Spline Font Database:
type: data
extensions:
- ".sfd"
tm_scope: text.sfd
ace_mode: yaml
language_id: 354
language_id: 767169629
Squirrel:
type: programming
color: "#800000"
@@ -4401,6 +4370,15 @@ Unity3D Asset:
- ".unity"
tm_scope: source.yaml
language_id: 380
Unix Assembly:
type: programming
group: Assembly
extensions:
- ".s"
- ".ms"
tm_scope: source.assembly
ace_mode: assembly_x86
language_id: 120
Uno:
type: programming
extensions:
@@ -4473,13 +4451,13 @@ Verilog:
codemirror_mode: verilog
codemirror_mime_type: text/x-verilog
language_id: 387
VimL:
Vim script:
type: programming
color: "#199f4b"
search_term: vim
tm_scope: source.viml
aliases:
- vim
- viml
- nvim
extensions:
- ".vim"
@@ -4832,7 +4810,6 @@ desktop:
eC:
type: programming
color: "#913960"
search_term: ec
extensions:
- ".ec"
- ".eh"
@@ -4882,7 +4859,6 @@ ooc:
reStructuredText:
type: prose
wrap: true
search_term: rst
aliases:
- rst
extensions:

View File

@@ -26,4 +26,4 @@
- Shell
- Swift
- TeX
- VimL
- Vim script

View File

@@ -0,0 +1,10 @@
module Linguist
module Strategy
# Detects language based on extension
class Extension
def self.call(blob, _)
Language.find_by_extension(blob.name.to_s)
end
end
end
end

View File

@@ -1,9 +1,10 @@
module Linguist
module Strategy
# Detects language based on filename and/or extension
# Detects language based on filename
class Filename
def self.call(blob, _)
Language.find_by_filename(blob.name.to_s)
name = blob.name.to_s
Language.find_by_filename(name)
end
end
end

View File

@@ -1,3 +1,3 @@
module Linguist
VERSION = "4.8.18"
VERSION = "5.0.0"
end

View File

@@ -21,8 +21,6 @@ header = <<-EOF
# listed alphabetically)
# interpreters - An Array of associated interpreters
# searchable - Boolean flag to enable searching (defaults to true)
# search_term - Deprecated: Some languages may be indexed under a
# different alias. Avoid defining new exceptions.
# language_id - Integer used as a language-name-independent indexed field so that we can rename
# languages in Linguist without reindexing all the code on GitHub. Must not be
# changed for existing languages without the explicit permission of GitHub staff.

29
test/fixtures/CMake/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project("To do list")
enable_testing()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(warnings "-Wall -Wextra -Werror")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(warnings "/W4 /WX /EHsc")
endif()
set(optimize "-O2")
if (NOT CONFIGURED_ONCE)
set(CMAKE_CXX_FLAGS "${warnings} ${optimize}"
CACHE STRING "Flags used by the compiler during all build types." FORCE)
set(CMAKE_C_FLAGS "${warnings} ${optimize}"
CACHE STRING "Flags used by the compiler during all build types." FORCE)
endif()
add_executable(toDo main.cpp ToDo.cpp)
add_test(toDoTest toDo)
set(CONFIGURED_ONCE TRUE CACHE INTERNAL
"A flag showing that CMake has configured at least once.")

200
test/fixtures/CoffeeScript/Cakefile vendored Executable file
View File

@@ -0,0 +1,200 @@
http = require 'http'
https = require 'https'
fs = require 'fs'
path = require 'path'
{spawn, exec} = require 'child_process'
semver = require 'semver'
AdmZip = require('adm-zip')
GitHubApi = require 'github'
github = new GitHubApi(version: '3.0.0')
# ----------------
# Server / Builder
# ----------------
option '-P', '--production', 'run server in production mode'
option null, '--port [PORT]', 'listen on specified port (default 3333)'
LOCAL_BRUNCH = path.join('.', 'node_modules', '.bin', 'brunch')
spawnBrunch = (flags, env) ->
if fs.existsSync(LOCAL_BRUNCH)
brunch = spawn LOCAL_BRUNCH, flags, env
else
console.error 'Warning, using global brunch. Run `npm install`.'
brunch = spawn 'brunch', flags, env
brunch.stdout.on 'data', (data) -> console.log data.toString().trim()
brunch.stderr.on 'data', (data) -> console.log data.toString().trim()
runBrunchWatch = (options, shouldStartServer) ->
flags = ['w']
flags.push '-s' if shouldStartServer
if options.production?
flags.push('-P')
process.env.BRUNCH_ENV = 'production'
if options.port?
flags.push '-p'
flags.push options.port
spawnBrunch flags, process.env
task 'server', 'start the brunch server in development', (options) ->
runBrunchWatch(options, true)
task 'watch', 'build the app continuously without a server', (options) ->
runBrunchWatch(options, false)
task 'build', 'build for production', ->
process.env.BRUNCH_ENV = 'production'
spawnBrunch ['b', '-P'], process.env
task 'test', 'run brunch in the test environment', ->
flags = ['w', '-s']
process.env.BRUNCH_ENV = 'test'
spawnBrunch flags, process.env
# -------------
# Tapas Updates
# -------------
updateMessage = 'update Tapas to latest (Cakefile, package.json, portkey.json,
config.coffee, generators/*)'
task 'tapas:update', updateMessage, (options) ->
url = 'https://codeload.github.com/mutewinter/tapas-with-ember/zip/master'
filesToUpdate = [
'Cakefile'
'package.json'
'portkey.json'
'config.coffee'
'generators/'
'testem.json'
'bower.json'
]
https.get url, (res) ->
data = []
dataLen = 0
res.on('data', (chunk) ->
data.push(chunk)
dataLen += chunk.length
).on('end', ->
buf = new Buffer(dataLen)
pos = 0
for dataItem in data
dataItem.copy(buf, pos)
pos += dataItem.length
zip = new AdmZip(buf)
filesToUpdate.forEach (file) ->
targetFile = "tapas-with-ember-master/#{file}"
if /\/$/.test(file)
zip.extractEntryTo(targetFile, file, false, true)
else
zip.extractEntryTo(targetFile, '', false, true)
)
# --------------
# Script Updates
# --------------
EMBER_BASE_URL = 'http://builds.emberjs.com'
GITHUB_API_URL = 'https://api.github.com'
EMBER = {}
EMBER_DATA = {}
['release', 'beta', 'canary'].forEach (build) ->
EMBER[build] =
prod: "#{EMBER_BASE_URL}/#{build}/ember.prod.js"
dev: "#{EMBER_BASE_URL}/#{build}/ember.js"
EMBER_DATA[build] =
prod: "#{EMBER_BASE_URL}/#{build}/ember-data.prod.js"
dev: "#{EMBER_BASE_URL}/#{build}/ember-data.js"
EMBER['tag'] =
prod: "#{EMBER_BASE_URL}/tags/{{tag}}/ember.prod.js"
dev: "#{EMBER_BASE_URL}/tags/{{tag}}/ember.js"
EMBER_DATA['tag'] =
prod: "#{EMBER_BASE_URL}/tags/{{tag}}/ember-data.prod.js"
dev: "#{EMBER_BASE_URL}/tags/{{tag}}/ember-data.js"
downloadFile = (src, dest) ->
console.log('Downloading ' + src + ' to ' + dest)
data = ''
request = http.get src, (response) ->
response.on('data', (chunk) ->
data += chunk
)
response.on('end', ->
fs.writeFileSync(dest, data)
)
downloadEmberFile = (src, dest) ->
downloadFile(src, "vendor/ember/#{dest}")
listTags = (user, repo, since, name, command) ->
github.repos.getTags(user: user, repo: repo, (resp, tags) ->
for tag in tags
if semver.valid(tag.name) and !semver.lt(tag.name, since)
firstTag = tag.name unless firstTag
console.log " #{tag.name}"
console.log "Install with cake -t \"#{firstTag}\" #{command}"
)
installEmberFiles = (project, filename, options) ->
if 'tag' of options
# Download a Tag
tag = options.tag
tag = "v#{tag}" unless /^v/.test(tag)
downloadEmberFile(project['tag'].dev.replace(/{{tag}}/, tag),
"development/#{filename}")
downloadEmberFile(project['tag'].prod.replace(/{{tag}}/, tag),
"production/#{filename}")
else
# Download a Channel
channel = options.channel ? 'release'
downloadEmberFile project[channel].dev, "development/#{filename}"
downloadEmberFile project[channel].prod, "production/#{filename}"
# Channel
option '-c', '--channel "[CHANNEL_NAME]"',
'relase, beta, or canary (http://emberjs.com/builds)'
# Tag
option '-t', '--tag "[TAG_NAME]"',
'a tagged release to install. Run cake ember:list to see known tags'
# -----
# Ember
# -----
task 'ember:install', 'install latest Ember', (options) ->
installEmberFiles(EMBER, 'ember.js', options)
task 'ember:list', 'list tagged relases of Ember since v1.0.0', (options) ->
listTags 'emberjs', 'ember.js', 'v1.0.0', 'Ember', 'ember:install'
# ----------
# Ember Data
# ----------
task 'ember-data:install', 'install latest Ember Data', (options) ->
options.channel or= 'beta'
installEmberFiles(EMBER_DATA, 'ember-data.js', options)
task 'ember-data:list', 'list tagged relases of Ember Data', (options) ->
listTags 'emberjs', 'data', 'v0.0.1', 'Ember Data',
'ember-data:install'
# -----------
# Ember Model
# -----------
EMBER_MODEL =
dev: 'http://builds.erikbryn.com/ember-model/ember-model-latest.js'
prod: 'http://builds.erikbryn.com/ember-model/ember-model-latest.prod.js'
task 'ember-model:install', 'install latest Ember Model', (options) ->
downloadEmberFile EMBER_MODEL.dev, 'development/ember-model.js'
downloadEmberFile EMBER_MODEL.prod, 'production/ember-model.js'

97
test/fixtures/Dockerfile/Dockerfile vendored Executable file
View File

@@ -0,0 +1,97 @@
FROM ubuntu:14.04
MAINTAINER Wesley Hales <wesleyhales@gmail.com>
# Install.
RUN \
sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
apt-get update && \
apt-get -y upgrade && \
apt-get install -y build-essential && \
apt-get install -y software-properties-common && \
apt-get install -y byobu curl git htop man unzip vim wget && \
rm -rf /var/lib/apt/lists/*
# Set environment variables.
ENV HOME /root
# Define working directory.
WORKDIR /root
# Install Java.
RUN \
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java7-installer && \
rm -rf /var/lib/apt/lists/* \
echo "done"
# Install Phantom2 build requirements (Won't build on systems < 2GB ram)
RUN \
sudo apt-get update && apt-get -y install g++ flex bison gperf ruby perl \
libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev libjpeg-dev libqt5webkit5-dev
#####################################build latest phantom
######################################+++++ only do this in dev when needed
#RUN rm -rf phantomjs
#RUN git clone git://github.com/ariya/phantomjs.git
#RUN cd /root/phantomjs/ && ./build.sh --confirm
#RUN ln -s /root/phantomjs/bin/phantomjs /usr/bin/phantomjs
######################################+++++ END only do this in dev when needed
######################################+++++ comment out when building new version of phantomjs
ADD phantomjs /root/phantomjs
RUN ln -s /root/phantomjs /usr/bin/phantomjs
######################################+++++ END comment out when building new version of phantomjs
RUN git clone git://github.com/wesleyhales/speedgun.git
#RUN mkdir /root/speedgun/core/reports
#VOLUME ["/root/speedgun/core/reports"]
RUN cd speedgun/core && phantomjs --ssl-protocol=any --ignore-ssl-errors=yes speedgun.js http://www.google.com performance csv
RUN cd /root && wget https://dl.dropboxusercontent.com/u/12278845/server.tar
RUN cd /root && tar -xvf server.tar
#RUN echo "cd /root/jboss-as-7.1.1.Final-fluxui/ && ./bin/standalone.sh --server-config=standalone-full.xml -b 0.0.0.0" >> /root/.bashrc
# install maven
RUN sudo apt-get update && apt-get install -y maven
ADD src /root/src
ADD pom.xml /root/pom.xml
RUN mvn clean install
#RUN cp -rf /root/target/speedgun.war /root/jboss-as-7.1.1.Final-fluxui/standalone/deployments/
RUN ln -s /root/target/speedgun /root/jboss-as-7.1.1.Final-fluxui/standalone/deployments/speedgun.war
RUN touch /root/jboss-as-7.1.1.Final-fluxui/standalone/deployments/speedgun.war.dodeploy
# Cleanup old JMS queue
RUN rm -rf /root/jboss-as-7.1.1.Final-fluxui/standalone/tmp/ /root/jboss-as-7.1.1.Final-fluxui/standalone/data/*
RUN mkdir /root/jboss-as-7.1.1.Final-fluxui/speedgun
RUN cd /root/jboss-as-7.1.1.Final-fluxui/speedgun && curl -O https://raw.githubusercontent.com/wesleyhales/speedgun/master/core/speedgun.js
RUN cd /root/jboss-as-7.1.1.Final-fluxui/speedgun && curl -O https://raw.githubusercontent.com/wesleyhales/speedgun/master/core/config.json
COPY server-entrypoint.sh /
ENTRYPOINT ["/server-entrypoint.sh"]
RUN apt-get install -y postgresql-client
COPY speedgun.sql /
EXPOSE 3306 8080 8443
#CMD ["postgres"]

5
test/fixtures/Makefile/Makefile vendored Executable file
View File

@@ -0,0 +1,5 @@
SUBDIRS:=components test
.PHONY: ${SUBDIRS} clean
all:${SUBDIRS}
${SUBDIRS}:
${MAKE} -C $@ all

57
test/fixtures/Maven POM/pom.xml vendored Normal file
View File

@@ -0,0 +1,57 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>awilbur.personal</groupId>
<artifactId>hudsel</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>hudsel</name>
<properties>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
<skipTests>false</skipTests>
</properties>
<dependencies>
<!-- Adding TestNG for unit test support -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
</dependency>
<!-- Adding Selenium dependency -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.41.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- using the compiler plug-in to specify that this project is to be compiled with JDK 1.6 -->
<!-- This is needed so that we get the JDK annotation support that was introduced recently -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
<!-- You can specify a specific testng.xml file here <suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng-sample.xml</suiteXmlFile> </suiteXmlFiles> -->
<!-- Or dynamically with something like '-DsuiteXmlFile=src/test/resources/testng-sample.xml' -->
<suiteXmlFiles>
<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
</suiteXmlFiles>
<!-- Build with '-DskipTests=true' to bypass test execution @ build time Default: false -->
<skipTests>${skipTests}</skipTests>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -60,8 +60,8 @@ class TestLanguage < Minitest::Test
assert_equal Language['SuperCollider'], Language.find_by_alias('supercollider')
assert_equal Language['TeX'], Language.find_by_alias('tex')
assert_equal Language['TypeScript'], Language.find_by_alias('ts')
assert_equal Language['VimL'], Language.find_by_alias('vim')
assert_equal Language['VimL'], Language.find_by_alias('viml')
assert_equal Language['Vim script'], Language.find_by_alias('vim')
assert_equal Language['Vim script'], Language.find_by_alias('viml')
assert_equal Language['reStructuredText'], Language.find_by_alias('rst')
assert_equal Language['YAML'], Language.find_by_alias('yml')
assert_nil Language.find_by_alias(nil)
@@ -90,7 +90,7 @@ class TestLanguage < Minitest::Test
assert_equal Language['Ruby'], Language['Ruby'].group
# Test a few special groups
assert_equal Language['Assembly'], Language['GAS'].group
assert_equal Language['Assembly'], Language['Unix Assembly'].group
assert_equal Language['C'], Language['OpenCL'].group
assert_equal Language['Haskell'], Language['Literate Haskell'].group
assert_equal Language['Java'], Language['Java Server Pages'].group
@@ -106,39 +106,6 @@ class TestLanguage < Minitest::Test
end
end
# Used for code search indexing. Changing any of these values may
# require reindexing repositories.
def test_search_term
assert_equal 'perl', Language['Perl'].search_term
assert_equal 'python', Language['Python'].search_term
assert_equal 'ruby', Language['Ruby'].search_term
assert_equal 'common-lisp', Language['Common Lisp'].search_term
assert_equal 'html+erb', Language['HTML+ERB'].search_term
assert_equal 'max/msp', Language['Max'].search_term
assert_equal 'puppet', Language['Puppet'].search_term
assert_equal 'pure-data', Language['Pure Data'].search_term
assert_equal 'aspx-vb', Language['ASP'].search_term
assert_equal 'as3', Language['ActionScript'].search_term
assert_equal 'nasm', Language['Assembly'].search_term
assert_equal 'bat', Language['Batchfile'].search_term
assert_equal 'csharp', Language['C#'].search_term
assert_equal 'cpp', Language['C++'].search_term
assert_equal 'cfm', Language['ColdFusion'].search_term
assert_equal 'dpatch', Language['Darcs Patch'].search_term
assert_equal 'fsharp', Language['F#'].search_term
assert_equal 'pot', Language['Gettext Catalog'].search_term
assert_equal 'irc', Language['IRC log'].search_term
assert_equal 'lhs', Language['Literate Haskell'].search_term
assert_equal 'mirah', Language['Mirah'].search_term
assert_equal 'raw', Language['Raw token data'].search_term
assert_equal 'bash', Language['Shell'].search_term
assert_equal 'vim', Language['VimL'].search_term
assert_equal 'jsp', Language['Java Server Pages'].search_term
assert_equal 'rst', Language['reStructuredText'].search_term
assert_equal 'supercollider', Language['SuperCollider'].search_term
end
def test_popular
assert Language['Ruby'].popular?
assert Language['Perl'].popular?
@@ -203,10 +170,16 @@ class TestLanguage < Minitest::Test
def test_find_by_extension
assert_equal [], Language.find_by_extension('.factor-rc')
assert_equal [], Language.find_by_extension('foo.rb')
assert_equal [Language['Ruby']], Language.find_by_extension('rb')
assert_equal [Language['Ruby']], Language.find_by_extension('.rb')
assert_equal [Language['Limbo'], Language['M'], Language['MUF'], Language['Mathematica'], Language['Matlab'], Language['Mercury'], Language['Objective-C']], Language.find_by_extension('.m')
assert_equal [Language['Limbo'], Language['M'], Language['MUF'], Language['Mathematica'], Language['Matlab'], Language['Mercury'], Language['Objective-C']], Language.find_by_extension('foo.m')
assert_equal [Language['Ruby']], Language.find_by_extension('foo.rb')
assert_equal [Language['Ruby']], Language.find_by_extension('foo/bar.rb')
assert_equal [Language['Ruby']], Language.find_by_extension('PKGBUILD.rb')
assert_equal ['C', 'C++', 'Objective-C'], Language.find_by_extension('foo.h').map(&:name).sort
assert_equal [], Language.find_by_extension('rb')
assert_equal [], Language.find_by_extension('.null')
assert_equal [Language['HTML+Django']], Language.find_by_extension('index.jinja')
assert_equal [Language['Chapel']], Language.find_by_extension('examples/hello.chpl')
assert_equal [], Language.find_by_filename('F.I.L.E.')
end
def test_find_all_by_extension
@@ -219,23 +192,17 @@ class TestLanguage < Minitest::Test
def test_find_by_filename
assert_equal [Language['Shell']], Language.find_by_filename('PKGBUILD')
assert_equal [Language['Ruby']], Language.find_by_filename('foo.rb')
assert_equal [Language['Ruby']], Language.find_by_filename('foo/bar.rb')
assert_equal [Language['Ruby']], Language.find_by_filename('Rakefile')
assert_equal [Language['Ruby']], Language.find_by_filename('PKGBUILD.rb')
assert_equal Language['ApacheConf'], Language.find_by_filename('httpd.conf').first
assert_equal [Language['ApacheConf']], Language.find_by_filename('.htaccess')
assert_equal Language['Nginx'], Language.find_by_filename('nginx.conf').first
assert_equal ['C', 'C++', 'Objective-C'], Language.find_by_filename('foo.h').map(&:name).sort
assert_equal [], Language.find_by_filename('foo.rb')
assert_equal [], Language.find_by_filename('rb')
assert_equal [], Language.find_by_filename('.null')
assert_equal [Language['Shell']], Language.find_by_filename('.bashrc')
assert_equal [Language['Shell']], Language.find_by_filename('bash_profile')
assert_equal [Language['Shell']], Language.find_by_filename('.zshrc')
assert_equal [Language['Clojure']], Language.find_by_filename('riemann.config')
assert_equal [Language['HTML+Django']], Language.find_by_filename('index.jinja')
assert_equal [Language['Chapel']], Language.find_by_filename('examples/hello.chpl')
assert_equal [], Language.find_by_filename('F.I.L.E.')
end
def test_find_by_interpreter
@@ -345,13 +312,6 @@ class TestLanguage < Minitest::Test
assert_equal 'text', Language['FORTRAN'].ace_mode
end
def test_ace_modes
silence_warnings do
assert Language.ace_modes.include?(Language['Ruby'])
assert Language.ace_modes.include?(Language['FORTRAN'])
end
end
def test_codemirror_mode
assert_equal 'ruby', Language['Ruby'].codemirror_mode
assert_equal 'javascript', Language['JavaScript'].codemirror_mode
@@ -379,17 +339,6 @@ class TestLanguage < Minitest::Test
assert Language['SuperCollider'].extensions.include?('.scd')
end
def test_primary_extension
assert_equal '.pl', Language['Perl'].primary_extension
assert_equal '.py', Language['Python'].primary_extension
assert_equal '.rb', Language['Ruby'].primary_extension
assert_equal '.js', Language['JavaScript'].primary_extension
assert_equal '.coffee', Language['CoffeeScript'].primary_extension
assert_equal '.t', Language['Turing'].primary_extension
assert_equal '.ts', Language['TypeScript'].primary_extension
assert_equal '.sc', Language['SuperCollider'].primary_extension
end
def test_eql
assert Language['Ruby'].eql?(Language['Ruby'])
assert !Language['Ruby'].eql?(Language['Python'])

View File

@@ -0,0 +1,5 @@
---
type: grammar
name: ninja.tmbundle
license: other
---