earthquake 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
1
+ 0.2.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{earthquake}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["jugyo"]
@@ -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]}'"
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: earthquake
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.1
5
+ version: 0.2.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - jugyo