sploek 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Ehren Murdick
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,17 @@
1
+ = sploek
2
+
3
+ Description goes here.
4
+
5
+ == Note on Patches/Pull Requests
6
+
7
+ * Fork the project.
8
+ * Make your feature addition or bug fix.
9
+ * Add tests for it. This is important so I don't break it in a
10
+ future version unintentionally.
11
+ * Commit, do not mess with rakefile, version, or history.
12
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
13
+ * Send me a pull request. Bonus points for topic branches.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2010 Ehren Murdick. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,48 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "sploek"
8
+ gem.summary = %Q{Auto run specs, flog, reek}
9
+ gem.email = "ehren.murdick@gmail.com"
10
+ gem.homepage = "http://github.com/ehrenmurdick/sploek"
11
+ gem.authors = ["Ehren Murdick"]
12
+ gem.add_development_dependency "rspec", ">= 1.2.9"
13
+
14
+ gem.add_dependency "term-ansicolor", ">= 1.0.5"
15
+
16
+ gem.bindir = "bin"
17
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
18
+ end
19
+ Jeweler::GemcutterTasks.new
20
+ rescue LoadError
21
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
22
+ end
23
+
24
+ require 'spec/rake/spectask'
25
+ Spec::Rake::SpecTask.new(:spec) do |spec|
26
+ spec.libs << 'lib' << 'spec'
27
+ spec.spec_files = FileList['spec/**/*_spec.rb']
28
+ end
29
+
30
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
31
+ spec.libs << 'lib' << 'spec'
32
+ spec.pattern = 'spec/**/*_spec.rb'
33
+ spec.rcov = true
34
+ end
35
+
36
+ task :spec => :check_dependencies
37
+
38
+ task :default => :spec
39
+
40
+ require 'rake/rdoctask'
41
+ Rake::RDocTask.new do |rdoc|
42
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
43
+
44
+ rdoc.rdoc_dir = 'rdoc'
45
+ rdoc.title = "sploek #{version}"
46
+ rdoc.rdoc_files.include('README*')
47
+ rdoc.rdoc_files.include('lib/**/*.rb')
48
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.1
data/bin/sploek ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ system("watchr #{File.join(File.dirname(__FILE__), '..', 'lib', 'sploek.watchr.rb')}")
data/lib/sploek.rb ADDED
File without changes
@@ -0,0 +1,83 @@
1
+ require 'term/ansicolor'
2
+
3
+ puts "sploek initialized"
4
+
5
+ ["on_green", "green", "underline",
6
+ "append_features", "on_yellow",
7
+ "yellow", "blink", "on_blue", "blue",
8
+ "uncolored", "rapid_blink", "on_magenta",
9
+ "reset", "magenta", "negative",
10
+ "on_cyan", "cyan", "concealed",
11
+ "attributes", "on_white", "white",
12
+ "underscore", "strikethrough", "bold",
13
+ "on_black", "black", "dark", "on_red",
14
+ "clear", "red", "coloring?", "italic"].each do |m|
15
+ eval("def #{m}; Term::ANSIColor.#{m}; end")
16
+ end
17
+
18
+ def nl
19
+ "\n"
20
+ end
21
+
22
+
23
+ def find_file match
24
+ path = match.to_s.sub('_spec', '').sub(/^spec\//, '')
25
+
26
+ locations = [
27
+ File.join("app", path),
28
+ File.join("lib", path),
29
+ path
30
+ ]
31
+ if File.exist?(match.to_s) && match.to_s["_spec"].nil?
32
+ match
33
+ elsif path = locations.find {|x| File.exist?(x) }
34
+ path
35
+ end
36
+ end
37
+
38
+ def find_spec match
39
+ locations = [
40
+ File.join("spec", match[1] + "_spec.rb"),
41
+ File.join("spec", match[2] + "_spec.rb"),
42
+ File.join("spec", match[1].sub(/^app/, '') + "_spec.rb")
43
+ ]
44
+ if match[1] =~ /_spec$/
45
+ match
46
+ elsif specpath = locations.find {|x| File.exist?(x) }
47
+ specpath
48
+ end
49
+ end
50
+
51
+ def run_spec match
52
+ specpath = find_spec(match)
53
+ return unless specpath
54
+ print magenta, "spec", reset, " ", specpath, nl
55
+ # result = %x{ spec #{specpath} }
56
+
57
+
58
+ if system("spec #{specpath}")
59
+ system("clear")
60
+ print magenta, "spec", reset, " ", specpath, nl
61
+ print green, "success", reset, nl
62
+ true
63
+ else
64
+ false
65
+ end
66
+ end
67
+
68
+ def run_cmd(cmd, match)
69
+ match = find_file(match)
70
+ return unless match
71
+ puts "=" * 80
72
+ print magenta, cmd, reset, " ", match, nl
73
+ system "#{cmd} #{match}"
74
+ end
75
+
76
+ watch("^(.*/(.*))\.rb$") do |md|
77
+ system "clear"
78
+
79
+ if run_spec(md)
80
+ run_cmd("flog", md)
81
+ run_cmd("reek", md)
82
+ end
83
+ end
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+
3
+ describe "foobar" do
4
+ it do
5
+ true.should == true
6
+ # true.should == 2
7
+ end
8
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,9 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'sploek'
4
+ require 'spec'
5
+ require 'spec/autorun'
6
+
7
+ Spec::Runner.configure do |config|
8
+
9
+ end
@@ -0,0 +1,8 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Sploek" do
4
+ it "fails" do
5
+ true.should be_true
6
+ # fail "hey buddy, you should probably rename this file and start specing for real"
7
+ end
8
+ end
data/sploek.gemspec ADDED
@@ -0,0 +1,62 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{sploek}
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Ehren Murdick"]
12
+ s.date = %q{2010-10-18}
13
+ s.default_executable = %q{sploek}
14
+ s.email = %q{ehren.murdick@gmail.com}
15
+ s.executables = ["sploek"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE",
18
+ "README.rdoc"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ ".gitignore",
23
+ "LICENSE",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "bin/sploek",
28
+ "lib/sploek.rb",
29
+ "lib/sploek.watchr.rb",
30
+ "spec/spec.opts",
31
+ "spec/spec_helper.rb",
32
+ "spec/sploek_spec.rb",
33
+ "sploek.gemspec"
34
+ ]
35
+ s.homepage = %q{http://github.com/ehrenmurdick/sploek}
36
+ s.rdoc_options = ["--charset=UTF-8"]
37
+ s.require_paths = ["lib"]
38
+ s.rubygems_version = %q{1.3.7}
39
+ s.summary = %q{Auto run specs, flog, reek}
40
+ s.test_files = [
41
+ "spec/models/foobar_spec.rb",
42
+ "spec/spec_helper.rb",
43
+ "spec/sploek_spec.rb"
44
+ ]
45
+
46
+ if s.respond_to? :specification_version then
47
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
48
+ s.specification_version = 3
49
+
50
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
51
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
52
+ s.add_runtime_dependency(%q<term-ansicolor>, [">= 1.0.5"])
53
+ else
54
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
55
+ s.add_dependency(%q<term-ansicolor>, [">= 1.0.5"])
56
+ end
57
+ else
58
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
59
+ s.add_dependency(%q<term-ansicolor>, [">= 1.0.5"])
60
+ end
61
+ end
62
+
metadata ADDED
@@ -0,0 +1,114 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sploek
3
+ version: !ruby/object:Gem::Version
4
+ hash: 25
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 1
10
+ version: 0.1.1
11
+ platform: ruby
12
+ authors:
13
+ - Ehren Murdick
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-10-18 00:00:00 -07:00
19
+ default_executable: sploek
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rspec
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 13
30
+ segments:
31
+ - 1
32
+ - 2
33
+ - 9
34
+ version: 1.2.9
35
+ type: :development
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: term-ansicolor
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 29
46
+ segments:
47
+ - 1
48
+ - 0
49
+ - 5
50
+ version: 1.0.5
51
+ type: :runtime
52
+ version_requirements: *id002
53
+ description:
54
+ email: ehren.murdick@gmail.com
55
+ executables:
56
+ - sploek
57
+ extensions: []
58
+
59
+ extra_rdoc_files:
60
+ - LICENSE
61
+ - README.rdoc
62
+ files:
63
+ - .document
64
+ - .gitignore
65
+ - LICENSE
66
+ - README.rdoc
67
+ - Rakefile
68
+ - VERSION
69
+ - bin/sploek
70
+ - lib/sploek.rb
71
+ - lib/sploek.watchr.rb
72
+ - spec/spec.opts
73
+ - spec/spec_helper.rb
74
+ - spec/sploek_spec.rb
75
+ - sploek.gemspec
76
+ - spec/models/foobar_spec.rb
77
+ has_rdoc: true
78
+ homepage: http://github.com/ehrenmurdick/sploek
79
+ licenses: []
80
+
81
+ post_install_message:
82
+ rdoc_options:
83
+ - --charset=UTF-8
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ none: false
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ hash: 3
92
+ segments:
93
+ - 0
94
+ version: "0"
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ hash: 3
101
+ segments:
102
+ - 0
103
+ version: "0"
104
+ requirements: []
105
+
106
+ rubyforge_project:
107
+ rubygems_version: 1.3.7
108
+ signing_key:
109
+ specification_version: 3
110
+ summary: Auto run specs, flog, reek
111
+ test_files:
112
+ - spec/models/foobar_spec.rb
113
+ - spec/spec_helper.rb
114
+ - spec/sploek_spec.rb