jugyo-termtter 0.8.7 → 0.8.8

Sign up to get free protection for your applications and to get access to all the features.
data/lib/plugin/stdout.rb CHANGED
@@ -60,4 +60,4 @@ end
60
60
  # output statuses to stdout
61
61
  # example config
62
62
  # configatron.plugins.stdout.colors = [:none, :red, :green, :yellow, :blue, :magenta, :cyan]
63
- # configatron.plugins.stdout.timeline_format = '<%= color(time, 90) %> <%= color(status, status_color) %> <%= color(id, 90) %>'
63
+ # configatron.plugins.stdout.timeline_format = '<90><%=time%></90> <<%=status_color%>><%=status%></<%=status_color%>> <90><%=id%></90>'
@@ -1,6 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  require 'highline'
4
+ require 'termcolor'
4
5
  require 'time'
5
6
 
6
7
  module Termtter
@@ -49,12 +50,15 @@ module Termtter
49
50
  return []
50
51
  end
51
52
 
53
+ configatron.search.set_default(:highlihgt_text_format, '<on_magenta><white>\1</white></on_magenta>')
52
54
  def search(query)
53
55
  results = fetch_as_json(search_url_for("/search.json?q=#{CGI.escape(query)}"))['results']
54
56
  return results.map do |s|
55
57
  status = Status.new
56
58
  status.id = s['id']
57
- status.text = CGI.unescapeHTML(s['text']).gsub(/(\n|\r)/, '').gsub(/#{Regexp.escape(query)}/i, color(color('\0', 41), 37))
59
+ status.text = CGI.unescapeHTML(s['text']).
60
+ gsub(/(\n|\r)/, '').
61
+ gsub(/(#{Regexp.escape(query)})/i, configatron.search.highlihgt_text_format)
58
62
  status.created_at = Time.parse(s["created_at"])
59
63
  status.user_screen_name = s['from_user']
60
64
  status
@@ -1,4 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module Termtter
3
- VERSION = '0.8.7'
3
+ VERSION = '0.8.8'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jugyo-termtter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo