appveyor-worker 0.1.0

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: f14958f257a12af7fbc103b824934e60c1278023
4
+ data.tar.gz: 06bf59c8c02a52525f1153977f6982f255a25217
5
+ SHA512:
6
+ metadata.gz: e8cf32d5cb8d580f3575df8f39187bc630d56c717a77de0787bdadf6897830c0225bc97cd9e44d4c674280b46aac591d7ad1eab65136d5286231bbb8dd173c8e
7
+ data.tar.gz: eb0654f08f12ea4a37e57c2b9217965c6968a2cc1cb75afe8c2d0bcc541a552bd5f9a0316802719cdb7f7a8c1258e8edbea1801150f377f9d0375659342579b8
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - '2.3'
4
+ - '2.2'
5
+ - '2.1'
6
+ - '2.0'
@@ -0,0 +1,10 @@
1
+ I: Install dependencies
2
+ bundle install
3
+ --:
4
+ T: Run tests
5
+ bundle exec rake -new_console:c
6
+ C: Console
7
+ bundle console -new_console
8
+ --:
9
+ B: Build
10
+ bundle exec rake build -new_console:c
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in appveyor-worker.gemspec
4
+ gemspec
@@ -0,0 +1,30 @@
1
+ # AppVeyor::Worker
2
+
3
+ [![Build status](https://ci.appveyor.com/api/projects/status/oiqm2v8jcr9td1la?svg=true)](https://ci.appveyor.com/project/ukoloff/appveyor-worker)
4
+
5
+ Access to [AppVeyor](http://www.appveyor.com/)
6
+ [Build Worker API](http://www.appveyor.com/docs/build-worker-api)
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'appveyor-worker'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install appveyor-worker
23
+
24
+ ## Usage
25
+
26
+ ```ruby
27
+ require 'appveyor/worker'
28
+
29
+ AppVeyor::Worker.message "Hello, world!", "It's me"
30
+ ```
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ desc 'Run tests'
4
+ task :test do
5
+ require "minitest/autorun"
6
+
7
+ Dir.glob('./test/*.rb'){|f| require f}
8
+ end
9
+
10
+ task default: :test
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'appveyor/worker/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "appveyor-worker"
8
+ spec.version = AppVeyor::Worker::VERSION
9
+ spec.authors = ["Stas Ukolov"]
10
+ spec.email = ["ukoloff@gmail.com"]
11
+
12
+ spec.summary = 'Access to AppVeyor Build Worker API'
13
+ spec.description = 'Access to AppVeyor Build Worker API'
14
+ spec.homepage = "https://github.com/ukoloff/appveyor-worker"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_dependency "json"
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.9"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "minitest"
27
+ end
@@ -0,0 +1,33 @@
1
+ version: 1.0.{build}-{branch}
2
+
3
+ cache:
4
+ - vendor/bundle
5
+
6
+ environment:
7
+ matrix:
8
+ - RUBY_VERSION: 23
9
+ - RUBY_VERSION: 22
10
+ - RUBY_VERSION: 21
11
+ - RUBY_VERSION: 200
12
+
13
+ install:
14
+ - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
15
+ - bundle config --local path vendor/bundle
16
+ - bundle install
17
+
18
+ build: off
19
+
20
+ before_test:
21
+ - ruby -v
22
+ - gem -v
23
+ - bundle -v
24
+
25
+ test_script:
26
+ - bundle exec rake
27
+
28
+ after_test:
29
+ - bundle exec rake build
30
+
31
+ artifacts:
32
+ - path: pkg/*.gem
33
+ name: Gem
@@ -0,0 +1 @@
1
+ require_relative 'appveyor'
@@ -0,0 +1,4 @@
1
+ module AppVeyor
2
+ end
3
+
4
+ Appveyor = AppVeyor
@@ -0,0 +1,57 @@
1
+ require 'json'
2
+ require 'net/http'
3
+
4
+ require_relative "worker/version"
5
+
6
+ module AppVeyor::Worker
7
+ def self.skip?
8
+ !api
9
+ end
10
+
11
+ def self.message msg, details=nil
12
+ x = api or return
13
+ body = JSON.generate category: 'info',
14
+ message: msg,
15
+ details: details
16
+ x.post '/api/build/messages',
17
+ body,
18
+ 'Content-Length'=>body.length.to_s,
19
+ 'Content-Type'=>'application/json'
20
+ end
21
+
22
+ def self.test info
23
+ x = api or return
24
+ body = JSON.generate info
25
+ x.post '/api/tests',
26
+ body,
27
+ 'Content-Length'=>body.length.to_s,
28
+ 'Content-Type'=>'application/json'
29
+ end
30
+
31
+ def self.env envs
32
+ x = api or return
33
+ envs.each do |k, v|
34
+ body = JSON.generate name: k, value: v
35
+ x.post '/api/build/variables',
36
+ body,
37
+ 'Content-Length'=>body.length.to_s,
38
+ 'Content-Type'=>'application/json'
39
+ end
40
+ end
41
+
42
+ private
43
+
44
+ def self.api
45
+ return if false===@http
46
+ return @http if @http
47
+ unless z = ENV['APPVEYOR_API_URL']
48
+ @http = false
49
+ return
50
+ end
51
+ z = URI z
52
+ @http = x = Net::HTTP.start z.host, z.port
53
+ x.use_ssl='https'==z.scheme
54
+ x
55
+ end
56
+
57
+ end
@@ -0,0 +1,5 @@
1
+ require_relative "../../appveyor"
2
+
3
+ module AppVeyor::Worker
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,22 @@
1
+ require 'yaml'
2
+ require_relative '../appveyor/worker'
3
+
4
+ module Minitest
5
+ def self.plugin_appveyor_init options
6
+ self.reporter << AppVeyor.new unless ::AppVeyor::Worker.skip?
7
+ end
8
+
9
+ class AppVeyor < AbstractReporter
10
+
11
+ def record result
12
+ ::AppVeyor::Worker.test testFramework: 'Minitest',
13
+ testName: result.name,
14
+ fileName: result.class.name,
15
+ outcome: result.skipped? ? 'Ignored' : result.passed? ? 'Passed' : 'Failed',
16
+ durationMilliseconds: result.time*1000,
17
+ StdOut: YAML.dump('assertions'=>result.assertions),
18
+ ErrorStackTrace: (result.failure.backtrace * "\n" rescue nil)
19
+ end
20
+
21
+ end
22
+ end
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: appveyor-worker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Stas Ukolov
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-04-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: json
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.9'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.9'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Access to AppVeyor Build Worker API
70
+ email:
71
+ - ukoloff@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".travis.yml"
78
+ - FarMenu.ini
79
+ - Gemfile
80
+ - README.md
81
+ - Rakefile
82
+ - appveyor-worker.gemspec
83
+ - appveyor.yml
84
+ - lib/app_veyor.rb
85
+ - lib/appveyor.rb
86
+ - lib/appveyor/worker.rb
87
+ - lib/appveyor/worker/version.rb
88
+ - lib/minitest/appveyor_plugin.rb
89
+ homepage: https://github.com/ukoloff/appveyor-worker
90
+ licenses:
91
+ - MIT
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.2.3
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: Access to AppVeyor Build Worker API
113
+ test_files: []