coverme 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d6abaed75292a0706a15e6c17a3fe5e1c60c2bf7
4
+ data.tar.gz: 6a62198c4a096eaa4bccb70923153880a559fa7b
5
+ SHA512:
6
+ metadata.gz: e00eade018ff2b4e42f3323800e84d72ec38d1b515aedd824623ef83c8c6f15b864e19e3b42150ed3b31a860e1225c7dfa33c259049b9762817d6609d6910e81
7
+ data.tar.gz: 3a9c6a09c6ac3adab40ee7a9a21c34b65df2984dd9afd238ae4a791716c670a9af9075597cf50ff3c99e0555e7b8c4b5af21efb489eccd3957a9fbeedd433290
@@ -0,0 +1,22 @@
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
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.2
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in coverme.gemspec
4
+ gemspec
5
+
6
+ gem "bundler", "~> 1.6"
7
+ gem "rake"
8
+ gem "rspec"
9
+ gem "guard-rspec"
@@ -0,0 +1,6 @@
1
+ guard :rspec, cmd: 'bundle exec rspec' do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
+ watch('spec/spec_helper.rb') { "spec" }
5
+ end
6
+
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Martin Schneider
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,29 @@
1
+ # Coverme
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'coverme'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install coverme
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( https://github.com/[my-github-username]/coverme/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create a new Pull Request
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+
File without changes
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'coverme/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "coverme"
8
+ spec.version = Coverme::VERSION
9
+ spec.authors = ["Martin Schneider"]
10
+ spec.email = ["info@outsmartin.de"]
11
+ spec.summary = %q{Client to send data to coverme.io}
12
+ spec.description = %q{This is a gem to easily set up coverage reporting for coverme.io. Currently
13
+ it supports only SimpleCov JSON reports.}
14
+ spec.homepage = "http://coverme.io"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0")
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(spec|features)/})
20
+ spec.require_paths = ["lib"]
21
+ end
@@ -0,0 +1,31 @@
1
+ require "coverme/version"
2
+ require "ostruct"
3
+ require 'net/http'
4
+ require 'uri'
5
+
6
+ module Coverme
7
+ class << self
8
+ def config
9
+ @config ||= OpenStruct.new
10
+ end
11
+
12
+ def ship_it(json)
13
+ raise TokenMissingError if !config.token
14
+ project_token = config.token
15
+ host_uri = config.uri || 'http://coverme.io'
16
+ uri = URI.parse("#{host_uri}/api/runs")
17
+
18
+ body = {
19
+ 'run[test]' => json,
20
+ 'token' => project_token,
21
+ }
22
+
23
+ current_commit = `git rev-parse HEAD`
24
+ if $?.success?
25
+ body['run[commit]'] = current_commit
26
+ end
27
+
28
+ Net::HTTP.post_form( uri, body )
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,3 @@
1
+ module Coverme
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe Coverme do
4
+ it 'has a version number' do
5
+ expect(Coverme::VERSION).not_to be nil
6
+ end
7
+
8
+ it '.config' do
9
+ Coverme.config.token = 'project_token'
10
+ expect(Coverme.config.token).to eq 'project_token'
11
+ end
12
+
13
+ it '.ship_it' do
14
+ json = '{}'
15
+ Coverme.config.token = 'project_token'
16
+ expect(Net::HTTP).to receive(:post_form)
17
+ Coverme.ship_it(json)
18
+ end
19
+ end
@@ -0,0 +1,2 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require 'coverme'
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: coverme
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Martin Schneider
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-07 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |-
14
+ This is a gem to easily set up coverage reporting for coverme.io. Currently
15
+ it supports only SimpleCov JSON reports.
16
+ email:
17
+ - info@outsmartin.de
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - ".gitignore"
23
+ - ".rspec"
24
+ - ".travis.yml"
25
+ - Gemfile
26
+ - Guardfile
27
+ - LICENSE
28
+ - README.md
29
+ - Rakefile
30
+ - config/environment.rb
31
+ - coverme.gemspec
32
+ - lib/coverme.rb
33
+ - lib/coverme/version.rb
34
+ - spec/lib/coverme_spec.rb
35
+ - spec/spec_helper.rb
36
+ homepage: http://coverme.io
37
+ licenses:
38
+ - MIT
39
+ metadata: {}
40
+ post_install_message:
41
+ rdoc_options: []
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ requirements: []
55
+ rubyforge_project:
56
+ rubygems_version: 2.2.2
57
+ signing_key:
58
+ specification_version: 4
59
+ summary: Client to send data to coverme.io
60
+ test_files:
61
+ - spec/lib/coverme_spec.rb
62
+ - spec/spec_helper.rb