infrataster-plugin-ssl_certificates 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2be075f13659eafd7c7edbedc8e382f9a74c7a6d
4
+ data.tar.gz: 5d69801417ad3a7744bab1fa90028203de8955d2
5
+ SHA512:
6
+ metadata.gz: 7b8607911436b76081d821f71605cad7d782cf231956deae810f24d0a2f363a22a0b7132e4f8c709a0a4f34d06a79c91bfff5c3a04250889a641fbef2746915b
7
+ data.tar.gz: 9abba59b9b5b75faedd189b4c2b70a50480d11f3c982eb9036a176cb2cadc91371ec57697d6796c1c7f6f360ad11d05305678860bc171d7d08fb8a5d96b3b6af
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in infrataster-plugin-ssl_certificates.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Kazuma Muramatsu
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,39 @@
1
+ # Infrataster::Plugin::SslCertificates
2
+
3
+ Check SSL certificates plugin for [infrataster](https://github.com/ryotarai/infrataster)
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'infrataster-plugin-ssl_certificates'
11
+ ```
12
+
13
+ And then add the following line to your spec_helper.rb:
14
+
15
+ ```ruby
16
+ require 'infrataster-plugin-ssl_certificates'
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```ruby
22
+ # spec/example_spec.rb
23
+ reuqire 'spec_helper'
24
+
25
+ describe server(:app) do
26
+ describe domain('https://www.example.com') do
27
+ it { expect(certificate.serial).to eq(1234567) }
28
+ it { expect(certificate.not_after.to_s).to eq("2015-12-31 18:00:00 UTC") }
29
+ end
30
+ end
31
+ ```
32
+
33
+ ## Contributing
34
+
35
+ 1. Fork it ( https://github.com/[my-github-username]/infrataster-plugin-ssl_certificates/fork )
36
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
37
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
38
+ 4. Push to the branch (`git push origin my-new-feature`)
39
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ desc 'Run unit tests'
5
+ task :spec => ['spec:unit']
6
+
7
+ namespace :spec do
8
+ RSpec::Core::RakeTask.new("unit") do |task|
9
+ task.pattern = "./spec/*_spec.rb"
10
+ end
11
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'infrataster_plugin_ssl_certificates/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "infrataster-plugin-ssl_certificates"
8
+ spec.version = Infrataster::Plugin::SslCertificates::VERSION
9
+ spec.authors = ["Kazuma Muramatsu"]
10
+ spec.email = ["muramatu.k@gmail.com"]
11
+ spec.summary = %q{Check SSL certificates plugin for infrataster}
12
+ spec.description = %q{Check SSL certificates plugin for infrataster}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency 'infrataster', '~> 0.2.0'
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.7"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rspec", "~> 3.0"
26
+ end
@@ -0,0 +1,5 @@
1
+ require 'infrataster_plugin_ssl_certificates/version'
2
+
3
+ require 'infrataster/resources/ssl_certificates_resource'
4
+ require 'infrataster/contexts/ssl_certificates_context'
5
+ require 'infrataster/helpers/ssl_certificates_resource_helper'
@@ -0,0 +1,17 @@
1
+ require 'infrataster'
2
+ require 'net/https'
3
+
4
+ module Infrataster
5
+ module Contexts
6
+ class SslCertificatesContext < BaseContext
7
+ def certificate
8
+ https = Net::HTTP.new(resource.url.host, resource.url.port)
9
+ https.use_ssl = true
10
+ https.verify_mode = OpenSSL::SSL::VERIFY_PEER
11
+ https.start do
12
+ https.peer_cert
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ require 'rspec'
2
+ require 'infrataster/resources'
3
+
4
+ module Infrataster
5
+ module Helpers
6
+ module ResourceHelper
7
+ def domain(*args)
8
+ Resources::SslCertificatesResource.new(*args)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,19 @@
1
+ require 'infrataster'
2
+
3
+ module Infrataster
4
+ module Resources
5
+ class SslCertificatesResource < BaseResource
6
+ Error = Class.new(StandardError)
7
+
8
+ attr_reader :url
9
+
10
+ def initialize(url)
11
+ @url = URI.parse(url)
12
+ end
13
+
14
+ def to_s
15
+ "SSL Certification: #{@url}"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,7 @@
1
+ module Infrataster
2
+ module Plugin
3
+ module SslCertificates
4
+ VERSION = '0.0.1'
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: infrataster-plugin-ssl_certificates
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kazuma Muramatsu
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: infrataster
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.2.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.2.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.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
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: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ description: Check SSL certificates plugin for infrataster
70
+ email:
71
+ - muramatu.k@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - LICENSE.txt
79
+ - README.md
80
+ - Rakefile
81
+ - infrataster-plugin-ssl_certificates.gemspec
82
+ - lib/infrataster-plugin-ssl_certificates.rb
83
+ - lib/infrataster/contexts/ssl_certificates_context.rb
84
+ - lib/infrataster/helpers/ssl_certificates_resource_helper.rb
85
+ - lib/infrataster/resources/ssl_certificates_resource.rb
86
+ - lib/infrataster_plugin_ssl_certificates/version.rb
87
+ homepage: ''
88
+ licenses:
89
+ - MIT
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.4.5
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: Check SSL certificates plugin for infrataster
111
+ test_files: []