thong 0.0.1

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.
data/.gitignore ADDED
@@ -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/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in thong.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Telmo
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.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # Thong
2
+
3
+ _Because sometimes you don't want to cover it all_
4
+
5
+ Thong is a tongue in cheek reference to [coveralls](https://coveralls.io/). The purpose of thong is to provide similar capabilities to what [coveralls](https://coveralls.io/) provides for GitHub but being self hosted.
6
+
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ gem 'thong'
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install thong
21
+
22
+ ## Usage
23
+
24
+ in your `spec_helper` add the following before requiring your application's code
25
+
26
+ ```
27
+ require 'thong'
28
+ Thong.wear!
29
+ ```
30
+ That's it
31
+
32
+ ## Contributing
33
+
34
+ 1. Fork it
35
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
36
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
37
+ 4. Push to the branch (`git push origin my-new-feature`)
38
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,16 @@
1
+ require 'json'
2
+ module Thong
3
+ module SimpleCov
4
+ class Formatter
5
+ def format(result)
6
+ result.files.each { |f|
7
+ filename = f.filename.gsub(::SimpleCov.root, '')
8
+ puts "#{filename} - #{f.covered_percent.round(2)}%"
9
+ }
10
+ puts "Coverage is at #{result.covered_percent.round(2)}%.
11
+ #{result.covered_lines} lines covered by test.
12
+ #{result.missed_lines} lines not covered by test"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,3 @@
1
+ module Thong
2
+ VERSION = "0.0.1"
3
+ end
data/lib/thong.rb ADDED
@@ -0,0 +1,42 @@
1
+ require 'colorize'
2
+ require 'simplecov'
3
+ require "thong/version"
4
+ require "thong/simplecov"
5
+
6
+ module Thong
7
+ extend self
8
+
9
+ attr_accessor :adapter
10
+
11
+ def wear!(simplecov_setting=nil, &block)
12
+ setup!
13
+ start! simplecov_setting, &block
14
+ end
15
+
16
+ def setup!
17
+ ::SimpleCov.formatter = Thong::SimpleCov::Formatter
18
+ puts "[Thong] Setting up the SimpleCov formatter.".colorize(:green)
19
+ end
20
+
21
+
22
+ def start!(simplecov_setting = 'test_frameworks', &block)
23
+ ::SimpleCov.add_filter 'vendor'
24
+ ::SimpleCov.add_filter 'spec'
25
+
26
+ if simplecov_setting
27
+ puts "[Thong] Using SimpleCov's '#{simplecov_setting}' settings.".colorize(:green)
28
+ if block_given?
29
+ ::SimpleCov.start(simplecov_setting) { instance_eval &block }
30
+ else
31
+ ::SimpleCov.start(simplecov_setting)
32
+ end
33
+ elsif block_given?
34
+ puts "[Thong] Using SimpleCov settings defined in block".colorize(:green)
35
+ ::SimpleCov.start { instance_eval &block }
36
+ else
37
+ puts "[Thong] Using SimpleCov with default settings".colorize(:green)
38
+ ::SimpleCov.start
39
+ end
40
+ end
41
+
42
+ end
data/thong.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'thong/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "thong"
8
+ gem.version = Thong::VERSION
9
+ gem.authors = ["Telmo"]
10
+ gem.email = ["telmox@gmail.com"]
11
+ gem.description = %q{Self hosted version of CoverAlls}
12
+ gem.summary = %q{Self hosted version of CoverAlls}
13
+ gem.homepage = ""
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.add_dependency 'simplecov', ">= 0.7"
21
+ gem.add_dependency 'colorize'
22
+ gem.add_dependency 'rest-client'
23
+
24
+ gem.add_development_dependency 'rspec'
25
+ gem.add_development_dependency 'rake'
26
+ gem.add_development_dependency 'webmock', '1.7'
27
+ gem.add_development_dependency 'vcr', '1.11.3'
28
+ end
metadata ADDED
@@ -0,0 +1,137 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: thong
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Telmo
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-09-21 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: simplecov
16
+ requirement: &9710000 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0.7'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *9710000
25
+ - !ruby/object:Gem::Dependency
26
+ name: colorize
27
+ requirement: &9709380 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *9709380
36
+ - !ruby/object:Gem::Dependency
37
+ name: rest-client
38
+ requirement: &9708680 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *9708680
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: &9707480 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *9707480
58
+ - !ruby/object:Gem::Dependency
59
+ name: rake
60
+ requirement: &9723080 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *9723080
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: &9722320 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - =
75
+ - !ruby/object:Gem::Version
76
+ version: '1.7'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *9722320
80
+ - !ruby/object:Gem::Dependency
81
+ name: vcr
82
+ requirement: &9721260 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - =
86
+ - !ruby/object:Gem::Version
87
+ version: 1.11.3
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: *9721260
91
+ description: Self hosted version of CoverAlls
92
+ email:
93
+ - telmox@gmail.com
94
+ executables: []
95
+ extensions: []
96
+ extra_rdoc_files: []
97
+ files:
98
+ - .gitignore
99
+ - Gemfile
100
+ - LICENSE.txt
101
+ - README.md
102
+ - Rakefile
103
+ - lib/thong.rb
104
+ - lib/thong/simplecov.rb
105
+ - lib/thong/version.rb
106
+ - thong.gemspec
107
+ homepage: ''
108
+ licenses: []
109
+ post_install_message:
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ segments:
120
+ - 0
121
+ hash: 1682490243110641045
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ segments:
129
+ - 0
130
+ hash: 1682490243110641045
131
+ requirements: []
132
+ rubyforge_project:
133
+ rubygems_version: 1.8.11
134
+ signing_key:
135
+ specification_version: 3
136
+ summary: Self hosted version of CoverAlls
137
+ test_files: []