Compare commits
No commits in common. 'master' and '0.3.4' have entirely different histories.
@ -1,7 +0,0 @@
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- '0.10'
|
||||
|
||||
notifications:
|
||||
email: false
|
@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 Dmitri Akatov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
@ -0,0 +1,33 @@
|
||||
module.exports = (karma) ->
|
||||
karma.set
|
||||
basePath: '..'
|
||||
|
||||
frameworks: ['mocha']
|
||||
|
||||
files: [
|
||||
'bower_components/angular/angular.js'
|
||||
'angular-contenteditable.js'
|
||||
'test/unit/*.coffee'
|
||||
]
|
||||
|
||||
preprocessors: '**/*.coffee': 'coffee'
|
||||
|
||||
exclude: []
|
||||
|
||||
reporters: ['progress']
|
||||
|
||||
port: 9876
|
||||
|
||||
runnerPort: 9100
|
||||
|
||||
colors: true
|
||||
|
||||
logLevel: karma.LOG_INFO
|
||||
|
||||
autoWatch: true
|
||||
|
||||
browsers: ['Chrome']
|
||||
|
||||
captureTimeout: 60000
|
||||
|
||||
singleRun: false
|
@ -0,0 +1,3 @@
|
||||
describe 'radians', ->
|
||||
describe 'contenteditable', ->
|
||||
it 'passes', ->
|
@ -1,97 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require 'tmpdir'
|
||||
require 'json'
|
||||
|
||||
puts 'running post-commit hook'
|
||||
|
||||
BOWER = JSON.parse File.read 'bower.json'
|
||||
|
||||
def commit
|
||||
@commit ||= `git log | head -1 | cut -d' ' -f2`
|
||||
end
|
||||
|
||||
# get version of library from bower.json
|
||||
def bower_version(library)
|
||||
BOWER["dependencies"][library] || BOWER["devDependencies"][library]
|
||||
end
|
||||
|
||||
# return the base url for a library from bower / github
|
||||
def library_base_url(library)
|
||||
# TODO: figure out how to clean the cache so we can use `bower --offline`
|
||||
(@library_base_url ||= {})[library] ||=
|
||||
JSON.parse(`bower lookup #{library} --json`)["url"]
|
||||
.sub(/^git:\/\/github.com/, 'https://rawgithub.com')
|
||||
.sub(/\.git$/, "/#{bower_version(library).sub(/~/, '')}/")
|
||||
end
|
||||
|
||||
# transform script ref to bower URL
|
||||
def script_url(src)
|
||||
if src =~ /\/bower_components\//
|
||||
parts = src.split('/bower_components/')[1].split('/')
|
||||
library_base_url(parts[0]) + parts.drop(1).join('/')
|
||||
else
|
||||
src.sub(/^\.\.\/\.\./,
|
||||
'https://rawgithub.com/akatov/angular-contenteditable/master')
|
||||
end
|
||||
end
|
||||
|
||||
# link href
|
||||
# script src
|
||||
def replace_script_and_link(contents)
|
||||
["script src", "link href"].reduce(contents) do |c, tag|
|
||||
c.gsub /#{tag}="([^"]*)"/ do
|
||||
"#{tag}=\"#{script_url($1)}\""
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def index_header
|
||||
<<EOF
|
||||
<html>
|
||||
<head>
|
||||
<title>angular-contenteditable</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>angular contenteditable</h1>
|
||||
<h2>examples<h2>
|
||||
<ul>
|
||||
EOF
|
||||
end
|
||||
|
||||
def index_footer
|
||||
<<EOF
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
end
|
||||
|
||||
puts commit
|
||||
|
||||
def execute
|
||||
Dir.mktmpdir do |temp|
|
||||
FileUtils.cp_r 'test/fixtures/', temp
|
||||
FileUtils.mv "#{temp}/fixtures", "#{temp}/examples"
|
||||
File.open("#{temp}/index.html", File::CREAT | File::WRONLY) do |index_file|
|
||||
index_file.write index_header
|
||||
Dir.glob("#{temp}/examples/*.html").each do |file_name|
|
||||
bn = File.basename file_name
|
||||
puts "changing references in #{bn}"
|
||||
File.write file_name, replace_script_and_link(File.read file_name)
|
||||
index_file.write " <li><a href='examples/#{bn}'>#{bn}</a></li>\n"
|
||||
end
|
||||
index_file.write index_footer
|
||||
end
|
||||
`git checkout gh-pages`
|
||||
`git rm -r examples`
|
||||
['index.html', 'examples'].each do |f|
|
||||
FileUtils.cp_r "#{temp}/#{f}", '.'
|
||||
`git add #{f}`
|
||||
end
|
||||
`git commit --message "updating gh-pages for commit #{commit}"`
|
||||
`git checkout master`
|
||||
end
|
||||
end
|
||||
|
||||
execute
|
Reference in New Issue