flickr_cli 0.2.2 → 0.2.3

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.
Files changed (3) hide show
  1. data/lib/flickr_cli.rb +5 -4
  2. metadata +8 -25
  3. data/lib/authentication.rb +0 -38
data/lib/flickr_cli.rb CHANGED
@@ -1,12 +1,10 @@
1
1
  # Extental Dependencies
2
2
  require 'rubygems'
3
- require 'flickraw'
4
- require 'launchy'
5
3
  require 'highline/import'
6
4
  require 'asciiart'
5
+ require 'flickr_authentication'
7
6
 
8
7
  # Internal Libraries
9
- require 'authentication'
10
8
  require 'menu'
11
9
 
12
10
  module FlickrCli
@@ -14,7 +12,10 @@ module FlickrCli
14
12
  def self.start_program
15
13
  HighLine.track_eof = false
16
14
 
17
- Authentication.establish_session
15
+ fa = FlickrAuthentication.new(key: 'e8505c88feb2c0cc9d2da6bcbe18767c', shared_secret: 'd344de362ea86f0e', auth_file: File.join(Dir.home, ".flickr_clirc"))
16
+ fa.authenticate
17
+
18
+ # Authentication.establish_session
18
19
  Menu.main_menu
19
20
  end
20
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickr_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
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-28 00:00:00.000000000 Z
12
+ date: 2013-07-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline
@@ -28,29 +28,13 @@ dependencies:
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.6.11
30
30
  - !ruby/object:Gem::Dependency
31
- name: launchy
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - '='
36
- - !ruby/object:Gem::Version
37
- version: 0.4.0
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - '='
44
- - !ruby/object:Gem::Version
45
- version: 0.4.0
46
- - !ruby/object:Gem::Dependency
47
- name: flickraw
31
+ name: asciiart
48
32
  requirement: !ruby/object:Gem::Requirement
49
33
  none: false
50
34
  requirements:
51
35
  - - '='
52
36
  - !ruby/object:Gem::Version
53
- version: 0.8.4
37
+ version: 0.0.5
54
38
  type: :runtime
55
39
  prerelease: false
56
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,15 +42,15 @@ dependencies:
58
42
  requirements:
59
43
  - - '='
60
44
  - !ruby/object:Gem::Version
61
- version: 0.8.4
45
+ version: 0.0.5
62
46
  - !ruby/object:Gem::Dependency
63
- name: asciiart
47
+ name: flickr_authentication
64
48
  requirement: !ruby/object:Gem::Requirement
65
49
  none: false
66
50
  requirements:
67
51
  - - '='
68
52
  - !ruby/object:Gem::Version
69
- version: 0.0.5
53
+ version: 0.0.1
70
54
  type: :runtime
71
55
  prerelease: false
72
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +58,7 @@ dependencies:
74
58
  requirements:
75
59
  - - '='
76
60
  - !ruby/object:Gem::Version
77
- version: 0.0.5
61
+ version: 0.0.1
78
62
  - !ruby/object:Gem::Dependency
79
63
  name: pry
80
64
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +84,6 @@ extensions: []
100
84
  extra_rdoc_files: []
101
85
  files:
102
86
  - bin/flickr_cli
103
- - lib/authentication.rb
104
87
  - lib/flickr_cli.rb
105
88
  - lib/menu.rb
106
89
  homepage: https://github.com/nodanaonlyzuul/flickr_cli
@@ -1,38 +0,0 @@
1
- module FlickrCli
2
- module Authentication
3
- def self.establish_session
4
- auth_file = File.join(Dir.home, ".flickr_clirc")
5
- FlickRaw.api_key = "e8505c88feb2c0cc9d2da6bcbe18767c"
6
- FlickRaw.shared_secret = "d344de362ea86f0e"
7
-
8
- if File.exists?(auth_file)
9
- puts "authenticating with #{auth_file}"
10
- data = YAML.load_file(auth_file)
11
- auth = flickr.auth.checkToken :auth_token => data["api_token"]
12
- else
13
- frob = flickr.auth.getFrob
14
- auth_url = FlickRaw.auth_url :frob => frob, :perms => "write"
15
-
16
- puts " "
17
- puts "opening your browser..."
18
- sleep 1
19
- puts "Come back and press Enter when you are finished"
20
- sleep 2
21
- Launchy.open(auth_url)
22
-
23
- STDIN.getc
24
-
25
- # Authentication
26
- auth = flickr.auth.getToken :frob => frob
27
- login = flickr.test.login
28
-
29
- puts auth.token
30
-
31
- require 'yaml'
32
- data = {}
33
- data["api_token"] = auth.token
34
- File.open(auth_file, "w"){|f| YAML.dump(data, f) }
35
- end
36
- end
37
- end
38
- end