siteleaf 0.9.16 → 0.9.17

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.
Files changed (3) hide show
  1. data/bin/siteleaf +29 -23
  2. data/lib/siteleaf/version.rb +1 -1
  3. 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
- if site = Siteleaf::Site.find_by_domain(ARGV[1])
170
- config site
171
- else
172
- puts "No site found for `#{ARGV[1]}`, run `siteleaf new #{ARGV[1]}` to create it.\n"
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
- if (site = Siteleaf::Site.create(:title => ARGV[1], :domain => ARGV[1])) && (!site.error)
177
- dir = ARGV.size >= 3 ? ARGV[2] : ARGV[1]
178
- Dir.mkdir(dir) unless File.directory?(dir)
179
- Dir.chdir(dir)
180
- config site
181
- else
182
- puts "Could not create site `#{ARGV[1]}`.\n"
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
- if site_id = get_site_id
189
- get_theme_assets(site_id)
190
- else
191
- puts "Site not configured, run `siteleaf config yoursite.com`.\n"
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
- if site_id = get_site_id
201
- put_theme_assets(site_id)
202
- else
203
- puts "Site not configured, run `siteleaf config yoursite.com`.\n"
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"
@@ -1,3 +1,3 @@
1
1
  module Siteleaf
2
- VERSION = "0.9.16"
2
+ VERSION = "0.9.17"
3
3
  end
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.16
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-16 00:00:00.000000000 Z
12
+ date: 2013-10-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty