lib/ayadn/view.rb in ayadn-1.7.1 vs lib/ayadn/view.rb in ayadn-1.7.2

- old
+ new

@@ -12,17 +12,17 @@ def hide_cursor puts "\e[?25l" end - def show_posts_with_index(data, options, niceranks = {}) + def show_posts_with_index(data, options = {}, niceranks = {}) posts, view = build_stream_with_index(data, options, niceranks) puts view unless view == "" Databases.save_indexed_posts(posts) end - def show_posts(data, options, niceranks = {}) + def show_posts(data, options = {}, niceranks = {}) resp = build_stream_without_index(data, options, niceranks) puts resp unless resp == "" end def if_raw what, options @@ -35,22 +35,18 @@ def show_raw(stream, options = {}) #puts stream.to_json jj stream end - def show_simple_post(post, options) + def show_simple_post(post, options = {}) puts build_stream_without_index(post, options, {}) end def show_posted(resp) show_simple_post([resp['data']], {}) end - def show_simple_stream(stream) - puts stream - end - def show_list_reposted(list, target) users_list, table = @workers.build_reposted_list(list, target) puts @workers.build_users_list(users_list, table) puts "\n" end @@ -285,11 +281,11 @@ view << ann[0]['value']['content'] view << "\n" end view << "\n\n" end - view << "\nYour account is currently linked to #{bucket.length} channels.\n\n".color(:green) unless options[:channels] + view << "\nYour account is currently linked to #{bucket.length} channels.\n\n".color(:green) unless options[:channels] || options[:id] puts view end def render(stream, options = {}, niceranks = {}) unless options[:raw] @@ -304,14 +300,9 @@ if options[:index] show_posts_with_index(stream, options, niceranks) else show_posts(stream, options, niceranks) end - end - - def get_simple_view(stream) - clear_screen() - show_simple_stream(stream) end def clear_screen puts "\e[H\e[2J" end