spackle 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +166 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/bin/ruby-project-root +14 -0
- data/bin/spackle +14 -0
- data/bin/spackle-vim-load-quickfix +47 -0
- data/bin/spackle-vim-open +49 -0
- data/lib/spackle/commandline.rb +53 -0
- data/lib/spackle/configuration.rb +37 -0
- data/lib/spackle/error.rb +31 -0
- data/lib/spackle/helpers/ruby_project_root.rb +34 -0
- data/lib/spackle/output/base.rb +44 -0
- data/lib/spackle/output/vim_quickfix.rb +7 -0
- data/lib/spackle/output.rb +2 -0
- data/lib/spackle/spec/base_formatter.rb +22 -0
- data/lib/spackle/spec/spackle_formatter.rb +14 -0
- data/lib/spackle/spec.rb +1 -0
- data/lib/spackle.rb +104 -0
- data/spec/integration_spec.rb +84 -0
- data/spec/spackle/commandline_spec.rb +48 -0
- data/spec/spackle/configuration_spec.rb +43 -0
- data/spec/spackle/error_spec.rb +34 -0
- data/spec/spackle/output/base_spec.rb +53 -0
- data/spec/spackle/output/vim_quickfix_spec.rb +25 -0
- data/spec/spackle/spec/base_formatter_spec.rb +15 -0
- data/spec/spackle/spec/spackle_formatter_spec.rb +58 -0
- data/spec/spackle_error_fixture.rb +10 -0
- data/spec/spackle_spec.rb +203 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +14 -0
- data/spec/test_app_helper.rb +55 -0
- data/support/vim/spackle.vim +17 -0
- data/test_app/lib/error_raiser.rb +7 -0
- data/test_app/lib/method_typo.rb +7 -0
- data/test_app/lib/missing_end.rb +7 -0
- data/test_app/lib/working_class.rb +7 -0
- data/test_app/spec/error_raiser_spec.rb +14 -0
- data/test_app/spec/failing_working_class_spec.rb +14 -0
- data/test_app/spec/method_typo_spec.rb +14 -0
- data/test_app/spec/missing_end_spec.rb +13 -0
- data/test_app/spec/passing_working_class_spec.rb +14 -0
- data/test_app/spec/spec_helper.rb +8 -0
- metadata +127 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
|
+
require 'spackle'
|
4
|
+
require 'spec'
|
5
|
+
require 'spec/autorun'
|
6
|
+
|
7
|
+
|
8
|
+
require 'test_app_helper'
|
9
|
+
require 'spackle_error_fixture'
|
10
|
+
|
11
|
+
|
12
|
+
Spec::Runner.configure do |config|
|
13
|
+
config.include SpackleErrorFixture
|
14
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'tempfile'
|
2
|
+
|
3
|
+
module TestAppHelper
|
4
|
+
TEST_APP_DIR = File.join(File.dirname(__FILE__), '../test_app')
|
5
|
+
class Spec
|
6
|
+
attr_reader :status, :test_error, :test_output, :spackle_output, :dot_spackle
|
7
|
+
attr_accessor :spec_name
|
8
|
+
def initialize
|
9
|
+
self.spec_name = spec_name
|
10
|
+
write_dot_spackle
|
11
|
+
ENV['SPACKLE_CONFIG'] = @dot_spackle.path
|
12
|
+
end
|
13
|
+
|
14
|
+
def spackle_output_file
|
15
|
+
@spackle_output_file ||= Tempfile.new("spackle")
|
16
|
+
end
|
17
|
+
|
18
|
+
def write_dot_spackle
|
19
|
+
@dot_spackle = Tempfile.open("spackle")
|
20
|
+
@dot_spackle.puts <<-END
|
21
|
+
Spackle.configure do |c|
|
22
|
+
c.set_defaults_for :vim
|
23
|
+
c.spackle_file = "#{File.basename(spackle_output_file.path)}"
|
24
|
+
c.tempdir = "#{File.dirname(spackle_output_file.path)}"
|
25
|
+
c.callback_command = "/bin/true"
|
26
|
+
end
|
27
|
+
END
|
28
|
+
@dot_spackle.close
|
29
|
+
end
|
30
|
+
|
31
|
+
def spec_opts
|
32
|
+
"-r ../lib/spackle --format Spackle::Spec::SpackleFormatter"
|
33
|
+
end
|
34
|
+
|
35
|
+
def command
|
36
|
+
"spec #{spec_opts} spec/#{spec_name.to_s}_spec.rb"
|
37
|
+
end
|
38
|
+
|
39
|
+
def run(spec_name)
|
40
|
+
@spec_name = spec_name
|
41
|
+
Dir.chdir TEST_APP_DIR
|
42
|
+
saved_stderr = STDERR.dup
|
43
|
+
STDERR.reopen("/dev/null")
|
44
|
+
@test_output = `#{command}`
|
45
|
+
STDERR.reopen(saved_stderr)
|
46
|
+
@status = $?
|
47
|
+
@spackle_output = File.read(spackle_output_file.path)
|
48
|
+
end
|
49
|
+
|
50
|
+
def exitstatus
|
51
|
+
@status.exitstatus
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
" SpacklePlugin Load a quickfix file via the Vim remote interface
|
2
|
+
" URL: http://github.com/rleemorlang/spackle
|
3
|
+
"
|
4
|
+
"
|
5
|
+
|
6
|
+
if &cp || (exists("g:loaded_spackle") && g:loaded_spackle)
|
7
|
+
finish
|
8
|
+
endif
|
9
|
+
let g:loaded_spackle = 1
|
10
|
+
|
11
|
+
|
12
|
+
function! LoadSpackleQuickfix(path)
|
13
|
+
execute "cgetfile " a:path
|
14
|
+
echon "Loaded quickfix from '" a:path "'"
|
15
|
+
cw
|
16
|
+
endfunction
|
17
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
require 'working_class'
|
4
|
+
|
5
|
+
# REMEMBER: we want this test to FAIL
|
6
|
+
|
7
|
+
describe WorkingClass do
|
8
|
+
it "should return false" do
|
9
|
+
WorkingClass.a_method.should be_false
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
require 'working_class'
|
4
|
+
|
5
|
+
# this is the one spec we want to be passing
|
6
|
+
|
7
|
+
describe WorkingClass do
|
8
|
+
it "should return true" do
|
9
|
+
WorkingClass.a_method.should be_true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
|
metadata
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spackle
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rick Lee-Morlang
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-11-17 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rspec
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.2.9
|
24
|
+
version:
|
25
|
+
description: "\n\
|
26
|
+
Spackle tells your editor about the errors in your code. No more need to \n\
|
27
|
+
visually scan your test output for errors, filenames, and line numbers.\n\
|
28
|
+
Just tell your editor to jump to the next error location.\n\
|
29
|
+
\t\t"
|
30
|
+
email: rick@lee-morlang.com
|
31
|
+
executables:
|
32
|
+
- spackle
|
33
|
+
- spackle-vim-open
|
34
|
+
- ruby-project-root
|
35
|
+
- spackle-vim-load-quickfix
|
36
|
+
extensions: []
|
37
|
+
|
38
|
+
extra_rdoc_files:
|
39
|
+
- LICENSE
|
40
|
+
- README.rdoc
|
41
|
+
files:
|
42
|
+
- .document
|
43
|
+
- .gitignore
|
44
|
+
- LICENSE
|
45
|
+
- README.rdoc
|
46
|
+
- Rakefile
|
47
|
+
- VERSION
|
48
|
+
- bin/ruby-project-root
|
49
|
+
- bin/spackle
|
50
|
+
- bin/spackle-vim-load-quickfix
|
51
|
+
- bin/spackle-vim-open
|
52
|
+
- lib/spackle.rb
|
53
|
+
- lib/spackle/commandline.rb
|
54
|
+
- lib/spackle/configuration.rb
|
55
|
+
- lib/spackle/error.rb
|
56
|
+
- lib/spackle/helpers/ruby_project_root.rb
|
57
|
+
- lib/spackle/output.rb
|
58
|
+
- lib/spackle/output/base.rb
|
59
|
+
- lib/spackle/output/vim_quickfix.rb
|
60
|
+
- lib/spackle/spec.rb
|
61
|
+
- lib/spackle/spec/base_formatter.rb
|
62
|
+
- lib/spackle/spec/spackle_formatter.rb
|
63
|
+
- spec/integration_spec.rb
|
64
|
+
- spec/spackle/commandline_spec.rb
|
65
|
+
- spec/spackle/configuration_spec.rb
|
66
|
+
- spec/spackle/error_spec.rb
|
67
|
+
- spec/spackle/output/base_spec.rb
|
68
|
+
- spec/spackle/output/vim_quickfix_spec.rb
|
69
|
+
- spec/spackle/spec/base_formatter_spec.rb
|
70
|
+
- spec/spackle/spec/spackle_formatter_spec.rb
|
71
|
+
- spec/spackle_error_fixture.rb
|
72
|
+
- spec/spackle_spec.rb
|
73
|
+
- spec/spec.opts
|
74
|
+
- spec/spec_helper.rb
|
75
|
+
- spec/test_app_helper.rb
|
76
|
+
- support/vim/spackle.vim
|
77
|
+
- test_app/lib/error_raiser.rb
|
78
|
+
- test_app/lib/method_typo.rb
|
79
|
+
- test_app/lib/missing_end.rb
|
80
|
+
- test_app/lib/working_class.rb
|
81
|
+
- test_app/spec/error_raiser_spec.rb
|
82
|
+
- test_app/spec/failing_working_class_spec.rb
|
83
|
+
- test_app/spec/method_typo_spec.rb
|
84
|
+
- test_app/spec/missing_end_spec.rb
|
85
|
+
- test_app/spec/passing_working_class_spec.rb
|
86
|
+
- test_app/spec/spec_helper.rb
|
87
|
+
has_rdoc: true
|
88
|
+
homepage: http://github.com/rleemorlang/spackle
|
89
|
+
licenses: []
|
90
|
+
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options:
|
93
|
+
- --charset=UTF-8
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: "0"
|
101
|
+
version:
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: "0"
|
107
|
+
version:
|
108
|
+
requirements: []
|
109
|
+
|
110
|
+
rubyforge_project:
|
111
|
+
rubygems_version: 1.3.5
|
112
|
+
signing_key:
|
113
|
+
specification_version: 3
|
114
|
+
summary: Spackle tells your editor about the errors in your code
|
115
|
+
test_files:
|
116
|
+
- spec/spackle/error_spec.rb
|
117
|
+
- spec/spackle/output/vim_quickfix_spec.rb
|
118
|
+
- spec/spackle/output/base_spec.rb
|
119
|
+
- spec/spackle/spec/spackle_formatter_spec.rb
|
120
|
+
- spec/spackle/spec/base_formatter_spec.rb
|
121
|
+
- spec/spackle/commandline_spec.rb
|
122
|
+
- spec/spackle/configuration_spec.rb
|
123
|
+
- spec/spackle_spec.rb
|
124
|
+
- spec/integration_spec.rb
|
125
|
+
- spec/test_app_helper.rb
|
126
|
+
- spec/spackle_error_fixture.rb
|
127
|
+
- spec/spec_helper.rb
|