pasture 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +15 -0
- data/README.md +3 -0
- data/bin/pasture +27 -0
- data/lib/pasture/api.rb +22 -0
- data/lib/pasture/logger.rb +5 -0
- data/lib/pasture.rb +2 -0
- metadata +108 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b5ee5c9ad634dba106d17f4143e193d4032e6243
|
4
|
+
data.tar.gz: 3e878e42b80543079ce9477a5544277b5048fb72
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5e5417d759bc727c9d389a89c7f9c2a94a5aa258f59d2e098bbdc9e927488e5852c56faef4408b8c316e4e73a9ac8c5f74e180e08b1efc0343b055f4dec1856b
|
7
|
+
data.tar.gz: a755a4c511411ffd30a585f4f8de1c2f0e72676557786c0a89c46cb603a37fe1ba45caa8d4a4c30de485650335944a9ee25da757107a759ece032fcf12b85eb7
|
data/LICENSE
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Copyright (C) 2015 Puppet Labs Inc
|
2
|
+
|
3
|
+
Puppet Labs can be contacted at: info@puppetlabs.com
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this file except in compliance with the License.
|
7
|
+
You may obtain a copy of the License at
|
8
|
+
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
See the License for the specific language governing permissions and
|
15
|
+
limitations under the License.
|
data/README.md
ADDED
data/bin/pasture
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'pasture'
|
4
|
+
require 'gli'
|
5
|
+
|
6
|
+
module GLIWrapper
|
7
|
+
include GLI::App
|
8
|
+
extend self
|
9
|
+
|
10
|
+
program_desc 'Controller for the pasture service.'
|
11
|
+
|
12
|
+
desc 'Start the pasture service'
|
13
|
+
command :start do |c|
|
14
|
+
c.flag [:c, :config_file, 'config_file'], :desc => 'Specify a configuration file.'
|
15
|
+
c.action do |global_options, options, args|
|
16
|
+
config_file = options[:config_file] || '/etc/pasture_config.yaml'
|
17
|
+
begin
|
18
|
+
options = YAML::load_file(config_file).merge(options)
|
19
|
+
rescue Errno::ENOENT
|
20
|
+
puts "No configuration file found at #{config_file}; continuing with defaults"
|
21
|
+
end
|
22
|
+
Pasture::API.set :pasture_options, options
|
23
|
+
Pasture::API.run!
|
24
|
+
end
|
25
|
+
end
|
26
|
+
exit run(ARGV)
|
27
|
+
end
|
data/lib/pasture/api.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'sinatra/base'
|
2
|
+
require 'cowsay'
|
3
|
+
|
4
|
+
module Pasture
|
5
|
+
|
6
|
+
class API < Sinatra::Base
|
7
|
+
|
8
|
+
include Cowsay
|
9
|
+
|
10
|
+
helpers do
|
11
|
+
def options
|
12
|
+
settings.pasture_options
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
get '/' do
|
17
|
+
Cowsay.say(params[:string] || "", options['character'])
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
data/lib/pasture.rb
ADDED
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pasture
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kevin Henner
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-12-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cowsay
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.3'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: gli
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.12'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.12'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sinatra
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.4'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.4'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mono_logger
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.1'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.1'
|
69
|
+
description: Pasture provides a RESTful API to serve all your cowsay needs.
|
70
|
+
email:
|
71
|
+
- kevin@puppetlabs.com
|
72
|
+
executables:
|
73
|
+
- pasture
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- LICENSE
|
78
|
+
- README.md
|
79
|
+
- bin/pasture
|
80
|
+
- lib/pasture.rb
|
81
|
+
- lib/pasture/api.rb
|
82
|
+
- lib/pasture/logger.rb
|
83
|
+
homepage: http://github.com/puppetlabs/pasture
|
84
|
+
licenses:
|
85
|
+
- Apache 2.0
|
86
|
+
metadata: {}
|
87
|
+
post_install_message:
|
88
|
+
rdoc_options: []
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - '>='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
requirements: []
|
102
|
+
rubyforge_project:
|
103
|
+
rubygems_version: 2.4.8
|
104
|
+
signing_key:
|
105
|
+
specification_version: 4
|
106
|
+
summary: Cowsay as a service (CaaS).
|
107
|
+
test_files: []
|
108
|
+
has_rdoc:
|