earthquake 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +0 -2
- data/VERSION +1 -1
- data/earthquake.gemspec +1 -1
- data/lib/earthquake/core.rb +12 -1
- data/lib/earthquake/get_access_token.rb +0 -1
- metadata +1 -1
data/Gemfile.lock
CHANGED
@@ -21,7 +21,6 @@ GEM
|
|
21
21
|
notify (0.3.0)
|
22
22
|
oauth (0.4.4)
|
23
23
|
rake (0.8.7)
|
24
|
-
rcov (0.9.9)
|
25
24
|
roauth (0.0.3)
|
26
25
|
rspec (2.3.0)
|
27
26
|
rspec-core (~> 2.3.0)
|
@@ -53,7 +52,6 @@ DEPENDENCIES
|
|
53
52
|
launchy
|
54
53
|
notify
|
55
54
|
oauth
|
56
|
-
rcov
|
57
55
|
rspec (~> 2.3.0)
|
58
56
|
termcolor
|
59
57
|
twitter-stream
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/earthquake.gemspec
CHANGED
data/lib/earthquake/core.rb
CHANGED
@@ -29,19 +29,30 @@ module Earthquake
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def load_config
|
32
|
+
# TODO: parse argv
|
32
33
|
self.config = {
|
33
34
|
:dir => File.expand_path('~/.earthquake'),
|
34
35
|
:consumer_key => 'qOdgatiUm6HIRcdoGVqaZg',
|
35
36
|
:consumer_secret => 'DHcL0bmS02vjSMHMrbFxCQqbDxh8yJZuLuzKviyFMo'
|
36
37
|
}
|
38
|
+
|
39
|
+
unless File.exists?(config[:dir])
|
40
|
+
require 'fileutils'
|
41
|
+
FileUtils.mkdir_p(config[:dir])
|
42
|
+
end
|
43
|
+
|
37
44
|
config[:file] ||= File.join(config[:dir], 'config')
|
45
|
+
|
46
|
+
unless File.exists?(config[:file])
|
47
|
+
File.open(config[:file], 'w')
|
48
|
+
end
|
49
|
+
|
38
50
|
load config[:file]
|
39
51
|
|
40
52
|
get_access_token unless self.config[:token] && self.config[:secret]
|
41
53
|
end
|
42
54
|
|
43
55
|
def start(*argv)
|
44
|
-
# TODO: parse argv
|
45
56
|
_init
|
46
57
|
|
47
58
|
Thread.start do
|
@@ -20,7 +20,6 @@ module Earthquake
|
|
20
20
|
|
21
21
|
puts "Saving 'token' and 'secret' to '#{config[:file]}'"
|
22
22
|
File.open(config[:file], 'a') do |f|
|
23
|
-
f << "\n"
|
24
23
|
f << "Earthquake.config[:token] = '#{config[:token]}'"
|
25
24
|
f << "\n"
|
26
25
|
f << "Earthquake.config[:secret] = '#{config[:secret]}'"
|