aptible-tasks 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ea06577ae2bc8fe3c1628fe765dd77b4f9e4507a
4
+ data.tar.gz: 06c9cc0b30a6233eb974f3dacfc9fa9b66bff761
5
+ SHA512:
6
+ metadata.gz: 401cc65579df4ddcd49e9aebbe2a7079d7ca352bc1d2a426416637d2c87a11bfa09c095f90e9796f24c7d449f0041c59242e13d9af475322923c0fffcd305f85
7
+ data.tar.gz: a188c8a30c0f2048fce3e94fea317a8b42b6d6c3973109f2a3cb191040a06190c43ae01e7b6b654aa47ce8e30ed8baf7a0ef7c250b76c7374820b65c1c6899fc
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format=documentation
@@ -0,0 +1,12 @@
1
+ Documentation:
2
+ Enabled: false
3
+
4
+ AllCops:
5
+ Includes:
6
+ - !ruby/regexp /\.rb$/
7
+ - !ruby/regexp /\.rake$/
8
+ - !ruby/regexp /\.gemspec$/
9
+ - !ruby/regexp /Rakefile$/
10
+ Excludes:
11
+ # Exclude line length check from autogenerated files
12
+ - !ruby/regexp /\/db\/schema\.rb$/
@@ -0,0 +1,2 @@
1
+ rvm:
2
+ 2.0.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in aptible-tasks.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Aptible, Inc.
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.
@@ -0,0 +1,41 @@
1
+ # Aptible::Tasks
2
+
3
+ [![Build Status](https://travis-ci.org/aptible/aptible-tasks.png?branch=master)](https://travis-ci.org/aptible/aptible-tasks)
4
+
5
+ Shared Rake tasks for Aptible projects.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'aptible-tasks'
12
+
13
+ And then run `bundle install`.
14
+
15
+ ## Usage
16
+
17
+ Add the following to your Rakefile:
18
+
19
+ require 'aptible/tasks'
20
+ Aptible::Tasks.load_tasks
21
+
22
+ ## Available Tasks
23
+
24
+ | Task Name | Purpose |
25
+ | ---------:| ------- |
26
+ | `spec` | Runs the spec suite with standard formatting |
27
+ | `rubocop` | Checks code against the Aptible-approved Ruby style guide |
28
+ | `ci` | Runs the suite of tasks performed by continuous integration |
29
+
30
+ ## Contributing
31
+
32
+ 1. Fork the project.
33
+ 1. Commit your changes, with specs.
34
+ 1. Ensure that your code passes specs (`rake spec`) and meets Aptible's Ruby style guide (`rake rubocop`).
35
+ 1. Create a new pull request on GitHub.
36
+
37
+ ## Copyright and License
38
+
39
+ MIT License, see [LICENSE](LICENSE.md) for details.
40
+
41
+ Copyright (c) 2013 [Aptible](https://www.aptible.com), [Frank Macreery](https://github.com/fancyremarker), and contributors.
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ require 'aptible/tasks'
4
+ Aptible::Tasks.load_tasks
5
+
6
+ task default: :ci
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ require 'English'
6
+ require 'aptible/tasks/version'
7
+
8
+ Gem::Specification.new do |spec|
9
+ spec.name = 'aptible-tasks'
10
+ spec.version = Aptible::Tasks::VERSION
11
+ spec.authors = ['Frank Macreery']
12
+ spec.email = ['frank@macreery.com']
13
+ spec.description = %q{Shared Rake tasks for Aptible projects.}
14
+ spec.summary = %q{Shared Rake tasks for Aptible projects.}
15
+ spec.homepage = 'https://github.com/aptible/aptible-tasks'
16
+ spec.license = 'MIT'
17
+
18
+ spec.files = `git ls-files`.split($RS)
19
+ spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
20
+ spec.test_files = spec.files.grep(/^spec\//)
21
+ spec.require_paths = ['lib']
22
+
23
+ spec.add_dependency 'rake'
24
+ spec.add_dependency 'rubocop', '>= 0.15.0'
25
+
26
+ spec.add_development_dependency 'bundler', '~> 1.3'
27
+ spec.add_development_dependency 'rspec', '~> 2.0'
28
+ end
@@ -0,0 +1,18 @@
1
+ require 'aptible/tasks/rubocop'
2
+ require 'aptible/tasks/version'
3
+
4
+ module Aptible
5
+ module Tasks
6
+ def self.load_tasks
7
+ glob = File.join(File.dirname(__FILE__), '..', 'tasks', '**', '*.rake')
8
+ Dir.glob(glob).each { |file| load file }
9
+ Rake::Task.tasks
10
+ end
11
+
12
+ def self.clear_task(task_name)
13
+ if Rake::Task.tasks.map(&:name).include?(task_name.to_s)
14
+ Rake::Task[task_name].clear
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,21 @@
1
+ require 'rubocop'
2
+
3
+ module Aptible
4
+ module Tasks
5
+ class Rubocop
6
+ def config_file
7
+ File.join(File.dirname(__FILE__), '..', '..', '..', '.rubocop.yml')
8
+ end
9
+
10
+ def config
11
+ ::Rubocop::ConfigLoader.load_file(config_file)
12
+ end
13
+
14
+ def run
15
+ cli = ::Rubocop::CLI.new
16
+ result = cli.run(%W{ -c #{config_file} })
17
+ abort unless result == 0
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,5 @@
1
+ module Aptible
2
+ module Tasks
3
+ VERSION = '0.1.0'
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ desc 'Run all continuous integration tasks'
2
+ task ci: [:rubocop, :spec]
@@ -0,0 +1,4 @@
1
+ desc 'Run Aptible custom Rubocop style checker'
2
+ task :rubocop do
3
+ Aptible::Tasks::Rubocop.new.run
4
+ end
@@ -0,0 +1,11 @@
1
+ require 'rspec/core'
2
+ require 'rspec/core/rake_task'
3
+
4
+ # Clear any predefined :spec task
5
+ Aptible::Tasks.clear_task(:spec)
6
+
7
+ RSpec::Core::RakeTask.new(:spec) do |spec|
8
+ spec.pattern = FileList['spec/**/*_spec.rb']
9
+ spec.rspec_opts = '-c' # Color
10
+ spec.rspec_opts << '-fd' # Format: Documentation
11
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ describe Aptible::Tasks::Rubocop do
4
+ before do
5
+ ::Rubocop::CLI.stub(:run)
6
+ end
7
+
8
+ its(:config) { should be_a ::Rubocop::Config }
9
+
10
+ describe :config do
11
+ it 'contains sane values' do
12
+ subject.config['Documentation']['Enabled'].should be_false
13
+ subject.config['AllCops']['Excludes'].should_not be_empty
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+ require 'rake'
3
+
4
+ shared_context 'rake' do
5
+ let(:rake) { Rake::Application.new }
6
+ let(:task_name) { self.class.top_level_description[/rake (.+)/, 1] }
7
+ subject { rake[task_name] }
8
+
9
+ before do
10
+ Rake.application = rake
11
+ Aptible::Tasks.load_tasks
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+
4
+ # Load shared spec files
5
+ Dir["#{File.dirname(__FILE__)}/shared/**/*.rb"].each do |file|
6
+ require file
7
+ end
8
+
9
+ # Require library up front
10
+ require 'aptible/tasks'
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'rake ci' do
4
+ include_context 'rake'
5
+
6
+ its(:prerequisites) { should include 'rubocop' }
7
+ its(:prerequisites) { should include 'spec' }
8
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'rake rubocop' do
4
+ include_context 'rake'
5
+
6
+ let(:rubocop) { double('rubocop') }
7
+
8
+ before do
9
+ Aptible::Tasks::Rubocop.stub(new: rubocop)
10
+ end
11
+
12
+ its(:prerequisites) { should be_empty }
13
+
14
+ it 'delegates to ::Rubocop.new.run' do
15
+ rubocop.should_receive(:run)
16
+ subject.invoke
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'rake spec' do
4
+ include_context 'rake'
5
+
6
+ its(:prerequisites) { should be_empty }
7
+ end
metadata ADDED
@@ -0,0 +1,127 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aptible-tasks
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Frank Macreery
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.15.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.15.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ description: Shared Rake tasks for Aptible projects.
70
+ email:
71
+ - frank@macreery.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - .rspec
78
+ - .rubocop.yml
79
+ - .travis.yml
80
+ - Gemfile
81
+ - LICENSE.md
82
+ - README.md
83
+ - Rakefile
84
+ - aptible-tasks.gemspec
85
+ - lib/aptible/tasks.rb
86
+ - lib/aptible/tasks/rubocop.rb
87
+ - lib/aptible/tasks/version.rb
88
+ - lib/tasks/ci.rake
89
+ - lib/tasks/rubocop.rake
90
+ - lib/tasks/spec.rake
91
+ - spec/aptible/tasks/rubocop_spec.rb
92
+ - spec/shared/contexts/rake.rb
93
+ - spec/spec_helper.rb
94
+ - spec/tasks/ci_spec.rb
95
+ - spec/tasks/rubocob_spec.rb
96
+ - spec/tasks/spec_spec.rb
97
+ homepage: https://github.com/aptible/aptible-tasks
98
+ licenses:
99
+ - MIT
100
+ metadata: {}
101
+ post_install_message:
102
+ rdoc_options: []
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - '>='
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ requirements: []
116
+ rubyforge_project:
117
+ rubygems_version: 2.0.0
118
+ signing_key:
119
+ specification_version: 4
120
+ summary: Shared Rake tasks for Aptible projects.
121
+ test_files:
122
+ - spec/aptible/tasks/rubocop_spec.rb
123
+ - spec/shared/contexts/rake.rb
124
+ - spec/spec_helper.rb
125
+ - spec/tasks/ci_spec.rb
126
+ - spec/tasks/rubocob_spec.rb
127
+ - spec/tasks/spec_spec.rb