mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
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
This commit is contained in:
committed by
Brandon Black
parent
9d8392dab8
commit
9b941a34f0
29
test/fixtures/CMake/CMakeLists.txt
vendored
Normal file
29
test/fixtures/CMake/CMakeLists.txt
vendored
Normal 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
200
test/fixtures/CoffeeScript/Cakefile
vendored
Executable 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
97
test/fixtures/Dockerfile/Dockerfile
vendored
Executable 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
5
test/fixtures/Makefile/Makefile
vendored
Executable 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
57
test/fixtures/Maven POM/pom.xml
vendored
Normal 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>
|
||||
Reference in New Issue
Block a user