jeni 0.2.3 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Bugs.rdoc +5 -0
- data/History.txt +9 -0
- data/lib/jeni.rb +3 -0
- data/lib/jeni/actions.rb +4 -11
- data/lib/jeni/io.rb +2 -2
- data/lib/jeni/utils.rb +11 -3
- data/lib/jeni/version.rb +8 -12
- metadata +70 -85
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OTk0NDE2OWViOTU5YzYzOWMwZTc1YmVkZjZlZGE4M2E0NjNhMTRiZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ODEwOTA2YzcwNTg3ZGY3NDk1YjlhYmI3MTM4ZTlhZjQ5ZDdhZjYwZg==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MDM1ZjA1ZTUxMjg2OGJjYjY2ZGE5ZWQ3OWFkYTI4ZDA3MmQwYWUxOWVmNTJh
|
10
|
+
MWU3MmM3NzE1NzAxZjhhYjAzZWE4MmNkZThjMjE5ZDI1ZGZhNjI4N2Y3NTM1
|
11
|
+
ZDU4OTczYTdhY2Y0ZjNmOWY2YjNmZWZkODBjNTNjMGQ0ZWM0YmY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OGU3YzQ1MThhZWJjNTY0NDg0Y2QyOWI1MGVlMDEyNjg3ODE4MTdiYzQ4OGZm
|
14
|
+
YzhlYWM5NTYxZjgxYWE0YzNlZGI5Yjg2MjdjMDIyYmY1MmEwYWU1ZTQ5MDg5
|
15
|
+
YjJlZWU2OTdjYTYyMGFkZWQ0NzhkODRjOTU4ZTU3MTllYjBjMTc=
|
data/Bugs.rdoc
CHANGED
data/History.txt
CHANGED
@@ -4,6 +4,15 @@
|
|
4
4
|
== History
|
5
5
|
|
6
6
|
|
7
|
+
[jeni-0.2.5 28-Aug-2013]
|
8
|
+
|
9
|
+
make target_root accessible and ignore chown etc on pretend
|
10
|
+
|
11
|
+
[jeni-0.2.4 02-Aug-2013]
|
12
|
+
|
13
|
+
Jeni::IO change to use $stdin.gets instead of Kernel#gets, which will automatically
|
14
|
+
read from a file on the command line, not what is wanted here.
|
15
|
+
|
7
16
|
[jeni-0.2.3 21-Nov-2012]
|
8
17
|
|
9
18
|
Generate templates to /tmp directory before transferring to target. Allow users to
|
data/lib/jeni.rb
CHANGED
data/lib/jeni/actions.rb
CHANGED
@@ -95,10 +95,7 @@ module Jeni
|
|
95
95
|
# change the owner of a file
|
96
96
|
def chown(file, owner)
|
97
97
|
message = "#{file} to #{owner}"
|
98
|
-
if @pretend
|
99
|
-
say(:chown, message, :ok)
|
100
|
-
return
|
101
|
-
end
|
98
|
+
return if @pretend
|
102
99
|
if FileTest.exists?(file) then
|
103
100
|
FileUtils.chown(owner, nil, file)
|
104
101
|
say(:chown, message, :ok)
|
@@ -110,10 +107,7 @@ module Jeni
|
|
110
107
|
# change the group of a file
|
111
108
|
def chgrp(file, owner)
|
112
109
|
message = "#{file} to #{owner}"
|
113
|
-
if @pretend
|
114
|
-
say(:chgrp, message, :ok)
|
115
|
-
return
|
116
|
-
end
|
110
|
+
return if @pretend
|
117
111
|
if FileTest.exists?(file) then
|
118
112
|
FileUtils.chown(nil, owner, file)
|
119
113
|
say(:chgrp, message, :ok)
|
@@ -125,9 +119,8 @@ module Jeni
|
|
125
119
|
# make a file executable
|
126
120
|
def chmod(file, mode)
|
127
121
|
message = "#{file} to #{mode.to_s(8)}"
|
128
|
-
if @pretend
|
129
|
-
|
130
|
-
elsif FileTest.exists?(file) then
|
122
|
+
return if @pretend
|
123
|
+
if FileTest.exists?(file) then
|
131
124
|
FileUtils.chmod(mode,file)
|
132
125
|
say(:chmod, message, :ok)
|
133
126
|
else
|
data/lib/jeni/io.rb
CHANGED
@@ -53,9 +53,9 @@ module Jeni
|
|
53
53
|
def_key = Answers[default]
|
54
54
|
answers = (options.split(//) & AnswerKeys.split(//)).collect {|k| k == def_key ? k.upcase : k}.join('')
|
55
55
|
print "#{question}(#{answers})? "
|
56
|
-
response = gets.chomp.downcase
|
56
|
+
response = $stdin.gets.chomp.downcase
|
57
57
|
if Answers.has_value?(response) then
|
58
|
-
return Answers.
|
58
|
+
return Answers.key(response)
|
59
59
|
else
|
60
60
|
return default
|
61
61
|
end
|
data/lib/jeni/utils.rb
CHANGED
@@ -39,13 +39,21 @@ module Jeni
|
|
39
39
|
return file
|
40
40
|
end
|
41
41
|
|
42
|
-
# check if target directory exists and is writeable
|
43
|
-
#
|
44
|
-
# the
|
42
|
+
# check if target's directory exists and is writeable
|
43
|
+
#
|
44
|
+
# this will create a directory for the target if it does not
|
45
|
+
# exist (and all intermediate paths) unless the nomkdir option is set
|
46
|
+
#
|
47
|
+
# @param [String] target path to the file to be created
|
48
|
+
# @param [String] owner of the target file and directory if it
|
49
|
+
# does not already exist
|
50
|
+
#
|
45
51
|
def check_target(target, owner=nil)
|
52
|
+
# if its not an absolute path then get the absolute path
|
46
53
|
unless target[0,1] == '/'
|
47
54
|
target = File.expand_path(File.join(@target_root, target))
|
48
55
|
end
|
56
|
+
# now get the directory for the target and ensure it exists
|
49
57
|
dir = File.dirname(target)
|
50
58
|
unless FileTest.directory?(dir)
|
51
59
|
unless @nomkdir
|
data/lib/jeni/version.rb
CHANGED
@@ -1,17 +1,13 @@
|
|
1
1
|
# Created by Jevoom
|
2
2
|
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# generate to an alternative target directory, either with target= method or optparse.
|
6
|
-
# Allow a block for optparse that passes through the optparse object to allow custom
|
7
|
-
# options to be added. Add classify method so templates can convert e.g. project name
|
8
|
-
# into a Ruby class (my_project -> MyProject).
|
3
|
+
# 28-Aug-2013
|
4
|
+
# make target_root accessible and ignore chown etc on pretend
|
9
5
|
|
10
6
|
module Jeni
|
11
|
-
# version set to 0.2.
|
12
|
-
Version = '0.2.
|
13
|
-
# date set to
|
14
|
-
Version_Date = '
|
15
|
-
#ident string set to: jeni-0.2.
|
16
|
-
Ident = 'jeni-0.2.
|
7
|
+
# version set to 0.2.5
|
8
|
+
Version = '0.2.5'
|
9
|
+
# date set to 28-Aug-2013
|
10
|
+
Version_Date = '28-Aug-2013'
|
11
|
+
#ident string set to: jeni-0.2.5 28-Aug-2013
|
12
|
+
Ident = 'jeni-0.2.5 28-Aug-2013'
|
17
13
|
end
|
metadata
CHANGED
@@ -1,82 +1,75 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: jeni
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 3
|
10
|
-
version: 0.2.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.5
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Dr Robert
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
11
|
+
date: 2013-08-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: !binary |-
|
15
|
+
Y29sb3JlZA==
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ! '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
21
|
type: :runtime
|
22
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
-
none: false
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
hash: 3
|
28
|
-
segments:
|
29
|
-
- 0
|
30
|
-
version: "0"
|
31
|
-
name: colored
|
32
|
-
version_requirements: *id001
|
33
22
|
prerelease: false
|
34
|
-
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ! '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: !binary |-
|
30
|
+
ZGlmZnk=
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ! '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
35
36
|
type: :runtime
|
36
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
-
none: false
|
38
|
-
requirements:
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
hash: 3
|
42
|
-
segments:
|
43
|
-
- 0
|
44
|
-
version: "0"
|
45
|
-
name: diffy
|
46
|
-
version_requirements: *id002
|
47
37
|
prerelease: false
|
48
|
-
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: !binary |-
|
45
|
+
aGFtbA==
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ! '>='
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
49
51
|
type: :runtime
|
50
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
51
|
-
none: false
|
52
|
-
requirements:
|
53
|
-
- - ">="
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
hash: 3
|
56
|
-
segments:
|
57
|
-
- 0
|
58
|
-
version: "0"
|
59
|
-
name: haml
|
60
|
-
version_requirements: *id003
|
61
52
|
prerelease: false
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
description: ! "A simple alternative to rubigen and thor that can be used to create
|
59
|
+
a post-install script \nfor a gem needing more than the standard file ops covered
|
60
|
+
by rubygems. It can also be \nused for straight directories instead of gems, if
|
61
|
+
required.\n"
|
67
62
|
email: robert@osburn-sharp.ath.cx
|
68
63
|
executables: []
|
69
|
-
|
70
64
|
extensions: []
|
71
|
-
|
72
|
-
extra_rdoc_files:
|
65
|
+
extra_rdoc_files:
|
73
66
|
- History.txt
|
74
67
|
- Bugs.rdoc
|
75
68
|
- Intro.txt
|
76
69
|
- LICENCE.rdoc
|
77
70
|
- Gemfile
|
78
71
|
- README.md
|
79
|
-
files:
|
72
|
+
files:
|
80
73
|
- History.txt
|
81
74
|
- Bugs.rdoc
|
82
75
|
- Intro.txt
|
@@ -119,38 +112,30 @@ files:
|
|
119
112
|
- test/examples/target/jeni_template.rb
|
120
113
|
- test/examples/target/shebang.rb
|
121
114
|
- test/examples/target2/subfiles/subfile_1.rb
|
122
|
-
homepage:
|
123
|
-
licenses:
|
115
|
+
homepage: ''
|
116
|
+
licenses:
|
124
117
|
- Open Software Licence v3.0
|
118
|
+
metadata: {}
|
125
119
|
post_install_message:
|
126
|
-
rdoc_options:
|
120
|
+
rdoc_options:
|
127
121
|
- --main=README.rdoc
|
128
|
-
require_paths:
|
122
|
+
require_paths:
|
129
123
|
- lib
|
130
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
none: false
|
141
|
-
requirements:
|
142
|
-
- - ">="
|
143
|
-
- !ruby/object:Gem::Version
|
144
|
-
hash: 3
|
145
|
-
segments:
|
146
|
-
- 0
|
147
|
-
version: "0"
|
124
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ! '>='
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
129
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
148
134
|
requirements: []
|
149
|
-
|
150
135
|
rubyforge_project:
|
151
|
-
rubygems_version:
|
136
|
+
rubygems_version: 2.0.7
|
152
137
|
signing_key:
|
153
|
-
specification_version:
|
154
|
-
summary: A little post-install helper for Gems to install things Gems can't reach,
|
138
|
+
specification_version: 4
|
139
|
+
summary: A little post-install helper for Gems to install things Gems can't reach,
|
140
|
+
and can be used for non-gems too.
|
155
141
|
test_files: []
|
156
|
-
|