usmu-github-pages 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +6 -0
- data/.ruby-version +1 -0
- data/.yardopts +1 -0
- data/CONTRIBUTING.md +7 -0
- data/Gemfile +8 -0
- data/Guardfile +13 -0
- data/LICENSE.md +22 -0
- data/README.md +53 -0
- data/Rakefile +92 -0
- data/circle.yml +7 -0
- data/lib/usmu/github/pages/configuration.rb +29 -0
- data/lib/usmu/github/pages/version.rb +9 -0
- data/lib/usmu/github/pages.rb +143 -0
- data/spec/spec_helper.rb +109 -0
- data/usmu-github-pages.gemspec +33 -0
- metadata +208 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3113ce3bbb8c5c0ef846988bdcefa36937d38303
|
4
|
+
data.tar.gz: 5cc2ba345674beeb0a26f815ae272395d58175cd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 232a97e0de2c8605115c2ddd5bce2948f2300650a91b91812bdfc6606a1b6319e08c0ed5915a11fb4438b34a6897131f3c07e00114314387933512b759335aa4
|
7
|
+
data.tar.gz: 446ab51ded1bb1abfa1a3ae5fc518760fe043e5aaf477ea70c7f887ff12c1297c1758359e6ee2f6aa14917eeaef54d058d961618037c24f61fc3ed17e9b96747
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.0@usmu-github-pages
|
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--private --protected --default-return void -m markdown -M redcarpet -- lib/**/*.rb - README.md CHANGELOG.md
|
data/CONTRIBUTING.md
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in usmu.gemspec
|
4
|
+
gemspec name: 'usmu-github-pages'
|
5
|
+
|
6
|
+
gem 'codeclimate-test-reporter', group: :test, require: nil
|
7
|
+
gem 'mutant', '~> 0.8', group: 'mutant'
|
8
|
+
gem 'mutant-rspec', '~> 0.8', group: 'mutant'
|
data/Guardfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard :rspec, cmd: 'rspec', spec_paths: ['spec'] do
|
5
|
+
watch(%r{^spec/.+_spec\.rb$})
|
6
|
+
watch(%r{^lib/usmu/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
7
|
+
watch(%r{^spec/support}) { 'spec' }
|
8
|
+
watch('spec/spec_helper.rb') { 'spec' }
|
9
|
+
|
10
|
+
# Turnip features and steps
|
11
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
12
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
13
|
+
end
|
data/LICENSE.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Matthew Scharley and contributors
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# usmu-github-pages
|
2
|
+
|
3
|
+
[](https://circleci.com/gh/usmu/usmu-github-pages/tree/master)
|
4
|
+
[](https://gemnasium.com/usmu/usmu-github-pages)
|
5
|
+
[](https://codeclimate.com/github/usmu/usmu-github-pages)
|
6
|
+
|
7
|
+
**Source:** [https://github.com/usmu/usmu-github-pages](https://github.com/usmu/usmu-github-pages)
|
8
|
+
**Author:** Matthew Scharley
|
9
|
+
**Contributors:** [See contributors on GitHub][gh-contrib]
|
10
|
+
**Bugs/Support:** [Github Issues][gh-issues]
|
11
|
+
**Copyright:** 2014
|
12
|
+
**License:** [MIT license][license]
|
13
|
+
**Status:** Active
|
14
|
+
|
15
|
+
## Synopsis
|
16
|
+
|
17
|
+
Allows you to deploy your [Usmu][usmu] website to the Github Pages service or another git-based service.
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
$ gem install usmu-github-pages
|
22
|
+
|
23
|
+
OR
|
24
|
+
|
25
|
+
$ echo 'gem "usmu-github-pages"' >> Gemfile
|
26
|
+
$ bundle install
|
27
|
+
|
28
|
+
Usmu will automatically detect any plugins available and automatically make them available.
|
29
|
+
|
30
|
+
## Configuration
|
31
|
+
|
32
|
+
$ usmu gh-pages init
|
33
|
+
|
34
|
+
This plugin also supports a few keys in `usmu.yml`:
|
35
|
+
|
36
|
+
plugins:
|
37
|
+
github-pages:
|
38
|
+
# The remote to deploy to. Change this if github is not your origin
|
39
|
+
# remote.
|
40
|
+
remote: origin
|
41
|
+
# The branch to deploy to. This should get correctly configured
|
42
|
+
# automatically in all cases involving Github but is provided just in
|
43
|
+
# case you need to change it or you are using another git-based host.
|
44
|
+
branch: gh-pages
|
45
|
+
|
46
|
+
## Usage
|
47
|
+
|
48
|
+
$ usmu gh-pages deploy
|
49
|
+
|
50
|
+
[gh-contrib]: https://github.com/usmu/usmu-github-pages/graphs/contributors
|
51
|
+
[gh-issues]: https://github.com/usmu/usmu-github-pages/issues
|
52
|
+
[license]: https://github.com/usmu/usmu-github-pages/blob/master/LICENSE.md
|
53
|
+
[usmu]: https://github.com/usmu/usmu
|
data/Rakefile
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
require 'usmu/github/pages/version'
|
6
|
+
|
7
|
+
def current_gems
|
8
|
+
Dir["pkg/usmu-github-pages-#{Usmu::Github::Pages::VERSION}*.gem"]
|
9
|
+
end
|
10
|
+
|
11
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
12
|
+
t.pattern = 'spec/**/*_spec.rb'
|
13
|
+
end
|
14
|
+
|
15
|
+
desc 'Run all test scripts'
|
16
|
+
task :test => [:clean, :spec, :mutant]
|
17
|
+
|
18
|
+
desc 'Run mutation tests'
|
19
|
+
task :mutant, [:target] => [:clean] do |t,args|
|
20
|
+
old = ENV.delete('CODECLIMATE_REPO_TOKEN')
|
21
|
+
if `which mutant 2>&1 > /dev/null; echo \$?`.to_i != 0
|
22
|
+
puts 'Mutant isn\'t supported on your platform. Please run these tests on MRI <= 2.1.5.'
|
23
|
+
else
|
24
|
+
sh('bundle', 'exec', 'mutant', '--include', 'lib', '--require', 'usmu/github/pages', '--use', 'rspec', args[:target] || 'Usmu::Github::Pages*')
|
25
|
+
end
|
26
|
+
ENV['CODECLIMATE_REPO_TOKEN'] = old unless old.nil?
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'Run CI test suite'
|
30
|
+
task :ci => [:clean, :spec]
|
31
|
+
|
32
|
+
desc 'Clean up after tests'
|
33
|
+
task :clean do
|
34
|
+
[
|
35
|
+
'test/coverage',
|
36
|
+
current_gems,
|
37
|
+
].flatten.each do |f|
|
38
|
+
rm_r f if File.exist? f
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
namespace :gem do
|
43
|
+
desc 'Build gems'
|
44
|
+
task :build => [:clean] do
|
45
|
+
mkdir 'pkg' unless File.exist? 'pkg'
|
46
|
+
Dir['*.gemspec'].each do |gemspec|
|
47
|
+
sh "gem build #{gemspec}"
|
48
|
+
end
|
49
|
+
Dir['*.gem'].each do |gem|
|
50
|
+
mv gem, "pkg/#{gem}"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
desc 'Install gem'
|
55
|
+
task :install => ['gem:build'] do
|
56
|
+
sh "gem install pkg/usmu-github-pages-#{Usmu::Github::Pages::VERSION}.gem"
|
57
|
+
end
|
58
|
+
|
59
|
+
desc 'Deploy gems to rubygems'
|
60
|
+
task :deploy => ['gem:build'] do
|
61
|
+
current_gems.each do |gem|
|
62
|
+
sh "gem push #{gem}"
|
63
|
+
end
|
64
|
+
sh "git tag #{Usmu::Github::Pages::VERSION}" if File.exist? '.git'
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# (mostly) borrowed from: https://gist.github.com/mcansky/802396
|
69
|
+
desc 'generate changelog with nice clean output'
|
70
|
+
task :changelog, :since_c, :until_c do |t,args|
|
71
|
+
since_c = args[:since_c] || `git tag | egrep '^[0-9]+\\.[0-9]+\\.[0-9]+\$' | sort -Vr | head -n 1`.chomp
|
72
|
+
until_c = args[:until_c]
|
73
|
+
cmd=`git log --pretty="format:%ci::::%an <%ae>::::%s::::%H" #{since_c}..#{until_c}`
|
74
|
+
|
75
|
+
entries = Hash.new
|
76
|
+
changelog_content = "\#\# #{Usmu::Github::Pages::VERSION}\n\n"
|
77
|
+
|
78
|
+
cmd.lines.each do |entry|
|
79
|
+
date, author, subject, hash = entry.chomp.split('::::')
|
80
|
+
entries[author] = Array.new unless entries[author]
|
81
|
+
day = date.split(' ').first
|
82
|
+
entries[author] << "#{subject} (#{hash})" unless subject =~ /Merge/
|
83
|
+
end
|
84
|
+
|
85
|
+
# generate clean output
|
86
|
+
entries.keys.each do |author|
|
87
|
+
changelog_content += author + "\n\n"
|
88
|
+
entries[author].reverse.each { |entry| changelog_content += "* #{entry}\n" }
|
89
|
+
end
|
90
|
+
|
91
|
+
puts changelog_content
|
92
|
+
end
|
data/circle.yml
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'usmu/helpers/indexer'
|
2
|
+
|
3
|
+
class Usmu::Github::Pages::Configuration
|
4
|
+
include Usmu::Helpers::Indexer
|
5
|
+
|
6
|
+
indexer :@config
|
7
|
+
|
8
|
+
def initialize(config)
|
9
|
+
@config = config
|
10
|
+
end
|
11
|
+
|
12
|
+
# If this is a *.github.io repository then there's a good chance we're
|
13
|
+
# dealing with a repository that must be built to the master branch.
|
14
|
+
# Otherwise this is a gh-pages branch repository.
|
15
|
+
def default_branch(remote)
|
16
|
+
remote_url = `git config remote.#{Shellwords.escape remote}.url`.chomp
|
17
|
+
repo_name = begin
|
18
|
+
URI.parse(remote_url).path[1..-5]
|
19
|
+
rescue ::URI::InvalidURIError
|
20
|
+
remote_url.split(':', 2).last[0..-5]
|
21
|
+
end
|
22
|
+
|
23
|
+
if File.basename(repo_name).end_with? '.github.io'
|
24
|
+
'master'
|
25
|
+
else
|
26
|
+
'gh-pages'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,143 @@
|
|
1
|
+
%w{
|
2
|
+
shellwords
|
3
|
+
uri
|
4
|
+
usmu/github/pages/configuration
|
5
|
+
usmu/github/pages/version
|
6
|
+
}.each {|f| require f }
|
7
|
+
|
8
|
+
module Usmu
|
9
|
+
module Github
|
10
|
+
class Pages
|
11
|
+
def initialize
|
12
|
+
@log = Logging.logger[self]
|
13
|
+
@log.debug("Initializing usmu-github-pages v#{VERSION}")
|
14
|
+
end
|
15
|
+
|
16
|
+
# @see Usmu::Plugin::CoreHooks#commands
|
17
|
+
def commands(ui, c)
|
18
|
+
@log.debug('Adding commands from usmu-github-pages.')
|
19
|
+
@ui = ui
|
20
|
+
|
21
|
+
c.command(:'gh-pages init') do |command|
|
22
|
+
command.syntax = 'usmu gh-pages init'
|
23
|
+
command.description = 'Ensures that your repository is compatible and setup correctly for Github Pages.'
|
24
|
+
command.action &method(:command_init)
|
25
|
+
end
|
26
|
+
|
27
|
+
c.command(:'gh-pages deploy') do |command|
|
28
|
+
command.syntax = 'usmu gh-pages deploy'
|
29
|
+
command.description = 'Generates a site and commits it to Github.'
|
30
|
+
command.action &method(:command_deploy)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def command_init(args, options)
|
35
|
+
config = Configuration.new(@ui.configuration['plugin', 'github-pages', default: {}])
|
36
|
+
|
37
|
+
# Ensure git (>= 2.5).
|
38
|
+
git_version = `git version 2>&1`.split(' ').last
|
39
|
+
if Gem::Version.new(git_version) < Gem::Version.new('2.5.0')
|
40
|
+
@log.fatal('The Github Pages plugin requires at least git version 2.5.0')
|
41
|
+
exit 1
|
42
|
+
end
|
43
|
+
|
44
|
+
# Work out what the correct gh-pages branch is.
|
45
|
+
remote = config['remote', default: 'origin']
|
46
|
+
branch = config['branch', default: config.default_branch(remote)]
|
47
|
+
@log.info("Configuring to deploy to #{remote}/#{branch}.")
|
48
|
+
|
49
|
+
# Ensure destination is gitignored.
|
50
|
+
destination = @ui.configuration['destination', default: 'site']
|
51
|
+
gitignore_path = File.expand_path './.gitignore', @ui.configuration.config_dir
|
52
|
+
gitignore = File.read(gitignore_path).lines.map(&:chomp)
|
53
|
+
if gitignore.grep(%r{^/?#{File.basename destination}$}).empty?
|
54
|
+
@log.info("Adding #{destination} to gitignore at #{gitignore_path}")
|
55
|
+
gitignore.push("#{File.basename destination}")
|
56
|
+
File.write gitignore_path, gitignore.join("\n") + "\n"
|
57
|
+
end
|
58
|
+
|
59
|
+
# Ensure the destination directory is configured correctly.
|
60
|
+
destination = @ui.configuration.destination_path
|
61
|
+
if File.exist? destination
|
62
|
+
unless File.file? File.expand_path('./.git', destination)
|
63
|
+
if File.exist? File.expand_path('./.git', destination)
|
64
|
+
@log.fatal('Destination directory looks like a git clone not a worktree: ' + destination)
|
65
|
+
else
|
66
|
+
@log.fatal('Destination directory exists but doesn\'t look like it is controlled by git: ' + destination)
|
67
|
+
end
|
68
|
+
exit 1
|
69
|
+
end
|
70
|
+
else
|
71
|
+
@log.info("Configuring git worktree at: #{destination}")
|
72
|
+
`git worktree prune 2>&1`
|
73
|
+
`git worktree add #{Shellwords.escape destination} HEAD 2>&1`
|
74
|
+
end
|
75
|
+
|
76
|
+
# Check if branch exists locally and remotely.
|
77
|
+
branches = `git branch -a`.lines.map{|l| l[2..-1]}.map(&:chomp)
|
78
|
+
local = !branches.select{|b| b == branch }.empty?
|
79
|
+
remote = !branches.select{|b| b == "remotes/#{remote}/#{branch}" }.empty?
|
80
|
+
if !local && !remote
|
81
|
+
Dir.chdir destination do
|
82
|
+
`git checkout -f --orphan #{Shellwords.escape branch} 2>&1`
|
83
|
+
`git rm -r . 2>&1`
|
84
|
+
end
|
85
|
+
else
|
86
|
+
Dir.chdir destination do
|
87
|
+
`git checkout -f #{Shellwords.escape branch} 2>&1`
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def command_deploy(args, options)
|
93
|
+
@configuration = @ui.configuration
|
94
|
+
config = Configuration.new(@ui.configuration['plugin', 'github-pages', default: {}])
|
95
|
+
remote = config['remote', default: 'origin']
|
96
|
+
branch = config['branch', default: config.default_branch(remote)]
|
97
|
+
destination = @ui.configuration.destination_path
|
98
|
+
|
99
|
+
# Ensure we're deploying a complete commit.
|
100
|
+
sha = `git rev-parse HEAD`.chomp[0, 7]
|
101
|
+
unless `git diff HEAD --name-only`.lines.count == 0
|
102
|
+
@log.fatal("Found unsaved changes in your git repository. Please commit these changes and try again.")
|
103
|
+
exit 1
|
104
|
+
end
|
105
|
+
|
106
|
+
# Ensure clean worktree.
|
107
|
+
@log.info("Cleaning output directory.")
|
108
|
+
Dir.chdir destination do
|
109
|
+
`git fetch #{Shellwords.escape remote} 2>&1`
|
110
|
+
`git reset --hard #{Shellwords.escape remote}/#{Shellwords.escape branch} 2>&1`
|
111
|
+
end
|
112
|
+
|
113
|
+
# Regenerate site.
|
114
|
+
Usmu.plugins[Usmu::Plugin::Core].command_generate({}, options)
|
115
|
+
|
116
|
+
Dir.chdir destination do
|
117
|
+
# Commit results.
|
118
|
+
`git add . 2>&1`
|
119
|
+
if `git diff HEAD --name-only`.lines.count == 0
|
120
|
+
@log.info "Detected no changes - deploy aborted."
|
121
|
+
exit 0
|
122
|
+
end
|
123
|
+
`git commit -a -m "Update created by usmu-github-pages from revision #{sha}." 2>&1`
|
124
|
+
if $?.exitstatus != 0
|
125
|
+
@log.fatal "Unable to create a new commit. Please check the destination folder for more information."
|
126
|
+
exit 1
|
127
|
+
end
|
128
|
+
|
129
|
+
# Push branch to remote.
|
130
|
+
@log.info("Deploying to Github...")
|
131
|
+
`git push #{Shellwords.escape remote} #{Shellwords.escape branch} 2>&1`
|
132
|
+
end
|
133
|
+
|
134
|
+
cname_file = File.expand_path('./CNAME', destination)
|
135
|
+
if File.exist? cname_file
|
136
|
+
@log.success("Your site should be available shortly at http://#{File.read(cname_file).chomp}/")
|
137
|
+
else
|
138
|
+
@log.success("Deploy completed successfully.")
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
begin
|
2
|
+
require 'codeclimate-test-reporter'
|
3
|
+
CodeClimate::TestReporter.start
|
4
|
+
rescue LoadError
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'logging'
|
8
|
+
require 'rspec/logging_helper'
|
9
|
+
require 'timeout'
|
10
|
+
|
11
|
+
Logging.init :debug, :info, :success, :warn, :error, :fatal
|
12
|
+
|
13
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
14
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
15
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
16
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
17
|
+
#
|
18
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
19
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
20
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
21
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
22
|
+
# a separate helper file that requires the additional dependencies and performs
|
23
|
+
# the additional setup, and require it from the spec files that actually need it.
|
24
|
+
#
|
25
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
26
|
+
# users commonly want.
|
27
|
+
#
|
28
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
29
|
+
RSpec.configure do |config|
|
30
|
+
# rspec-expectations config goes here. You can use an alternate
|
31
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
32
|
+
# assertions if you prefer.
|
33
|
+
config.expect_with :rspec do |expectations|
|
34
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
35
|
+
# and `failure_message` of custom matchers include text for helper methods
|
36
|
+
# defined using `chain`, e.g.:
|
37
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
38
|
+
# # => "be bigger than 2 and smaller than 4"
|
39
|
+
# ...rather than:
|
40
|
+
# # => "be bigger than 2"
|
41
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
42
|
+
end
|
43
|
+
|
44
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
45
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
46
|
+
config.mock_with :rspec do |mocks|
|
47
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
48
|
+
# a real object. This is generally recommended, and will default to
|
49
|
+
# `true` in RSpec 4.
|
50
|
+
mocks.verify_partial_doubles = true
|
51
|
+
end
|
52
|
+
|
53
|
+
# These two settings work together to allow you to limit a spec run
|
54
|
+
# to individual examples or groups you care about by tagging them with
|
55
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
56
|
+
# get run.
|
57
|
+
config.filter_run :focus
|
58
|
+
config.run_all_when_everything_filtered = true
|
59
|
+
|
60
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
61
|
+
# For more details, see:
|
62
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
63
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
64
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
65
|
+
config.disable_monkey_patching!
|
66
|
+
|
67
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
68
|
+
# be too noisy due to issues in dependencies.
|
69
|
+
config.warnings = false
|
70
|
+
|
71
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
72
|
+
# file, and it's useful to allow more verbose output when running an
|
73
|
+
# individual spec file.
|
74
|
+
if config.files_to_run.one?
|
75
|
+
# Use the documentation formatter for detailed output,
|
76
|
+
# unless a formatter has already been configured
|
77
|
+
# (e.g. via a command-line flag).
|
78
|
+
config.default_formatter = 'doc'
|
79
|
+
end
|
80
|
+
|
81
|
+
# Print the 10 slowest examples and example groups at the
|
82
|
+
# end of the spec run, to help surface which specs are running
|
83
|
+
# particularly slow.
|
84
|
+
config.profile_examples = 10
|
85
|
+
|
86
|
+
# Run specs in random order to surface order dependencies. If you find an
|
87
|
+
# order dependency and want to debug it, you can fix the order by providing
|
88
|
+
# the seed, which is printed after each run.
|
89
|
+
# --seed 1234
|
90
|
+
config.order = :random
|
91
|
+
|
92
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
93
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
94
|
+
# test failures related to randomization by passing the same `--seed` value
|
95
|
+
# as the one that triggered the failure.
|
96
|
+
Kernel.srand config.seed
|
97
|
+
|
98
|
+
# Set a timeout on individual tests
|
99
|
+
config.around(:each) do |example|
|
100
|
+
Timeout.timeout(5, &example)
|
101
|
+
end
|
102
|
+
|
103
|
+
# Configure RSpec to capture log messages for tests.
|
104
|
+
include RSpec::LoggingHelper
|
105
|
+
config.capture_log_messages
|
106
|
+
end
|
107
|
+
|
108
|
+
# Allow loading of mocks
|
109
|
+
$LOAD_PATH.unshift(File.realpath('./spec/mock')) if File.exist? 'spec/mock'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'usmu/github/pages/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'usmu-github-pages'
|
8
|
+
spec.version = Usmu::Github::Pages::VERSION
|
9
|
+
spec.authors = ['Matthew Scharley']
|
10
|
+
spec.email = ['matt.scharley@gmail.com']
|
11
|
+
spec.summary = %q{Github Pages publishing plugin for Usmu.}
|
12
|
+
spec.homepage = 'https://github.com/usmu/usmu-github-pages'
|
13
|
+
spec.license = 'MIT'
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^spec/})
|
18
|
+
spec.require_paths = ['lib']
|
19
|
+
|
20
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.2.0')
|
21
|
+
|
22
|
+
spec.add_dependency 'usmu', '~> 1.4', '>= 1.4.3'
|
23
|
+
spec.add_dependency 'logging', '~> 2.0'
|
24
|
+
|
25
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.1'
|
28
|
+
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.2'
|
29
|
+
spec.add_development_dependency 'yard', '~> 0.8'
|
30
|
+
spec.add_development_dependency 'guard', '~> 2.8'
|
31
|
+
spec.add_development_dependency 'guard-rspec', '~> 4.3'
|
32
|
+
spec.add_development_dependency 'libnotify', '~> 0.9'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: usmu-github-pages
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matthew Scharley
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: usmu
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.4'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.4.3
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.4'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.4.3
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: logging
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '2.0'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '2.0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: bundler
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '1.6'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '1.6'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rake
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '10.0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '10.0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rspec
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '3.1'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '3.1'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rspec_junit_formatter
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0.2'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0.2'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: yard
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0.8'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0.8'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: guard
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '2.8'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '2.8'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: guard-rspec
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '4.3'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '4.3'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: libnotify
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0.9'
|
152
|
+
type: :development
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "~>"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0.9'
|
159
|
+
description:
|
160
|
+
email:
|
161
|
+
- matt.scharley@gmail.com
|
162
|
+
executables: []
|
163
|
+
extensions: []
|
164
|
+
extra_rdoc_files: []
|
165
|
+
files:
|
166
|
+
- ".gitignore"
|
167
|
+
- ".rspec"
|
168
|
+
- ".ruby-version"
|
169
|
+
- ".yardopts"
|
170
|
+
- CONTRIBUTING.md
|
171
|
+
- Gemfile
|
172
|
+
- Guardfile
|
173
|
+
- LICENSE.md
|
174
|
+
- README.md
|
175
|
+
- Rakefile
|
176
|
+
- circle.yml
|
177
|
+
- lib/usmu/github/pages.rb
|
178
|
+
- lib/usmu/github/pages/configuration.rb
|
179
|
+
- lib/usmu/github/pages/version.rb
|
180
|
+
- spec/spec_helper.rb
|
181
|
+
- usmu-github-pages.gemspec
|
182
|
+
homepage: https://github.com/usmu/usmu-github-pages
|
183
|
+
licenses:
|
184
|
+
- MIT
|
185
|
+
metadata: {}
|
186
|
+
post_install_message:
|
187
|
+
rdoc_options: []
|
188
|
+
require_paths:
|
189
|
+
- lib
|
190
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 2.2.0
|
195
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
|
+
requirements:
|
197
|
+
- - ">="
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
version: '0'
|
200
|
+
requirements: []
|
201
|
+
rubyforge_project:
|
202
|
+
rubygems_version: 2.5.1
|
203
|
+
signing_key:
|
204
|
+
specification_version: 4
|
205
|
+
summary: Github Pages publishing plugin for Usmu.
|
206
|
+
test_files:
|
207
|
+
- spec/spec_helper.rb
|
208
|
+
has_rdoc:
|