jeni 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/Bugs.rdoc +6 -0
  2. data/Gemfile +14 -0
  3. data/History.txt +9 -0
  4. data/Intro.txt +3 -0
  5. data/LICENCE.rdoc +159 -0
  6. data/README.md +188 -0
  7. data/lib/jeni.rb +374 -0
  8. data/lib/jeni/actions.rb +400 -0
  9. data/lib/jeni/errors.rb +22 -0
  10. data/lib/jeni/io.rb +71 -0
  11. data/lib/jeni/options.rb +68 -0
  12. data/lib/jeni/optparse.rb +84 -0
  13. data/lib/jeni/utils.rb +181 -0
  14. data/lib/jeni/version.rb +13 -0
  15. data/spec/jeni_spec.rb +85 -0
  16. data/spec/jeni_utils_spec.rb +297 -0
  17. data/spec/spec_helper.rb +26 -0
  18. data/test/examples/source/coati.haml.conf +37 -0
  19. data/test/examples/source/executable +3 -0
  20. data/test/examples/source/jenny-diff.rb +64 -0
  21. data/test/examples/source/jenny.rb +63 -0
  22. data/test/examples/source/shebang.rb +3 -0
  23. data/test/examples/source/subfiles/subfile_1.rb +63 -0
  24. data/test/examples/source/template.haml.rb +10 -0
  25. data/test/examples/target/archive/coati.haml.conf +37 -0
  26. data/test/examples/target/archive/executable +3 -0
  27. data/test/examples/target/archive/jenny-diff.rb +64 -0
  28. data/test/examples/target/archive/jenny.rb +63 -0
  29. data/test/examples/target/archive/shebang.rb +3 -0
  30. data/test/examples/target/archive/subfiles/subfile_1.rb +63 -0
  31. data/test/examples/target/archive/template.haml.rb +10 -0
  32. data/test/examples/target/jenny.rb +63 -0
  33. data/test/examples/target/jenny_link.rb +63 -0
  34. data/test/examples/target2/coati.conf +36 -0
  35. data/test/examples/target2/coati.haml.conf +37 -0
  36. data/test/examples/target2/executable +3 -0
  37. data/test/examples/target2/jenny-diff.rb +64 -0
  38. data/test/examples/target2/jenny.rb +63 -0
  39. data/test/examples/target2/jenny_link.rb +63 -0
  40. data/test/examples/target2/jenny_template.rb +10 -0
  41. data/test/examples/target2/jenny_test.rb +63 -0
  42. data/test/examples/target2/shebang.rb +3 -0
  43. data/test/examples/target2/std_template.rb +12 -0
  44. data/test/examples/target2/template.haml.rb +10 -0
  45. data/test/examples/test1.rb +30 -0
  46. data/test/examples/test2.rb +27 -0
  47. data/test/examples/test_args +24 -0
  48. data/test/examples/test_users +16 -0
  49. metadata +162 -0
@@ -0,0 +1,3 @@
1
+ #! /usr/bin/ruby -w
2
+
3
+ puts "Just a test"
@@ -0,0 +1,63 @@
1
+ #
2
+ # Author:: R.J.Sharp
3
+ # Email:: robert(a)osburn-sharp.ath.cx
4
+ # Copyright:: Copyright (c) 2012
5
+ # License:: Open Software Licence v3.0
6
+ #
7
+ # This software is licensed for use under the Open Software Licence v. 3.0
8
+ # The terms of this licence can be found at http://www.opensource.org/licenses/osl-3.0.php
9
+ # and in the file LICENCE. Under the terms of this licence, all derivative works
10
+ # must themselves be licensed under the Open Software Licence v. 3.0
11
+ #
12
+ #
13
+ # [requires go here]
14
+ require 'rubygems'
15
+
16
+ # = Jeni
17
+ #
18
+ # [Description of the main module]
19
+ module Jeni
20
+ class Installer
21
+
22
+ def initialize(gem_name)
23
+ @gem_name = gem_name
24
+ @gem_spec = Gem::Specification.find_by_name(@gem_name)
25
+ @commands = []
26
+ end
27
+
28
+ def self.construct(gem_name, options={}, &block)
29
+ @pretend = options[:pretend] || true # JUST FOR NOW!
30
+ installer = self.new(gem_name)
31
+ block.call(installer)
32
+ return self
33
+ end
34
+
35
+ def run!(pretent=false)
36
+
37
+ end
38
+
39
+ # copy a file from the source, relative to the gem home to the target
40
+ # which is absolute
41
+ def file(source, target, opts={})
42
+ @commands << {:file => {source => target}}
43
+ if opts.has_key?(:chown) then
44
+ @commands << {:chown => opts[:chown]}
45
+ end
46
+ end
47
+
48
+ # copy all of the files in a directory
49
+ def directory(source, target, opts={})
50
+
51
+ end
52
+
53
+ # create a wrapper at target to call source
54
+ def wrapper(source, target)
55
+
56
+ end
57
+
58
+ def link(source, target)
59
+
60
+ end
61
+
62
+ end
63
+ end
@@ -0,0 +1,10 @@
1
+ # Author: #{author}
2
+ # Created at: #{Time.now.strftime("%H:%M %d-%m-%y")}
3
+
4
+ module Amodule
5
+ class Aclass
6
+ def amethod
7
+ puts "#{greeting}"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,63 @@
1
+ #
2
+ # Author:: R.J.Sharp
3
+ # Email:: robert(a)osburn-sharp.ath.cx
4
+ # Copyright:: Copyright (c) 2012
5
+ # License:: Open Software Licence v3.0
6
+ #
7
+ # This software is licensed for use under the Open Software Licence v. 3.0
8
+ # The terms of this licence can be found at http://www.opensource.org/licenses/osl-3.0.php
9
+ # and in the file LICENCE. Under the terms of this licence, all derivative works
10
+ # must themselves be licensed under the Open Software Licence v. 3.0
11
+ #
12
+ #
13
+ # [requires go here]
14
+ require 'rubygems'
15
+
16
+ # = Jeni
17
+ #
18
+ # [Description of the main module]
19
+ module Jeni
20
+ class Installer
21
+
22
+ def initialize(gem_name)
23
+ @gem_name = gem_name
24
+ @gem_spec = Gem::Specification.find_by_name(@gem_name)
25
+ @commands = []
26
+ end
27
+
28
+ def self.construct(gem_name, options={}, &block)
29
+ @pretend = options[:pretend] || true # JUST FOR NOW!
30
+ installer = self.new(gem_name)
31
+ block.call(installer)
32
+ return self
33
+ end
34
+
35
+ def run!(pretent=false)
36
+
37
+ end
38
+
39
+ # copy a file from the source, relative to the gem home to the target
40
+ # which is absolute
41
+ def file(source, target, opts={})
42
+ @commands << {:file => {source => target}}
43
+ if opts.has_key?(:chown) then
44
+ @commands << {:chown => opts[:chown]}
45
+ end
46
+ end
47
+
48
+ # copy all of the files in a directory
49
+ def directory(source, target, opts={})
50
+
51
+ end
52
+
53
+ # create a wrapper at target to call source
54
+ def wrapper(source, target)
55
+
56
+ end
57
+
58
+ def link(source, target)
59
+
60
+ end
61
+
62
+ end
63
+ end
@@ -0,0 +1,63 @@
1
+ #
2
+ # Author:: R.J.Sharp
3
+ # Email:: robert(a)osburn-sharp.ath.cx
4
+ # Copyright:: Copyright (c) 2012
5
+ # License:: Open Software Licence v3.0
6
+ #
7
+ # This software is licensed for use under the Open Software Licence v. 3.0
8
+ # The terms of this licence can be found at http://www.opensource.org/licenses/osl-3.0.php
9
+ # and in the file LICENCE. Under the terms of this licence, all derivative works
10
+ # must themselves be licensed under the Open Software Licence v. 3.0
11
+ #
12
+ #
13
+ # [requires go here]
14
+ require 'rubygems'
15
+
16
+ # = Jeni
17
+ #
18
+ # [Description of the main module]
19
+ module Jeni
20
+ class Installer
21
+
22
+ def initialize(gem_name)
23
+ @gem_name = gem_name
24
+ @gem_spec = Gem::Specification.find_by_name(@gem_name)
25
+ @commands = []
26
+ end
27
+
28
+ def self.construct(gem_name, options={}, &block)
29
+ @pretend = options[:pretend] || true # JUST FOR NOW!
30
+ installer = self.new(gem_name)
31
+ block.call(installer)
32
+ return self
33
+ end
34
+
35
+ def run!(pretent=false)
36
+
37
+ end
38
+
39
+ # copy a file from the source, relative to the gem home to the target
40
+ # which is absolute
41
+ def file(source, target, opts={})
42
+ @commands << {:file => {source => target}}
43
+ if opts.has_key?(:chown) then
44
+ @commands << {:chown => opts[:chown]}
45
+ end
46
+ end
47
+
48
+ # copy all of the files in a directory
49
+ def directory(source, target, opts={})
50
+
51
+ end
52
+
53
+ # create a wrapper at target to call source
54
+ def wrapper(source, target)
55
+
56
+ end
57
+
58
+ def link(source, target)
59
+
60
+ end
61
+
62
+ end
63
+ end
@@ -0,0 +1,36 @@
1
+ upstream coati {
2
+ server unix:/home/robert/dev/rails/coati/tmp/.sock fail_timeout=0;
3
+ }
4
+
5
+
6
+ server {
7
+ listen 192.168.0.20:80;
8
+ server_name coati.lucius.osburn-sharp.ath.cx;
9
+
10
+ access_log /home/robert/dev/rails/coati/log/access.log;
11
+ error_log /home/robert/dev/rails/coati/log/error.log;
12
+
13
+ root /home/robert/dev/rails/coati/public/;
14
+ index index.html;
15
+
16
+ location / {
17
+ proxy_set_header X-Real-IP $remote_addr;
18
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
19
+ proxy_set_header Host $http_host;
20
+ proxy_redirect off;
21
+
22
+ if (-f $request_filename/index.html) {
23
+ rewrite (.*) $1/index.html break;
24
+ }
25
+
26
+ if (-f $request_filename.html) {
27
+ rewrite (.*) $1.html break;
28
+ }
29
+
30
+ if (!-f $request_filename) {
31
+ proxy_pass http://coati;
32
+ break;
33
+ }
34
+ }
35
+
36
+ }
@@ -0,0 +1,37 @@
1
+ upstream coati {
2
+ server unix:#{root}/tmp/.sock fail_timeout=0;
3
+ }
4
+
5
+
6
+ server {
7
+ listen 192.168.0.20:80;
8
+ server_name #{app_name}.lucius.osburn-sharp.ath.cx;
9
+
10
+ access_log #{root}/log/access.log;
11
+ error_log #{root}/log/error.log;
12
+
13
+ root #{root}/public/;
14
+ index index.html;
15
+
16
+ location / {
17
+ proxy_set_header X-Real-IP $remote_addr;
18
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
19
+ proxy_set_header Host $http_host;
20
+ proxy_redirect off;
21
+
22
+ if (-f $request_filename/index.html) {
23
+ rewrite (.*) $1/index.html break;
24
+ }
25
+
26
+ if (-f $request_filename.html) {
27
+ rewrite (.*) $1.html break;
28
+ }
29
+
30
+ if (!-f $request_filename) {
31
+ proxy_pass http://coati;
32
+ break;
33
+ }
34
+ }
35
+
36
+ }
37
+
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby18
2
+
3
+ puts "Executing"
@@ -0,0 +1,64 @@
1
+ #
2
+ # Author:: R.J.Sharp
3
+ # Email:: robert(a)osburn-sharp.ath.cx
4
+ # Copyright:: Copyright (c) 2012
5
+ # License:: Open Software Licence v3.0
6
+ #
7
+ # This software is licensed for use under the Open Software Licence v. 3.0
8
+ # The terms of this licence can be found at http://www.opensource.org/licenses/osl-3.0.php
9
+ # and in the file LICENCE. Under the terms of this licence, all derivative works
10
+ # must themselves be licensed under the Open Software Licence v. 3.0
11
+ #
12
+ #
13
+ # [requires go here]
14
+ require 'rubygems'
15
+ require 'jerbil'
16
+
17
+ # = Jeni
18
+ #
19
+ # [Description of the main module]
20
+ module Jeni
21
+ class Installer
22
+
23
+ def initialize(gem_name)
24
+ @gem_name = gem_name
25
+ @gem_spec = Gem::Specification.find_by_name(@gem_name)
26
+ @commands = []
27
+ end
28
+
29
+ def self.construct(gem_name, options={}, &block)
30
+ @pretend = options[:pretend] || true # JUST FOR NOW!
31
+ installer = self.new(gem_name)
32
+ block.call(installer)
33
+ return self
34
+ end
35
+
36
+ def run!(pretent=false)
37
+
38
+ end
39
+
40
+ # copy a file from the source, relative to the gem home to the target
41
+ # which is absolute
42
+ def file(source, target, opts={})
43
+ @commands << {:file => {source => target}}
44
+ if opts.has_key?(:chown) then
45
+ @commands << {:chown => opts[:chown]}
46
+ end
47
+ end
48
+
49
+ # copy all of the files in a directory
50
+ def directory(source, target, opts={})
51
+
52
+ end
53
+
54
+ # create a wrapper at target to call source
55
+ def wrapper(source, target)
56
+
57
+ end
58
+
59
+ def link(source, target)
60
+
61
+ end
62
+
63
+ end
64
+ end
@@ -0,0 +1,63 @@
1
+ #
2
+ # Author:: R.J.Sharp
3
+ # Email:: robert(a)osburn-sharp.ath.cx
4
+ # Copyright:: Copyright (c) 2012
5
+ # License:: Open Software Licence v3.0
6
+ #
7
+ # This software is licensed for use under the Open Software Licence v. 3.0
8
+ # The terms of this licence can be found at http://www.opensource.org/licenses/osl-3.0.php
9
+ # and in the file LICENCE. Under the terms of this licence, all derivative works
10
+ # must themselves be licensed under the Open Software Licence v. 3.0
11
+ #
12
+ #
13
+ # [requires go here]
14
+ require 'rubygems'
15
+
16
+ # = Jeni
17
+ #
18
+ # [Description of the main module]
19
+ module Jeni
20
+ class Installer
21
+
22
+ def initialize(gem_name)
23
+ @gem_name = gem_name
24
+ @gem_spec = Gem::Specification.find_by_name(@gem_name)
25
+ @commands = []
26
+ end
27
+
28
+ def self.construct(gem_name, options={}, &block)
29
+ @pretend = options[:pretend] || true # JUST FOR NOW!
30
+ installer = self.new(gem_name)
31
+ block.call(installer)
32
+ return self
33
+ end
34
+
35
+ def run!(pretent=false)
36
+
37
+ end
38
+
39
+ # copy a file from the source, relative to the gem home to the target
40
+ # which is absolute
41
+ def file(source, target, opts={})
42
+ @commands << {:file => {source => target}}
43
+ if opts.has_key?(:chown) then
44
+ @commands << {:chown => opts[:chown]}
45
+ end
46
+ end
47
+
48
+ # copy all of the files in a directory
49
+ def directory(source, target, opts={})
50
+
51
+ end
52
+
53
+ # create a wrapper at target to call source
54
+ def wrapper(source, target)
55
+
56
+ end
57
+
58
+ def link(source, target)
59
+
60
+ end
61
+
62
+ end
63
+ end
@@ -0,0 +1,63 @@
1
+ #
2
+ # Author:: R.J.Sharp
3
+ # Email:: robert(a)osburn-sharp.ath.cx
4
+ # Copyright:: Copyright (c) 2012
5
+ # License:: Open Software Licence v3.0
6
+ #
7
+ # This software is licensed for use under the Open Software Licence v. 3.0
8
+ # The terms of this licence can be found at http://www.opensource.org/licenses/osl-3.0.php
9
+ # and in the file LICENCE. Under the terms of this licence, all derivative works
10
+ # must themselves be licensed under the Open Software Licence v. 3.0
11
+ #
12
+ #
13
+ # [requires go here]
14
+ require 'rubygems'
15
+
16
+ # = Jeni
17
+ #
18
+ # [Description of the main module]
19
+ module Jeni
20
+ class Installer
21
+
22
+ def initialize(gem_name)
23
+ @gem_name = gem_name
24
+ @gem_spec = Gem::Specification.find_by_name(@gem_name)
25
+ @commands = []
26
+ end
27
+
28
+ def self.construct(gem_name, options={}, &block)
29
+ @pretend = options[:pretend] || true # JUST FOR NOW!
30
+ installer = self.new(gem_name)
31
+ block.call(installer)
32
+ return self
33
+ end
34
+
35
+ def run!(pretent=false)
36
+
37
+ end
38
+
39
+ # copy a file from the source, relative to the gem home to the target
40
+ # which is absolute
41
+ def file(source, target, opts={})
42
+ @commands << {:file => {source => target}}
43
+ if opts.has_key?(:chown) then
44
+ @commands << {:chown => opts[:chown]}
45
+ end
46
+ end
47
+
48
+ # copy all of the files in a directory
49
+ def directory(source, target, opts={})
50
+
51
+ end
52
+
53
+ # create a wrapper at target to call source
54
+ def wrapper(source, target)
55
+
56
+ end
57
+
58
+ def link(source, target)
59
+
60
+ end
61
+
62
+ end
63
+ end