siteleaf 0.9.16 → 0.9.17
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/siteleaf +29 -23
- data/lib/siteleaf/version.rb +1 -1
- metadata +2 -2
data/bin/siteleaf
CHANGED
@@ -48,8 +48,10 @@ def auth(re_auth = false)
|
|
48
48
|
Marshal.dump({:api_key => auth['api_key'], :api_secret => auth['api_secret']}, file)
|
49
49
|
end
|
50
50
|
puts "=> Gem authorized." if re_auth
|
51
|
+
return true
|
51
52
|
else
|
52
53
|
puts auth['error'] || "Could not authorize, check your e-mail or password."
|
54
|
+
return false
|
53
55
|
end
|
54
56
|
end
|
55
57
|
end
|
@@ -165,30 +167,33 @@ when 's', 'server'
|
|
165
167
|
when 'auth'
|
166
168
|
auth true
|
167
169
|
when 'c', 'config', 'setup'
|
168
|
-
auth
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
170
|
+
if auth
|
171
|
+
if site = Siteleaf::Site.find_by_domain(ARGV[1])
|
172
|
+
config site
|
173
|
+
else
|
174
|
+
puts "No site found for `#{ARGV[1]}`, run `siteleaf new #{ARGV[1]}` to create it.\n"
|
175
|
+
end
|
173
176
|
end
|
174
177
|
when 'n', 'new'
|
175
|
-
auth
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
178
|
+
if auth
|
179
|
+
if (site = Siteleaf::Site.create(:title => ARGV[1], :domain => ARGV[1])) && (!site.error)
|
180
|
+
dir = ARGV.size >= 3 ? ARGV[2] : ARGV[1]
|
181
|
+
Dir.mkdir(dir) unless File.directory?(dir)
|
182
|
+
Dir.chdir(dir)
|
183
|
+
config site
|
184
|
+
else
|
185
|
+
puts "Could not create site `#{ARGV[1]}`.\n"
|
186
|
+
end
|
183
187
|
end
|
184
188
|
when 'pull'
|
185
189
|
case ARGV[1]
|
186
190
|
when 'theme'
|
187
|
-
auth
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
191
|
+
if auth
|
192
|
+
if site_id = get_site_id
|
193
|
+
get_theme_assets(site_id)
|
194
|
+
else
|
195
|
+
puts "Site not configured, run `siteleaf config yoursite.com`.\n"
|
196
|
+
end
|
192
197
|
end
|
193
198
|
else
|
194
199
|
puts "`#{ARGV[0]}` command not found.\n"
|
@@ -196,11 +201,12 @@ when 'pull'
|
|
196
201
|
when 'push'
|
197
202
|
case ARGV[1]
|
198
203
|
when 'theme'
|
199
|
-
auth
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
+
if auth
|
205
|
+
if site_id = get_site_id
|
206
|
+
put_theme_assets(site_id)
|
207
|
+
else
|
208
|
+
puts "Site not configured, run `siteleaf config yoursite.com`.\n"
|
209
|
+
end
|
204
210
|
end
|
205
211
|
else
|
206
212
|
puts "`#{ARGV[0]}` command not found.\n"
|
data/lib/siteleaf/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: siteleaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.17
|
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-10-
|
12
|
+
date: 2013-10-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|