lib/hse/cli.rb in hse-0.1.19 vs lib/hse/cli.rb in hse-0.1.21
- old
+ new
@@ -103,11 +103,11 @@
end
desc 'check [FILE]', 'check the correctness of module in FILE'
def check(fname = 'default')
doc = parse.build fname
- if doc[:title].nil?
+ if doc[:ru].nil?
say "error: title should be filled", :red
elsif doc[:en].nil?
say "error: English title should be filled", :red
elsif doc[:author].nil?
say "error: author should be filled", :red
@@ -131,17 +131,17 @@
end
desc 'push [FILE]', 'parse FILE, build json DOC and push DOC'
def push(fname = false, env = 'default')
doc = build fname
- puts "BUILD DOC_ID = #{doc[:_id]}"
revision = remote(env).get_doc_revision(doc)
doc['_rev'] = revision if revision
puts "rev ====== #{revision}"
- post_body = JSON.generate doc
puts "pushing document id #{doc[:_id]}"
- remote(env).put(doc[:_id], post_body)
+ #post_body = JSON.generate doc
+ #remote(env).put(doc[:_id], post_body)
+ remote(env).push_docs doc
end
desc 'generate [APPDIR]', 'generates .couchapprc'
def generate(to = nil)
self.appdir = to if to
@@ -149,9 +149,14 @@
directory('modules')
directory('posts')
directory('panels')
directory('events')
template('couchapprc.erb', '.couchapprc')
+ end
+
+ desc 'version', 'print version'
+ def version
+ say Hse::VERSION
end
private