termtter 1.0.2 → 1.0.3

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.
data/Rakefile CHANGED
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
27
27
  s.add_dependency("highline", ">= 1.5.0")
28
28
  s.add_dependency("termcolor", ">= 0.3.1")
29
29
  s.add_dependency("rubytter", ">= 0.4.8")
30
+ s.add_dependency("sqlite3-ruby", ">= 1.2.4")
30
31
  s.authors = %w(jugyo ujihisa)
31
32
  s.email = 'jugyo.org@gmail.com'
32
33
  s.homepage = 'http://wiki.github.com/jugyo/termtter'
data/lib/termtter.rb CHANGED
@@ -25,37 +25,3 @@ require 'termtter/task_manager'
25
25
  require 'termtter/client'
26
26
  require 'termtter/api'
27
27
  require 'termtter/system_extensions'
28
-
29
- module Termtter
30
- APP_NAME = 'termtter'
31
-
32
- config.system.set_default :conf_dir, File.expand_path('~/.termtter')
33
- CONF_DIR = config.system.conf_dir
34
-
35
- config.system.set_default :conf_file, CONF_DIR + '/config'
36
- CONF_FILE = config.system.conf_file
37
- end
38
-
39
- if RUBY_VERSION < '1.8.7'
40
- class Array
41
- def take(n) self[0...n] end
42
- end
43
- end
44
-
45
- def plugin(name, init = {})
46
- unless init.empty?
47
- init.each do |key, value|
48
- config.plugins.__refer__(name.to_sym).__assign__(key.to_sym, value)
49
- end
50
- end
51
- # FIXME: below path should be replaced by optparsed path
52
- if File.exist?(path = File.expand_path("~/.termtter/plugins/#{name}"))
53
- require path
54
- else
55
- require "plugins/#{name}"
56
- end
57
- rescue LoadError => e
58
- Termtter::Client.handle_error(e)
59
- end
60
-
61
- $:.unshift(Termtter::CONF_DIR) # still does not use
@@ -2,6 +2,15 @@
2
2
  require 'fileutils'
3
3
 
4
4
  module Termtter
5
+ APP_NAME = 'termtter'
6
+
7
+ config.system.set_default :conf_dir, File.expand_path('~/.termtter')
8
+ CONF_DIR = config.system.conf_dir
9
+
10
+ config.system.set_default :conf_file, CONF_DIR + '/config'
11
+ CONF_FILE = config.system.conf_file
12
+ $:.unshift(Termtter::CONF_DIR)
13
+
5
14
  class CommandNotFound < StandardError; end
6
15
 
7
16
  module Client
@@ -1,5 +1,26 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
+ def plugin(name, init = {})
4
+ unless init.empty?
5
+ init.each do |key, value|
6
+ config.plugins.__refer__(name.to_sym).__assign__(key.to_sym, value)
7
+ end
8
+ end
9
+ # FIXME: below path should be replaced by optparsed path
10
+ if File.exist?(path = File.expand_path("~/.termtter/plugins/#{name}"))
11
+ require path
12
+ else
13
+ require "plugins/#{name}"
14
+ end
15
+ rescue LoadError => e
16
+ Termtter::Client.handle_error(e)
17
+ end
18
+
19
+ def filter(name, init = {})
20
+ warn "filter method will be removed. Use plugin instead."
21
+ plugin(name, init)
22
+ end
23
+
3
24
  require 'dl/import'
4
25
  module Readline
5
26
  begin
@@ -105,6 +126,12 @@ if win?
105
126
  end
106
127
  end
107
128
 
129
+ unless Array.instance_methods.include?('take')
130
+ class Array
131
+ def take(n) self[0...n] end
132
+ end
133
+ end
134
+
108
135
  unless Symbol.instance_methods.include?('to_proc')
109
136
  class Symbol
110
137
  def to_proc
@@ -1,4 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module Termtter
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: termtter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo
@@ -53,6 +53,16 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.4.8
55
55
  version:
56
+ - !ruby/object:Gem::Dependency
57
+ name: sqlite3-ruby
58
+ type: :runtime
59
+ version_requirement:
60
+ version_requirements: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 1.2.4
65
+ version:
56
66
  description: Termtter is a terminal based Twitter client
57
67
  email: jugyo.org@gmail.com
58
68
  executables: