lookout-rake 3.0.1 → 3.0.2

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: eb67e7e982e1ce55938552cc139c9a93fdb54a6f
4
+ data.tar.gz: 054176df9bbbd8d2fe7f9208cf9d10ed96101594
5
+ SHA512:
6
+ metadata.gz: 7e7373afc2a766b5c8c12c620721259a8f107efe91fed7b1cdee09a67a410c82e4687925bead9357b8183b1eb1fc034f1c8eed8e161d18a3244e23f06e48f7e2
7
+ data.tar.gz: ebe886ed3b922ebfbc7426231e7eb54db7279a591c7038562bb49f10528e0a6d7f47c7a1cd185c6d9babf17b016638c29b790a12c37c047ea85f3f1e806506aa
data/README CHANGED
@@ -1,18 +1,20 @@
1
1
  Lookout-Rake
2
2
 
3
- Lookout-Rake provides Rake tasks for testing using Lookout.
3
+ Lookout-Rake provides Rake¹ tasks for testing using Lookout.
4
+
5
+ ¹ See http://rake.rubyforge.org/
4
6
 
5
7
  § Installation
6
8
 
7
9
  Install Lookout-Rake with
8
10
 
9
- % gem install lookout
11
+ % gem install lookout-rake
10
12
 
11
13
  § Usage
12
14
 
13
15
  Include the following code in your ‹Rakefile›:
14
16
 
15
- require 'lookout/rake-3.0'
17
+ require 'lookout-rake-3.0'
16
18
 
17
19
  Lookout::Rake::Tasks::Test.new
18
20
 
@@ -24,14 +26,29 @@
24
26
 
25
27
  You can hook up your test task to use your Inventory¹:
26
28
 
27
- require 'library/version.rb'
29
+ load File.expand_path('../lib/library-X.0/version.rb', __FILE__)
28
30
 
29
31
  Lookout::Rake::Tasks::Test.new :inventory => Library::Version
30
32
 
31
- Also, if you use the tasks that come with Inventory, the test task will
32
- hook into the inventory you tell them to use automatically.
33
+ Also, if you use the tasks that come with Inventory-Rake², the test task
34
+ will hook into the inventory you tell them to use automatically, that is,
35
+ the following will do:
36
+
37
+ load File.expand_path('../lib/library-X.0/version.rb', __FILE__)
38
+
39
+ Inventory::Rake::Tasks.define Library::Version
40
+
41
+ Lookout::Rake::Tasks::Test.new
42
+
43
+ For further usage information, see the {API documentation}³.
44
+
45
+ ¹ Inventory: http://disu.se/software/inventory/
46
+ ² Inventory-Rake: http://disu.se/software/inventory-rake/
47
+ ³ API: http://disu.se/software/lookout-rake/api/Lookout/Rake/Tasks/Test/
48
+
49
+ § Integration
33
50
 
34
- To use Lookout together with Vim², place ‹contrib/rakelookout.vim› in
51
+ To use Lookout together with Vim¹, place ‹contrib/rakelookout.vim› in
35
52
  ‹~/.vim/compiler› and add
36
53
 
37
54
  compiler rakelookout
@@ -62,5 +79,30 @@
62
79
  receiving a lot of errors and/or failures and want to focus on those
63
80
  associated with a specific class or on a specific test.
64
81
 
65
- ¹ Get information on Inventory at http://disu.se/software/inventory/
66
- ² Find out more about Vim at http://www.vim.org/
82
+ ¹ Find out more about Vim at http://www.vim.org/
83
+
84
+ § Financing
85
+
86
+ Currently, most of my time is spent at my day job and in my rather busy
87
+ private life. Please motivate me to spend time on this piece of software
88
+ by donating some of your money to this project. Yeah, I realize that
89
+ requesting money to develop software is a bit, well, capitalistic of me.
90
+ But please realize that I live in a capitalistic society and I need money
91
+ to have other people give me the things that I need to continue living
92
+ under the rules of said society. So, if you feel that this piece of
93
+ software has helped you out enough to warrant a reward, please PayPal a
94
+ donation to now@disu.se¹. Thanks! Your support won’t go unnoticed!
95
+
96
+ ¹ Send a donation:
97
+ https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=now%40disu%2ese&item_name=Nikolai%20Weibull%20Software%20Services
98
+
99
+ § Reporting Bugs
100
+
101
+ Please report any bugs that you encounter to the {issue tracker}¹.
102
+
103
+ ¹ See https://github.com/now/lookout-rake/issues
104
+
105
+ § Authors
106
+
107
+ Nikolai Weibull wrote the code, the tests, the manual pages, and this
108
+ README.
data/Rakefile CHANGED
@@ -1,13 +1,22 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
- require 'inventory/rake-1.0'
3
+ require 'inventory-rake-1.0'
4
4
 
5
5
  $:.unshift File.expand_path('../lib', __FILE__)
6
- require 'lookout/rake-3.0'
6
+ require 'lookout-rake-3.0'
7
7
 
8
8
  Inventory::Rake::Tasks.define Lookout::Rake::Version, :gem => proc{ |_, s|
9
9
  s.author = 'Nikolai Weibull'
10
10
  s.email = 'now@bitwi.se'
11
11
  s.homepage = 'https://github.com/now/lookout-rake'
12
12
  }
13
- Lookout::Rake::Tasks::Test.new
13
+
14
+ Inventory::Rake::Tasks.unless_installing_dependencies do
15
+ Lookout::Rake::Tasks::Test.new
16
+
17
+ require 'inventory-rake-tasks-yard-1.0'
18
+ Inventory::Rake::Tasks::YARD.new do |t|
19
+ t.options += %w'--plugin yard-heuristics-1.0'
20
+ t.globals[:source_code_url] = 'https://github.com/now/%s/blob/v%s/%%s#L%%d' % [t.inventory.package, t.inventory]
21
+ end
22
+ end
@@ -0,0 +1,11 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ # Namespace for [Lookout](http://disu.se/software/lookout/). The bulk of the
4
+ # library is in {Rake::Tasks::Test}.
5
+ module Lookout end
6
+
7
+ # Namespace for [Rake](http://rake.rubyforge.org/) integration of Lookout.
8
+ module Lookout::Rake
9
+ load File.expand_path('../lookout-rake-3.0/version.rb', __FILE__)
10
+ Version.load
11
+ end
File without changes
@@ -7,14 +7,16 @@ class Lookout::Rake::Tasks::Test
7
7
  LoaderPath = File.join(File.dirname(__FILE__), 'test/loader.rb')
8
8
  Paths = %w'lib'
9
9
 
10
- # Defines a Rake task for running expectation tests named _:name_. Also
11
- # defines a task for running expectations with coverage name
12
- # _:name_:coverage. If _:name_ `#==` `:test`, then the default task is set
13
- # to depend on it, unless the default task has already been defined, as well
14
- # as the `:check` task.
10
+ # Defines a Rake task for running expectation tests named NAME. Also defines
11
+ # a task for running expectations with coverage checking named NAME:coverage.
12
+ # The default task is set to depend on the NAME task, unless the default task
13
+ # has already been defined. The `:check` task is likewise set to depend on
14
+ # NAME. The NAME task itself and its NAME:coverage counterpart are set to
15
+ # depend on the `:compile` task if it’s been defined.
16
+ #
17
+ # Optionally yields the TASK being created so that it may be adjusted further
18
+ # before being defined.
15
19
  #
16
- # Optionally yields the _task_ being created so that it may be adjusted
17
- # further before being defined.
18
20
  # @param [Hash] options
19
21
  # @option options [Symbol] :name (:test) The name of the task
20
22
  # @option options [Array<String>] :paths (['lib']) The paths to add to
@@ -31,14 +33,14 @@ class Lookout::Rake::Tasks::Test
31
33
  # @option options [Array<String>] :options (['-w']) The options to pass to
32
34
  # ruby
33
35
  # @yield [?]
34
- # @yieldparam [Test] task
36
+ # @yieldparam [self] task
35
37
  def initialize(options = {})
36
38
  self.name = options.fetch(:name, :test)
37
39
  self.paths = options.fetch(:paths, Paths)
38
40
  self.requires = options.fetch(:requires, [])
39
41
  self.files = options.fetch(:files){ ENV.include?('TEST') ? FileList[ENV['TEST']] : nil }
40
42
  inventory = options[:inventory] ||
41
- (provided?('inventory/rake-1.0') and Inventory::Rake::Tasks.inventory) and
43
+ ((provided? 'inventory/rake-1.0' or provided? 'inventory-rake-1.0') and Inventory::Rake::Tasks.inventory) and
42
44
  self.inventory = inventory
43
45
  self.specification = options.fetch(:specification) if options.include? :specification
44
46
  self.options = options.fetch(:options, %w'-w')
@@ -50,7 +52,7 @@ class Lookout::Rake::Tasks::Test
50
52
  attr_reader :name
51
53
 
52
54
  # @param [Symbol] value
53
- # @return [Symbol] The new name of the task: _value_
55
+ # @return [Symbol] The new name of the task: VALUE
54
56
  attr_writer :name
55
57
 
56
58
  # @return [Array<String>] The paths to add to `$LOAD_PATH`; may load
@@ -62,7 +64,7 @@ class Lookout::Rake::Tasks::Test
62
64
  end
63
65
 
64
66
  # @param [Array<String>] value
65
- # @return [Array<String>] The new paths to add to `$LOAD_PATH`: _value_
67
+ # @return [Array<String>] The new paths to add to `$LOAD_PATH`: VALUE
66
68
  attr_writer :paths
67
69
 
68
70
  # @return [Array<String>] The libraries to require; may load {#specification}
@@ -73,17 +75,17 @@ class Lookout::Rake::Tasks::Test
73
75
  end
74
76
 
75
77
  # @param [Array<String>] value
76
- # @return [Array<String>] The new libraries to require: _value_
78
+ # @return [Array<String>] The new libraries to require: VALUE
77
79
  attr_writer :requires
78
80
 
79
- # @return [Array<String>] The expectation files to load; defaults to
81
+ # @return [Array<String>] The expectation files to load, defaulting to
80
82
  # `FileList['test/unit/**/*.rb]`
81
83
  def files
82
84
  @files ||= FileList['test/unit/**/*.rb']
83
85
  end
84
86
 
85
87
  # @param [Array<String>] value
86
- # @return [Array<String>] The new expectation files to load: _value_
88
+ # @return [Array<String>] The new expectation files to load: VALUE
87
89
  attr_writer :files
88
90
 
89
91
  # @return [Inventory] The inventory to use
@@ -91,7 +93,7 @@ class Lookout::Rake::Tasks::Test
91
93
 
92
94
  # @param [Inventory] inventory
93
95
  # @return [Inventory] The new inventory to use for {#paths}, {#requires}, and
94
- # {#files}: _inventory_
96
+ # {#files}: INVENTORY
95
97
  def inventory=(inventory)
96
98
  self.paths = inventory.lib_directories
97
99
  self.requires = [inventory.package_require]
@@ -114,7 +116,7 @@ class Lookout::Rake::Tasks::Test
114
116
 
115
117
  # @param [Gem::Specification] specification
116
118
  # @return [Gem::Specification] The new specification to use for {#paths} and
117
- # {#requires}: _specification_
119
+ # {#requires}: SPECIFICATION
118
120
  def specification=(specification)
119
121
  self.paths = specification.require_paths
120
122
  self.requires = [specification.name.gsub('-', '/')]
@@ -125,7 +127,7 @@ class Lookout::Rake::Tasks::Test
125
127
  attr_reader :options
126
128
 
127
129
  # @param [Array<String>] value
128
- # @return [Array<String>] The new options to pass to ruby: _value_
130
+ # @return [Array<String>] The new options to pass to ruby: VALUE
129
131
  attr_writer :options
130
132
 
131
133
  def define
@@ -134,14 +136,19 @@ class Lookout::Rake::Tasks::Test
134
136
  run
135
137
  end
136
138
 
139
+ coverage = :"#{@name}:coverage"
137
140
  desc @name == :test ? 'Check test coverage' : 'Check test coverage for %s' % @name
138
- task :"#{@name}:coverage" do
141
+ task coverage do
139
142
  run %w'-c'
140
143
  end
141
144
 
145
+ [@name, coverage].each do |name|
146
+ task name => :compile if Rake::Task.task_defined? :compile
147
+ end
148
+
142
149
  task :default => @name unless Rake::Task.task_defined? :default
143
150
 
144
- task :check => :test if @name == :test
151
+ task :check => @name
145
152
  end
146
153
 
147
154
  private
@@ -0,0 +1,31 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ require 'inventory-1.0'
4
+
5
+ module Lookout::Rake
6
+ Version = Inventory.new(3, 0, 2){
7
+ def dependencies
8
+ super + Inventory::Dependencies.new{
9
+ development 'inventory-rake', 1, 4, 0
10
+ development 'yard', 0, 8, 0
11
+ development 'yard-heuristics', 1, 1, 0
12
+ runtime 'rake', 0, 9, 2, :feature => 'rake'
13
+ }
14
+ end
15
+
16
+ def package_libs
17
+ %w[tasks.rb
18
+ tasks/test.rb]
19
+ end
20
+
21
+ def additional_libs
22
+ super + %w[lookout/rake-3.0.rb
23
+ lookout-rake-3.0/tasks/test/loader.rb]
24
+ end
25
+
26
+ def unit_tests
27
+ super - %w[lookout/rake-3.0.rb
28
+ lookout-rake-3.0/tasks/test/loader.rb]
29
+ end
30
+ }
31
+ end
@@ -1,10 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
- # Namespace for Lookout.
4
- module Lookout end
5
-
6
- # Namespace for Rake integration of Lookout.
7
- module Lookout::Rake
8
- load File.expand_path('../rake/version.rb', __FILE__)
9
- Version.load
10
- end
3
+ warn "requiring 'lookout/rake-3.0' is deprecated; require 'lookout-rake-3.0' instead"
4
+ require 'lookout-rake-3.0'
@@ -0,0 +1,112 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ Expectations do
4
+ expect '-w -Ilib -- %s -rtest-1.0 -- test/unit/test-1.0.rb test/unit/test/version.rb' %
5
+ Lookout::Rake::Tasks::Test::LoaderPath do
6
+ command = nil
7
+ Rake.application = Rake::Application.new
8
+ stub Lookout::Rake::Tasks::Test.new(:inventory => Inventory.new(1, 0, 0, 'test/lib/test/version.rb')),
9
+ :ruby => proc{ |s| command = s } do
10
+ Rake.application[:test].invoke
11
+ end
12
+ command
13
+ end
14
+
15
+ expect '-w -Ilib -- %s -rtest-1.0 -l123 -- test/unit/test-1.0.rb test/unit/test/version.rb' %
16
+ Lookout::Rake::Tasks::Test::LoaderPath do
17
+ command = nil
18
+ Rake.application = Rake::Application.new
19
+ stub Lookout::Rake::Tasks::Test.new(:inventory => Inventory.new(1, 0, 0, 'test/lib/test/version.rb')),
20
+ :ruby => proc{ |s| command = s } do
21
+ with_env 'LINE' => '123' do
22
+ Rake.application[:test].invoke
23
+ end
24
+ end
25
+ command
26
+ end
27
+
28
+ expect '-w -Ilib -- %s -rtest-1.0 -c -- test/unit/test-1.0.rb test/unit/test/version.rb' %
29
+ Lookout::Rake::Tasks::Test::LoaderPath do
30
+ command = nil
31
+ Rake.application = Rake::Application.new
32
+ stub Lookout::Rake::Tasks::Test.new(:inventory => Inventory.new(1, 0, 0, 'test/lib/test/version.rb')),
33
+ :ruby => proc{ |s| command = s } do
34
+ Rake.application[:'test:coverage'].invoke
35
+ end
36
+ command
37
+ end
38
+
39
+ expect '-w -Ilib -- %s -rtest-1.0 -- test/unit/test-1.0.rb test/unit/test/version.rb' %
40
+ Lookout::Rake::Tasks::Test::LoaderPath do
41
+ command = nil
42
+ with_const 'Inventory::Rake::Tasks', Module.new do
43
+ stub Inventory::Rake::Tasks,
44
+ :inventory => Inventory.new(1, 0, 0, 'test/lib/test/version.rb') do
45
+ stub $LOADED_FEATURES, :any? => true do
46
+ Rake.application = Rake::Application.new
47
+ stub Lookout::Rake::Tasks::Test.new, :ruby => proc{ |s| command = s } do
48
+ Rake.application[:test].invoke
49
+ end
50
+ end
51
+ end
52
+ end
53
+ command
54
+ end
55
+
56
+ expect RuntimeError.new(/\Agem specification was not given/) do
57
+ Rake.application = Rake::Application.new
58
+ stub Dir, :[] => [] do
59
+ Lookout::Rake::Tasks::Test.new
60
+ Rake.application[:test].invoke
61
+ end
62
+ end
63
+
64
+ expect '-w -Ilib -- %s -rtest -- test/unit/test.rb test/unit/test/version.rb' %
65
+ Lookout::Rake::Tasks::Test::LoaderPath do
66
+ command = nil
67
+ Rake.application = Rake::Application.new
68
+ stub Dir, :[] => %w'test.gemspec' do
69
+ stub Gem::Specification, :load => Gem::Specification.new{ |s| s.name = 'test' } do
70
+ stub Lookout::Rake::Tasks::Test.new(:files => %w'test/unit/test.rb test/unit/test/version.rb'),
71
+ :ruby => proc{ |s| command = s } do
72
+ Rake.application[:test].invoke
73
+ end
74
+ end
75
+ end
76
+ command
77
+ end
78
+
79
+ expect '-w -Ilib -- %s -rtest -- test/unit/test.rb test/unit/test/version.rb' %
80
+ Lookout::Rake::Tasks::Test::LoaderPath do
81
+ command = nil
82
+ Rake.application = Rake::Application.new
83
+ stub Lookout::Rake::Tasks::Test.new(:specification => Gem::Specification.new{ |s|
84
+ s.name = 'test'
85
+ },
86
+ :files => %w'test/unit/test.rb test/unit/test/version.rb'),
87
+ :ruby => proc{ |s| command = s } do
88
+ Rake.application[:test].invoke
89
+ end
90
+ command
91
+ end
92
+
93
+ expect %w'lib' do
94
+ stub Dir, :[] => %w'test.gemspec' do
95
+ stub Gem::Specification, :load => Gem::Specification.new{ |s| s.name = 'test' } do
96
+ Rake.application = Rake::Application.new
97
+ Lookout::Rake::Tasks::Test.new(:paths => nil,
98
+ :files => %w'test/unit/test.rb test/unit/test/version.rb').paths
99
+ end
100
+ end
101
+ end
102
+
103
+ expect %w'test' do
104
+ stub Dir, :[] => %w'test.gemspec' do
105
+ stub Gem::Specification, :load => Gem::Specification.new{ |s| s.name = 'test' } do
106
+ Rake.application = Rake::Application.new
107
+ Lookout::Rake::Tasks::Test.new(:paths => nil,
108
+ :files => %w'test/unit/test.rb test/unit/test/version.rb').requires
109
+ end
110
+ end
111
+ end
112
+ end
metadata CHANGED
@@ -1,92 +1,209 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lookout-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
5
- prerelease:
4
+ version: 3.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Nikolai Weibull
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-05-04 00:00:00.000000000 Z
11
+ date: 2013-04-30 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: inventory
16
- requirement: &16866876 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: '1.3'
19
+ version: '1.4'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *16866876
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.4'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: inventory-rake
27
- requirement: &16866216 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.4'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.4'
41
+ - !ruby/object:Gem::Dependency
42
+ name: yard
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 0.8.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 0.8.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: yard-heuristics
57
+ requirement: !ruby/object:Gem::Requirement
29
58
  requirements:
30
59
  - - ~>
31
60
  - !ruby/object:Gem::Version
32
- version: '1.2'
61
+ version: '1.1'
33
62
  type: :development
34
63
  prerelease: false
35
- version_requirements: *16866216
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.1'
36
69
  - !ruby/object:Gem::Dependency
37
70
  name: rake
38
- requirement: &16865460 !ruby/object:Gem::Requirement
39
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
40
72
  requirements:
41
73
  - - ~>
42
74
  - !ruby/object:Gem::Version
43
75
  version: 0.9.2
44
76
  type: :runtime
45
77
  prerelease: false
46
- version_requirements: *16865460
47
- description: ! " Lookout-Rake\n\n Lookout-Rake provides
48
- Rake tasks for testing using Lookout.\n\n§ Installation\n\n Install Lookout-Rake
49
- with\n\n % gem install lookout\n\n§ Usage\n\n Include the following code in
50
- your ‹Rakefile›:\n\n require 'lookout/rake-3.0'\n\n Lookout::Rake::Tasks::Test.new\n\n
51
- \ If the ‹:default› task hasn’t been defined it’ll be set to depend on the\n ‹:test›
52
- task. The ‹:check› task will also depend on the ‹:test› task.\n There’s also
53
- a ‹:test:coverage› task that gets defined that uses the\n coverage library that
54
- comes with Ruby 1.9 to check the test coverage when\n the tests are run.\n\n
55
- \ You can hook up your test task to use your Inventory¹:\n\n require 'library/version.rb'\n\n
56
- \ Lookout::Rake::Tasks::Test.new :inventory => Library::Version\n\n Also,
57
- if you use the tasks that come with Inventory, the test task will\n hook into
58
- the inventory you tell them to use automatically.\n\n To use Lookout together
59
- with Vim², place ‹contrib/rakelookout.vim› in\n ‹~/.vim/compiler› and add\n\n
60
- \ compiler rakelookout\n\n to ‹~/.vim/after/ftplugin/ruby.vim›. Executing
61
- ‹:make› from inside Vim\n will now run your tests and an errors and failures
62
- can be visited with\n ‹:cnext›. Execute ‹:help quickfix› for additional information.\n\n
63
- \ Another useful addition to your ‹~/.vim/after/ftplugin/ruby.vim› file may\n
64
- \ be\n\n nnoremap <buffer> <silent> <Leader>M <Esc>:call <SID>run_test()<CR>\n
65
- \ let b:undo_ftplugin .= ' | nunmap <buffer> <Leader>M'\n\n function! s:run_test()\n
66
- \ let test = expand('%')\n let line = 'LINE=' . line('.')\n if
67
- test =~ '^lib/'\n let test = substitute(test, '^lib/', 'test/', '')\n let
68
- line = \"\"\n endif\n execute 'make' 'TEST=' . shellescape(test) line\n
69
- \ endfunction\n\n Now, pressing ‹<Leader>M› will either run all tests for
70
- a given class, if\n the implementation file is active, or run the test at or
71
- just before the\n cursor, if the test file is active. This is useful if you’re
72
- currently\n receiving a lot of errors and/or failures and want to focus on those\n
73
- \ associated with a specific class or on a specific test.\n\n¹ Get information
74
- on Inventory at http://disu.se/software/inventory/\n² Find out more about Vim at
75
- http://www.vim.org/\n"
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 0.9.2
83
+ description: |2
84
+ Lookout-Rake
85
+
86
+ Lookout-Rake provides Rake¹ tasks for testing using Lookout.
87
+
88
+ ¹ See http://rake.rubyforge.org/
89
+
90
+ § Installation
91
+
92
+ Install Lookout-Rake with
93
+
94
+ % gem install lookout-rake
95
+
96
+ § Usage
97
+
98
+ Include the following code in your ‹Rakefile›:
99
+
100
+ require 'lookout-rake-3.0'
101
+
102
+ Lookout::Rake::Tasks::Test.new
103
+
104
+ If the ‹:default› task hasn’t been defined it’ll be set to depend on the
105
+ ‹:test› task. The ‹:check› task will also depend on the ‹:test task.
106
+ There’s also a ‹:test:coverage› task that gets defined that uses the
107
+ coverage library that comes with Ruby 1.9 to check the test coverage when
108
+ the tests are run.
109
+
110
+ You can hook up your test task to use your Inventory¹:
111
+
112
+ load File.expand_path('../lib/library-X.0/version.rb', __FILE__)
113
+
114
+ Lookout::Rake::Tasks::Test.new :inventory => Library::Version
115
+
116
+ Also, if you use the tasks that come with Inventory-Rake², the test task
117
+ will hook into the inventory you tell them to use automatically, that is,
118
+ the following will do:
119
+
120
+ load File.expand_path('../lib/library-X.0/version.rb', __FILE__)
121
+
122
+ Inventory::Rake::Tasks.define Library::Version
123
+
124
+ Lookout::Rake::Tasks::Test.new
125
+
126
+ For further usage information, see the {API documentation}³.
127
+
128
+ ¹ Inventory: http://disu.se/software/inventory/
129
+ ² Inventory-Rake: http://disu.se/software/inventory-rake/
130
+ ³ API: http://disu.se/software/lookout-rake/api/Lookout/Rake/Tasks/Test/
131
+
132
+ § Integration
133
+
134
+ To use Lookout together with Vim¹, place ‹contrib/rakelookout.vim› in
135
+ ‹~/.vim/compiler› and add
136
+
137
+ compiler rakelookout
138
+
139
+ to ‹~/.vim/after/ftplugin/ruby.vim›. Executing ‹:make› from inside Vim
140
+ will now run your tests and an errors and failures can be visited with
141
+ ‹:cnext›. Execute ‹:help quickfix› for additional information.
142
+
143
+ Another useful addition to your ‹~/.vim/after/ftplugin/ruby.vim› file may
144
+ be
145
+
146
+ nnoremap <buffer> <silent> <Leader>M <Esc>:call <SID>run_test()<CR>
147
+ let b:undo_ftplugin .= ' | nunmap <buffer> <Leader>M'
148
+
149
+ function! s:run_test()
150
+ let test = expand('%')
151
+ let line = 'LINE=' . line('.')
152
+ if test =~ '^lib/'
153
+ let test = substitute(test, '^lib/', 'test/', '')
154
+ let line = ""
155
+ endif
156
+ execute 'make' 'TEST=' . shellescape(test) line
157
+ endfunction
158
+
159
+ Now, pressing ‹<Leader>M› will either run all tests for a given class, if
160
+ the implementation file is active, or run the test at or just before the
161
+ cursor, if the test file is active. This is useful if you’re currently
162
+ receiving a lot of errors and/or failures and want to focus on those
163
+ associated with a specific class or on a specific test.
164
+
165
+ ¹ Find out more about Vim at http://www.vim.org/
166
+
167
+ § Financing
168
+
169
+ Currently, most of my time is spent at my day job and in my rather busy
170
+ private life. Please motivate me to spend time on this piece of software
171
+ by donating some of your money to this project. Yeah, I realize that
172
+ requesting money to develop software is a bit, well, capitalistic of me.
173
+ But please realize that I live in a capitalistic society and I need money
174
+ to have other people give me the things that I need to continue living
175
+ under the rules of said society. So, if you feel that this piece of
176
+ software has helped you out enough to warrant a reward, please PayPal a
177
+ donation to now@disu.se¹. Thanks! Your support won’t go unnoticed!
178
+
179
+ ¹ Send a donation:
180
+ https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=now%40disu%2ese&item_name=Nikolai%20Weibull%20Software%20Services
181
+
182
+ § Reporting Bugs
183
+
184
+ Please report any bugs that you encounter to the {issue tracker}¹.
185
+
186
+ ¹ See https://github.com/now/lookout-rake/issues
187
+
188
+ § Authors
189
+
190
+ Nikolai Weibull wrote the code, the tests, the manual pages, and this
191
+ README.
76
192
  email: now@bitwi.se
77
193
  executables: []
78
194
  extensions: []
79
195
  extra_rdoc_files: []
80
196
  files:
81
- - lib/lookout/rake/tasks.rb
82
- - lib/lookout/rake/tasks/test.rb
197
+ - lib/lookout-rake-3.0/tasks.rb
198
+ - lib/lookout-rake-3.0/tasks/test.rb
199
+ - lib/lookout-rake-3.0.rb
200
+ - lib/lookout-rake-3.0/version.rb
83
201
  - lib/lookout/rake-3.0.rb
84
- - lib/lookout/rake/version.rb
85
- - lib/lookout/rake/tasks/test/loader.rb
86
- - test/unit/lookout/rake/tasks.rb
87
- - test/unit/lookout/rake/tasks/test.rb
88
- - test/unit/lookout/rake-3.0.rb
89
- - test/unit/lookout/rake/version.rb
202
+ - lib/lookout-rake-3.0/tasks/test/loader.rb
203
+ - test/unit/lookout-rake-3.0/tasks.rb
204
+ - test/unit/lookout-rake-3.0/tasks/test.rb
205
+ - test/unit/lookout-rake-3.0.rb
206
+ - test/unit/lookout-rake-3.0/version.rb
90
207
  - README
91
208
  - Rakefile
92
209
  homepage: https://github.com/now/lookout-rake
@@ -97,21 +214,19 @@ rdoc_options: []
97
214
  require_paths:
98
215
  - lib
99
216
  required_ruby_version: !ruby/object:Gem::Requirement
100
- none: false
101
217
  requirements:
102
- - - ! '>='
218
+ - - '>='
103
219
  - !ruby/object:Gem::Version
104
220
  version: '0'
105
221
  required_rubygems_version: !ruby/object:Gem::Requirement
106
- none: false
107
222
  requirements:
108
- - - ! '>='
223
+ - - '>='
109
224
  - !ruby/object:Gem::Version
110
225
  version: '0'
111
226
  requirements: []
112
227
  rubyforge_project:
113
- rubygems_version: 1.8.10
228
+ rubygems_version: 2.0.0
114
229
  signing_key:
115
230
  specification_version: 4
116
- summary: Lookout-Rake provides Rake tasks for testing using Lookout.
231
+ summary: Lookout-Rake provides Rake¹ tasks for testing using Lookout.
117
232
  test_files: []
@@ -1,39 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- require 'inventory-1.0'
4
-
5
- module Lookout::Rake
6
- Version = Inventory.new(3, 0, 1){
7
- def dependencies
8
- super + Inventory::Dependencies.new{
9
- development 'inventory-rake', 1, 2, 0
10
- optional 'rake', 0, 9, 2
11
- }
12
- end
13
-
14
- def requires
15
- %w'
16
- rake
17
- '
18
- end
19
-
20
- def libs
21
- %w'
22
- lookout/rake/tasks.rb
23
- lookout/rake/tasks/test.rb
24
- '
25
- end
26
-
27
- def additional_libs
28
- super + %w'
29
- lookout/rake/tasks/test/loader.rb
30
- '
31
- end
32
-
33
- def unit_tests
34
- super - %w'
35
- lookout/rake/tasks/test/loader.rb
36
- '
37
- end
38
- }
39
- end
@@ -1,106 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- Expectations do
4
- expect '-w -Ilib -- %s -rtest-1.0 -- test/unit/test-1.0.rb test/unit/test/version.rb' %
5
- Lookout::Rake::Tasks::Test::LoaderPath do
6
- command = nil
7
- Rake.application = Rake::Application.new
8
- Lookout::Rake::Tasks::Test.new(:inventory => Inventory.new(1, 0, 0, 'test/lib/test/version.rb')){ |t|
9
- stub(t).ruby{ |s| command = s }
10
- }
11
- Rake.application[:test].invoke
12
- command
13
- end
14
-
15
- expect '-w -Ilib -- %s -rtest-1.0 -l123 -- test/unit/test-1.0.rb test/unit/test/version.rb' %
16
- Lookout::Rake::Tasks::Test::LoaderPath do
17
- command = nil
18
- Rake.application = Rake::Application.new
19
- Lookout::Rake::Tasks::Test.new(:inventory => Inventory.new(1, 0, 0, 'test/lib/test/version.rb')){ |t|
20
- stub(t).ruby{ |s| command = s }
21
- }
22
- with_environment 'LINE' => '123' do
23
- Rake.application[:test].invoke
24
- end
25
- command
26
- end
27
-
28
- expect '-w -Ilib -- %s -rtest-1.0 -c -- test/unit/test-1.0.rb test/unit/test/version.rb' %
29
- Lookout::Rake::Tasks::Test::LoaderPath do
30
- command = nil
31
- Rake.application = Rake::Application.new
32
- Lookout::Rake::Tasks::Test.new(:inventory => Inventory.new(1, 0, 0, 'test/lib/test/version.rb')){ |t|
33
- stub(t).ruby{ |s| command = s }
34
- }
35
- Rake.application[:'test:coverage'].invoke
36
- command
37
- end
38
-
39
- expect '-w -Ilib -- %s -rtest-1.0 -- test/unit/test-1.0.rb test/unit/test/version.rb' %
40
- Lookout::Rake::Tasks::Test::LoaderPath do
41
- with_constant 'Inventory::Rake::Tasks', Module.new do
42
- stub(Inventory::Rake::Tasks).inventory{
43
- Inventory.new(1, 0, 0, 'test/lib/test/version.rb')
44
- }
45
- stub($LOADED_FEATURES).any?{ true }
46
- command = nil
47
- Rake.application = Rake::Application.new
48
- Lookout::Rake::Tasks::Test.new{ |t|
49
- stub(t).ruby{ |s| command = s }
50
- }
51
- Rake.application[:test].invoke
52
- command
53
- end
54
- end
55
-
56
- expect RuntimeError.new(/\Agem specification was not given/) do
57
- stub(Dir).[]{ [] }
58
- Rake.application = Rake::Application.new
59
- Lookout::Rake::Tasks::Test.new
60
- Rake.application[:test].invoke
61
- command
62
- end
63
-
64
- expect '-w -Ilib -- %s -rtest -- test/unit/test.rb test/unit/test/version.rb' %
65
- Lookout::Rake::Tasks::Test::LoaderPath do
66
- stub(Dir).[]{ %w'test.gemspec' }
67
- stub(Gem::Specification).load{ Gem::Specification.new{ |s| s.name = 'test' } }
68
- command = nil
69
- Rake.application = Rake::Application.new
70
- Lookout::Rake::Tasks::Test.new(:files => %w'test/unit/test.rb test/unit/test/version.rb'){ |t|
71
- stub(t).ruby{ |s| command = s }
72
- }
73
- Rake.application[:test].invoke
74
- command
75
- end
76
-
77
- expect '-w -Ilib -- %s -rtest -- test/unit/test.rb test/unit/test/version.rb' %
78
- Lookout::Rake::Tasks::Test::LoaderPath do
79
- command = nil
80
- Rake.application = Rake::Application.new
81
- Lookout::Rake::Tasks::Test.new(:specification => Gem::Specification.new{ |s|
82
- s.name = 'test'
83
- },
84
- :files => %w'test/unit/test.rb test/unit/test/version.rb'){ |t|
85
- stub(t).ruby{ |s| command = s }
86
- }
87
- Rake.application[:test].invoke
88
- command
89
- end
90
-
91
- expect %w'lib' do
92
- stub(Dir).[]{ %w'test.gemspec' }
93
- stub(Gem::Specification).load{ Gem::Specification.new{ |s| s.name = 'test' } }
94
- Rake.application = Rake::Application.new
95
- Lookout::Rake::Tasks::Test.new(:paths => nil,
96
- :files => %w'test/unit/test.rb test/unit/test/version.rb').paths
97
- end
98
-
99
- expect %w'test' do
100
- stub(Dir).[]{ %w'test.gemspec' }
101
- stub(Gem::Specification).load{ Gem::Specification.new{ |s| s.name = 'test' } }
102
- Rake.application = Rake::Application.new
103
- Lookout::Rake::Tasks::Test.new(:paths => nil,
104
- :files => %w'test/unit/test.rb test/unit/test/version.rb').requires
105
- end
106
- end