waggit 0.0.011 → 0.0.012
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/lib/git.rb +1 -0
- data/lib/waggit.rb +43 -18
- 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: 4e12a2d433f99bcae12d0035806d30f0a7a97948
|
|
4
|
+
data.tar.gz: 7ac23667b9bf78b81ae412a641aaf87b26b6485b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 65a6b2ecac24da89aad38c830bb2dd0d98ca331ac2de43c322553ccf6b5cf52f4cde6d907c54b10e6a9cfbf7f2f5a9b9ce9a9220214df8329e78bb417d0ea4d6
|
|
7
|
+
data.tar.gz: cf42c69b002a1acc8cc955779960f5e9e684a471af9faf49416688b1aabe362f174639823179fdc9394e5d57198169d53744c40b8feae59b337a6973738c9128
|
data/lib/git.rb
CHANGED
data/lib/waggit.rb
CHANGED
|
@@ -52,11 +52,13 @@ module Waggit
|
|
|
52
52
|
# Push local changes to wagon, ignoring git.
|
|
53
53
|
#
|
|
54
54
|
def self.forcepush(options)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
if confirm_push
|
|
56
|
+
dir = get_waggit_dir
|
|
57
|
+
if dir
|
|
58
|
+
Dir.chdir(dir) do
|
|
59
|
+
Files.clean_css
|
|
60
|
+
Wagon.push(options)
|
|
61
|
+
end
|
|
60
62
|
end
|
|
61
63
|
end
|
|
62
64
|
end
|
|
@@ -64,19 +66,21 @@ module Waggit
|
|
|
64
66
|
# Commit local changes and keep in sync with git, then push to wagon.
|
|
65
67
|
#
|
|
66
68
|
def self.push(options)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
Git.commit_prompt
|
|
72
|
-
Files.clean_css
|
|
73
|
-
if Git.has_changes?
|
|
69
|
+
if confirm_push
|
|
70
|
+
dir = get_waggit_dir
|
|
71
|
+
if dir
|
|
72
|
+
Dir.chdir(dir) do
|
|
74
73
|
Git.add_all
|
|
75
|
-
Git.
|
|
74
|
+
Git.commit_prompt
|
|
75
|
+
Files.clean_css
|
|
76
|
+
if Git.has_changes?
|
|
77
|
+
Git.add_all
|
|
78
|
+
Git.commit "cleaned css"
|
|
79
|
+
end
|
|
80
|
+
Git.pull
|
|
81
|
+
Git.push
|
|
82
|
+
Wagon.push(options)
|
|
76
83
|
end
|
|
77
|
-
Git.pull
|
|
78
|
-
Git.push
|
|
79
|
-
Wagon.push(options)
|
|
80
84
|
end
|
|
81
85
|
end
|
|
82
86
|
end
|
|
@@ -114,7 +118,7 @@ module Waggit
|
|
|
114
118
|
Git.delete_wagon
|
|
115
119
|
Git.delete_local
|
|
116
120
|
rescue Exception
|
|
117
|
-
"Pull aborted, switching back to master branch"
|
|
121
|
+
puts "Pull aborted, switching back to master branch"
|
|
118
122
|
Git.checkout_master
|
|
119
123
|
raise
|
|
120
124
|
end
|
|
@@ -166,7 +170,7 @@ module Waggit
|
|
|
166
170
|
|
|
167
171
|
Wagon.push(options)
|
|
168
172
|
rescue Exception
|
|
169
|
-
"Sync aborted, switching back to master branch"
|
|
173
|
+
puts "Sync aborted, switching back to master branch"
|
|
170
174
|
Git.checkout_master
|
|
171
175
|
raise
|
|
172
176
|
end
|
|
@@ -174,4 +178,25 @@ module Waggit
|
|
|
174
178
|
end
|
|
175
179
|
end
|
|
176
180
|
|
|
181
|
+
# Since pushing local content can overwrite remote content
|
|
182
|
+
# we want the user to confirm the operation
|
|
183
|
+
#
|
|
184
|
+
def self.confirm_push()
|
|
185
|
+
puts "Performing this operation will overwrite content on the server."
|
|
186
|
+
response = nil
|
|
187
|
+
while response.nil?
|
|
188
|
+
puts "Do you want to continue? [y/n]"
|
|
189
|
+
response = gets.chomp.downcase
|
|
190
|
+
case response
|
|
191
|
+
when "y", "yes"
|
|
192
|
+
return true
|
|
193
|
+
when "n", "no"
|
|
194
|
+
return false
|
|
195
|
+
else
|
|
196
|
+
puts "Invalid response! Plese try again."
|
|
197
|
+
response = nil
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
177
202
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: waggit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.012
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mere Agency
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-10-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A way of integrating LocomotiveCMS/Wagon with git. This is under development
|
|
14
14
|
and not ready for active use.
|