favt 0.0.4 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aedc23e0bcdae4700ff82f11fb9649c7e34b84c1
4
- data.tar.gz: 2462c92f33c9a4b6dbe1abd16548b2cfff106eaf
3
+ metadata.gz: cc75eff88cb8444c186a82ff5ab646180919d8ae
4
+ data.tar.gz: 75b8f3979d5160db679a58a8c622be3a087db52f
5
5
  SHA512:
6
- metadata.gz: f8f4f6f550e146b9bf84f24c8459e45876e91e7480bac3ee0bc1828a2ceb33850c7dd1dcb95685fbd5330e5501e5cfdde2466d851ffae03b8449b8ec79cf58a9
7
- data.tar.gz: 697466a1fe658d109f0df36352de4c9d4dadb5e0731e2b2bad492b82ef4f961dd38dba0406bfb982e05d312519ef0055f62e446166b13fafd4b47dac5f3cdbfc
6
+ metadata.gz: aa07af7af1b49ec870a131e9bc0c6d916e4e34f7d70252d630eb73a017ef028dbf7b24687fa09c2a7f7a57c1b8f91c6a156c19c375c40025dd5f6b77c37e80dc
7
+ data.tar.gz: e125170d9f9256b63e9a159548f2b86fe8fa7bba7bc8709702b3142933bee23ae5f2c0c12500257adb02afb8da1d4ec2b506760081f4bd56bf8125ae8e5a26ab
data/bin/favt CHANGED
@@ -19,6 +19,10 @@ def option_parse
19
19
  options["user"] = user
20
20
  end
21
21
 
22
+ opts.on("-f FILE", "--file FILE", String,
23
+ "Set any config yaml file (default:config.yaml)") do |file|
24
+ options["config_file"] = file
25
+ end
22
26
  end.parse!
23
27
  return options
24
28
  end
@@ -43,10 +47,10 @@ Config file examples (config.yaml)
43
47
  -----------------------------------
44
48
 
45
49
  client:
46
- consumer_key: "uCFhVhtftsQbpSlox2KZnRCWp"
47
- consumer_secret: "wzouRWR4aggXwcArfHeflkcvTDkezjFUhGLhU0D9ijj9fipMOP"
48
- access_token: "7883842-IBrjYXVe6yPQ4JBLUm6WjRh8beZuMvmFtH1wckfkqT"
49
- access_token_secret: "trdmKwy9CVYN4m6ZE99OmQP853B6ZlYXXWFccdZC1pOSg"
50
+ consumer_key: "Your Consumer Key"
51
+ consumer_secret: "Your Consumer Secret Key"
52
+ access_token: "Your Access Token"
53
+ access_token_secret: "Your Access Token Secret"
50
54
 
51
55
  users:
52
56
  - "esehara"
data/config.sample.yaml CHANGED
@@ -1,4 +1,4 @@
1
- lient:
1
+ client:
2
2
  consumer_key: "Your Consumer Key"
3
3
  consumer_secret: "Your Consumer Secret Key"
4
4
  access_token: "Your Access Token"
data/lib/favt.rb CHANGED
@@ -6,8 +6,7 @@ require "yaml"
6
6
 
7
7
  module Favt
8
8
  class TwitterClient
9
-
10
- def init_client()
9
+ def init_client
11
10
  keys = @config["client"]
12
11
  @client = Twitter::REST::Client.new do |config|
13
12
  config.consumer_key = keys["consumer_key"]
@@ -26,7 +25,7 @@ module Favt
26
25
  self.init_client()
27
26
  end
28
27
 
29
- def favorites_from_user()
28
+ def favorites_from_user
30
29
  users = self.target_users
31
30
  favorites = users.map do |user|
32
31
  @client.favorites user
@@ -41,15 +40,14 @@ module Favt
41
40
  return set_fav_posts
42
41
  end
43
42
 
44
- def target_users()
43
+ def target_users
45
44
  if !@options["user"]
46
45
  return @config["users"]
47
46
  end
48
47
  return [@options["user"]]
49
48
  end
50
49
 
51
- def favorite_posts()
52
-
50
+ def favorite_posts
53
51
  show_fav_posts = self.to_set(self.favorites_from_user.sort do
54
52
  |prev_post, next_post| next_post.id <=> prev_post.id
55
53
  end)
@@ -70,8 +68,7 @@ module Favt
70
68
  return favorites_dict
71
69
  end
72
70
 
73
- def render()
74
-
71
+ def render
75
72
  self.favorite_posts.each do |_, favorite|
76
73
  favorite["users"].times do
77
74
  print "■".red
data/lib/favt/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Favt
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: favt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - esehara shigeo