freighter 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 86abd16d687a7906bc20e78b1e69a23f2e93b44b
4
+ data.tar.gz: 1ea374580cf78e8364c54736e0cafc32c39a5d22
5
+ SHA512:
6
+ metadata.gz: e3d16301fe59fe48e5f8be7e28566f44703840a914908d47c927d337750dbb2058c91d5cdbb305b8eaaf5b27e64ded5079b835cf14796a524cd00155b2978cbf
7
+ data.tar.gz: e38f3ae9f03470365b70042d6f5a95b0f7936cb5a6d535f11a78b8b602779637e5502b6715a8e34b0d692b56bbfd9fb1ca7c7f9b11c93b4b81de69f74994408d
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,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in freighter.gemspec
4
+ gemspec
5
+
6
+ gem 'net-ssh'
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Sean McCleary
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,33 @@
1
+ # This gem is not ready yet. Just a gem stub at this point.
2
+
3
+ # Freighter
4
+
5
+ TODO: Write a gem description
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'freighter'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install freighter
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it ( https://github.com/[my-github-username]/freighter/fork )
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/freighter ADDED
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'optparse'
4
+ require 'bundler/setup'
5
+ require 'ostruct'
6
+ require 'freighter'
7
+ require 'pry'
8
+
9
+ @options = OpenStruct.new
10
+
11
+ if defined?(Rails)
12
+ @options.config_path = "#{Rails.root}/config/freighter.yml"
13
+ else
14
+ @options.config_path = "./config/freighter.yml"
15
+ end
16
+
17
+ OptionParser.new do |opts|
18
+ opts.banner = "Usage: freigter [options] (deploy)"
19
+
20
+ opts.on('-v', '--verbose', 'verbose logging') do |v|
21
+ @options.verbose = true
22
+ end
23
+
24
+ opts.on('-c', '--config', 'path to yml config') do |opt|
25
+ if opt
26
+ @options.config_path = opt
27
+ elsif defiend?(Rails) && Rails.root
28
+ @options.config_path = "#{Rails.root}/config/freighter.yml"
29
+ end
30
+ end
31
+ end.parse!
32
+
33
+ logger = Freighter::Logger.new(@options)
34
+
35
+ logger.log "All hand on deck. Toot toot."
36
+ logger.log "app is chatty", :verbose
37
+
38
+ config = Freighter::Parse.new(@options)
39
+
40
+ case ARGV[0]
41
+ when "deploy"
42
+ :deploy
43
+ else
44
+ logger.log "unexpected command given: #{ARGV[0]}. See usage. freighter --help", :error
45
+ end
46
+
data/freighter.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 'freighter/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "freighter"
8
+ spec.version = Freighter::VERSION
9
+ spec.authors = ["Sean McCleary"]
10
+ spec.email = ["seanmcc@gmail.com"]
11
+ spec.summary = %q{Ruby gem to deploy docker containers}
12
+ spec.description = %q{Ruby gem to deploy docker containers}
13
+ spec.homepage = "https://github.com/mrinterweb/freighter"
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_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "pry", "~> 0.10"
24
+ end
@@ -0,0 +1,19 @@
1
+ module Freighter
2
+ class Logger
3
+ def initialize(options)
4
+ @verbose = options.verbose
5
+ end
6
+
7
+ def log(str, verbose=false)
8
+ if @verbose or verbose != :verbose
9
+ puts str
10
+ end
11
+ end
12
+
13
+ def error(str)
14
+ puts str
15
+ puts "Freighter hit an iceburg. To the life boats. All is lost. :("
16
+ exit -1
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,18 @@
1
+ require 'yaml'
2
+ require 'pry'
3
+ require 'freighter/logger'
4
+
5
+ module Freighter
6
+ class Parse
7
+ def initialize(options)
8
+ @logger = Logger.new options
9
+ @config_path = options.config_path
10
+ begin
11
+ @config = YAML.load_file(@config_path)
12
+ @logger.log "config file parsed", :verbose
13
+ rescue Errno::ENOENT => e
14
+ @logger.error "Error parsing freighter config file.\n path: #{@config_path}\n #{e}"
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ module Freighter
2
+ VERSION = "0.0.1"
3
+ end
data/lib/freighter.rb ADDED
@@ -0,0 +1,7 @@
1
+ require "freighter/version"
2
+ require "freighter/logger"
3
+ require "freighter/parse"
4
+
5
+ module Freighter
6
+ # Your code goes here...
7
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: freighter
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Sean McCleary
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-02 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.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.10'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.10'
55
+ description: Ruby gem to deploy docker containers
56
+ email:
57
+ - seanmcc@gmail.com
58
+ executables:
59
+ - freighter
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - bin/freighter
69
+ - freighter.gemspec
70
+ - lib/freighter.rb
71
+ - lib/freighter/logger.rb
72
+ - lib/freighter/parse.rb
73
+ - lib/freighter/version.rb
74
+ homepage: https://github.com/mrinterweb/freighter
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.2.2
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Ruby gem to deploy docker containers
98
+ test_files: []