opskeleton 0.9.5 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/opskeleton/commit.rb +1 -1
- data/lib/opskeleton/generate_puppet.rb +3 -3
- data/lib/opskeleton/git.rb +24 -6
- data/lib/opskeleton/uncommited.rb +1 -1
- data/lib/opskeleton/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 424df0cdc77d6a9388a5d9f8e1460e5c54afafaf
|
4
|
+
data.tar.gz: de491b6eb2668a2d18ed5f5a038b20aeccfbab91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1defa9db7c05c5185458a25f276dba8a2bfc19edb03e0ede6932e569398124f3767c4e2e992f120624f2dfeef59f7738c5b7f31f89af9f826a55bae9e57d92c7
|
7
|
+
data.tar.gz: c966937aefc055e34587ab426a7022a1b99b72941871e62dc8aa9a261c7540b27b5ce0195165072a409aa50bd0ced8d1fb65856db147eb5043bfb1f599ef3f92
|
data/Gemfile.lock
CHANGED
data/lib/opskeleton/commit.rb
CHANGED
@@ -85,9 +85,9 @@ module Opsk
|
|
85
85
|
if(!File.exists?("#{path}/.git"))
|
86
86
|
copy_file('templates/gitignore', "#{path}/.gitignore")
|
87
87
|
inside(path) do
|
88
|
-
run('git init .')
|
89
|
-
run('git add -A')
|
90
|
-
run("git commit -m 'initial sandbox import'")
|
88
|
+
run('git init .', :verbose => false, :catpure => true)
|
89
|
+
run('git add -A', :verbose => false, :catpure => true)
|
90
|
+
run("git commit -m 'initial sandbox import'", :verbose => false, :catpure => true)
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
data/lib/opskeleton/git.rb
CHANGED
@@ -2,10 +2,11 @@ require 'git_clone_url'
|
|
2
2
|
|
3
3
|
module Opsk
|
4
4
|
class Git
|
5
|
-
extend Forwardable
|
5
|
+
extend ::Forwardable
|
6
6
|
|
7
7
|
|
8
8
|
def initialize(d,thor)
|
9
|
+
@d = d
|
9
10
|
@g = ::Git.open(d)
|
10
11
|
@thor = thor
|
11
12
|
end
|
@@ -14,7 +15,7 @@ module Opsk
|
|
14
15
|
def_delegator :@g, :pull, :pull
|
15
16
|
|
16
17
|
def changed?
|
17
|
-
|
18
|
+
git_run('status').include?('modified')
|
18
19
|
end
|
19
20
|
|
20
21
|
def report
|
@@ -27,10 +28,18 @@ module Opsk
|
|
27
28
|
end
|
28
29
|
end
|
29
30
|
|
30
|
-
def
|
31
|
-
|
31
|
+
def remaster
|
32
|
+
Dir.chdir @d do
|
33
|
+
git_run('stash','.')
|
34
|
+
git_run('checkout master','.')
|
35
|
+
git_run('stash apply stash@\{0\}','.')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def master_commit(options)
|
40
|
+
resp = @thor.yes? "Commit the changes under #{@d}? (y/n)" unless options['all']
|
32
41
|
if(options['all'] or resp)
|
33
|
-
|
42
|
+
remaster
|
34
43
|
if options['message']
|
35
44
|
@g.commit_all(options['message'])
|
36
45
|
else
|
@@ -60,7 +69,16 @@ module Opsk
|
|
60
69
|
|
61
70
|
# ruby-git cannot do this (lame)
|
62
71
|
def local_ahead?
|
63
|
-
|
72
|
+
git_run('status').include?('ahead')
|
73
|
+
end
|
74
|
+
|
75
|
+
def git_run(cmd,parent=nil)
|
76
|
+
dir = parent || @d
|
77
|
+
res = %x{git --git-dir=#{dir}/.git --work-tree=#{dir} #{cmd}}
|
78
|
+
if $? != 0
|
79
|
+
raise Exception.new("Failed to run #{cmd} due to #{res}")
|
80
|
+
end
|
81
|
+
res
|
64
82
|
end
|
65
83
|
end
|
66
84
|
end
|
@@ -49,7 +49,7 @@ module Opsk
|
|
49
49
|
Dir["modules/*"].reject{|o| not File.directory?(o)}.each do |d|
|
50
50
|
if File.exists?("#{d}/.git")
|
51
51
|
begin
|
52
|
-
cg = Opsk::
|
52
|
+
cg = Opsk::Git.new(d,self)
|
53
53
|
if cg.changed?
|
54
54
|
say "Listing changes for #{d}:\n\n"
|
55
55
|
cg.report
|
data/lib/opskeleton/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opskeleton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- narkisr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|