atig 0.3.7 → 0.3.8

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.
@@ -23,7 +23,7 @@ module Atig
23
23
  end
24
24
  end
25
25
 
26
- # 最新版のチェック
26
+ # git clone した状態から動かしていたら常に最新版のチェック
27
27
  daemon do
28
28
  log :info,"check update"
29
29
  messages = UpdateChecker.latest
@@ -35,7 +35,7 @@ module Atig
35
35
  @channel.notify(" ... and more. check it: http://mzp.github.com/atig/") if messages.size > 3
36
36
  end
37
37
  sleep (3*60*60)
38
- end
38
+ end if UpdateChecker.git_repos?
39
39
 
40
40
  db.statuses.listen do|entry|
41
41
  if db.followings.include?(entry.user) or
@@ -20,6 +20,10 @@ module Atig
20
20
  system("git show #{rev} > /dev/null 2>&1")
21
21
  end
22
22
 
23
+ def git_repos?
24
+ File.exists? File.expand_path('../../../.git', __FILE__)
25
+ end
26
+
23
27
  def git?
24
28
  system('which git > /dev/null 2>&1')
25
29
  end
@@ -47,7 +51,6 @@ module Atig
47
51
  []
48
52
  end
49
53
 
50
- module_function :latest, :commits, :server_version, :local_repos?, :git?
54
+ module_function :latest, :commits, :server_version, :local_repos?, :git?, :git_repos?
51
55
  end
52
56
  end
53
-
data/lib/atig/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Atig
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/autofix'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Autofix do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/destroy'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Destroy,"when status is not removed" do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/dm'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Dm do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/favorite'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Favorite do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/limit'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Limit do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/location'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Location do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/name'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Name do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../spec_helper', File.dirname(__FILE__))
4
4
  require 'atig/command/option'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Option do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/refresh'
5
- require 'atig/command/command_helper'
6
5
  require 'atig/command/info'
7
6
 
8
7
  describe Atig::Command::Refresh do
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/reply'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Reply do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/retweet'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Retweet do
8
7
  include CommandHelper
@@ -1,7 +1,6 @@
1
1
  # -*- mode:ruby; coding:utf-8 -*-
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
- require 'atig/command/command_helper'
5
4
  require 'atig/command/spam'
6
5
 
7
6
  describe Atig::Command::Spam do
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/status'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Status do
8
7
  include CommandHelper
@@ -25,6 +24,19 @@ describe Atig::Command::Status do
25
24
  @gateway.filtered.should == { :status => 'blah blah' }
26
25
  end
27
26
 
27
+ if RUBY_VERSION >= '1.9'
28
+ it "should post with japanese language" do
29
+ res = status("あ"*140)
30
+ @statuses.should_receive(:find_by_user).with(@me,:limit=>1).and_return(nil)
31
+ @api.should_receive(:post).with('statuses/update', {:status=>"あ"*140}).and_return(res)
32
+
33
+ call '#twitter', "status", ["あ" * 140]
34
+
35
+ @gateway.updated.should == [ res, '#twitter' ]
36
+ @gateway.filtered.should == { :status => "あ" * 140 }
37
+ end
38
+ end
39
+
28
40
  it "should not post same post" do
29
41
  e = entry user(1,'mzp'), status('blah blah')
30
42
  @statuses.should_receive(:find_by_user).with(@me,:limit=>1).and_return([ e ] )
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/thread'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Thread do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/time'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Time do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/uptime'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Uptime do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__)
4
4
  require 'atig/command/user_info'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::UserInfo do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/user'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::User do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/version'
5
- require 'atig/command/command_helper'
6
5
 
7
6
  describe Atig::Command::Version do
8
7
  include CommandHelper
@@ -2,7 +2,6 @@
2
2
 
3
3
  require File.expand_path( '../../spec_helper', __FILE__ )
4
4
  require 'atig/command/whois'
5
- require 'atig/command/command_helper'
6
5
  require 'atig/command/info'
7
6
 
8
7
  include Net::IRC::Constants
File without changes
@@ -9,6 +9,10 @@ describe Atig::Db::Followings,"when it is empty" do
9
9
  @db = Atig::Db::Followings.new('following.test.db')
10
10
  end
11
11
 
12
+ after(:all) do
13
+ FileUtils.rm_f 'following.test.db'
14
+ end
15
+
12
16
  it "should be emtpy" do
13
17
  @db.empty?.should be_true
14
18
  end
@@ -19,6 +19,12 @@ describe Atig::Db::Lists do
19
19
  @lists.listen{|kind,*args| @args[kind] = args }
20
20
  end
21
21
 
22
+ after(:all) do
23
+ %w(test-a.db test-b.db).each do |file|
24
+ FileUtils.rm_f file
25
+ end
26
+ end
27
+
22
28
  it "should have list" do
23
29
  @lists.update("a" => [ @alice, @bob ],
24
30
  "b" => [ @alice, @bob , @charriey ])
@@ -101,4 +107,3 @@ describe Atig::Db::Lists do
101
107
  @args[:mode].should == [ "a", [ bob ]]
102
108
  end
103
109
  end
104
-
@@ -31,6 +31,10 @@ describe Atig::Db::Statuses do
31
31
  @db.add :status => @c , :user => @alice, :source => :srcC
32
32
  end
33
33
 
34
+ after(:all) do
35
+ FileUtils.rm_f 'test.db'
36
+ end
37
+
34
38
  it "should be re-openable" do
35
39
  Atig::Db::Statuses.new 'test.db'
36
40
  end
data/spec/spec_helper.rb CHANGED
@@ -5,9 +5,9 @@ require 'bundler'
5
5
  Bundler.setup
6
6
  Bundler.require :default, :test
7
7
 
8
- $:.unshift(File.expand_path( '../lib', File.dirname(__FILE__) ) )
9
8
 
10
9
  require 'atig/monkey'
10
+ require 'command_helper'
11
11
 
12
12
  RSpec::Matchers.define :be_text do |text|
13
13
  match do |status|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
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-01-27 00:00:00.000000000 Z
12
+ date: 2013-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3
@@ -179,7 +179,6 @@ files:
179
179
  - lib/atig/command.rb
180
180
  - lib/atig/command/autofix.rb
181
181
  - lib/atig/command/command.rb
182
- - lib/atig/command/command_helper.rb
183
182
  - lib/atig/command/destroy.rb
184
183
  - lib/atig/command/dm.rb
185
184
  - lib/atig/command/favorite.rb
@@ -266,6 +265,7 @@ files:
266
265
  - spec/command/user_spec.rb
267
266
  - spec/command/version_spec.rb
268
267
  - spec/command/whois_spec.rb
268
+ - spec/command_helper.rb
269
269
  - spec/db/followings_spec.rb
270
270
  - spec/db/listenable_spec.rb
271
271
  - spec/db/lists_spec.rb
@@ -333,6 +333,7 @@ test_files:
333
333
  - spec/command/user_spec.rb
334
334
  - spec/command/version_spec.rb
335
335
  - spec/command/whois_spec.rb
336
+ - spec/command_helper.rb
336
337
  - spec/db/followings_spec.rb
337
338
  - spec/db/listenable_spec.rb
338
339
  - spec/db/lists_spec.rb