opscode 0.7.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Gemfile +8 -0
- data/Guardfile +5 -0
- data/LICENSE.txt +15 -0
- data/README.md +80 -0
- data/Rakefile +6 -0
- data/bin/opscode +11 -0
- data/lib/opscode.rb +28 -0
- data/lib/opscode/version.rb +3 -0
- data/opscode.gemspec +24 -0
- data/spec/lib/opscode_spec.rb +37 -0
- data/spec/spec_helper.rb +2 -0
- metadata +103 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 41c26f355c76c467271f1e033e5ea3a624c7f8d6
|
4
|
+
data.tar.gz: d4c581b858c5121687aca54f5fb017b81db016ad
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b054ddd13fa4ebfd0524043f1a47ff47782c4d0d88dff3c11eaced0982d619f7d506ca6da7cd5779e1b896eeb6fbe15c096a725e8be811d79ab31dc2b9ac2288
|
7
|
+
data.tar.gz: 320864fce78b029e854bbe6c369e06a969fe7d6e93a9bd198ef3c3efb8228eeed628773aa89335a8b3f0cc4020d90650538686f2c946bdc80d3476a84ee0f2d7
|
data/.gitignore
ADDED
@@ -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
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Author:: Fletcher Nichol (<fnichol@nichol.ca>)
|
2
|
+
|
3
|
+
Copyright 2014 Fletcher Nichol
|
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
@@ -0,0 +1,80 @@
|
|
1
|
+
# Opscode: An Infrastructure Code Workflow Tool
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/opscode.png)](http://badge.fury.io/rb/opscode)
|
4
|
+
[![Build Status](https://travis-ci.org/fnichol/opscode.png?branch=master)](https://travis-ci.org/fnichol/opscode)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/fnichol/opscode.png)](https://codeclimate.com/github/fnichol/opscode)
|
6
|
+
[![Dependency Status](https://gemnasium.com/fnichol/opscode.png)](https://gemnasium.com/fnichol/opscode)
|
7
|
+
|
8
|
+
Unify your source code management tools into a single development/release workflow that can be used by your entire team. Opscode is a minimal, zero dependency Ruby library that screams simplicity. Currently most major SCM tools are supported, including:
|
9
|
+
|
10
|
+
* [Git](http://git-scm.com/)
|
11
|
+
* [Mercurial](http://mercurial.selenic.com/)
|
12
|
+
* [Darcs](http://darcs.net/)
|
13
|
+
* [Bazaar](http://bazaar.canonical.com/)
|
14
|
+
* [Fossil](http://www.fossil-scm.org/index.html/doc/tip/www/index.wiki)
|
15
|
+
* [Subversion](https://issues.apache.org/jira/plugins/servlet/mobile#issue/INFRA-7524)
|
16
|
+
* [CVS](http://www.nongnu.org/cvs/)
|
17
|
+
|
18
|
+
## Installation
|
19
|
+
|
20
|
+
Add this line to your application's Gemfile:
|
21
|
+
|
22
|
+
gem 'opscode'
|
23
|
+
|
24
|
+
And then execute:
|
25
|
+
|
26
|
+
$ bundle
|
27
|
+
|
28
|
+
Or install it yourself as:
|
29
|
+
|
30
|
+
$ gem install opscode
|
31
|
+
|
32
|
+
## Usage
|
33
|
+
|
34
|
+
After installation, you will have an `opscode` command to run your various workflows.
|
35
|
+
|
36
|
+
To check the installed version:
|
37
|
+
|
38
|
+
$ opscode version
|
39
|
+
|
40
|
+
Other commands depend on your chosen SCM tool. For example, using the default Git implementation:
|
41
|
+
|
42
|
+
$ opscode checkout https://github.com/opscode/chef.git
|
43
|
+
|
44
|
+
To use another SCM tool you will need to export an environment variable `OPSCODE_SCM`. For example, to use Subversion:
|
45
|
+
|
46
|
+
$ export OPSCODE_SCM=svn
|
47
|
+
$ opscode checkout https://github.com/opscode/chef
|
48
|
+
|
49
|
+
More detailed usage depends on your SCM tool, but most will provide more information with:
|
50
|
+
|
51
|
+
$ opscode help
|
52
|
+
|
53
|
+
## Development
|
54
|
+
|
55
|
+
* Source hosted at [GitHub][repo]
|
56
|
+
* Report issues/questions/feature requests on [GitHub Issues][issues]
|
57
|
+
|
58
|
+
Pull requests are very welcome! Make sure your patches are well tested.
|
59
|
+
Ideally create a topic branch for every separate change you make. For
|
60
|
+
example:
|
61
|
+
|
62
|
+
1. Fork the repo
|
63
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
64
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
65
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
66
|
+
5. Create new Pull Request
|
67
|
+
|
68
|
+
## <a name="authors"></a> Authors
|
69
|
+
|
70
|
+
Created and maintained by [Fletcher Nichol][fnichol] (<fnichol@nichol.ca>)
|
71
|
+
|
72
|
+
## <a name="license"></a> License
|
73
|
+
|
74
|
+
Apache 2.0 (see [LICENSE.txt][license])
|
75
|
+
|
76
|
+
[license]: https://github.com/fnichol/opscode/blob/master/LICENSE.txt
|
77
|
+
[fnichol]: https://github.com/fnichol
|
78
|
+
[repo]: https://github.com/fnichol/opscode
|
79
|
+
[issues]: https://github.com/fnichol/opscode/issues
|
80
|
+
[contributors]: https://github.com/fnichol/opscode/contributors
|
data/Rakefile
ADDED
data/bin/opscode
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- encoding: utf-8 -*-
|
3
|
+
|
4
|
+
# Trap interrupts to quit cleanly. See
|
5
|
+
# https://twitter.com/mitchellh/status/283014103189053442
|
6
|
+
Signal.trap("INT") { exit 1 }
|
7
|
+
|
8
|
+
$:.unshift File.join(File.dirname(__FILE__), %w{.. lib})
|
9
|
+
require 'opscode'
|
10
|
+
|
11
|
+
Opscode::CLI.new(ARGV.dup, scm: ENV["OPSCODE_SCM"]).run
|
data/lib/opscode.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require "opscode/version"
|
2
|
+
|
3
|
+
module Opscode
|
4
|
+
|
5
|
+
class CLI
|
6
|
+
|
7
|
+
attr_reader :argv
|
8
|
+
|
9
|
+
def initialize(argv, opts = {})
|
10
|
+
@stdout_io = opts[:stdout_io] || $stdout
|
11
|
+
@scm = opts[:scm] || "git"
|
12
|
+
@argv = Array(argv)
|
13
|
+
end
|
14
|
+
|
15
|
+
def run
|
16
|
+
case argv.first
|
17
|
+
when "version", "--version", "-v", "-version"
|
18
|
+
stdout_io.puts "Opscode version #{Opscode::VERSION}"
|
19
|
+
else
|
20
|
+
exec(scm, *argv)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
attr_reader :stdout_io, :scm
|
27
|
+
end
|
28
|
+
end
|
data/opscode.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'opscode/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "opscode"
|
8
|
+
spec.version = Opscode::VERSION
|
9
|
+
spec.authors = ["Fletcher Nichol"]
|
10
|
+
spec.email = ["fnichol@nichol.ca"]
|
11
|
+
spec.summary = %q{Infrastructure code workflow tool}
|
12
|
+
spec.description = spec.summary
|
13
|
+
spec.homepage = "https://github.com/fnichol/opscode"
|
14
|
+
spec.license = "Apache 2.0"
|
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_development_dependency "bundler", "~> 1.6"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "stringio"
|
3
|
+
|
4
|
+
describe Opscode do
|
5
|
+
|
6
|
+
it 'has a version number' do
|
7
|
+
expect(Opscode::VERSION).not_to be nil
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
describe Opscode::CLI do
|
12
|
+
|
13
|
+
let(:io) { StringIO.new }
|
14
|
+
|
15
|
+
it "#argv returns arguments" do
|
16
|
+
expect(Opscode::CLI.new(%w{one two three}).argv).to eq(%w{one two three})
|
17
|
+
end
|
18
|
+
|
19
|
+
%w{version --version -v -version}.each do |arg|
|
20
|
+
it "with argv '#{arg}' returns a version string" do
|
21
|
+
Opscode::CLI.new([arg], stdout_io: io).run
|
22
|
+
expect(io.string).to eq("Opscode version #{Opscode::VERSION}\n")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it "with any other arguments delegate to the SCM tool" do
|
27
|
+
cli = Opscode::CLI.new(%w{checkout mainline}, stdout_io: io, scm: "cvs")
|
28
|
+
expect(cli).to receive(:exec).with("cvs", "checkout", "mainline")
|
29
|
+
cli.run
|
30
|
+
end
|
31
|
+
|
32
|
+
it "scm tool defaults to git" do
|
33
|
+
cli = Opscode::CLI.new(%w{log}, stdout_io: io)
|
34
|
+
expect(cli).to receive(:exec).with("git", "log")
|
35
|
+
cli.run
|
36
|
+
end
|
37
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: opscode
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.7.10
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Fletcher Nichol
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Infrastructure code workflow tool
|
56
|
+
email:
|
57
|
+
- fnichol@nichol.ca
|
58
|
+
executables:
|
59
|
+
- opscode
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- ".rspec"
|
65
|
+
- ".travis.yml"
|
66
|
+
- Gemfile
|
67
|
+
- Guardfile
|
68
|
+
- LICENSE.txt
|
69
|
+
- README.md
|
70
|
+
- Rakefile
|
71
|
+
- bin/opscode
|
72
|
+
- lib/opscode.rb
|
73
|
+
- lib/opscode/version.rb
|
74
|
+
- opscode.gemspec
|
75
|
+
- spec/lib/opscode_spec.rb
|
76
|
+
- spec/spec_helper.rb
|
77
|
+
homepage: https://github.com/fnichol/opscode
|
78
|
+
licenses:
|
79
|
+
- Apache 2.0
|
80
|
+
metadata: {}
|
81
|
+
post_install_message:
|
82
|
+
rdoc_options: []
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
requirements: []
|
96
|
+
rubyforge_project:
|
97
|
+
rubygems_version: 2.2.2
|
98
|
+
signing_key:
|
99
|
+
specification_version: 4
|
100
|
+
summary: Infrastructure code workflow tool
|
101
|
+
test_files:
|
102
|
+
- spec/lib/opscode_spec.rb
|
103
|
+
- spec/spec_helper.rb
|