kender 0.1.6 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjViZmI3ZGQwMjE4YjgyYjliOGNkOWE4ZmIwMzlmZjE1YTdlYjRmZA==
4
+ YTQzODlkMWZjMzBiODQyZTZiNmQ4NTgxYWRmYzFiYTYyMTA5YmEwMg==
5
5
  data.tar.gz: !binary |-
6
- ZjVlMjIxYWI4NzZjYWYxZThkYmZkOTIyZjgyYWNlMTM1MWQzMmIyZg==
6
+ ZTg0Y2RiNDJmYTEzMjUwODVhZDI4MmEwZDhlZWU4Y2Q1ZjM4OWM2Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2MwMWU2OGQ4M2Q0OWJjZGY2ZDU0ZmNhMmE0NGU3ZGNhNTcwMjU1NjllMTIx
10
- ZDIzYmZhM2M3ZDI0N2Y4MTljYzYwM2Q4NDZlMWE0ZDAwNGM5ZWEyNjA4MjJk
11
- YzkyM2EwN2MzY2Q1MDIxYWJlNTY2YWYyNjE3NGRmZWZlYmJjYjA=
9
+ MzIzNjg3ZDZiNDMzM2U5N2MyNmZkZWI3YTU4MmM3ODkzZWUzZjk5YTBiYzg3
10
+ ODNiMGY1OWRkNmVmYzUyN2NlZDg4MzViOWRkN2U1ZWNlOWYyMjUzMTU3Nzhk
11
+ MGIwYmU1ZDA0YTk5MjZkZjMyNjZlNjlkMWRjNmQxMzE3ZmVhNDc=
12
12
  data.tar.gz: !binary |-
13
- MjlhZGQwZjA5M2ZiYjExZGU5ZGI1ZTIzZWQxNzU5NGQ2Y2FjNGJhZGJlNjQ3
14
- YmJhYmUzZjRmMTRmN2I0YTM2NjlhMWQ4ZjFiNTY1Y2IxNmViNTI1NWFmM2Iz
15
- NTU1M2M5MDY1OTQ0MDg0MDhkOTRlNThlZmVjOWY0MmYyNzFiZGU=
13
+ MzhlMzQ3Nzk2NmNmODhlNmE4NjEwMjAxNWM3NWEwYmQ3M2JiNDFjNjBiNThj
14
+ NGFiNGRlZWYwNjdiMzhhYzJmYTMzODdkNWIyMjZlZGJiZDQ5NmEwMzlkMzAx
15
+ ZjM5ZjYzYTMyMjQ2M2I4YjM0Y2EyMjFkODc3ZDU5NmFhN2NlNmY=
@@ -0,0 +1,47 @@
1
+ @redo_bundle
2
+ Feature: Rspec
3
+ Kender is able to run specs using the rspec tool.
4
+
5
+ Background:
6
+ Given a file named "Gemfile" with:
7
+ """
8
+ source 'https://rubygems.org'
9
+ gem 'rspec', '~> 2.14'
10
+ gem 'kender', path: '../../' # needed to use the latest code
11
+ gem 'dice_bag', '~>0.7'
12
+ """
13
+ And I run `bundle install`
14
+
15
+ Scenario: The project has no specs but Rspec is executed
16
+ When I run `bundle exec rake ci`
17
+ Then it should pass with:
18
+ """
19
+ 0 examples, 0 failures
20
+ """
21
+
22
+ Scenario: The project has some passing specs to run
23
+ Given a file named "spec/testing_spec.rb" with:
24
+ """
25
+ describe "My software" do
26
+ it "works wonderfully" do
27
+ true
28
+ end
29
+ end
30
+ """
31
+ When I run `bundle exec rake ci`
32
+ Then it should pass with:
33
+ """
34
+ 1 example, 0 failures
35
+ """
36
+
37
+ Scenario: The project has some non passing specs to run
38
+ Given a file named "spec/testing_spec.rb" with:
39
+ """
40
+ describe "My software" do
41
+ it "fails miserably" do
42
+ expect(false).to be_true
43
+ end
44
+ end
45
+ """
46
+ When I run `bundle exec rake ci`
47
+ Then the exit status should not be 0
@@ -2,5 +2,12 @@ require 'aruba/cucumber'
2
2
  require 'kender'
3
3
 
4
4
  Before do
5
- @aruba_timeout_seconds = 10
5
+ #scenarios bundle to set up gems and it takes forever
6
+ @aruba_timeout_seconds = 30
7
+ end
8
+
9
+ # Unset bundle vars so when we create new bundle files in the scenarios
10
+ # we use those gems there instead of the ones loaded by kender gem
11
+ Before('@redo_bundle') do
12
+ unset_bundler_env_vars
6
13
  end
@@ -2,14 +2,10 @@ module Kender
2
2
  # This class abstracts the shell commands we use
3
3
  class Command
4
4
 
5
- def name
5
+ def name
6
6
  self.class.name.split("::").last.downcase.to_sym
7
7
  end
8
8
 
9
- def task_name
10
- "ci:#{name}"
11
- end
12
-
13
9
  def available?
14
10
  abort "Command failed: #{name}, availability status undefined."
15
11
  end
@@ -24,7 +20,7 @@ module Kender
24
20
  $?
25
21
  end
26
22
 
27
- class << self
23
+ class << self
28
24
 
29
25
  def commands
30
26
  @commands ||= []
@@ -34,8 +30,8 @@ module Kender
34
30
  commands << klass.new
35
31
  end
36
32
 
37
- def all_tasks
38
- all.map(&:task_name)
33
+ def all_names
34
+ all.map(&:name)
39
35
  end
40
36
 
41
37
  def all
@@ -61,3 +57,6 @@ require_relative 'commands/shamus'
61
57
  require_relative 'commands/test_unit'
62
58
  require_relative 'commands/rspec'
63
59
  require_relative 'commands/cucumber'
60
+ require_relative 'commands/reek'
61
+ require_relative 'commands/i18n_tasks'
62
+ require_relative 'commands/pb_duplicates'
@@ -0,0 +1,12 @@
1
+ module Kender
2
+ class I18nVerify < Command
3
+ def available?
4
+ Gem::Specification::find_all_by_name('i18n-tasks').any?
5
+ end
6
+
7
+ # The commands missing and unused produce informational reports only.
8
+ def command
9
+ 'i18n-tasks missing; i18n-tasks unused'
10
+ end
11
+ end
12
+ end
@@ -7,6 +7,9 @@ module Kender
7
7
  # do not run if running shamus
8
8
  return false if ENV['VALIDATE_PROJECT']
9
9
 
10
+ # make sure those gems were added
11
+ return false unless in_gemfile?("jasmine") && in_gemfile?("jasmine-phantom")
12
+
10
13
  # verify jasmine and phantomjs are present
11
14
  `phantomjs --version 2>&1 > /dev/null`
12
15
  return false unless $?.success?
@@ -0,0 +1,11 @@
1
+ module Kender
2
+ class PBDuplicates < Command
3
+ def available?
4
+ Rake::Task.task_defined?('pb_numbers:list:duplicates')
5
+ end
6
+
7
+ def command
8
+ 'bundle exec rake pb_numbers:list:duplicates'
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ module Kender
2
+ class Reek < Command
3
+
4
+ def available?
5
+ in_gemfile?('reek')
6
+ end
7
+
8
+ def command
9
+ 'bundle exec reek -q .'
10
+ end
11
+
12
+ end
13
+ end
@@ -2,7 +2,9 @@ module Kender
2
2
  class Rspec < Command
3
3
 
4
4
  def available?
5
- in_gemfile?("rspec") and not(ENV['VALIDATE_PROJECT'])
5
+ # do not run if running shamus
6
+ return false if ENV['VALIDATE_PROJECT']
7
+ in_gemfile?("rspec") || in_gemfile?("rspec-rails")
6
8
  end
7
9
 
8
10
  def command
@@ -1,6 +1,3 @@
1
- #make sure we require all the tools we need loaded in memory
2
- Bundler.require(:default, :test)
3
-
4
1
  require 'kender/configuration'
5
2
  require 'kender/github'
6
3
  require 'kender/command'
@@ -36,17 +33,20 @@ namespace :ci do
36
33
  task :config => ['ci:env', 'ci:config_project', 'ci:setup_db']
37
34
 
38
35
  desc "Run continuous integration tests with the current configuration"
39
- task :run => ['ci:env'] + Kender::Command.all_tasks
36
+ task :run => ['ci:env'] do
37
+ #make sure we require all the tools we need loaded in memory
38
+ Kender::Command.all.each do |command|
39
+ command.execute
40
+ end
41
+ end
40
42
 
41
43
  desc "Destroy resources created externally for the continuous integration run, e.g. drops databases"
42
44
  task :clean => ['ci:env', 'ci:drop_db']
43
45
 
44
- # Automatically create rake task for each individual command.
45
- Kender::Command.all.each do |command|
46
- desc "Individual task for #{command.name}, in parallel if available."
47
- task command.name do
48
- command.execute
49
- end
46
+ desc "Shows a list of all the software Kender will call when ci:run is invoked."
47
+ task :list => ['ci:env'] do
48
+ puts "Kender will execute the following software:"
49
+ puts Kender::Command.all_names.join("\n")
50
50
  end
51
51
 
52
52
  # The following tasks are internal to us, without description, the user can not discover them
@@ -1,3 +1,3 @@
1
1
  module Kender
2
- VERSION = '0.1.6'
2
+ VERSION = '0.2.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kender
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Smith
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - ~>
33
33
  - !ruby/object:Gem::Version
34
- version: 0.5.2
34
+ version: 0.5.4
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ~>
40
40
  - !ruby/object:Gem::Version
41
- version: 0.5.2
41
+ version: 0.5.4
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -62,6 +62,7 @@ extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
64
  - features/install.feature
65
+ - features/rspec.feature
65
66
  - features/scenarios.feature
66
67
  - features/support/env.rb
67
68
  - features/support/hooks.rb
@@ -71,7 +72,10 @@ files:
71
72
  - lib/kender/commands/bundle_audit.rb
72
73
  - lib/kender/commands/consistency_fail.rb
73
74
  - lib/kender/commands/cucumber.rb
75
+ - lib/kender/commands/i18n_tasks.rb
74
76
  - lib/kender/commands/jasmine.rb
77
+ - lib/kender/commands/pb_duplicates.rb
78
+ - lib/kender/commands/reek.rb
75
79
  - lib/kender/commands/rspec.rb
76
80
  - lib/kender/commands/shamus.rb
77
81
  - lib/kender/commands/test_unit.rb
@@ -82,7 +86,8 @@ files:
82
86
  - lib/kender/tasks/ci.rake
83
87
  - lib/kender/version.rb
84
88
  homepage:
85
- licenses: []
89
+ licenses:
90
+ - MIT
86
91
  metadata: {}
87
92
  post_install_message:
88
93
  rdoc_options: []
@@ -107,6 +112,7 @@ summary: Kender is a library of rake tasks that provides a consistent framework
107
112
  continuous integration (CI).
108
113
  test_files:
109
114
  - features/install.feature
115
+ - features/rspec.feature
110
116
  - features/scenarios.feature
111
117
  - features/support/env.rb
112
118
  - features/support/hooks.rb