flickr-store 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ require 'pp'
4
4
  BIN_ROOT = File.dirname(File.absolute_path(__FILE__))
5
5
  require BIN_ROOT + '/../lib/flickr-store'
6
6
 
7
- CREDS_FILE = './.flickr-credentials'
7
+ CREDS_FILE = Dir.home + '/.flickr-credentials'
8
8
  if File.exists?(CREDS_FILE)
9
9
  creds = Marshal.load(File.read(CREDS_FILE))
10
10
  print "Credentials: "
@@ -3,7 +3,7 @@
3
3
  BIN_ROOT = File.dirname(File.absolute_path(__FILE__))
4
4
  require BIN_ROOT + '/../lib/flickr-store'
5
5
 
6
- CREDS_FILE = './.flickr-credentials'
6
+ CREDS_FILE = Dir.home + '/.flickr-credentials'
7
7
  if !File.exists?(CREDS_FILE)
8
8
  puts "Please login using flickr-authenticate first!"
9
9
  exit
@@ -13,6 +13,8 @@ FlickRaw.secure = true
13
13
 
14
14
  module Flickr
15
15
  class Store
16
+ DICT_FILE = Dir.home + '/.flickr-store'
17
+
16
18
  def self.authenticate(key, secret)
17
19
  FlickRaw.api_key = key
18
20
  FlickRaw.shared_secret = secret
@@ -43,15 +45,15 @@ module Flickr
43
45
  flickr.access_token = access_token
44
46
  flickr.access_secret = access_secret
45
47
 
46
- if File.exists?('./.flickr-store')
48
+ if File.exists?(DICT_FILE)
47
49
  begin
48
- @dict = Marshal.load File.read('./.flickr-store')
50
+ @dict = Marshal.load File.read(DICT_FILE)
49
51
  rescue
50
- FileUtils.touch('./.flickr-store')
52
+ FileUtils.touch(DICT_FILE)
51
53
  @dict = {}
52
54
  end
53
55
  else
54
- FileUtils.touch('./.flickr-store')
56
+ FileUtils.touch(DICT_FILE)
55
57
  @dict = {}
56
58
  end
57
59
  end
@@ -96,7 +98,7 @@ module Flickr
96
98
  private
97
99
 
98
100
  def update_dict!
99
- File.write "./.flickr-store", Marshal.dump(@dict)
101
+ File.write DICT_FILE, Marshal.dump(@dict)
100
102
  end
101
103
  end
102
104
  end
@@ -1,5 +1,5 @@
1
1
  module Flickr
2
2
  class Store
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickr-store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: