depengine 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/de +2 -45
- data/lib/depengine/cli.rb +41 -0
- data/lib/depengine/version.rb +1 -1
- data/lib/depengine.rb +2 -43
- metadata +3 -2
data/bin/de
CHANGED
@@ -1,51 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require 'optparse'
|
3
2
|
require 'rubygems'
|
4
3
|
|
5
4
|
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
|
6
5
|
require 'depengine'
|
7
|
-
require 'depengine/
|
6
|
+
require 'depengine/cli'
|
8
7
|
|
9
|
-
|
10
|
-
parser = OptionParser.new do |opts|
|
11
|
-
exts = Treetop::Polyglot::VALID_GRAMMAR_EXT.collect { |i| '.' + i }
|
12
|
-
|
13
|
-
opts.banner = "Treetop Parsing Expression Grammar (PEG) Comand Line Compiler"
|
14
|
-
opts.define_head "Usage: tt [options] grammar_file[#{exts.join('|')}] ..."
|
15
|
-
opts.separator ''
|
16
|
-
opts.separator 'Examples:'
|
17
|
-
opts.separator ' tt foo.tt # 1 grammar -> 1 parser source'
|
18
|
-
opts.separator ' tt foo bar.treetop # 2 grammars -> 2 separate parsers'
|
19
|
-
opts.separator ' tt -o alt_name.rb foo # alternately named output file'
|
20
|
-
opts.separator ''
|
21
|
-
opts.separator ''
|
22
|
-
opts.separator 'NOTE: while treetop grammar files *must* have one of the following'
|
23
|
-
opts.separator 'filename extensions, the extension name is not required when calling'
|
24
|
-
opts.separator 'the compiler with grammar file names.'
|
25
|
-
opts.separator ''
|
26
|
-
opts.separator " Valid extensions: #{exts.join(', ')}"
|
27
|
-
opts.separator ''
|
28
|
-
opts.separator ''
|
29
|
-
opts.separator 'Options:'
|
30
|
-
|
31
|
-
opts.on('-o', '--output FILENAME', 'Write parser source to FILENAME') do |fn|
|
32
|
-
options[:out_file] = fn
|
33
|
-
end
|
34
|
-
|
35
|
-
opts.on('-f', '--force', 'Overwrite existing output file(s)') do
|
36
|
-
options[:force] = true
|
37
|
-
end
|
38
|
-
|
39
|
-
opts.on_tail('-v', '--version', 'Show Treetop version') do
|
40
|
-
puts "Treetop v#{Treetop::VERSION::STRING}"
|
41
|
-
exit
|
42
|
-
end
|
43
|
-
|
44
|
-
opts.on_tail('-h', '--help', 'Show this help message') do
|
45
|
-
puts opts
|
46
|
-
exit
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
puts "Hello de"
|
8
|
+
exit Depengine::CLI.run(ARGV)
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Depengine
|
2
|
+
module CLI
|
3
|
+
class << self
|
4
|
+
|
5
|
+
def run(args, input = $stdin, output = $stdout, error = $stderr) #:nodoc:
|
6
|
+
|
7
|
+
@deploy_home = '.'
|
8
|
+
@recipe_name = 'recipe/deploy.rb'
|
9
|
+
|
10
|
+
args.options do |o|
|
11
|
+
o.banner = "Usage: #{File.basename($0)} [options]"
|
12
|
+
o.separator ""
|
13
|
+
o.on('-h', '--deployhome [DIRNAME]', 'Home of deployments.') do |dname|
|
14
|
+
@deploy_home = dname
|
15
|
+
ENV['WORKSPACE'] = dname
|
16
|
+
end
|
17
|
+
o.on('-r', '--recipe [FILENAME]', 'Filename of the recipe.') do |fname|
|
18
|
+
@recipe_name = fname
|
19
|
+
end
|
20
|
+
o.on('-e', '--env [ENVNAME]', 'Environment name.') do |ename|
|
21
|
+
ENV['ENVIRONMENT'] = ename
|
22
|
+
end
|
23
|
+
o.on('-v', '--version [VERSION]', 'Version.') do |vname|
|
24
|
+
ENV['VERSION'] = vname
|
25
|
+
end
|
26
|
+
o.parse!
|
27
|
+
end
|
28
|
+
|
29
|
+
# unless args.size == 2
|
30
|
+
# error << args.options
|
31
|
+
# return 127
|
32
|
+
# end
|
33
|
+
|
34
|
+
recipe_filename = File.join(@deploy_home, @recipe_name)
|
35
|
+
puts "Using recipe #{recipe_filename}"
|
36
|
+
eval(File.new(recipe_filename).read)
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/depengine/version.rb
CHANGED
data/lib/depengine.rb
CHANGED
@@ -15,13 +15,12 @@ require 'pony'
|
|
15
15
|
require 'ptools'
|
16
16
|
require 'csv'
|
17
17
|
require 'zlib'
|
18
|
+
require 'optparse'
|
19
|
+
|
18
20
|
|
19
21
|
Dir[File.join( File.dirname(__FILE__), '**/*.rb' )].each \
|
20
22
|
{ |file| require file }
|
21
23
|
|
22
|
-
#Dir[File.join( '/export/home/ctraut/.rvm/gems/ruby-1.9.3-p194/gems/depengine-1.0.0/bin', '../lib/**/*.rb' )].each \
|
23
|
-
# { |file| require file }
|
24
|
-
|
25
24
|
# Global variables
|
26
25
|
$exec_file_path = __FILE__
|
27
26
|
$recipe_config = {}
|
@@ -30,43 +29,3 @@ $log = Log::DeploymentLogger.new
|
|
30
29
|
|
31
30
|
# include Deployment::Methods so we can call them directly in the recipe
|
32
31
|
include Deployment::Methods
|
33
|
-
|
34
|
-
module Deployment
|
35
|
-
class << self
|
36
|
-
def deploy(deploy_home )
|
37
|
-
recipe_name = File.join(deploy_home, "recipe/deploy.rb")
|
38
|
-
puts "Using recipe #{recipe_name}"
|
39
|
-
eval(File.new(recipe_name).read)
|
40
|
-
end
|
41
|
-
|
42
|
-
def run(args, input = $stdin, output = $stdout, error = $stderr) #:nodoc:
|
43
|
-
@binary = nil
|
44
|
-
|
45
|
-
args.options do |o|
|
46
|
-
o.banner = "Usage: #{File.basename($0)} [options] oldfile newfile"
|
47
|
-
o.separator ""
|
48
|
-
o.on('-c', 'Displays a context diff with 3 lines of', 'context.') do |ctx|
|
49
|
-
@format = :context
|
50
|
-
@lines = 3
|
51
|
-
end
|
52
|
-
o.on('-C', '--context [LINES]', Numeric, 'Displays a context diff with LINES lines', 'of context. Default 3 lines.') do |ctx|
|
53
|
-
@format = :context
|
54
|
-
@lines = ctx || 3
|
55
|
-
end
|
56
|
-
o.on_tail('--version', 'Shows the version of Diff::LCS.') do
|
57
|
-
error << BANNER
|
58
|
-
return 0
|
59
|
-
end
|
60
|
-
o.on_tail ""
|
61
|
-
o.on_tail 'By default, runs produces an "old-style" diff, with output like UNIX diff.'
|
62
|
-
o.parse!
|
63
|
-
end
|
64
|
-
|
65
|
-
unless args.size == 2
|
66
|
-
error << args.options
|
67
|
-
return 127
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: depengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -2643,6 +2643,7 @@ files:
|
|
2643
2643
|
- etc/ssh/id_rsa.pwu_copy
|
2644
2644
|
- lib/depengine.rb
|
2645
2645
|
- lib/depengine/asserter/url.rb
|
2646
|
+
- lib/depengine/cli.rb
|
2646
2647
|
- lib/depengine/dsl/deployment.rb
|
2647
2648
|
- lib/depengine/helper/hudson.rb
|
2648
2649
|
- lib/depengine/helper/mail.rb
|