flickr_cli 0.0.3 → 0.1.1

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 (2) hide show
  1. data/lib/menu.rb +17 -4
  2. metadata +18 -4
data/lib/menu.rb CHANGED
@@ -9,13 +9,14 @@ module FlickrCli
9
9
  end
10
10
  end
11
11
 
12
- def self.menu_for(contact)
12
+ def self.menu_for(contact, page = 1)
13
13
 
14
- user_id = flickr.people.findByUsername(:username => contact).id
15
- photos = flickr.photos.search(:user_id => user_id)
14
+ the_page = page
15
+ user_id = flickr.people.findByUsername(:username => contact).id
16
+ photos = flickr.photos.search(:user_id => user_id, :page => the_page)
16
17
 
17
18
  choose do |menu|
18
- menu.prompt = "Pick a file"
19
+ menu.prompt = "Pick a File (page #{the_page})"
19
20
 
20
21
  photos.map(&:title).each do |photo|
21
22
  menu.choice(photo) do
@@ -26,6 +27,10 @@ module FlickrCli
26
27
  self.menu_for(FlickrCli::Menu.menu_for(contact))
27
28
  end
28
29
  end
30
+ menu.choice("Back <<") { self.menu_for(contact, (the_page-1) )} if the_page > 1
31
+ menu.choice("More >>") { self.menu_for(contact, (the_page+1) )}
32
+ menu.choice("~(==::Main::==)~") { self.main_menu }
33
+ menu.choice("Quit") { say self.good_by_message; exit; }
29
34
  end
30
35
  end
31
36
 
@@ -48,6 +53,13 @@ module FlickrCli
48
53
  my_file.delete
49
54
  end
50
55
 
56
+ def self.good_by_message
57
+ ["Be that way",
58
+ "Goodbye - I'll never love again",
59
+ "See you later, bye!",
60
+ "Goodbye - Flickr? I hardly know her"].shuffle[0]
61
+ end
62
+
51
63
  def self.contacts
52
64
  contacts ||= flickr.contacts.getList.map(&:username).sort
53
65
 
@@ -60,6 +72,7 @@ module FlickrCli
60
72
  end
61
73
  end
62
74
 
75
+
63
76
  # TODO: implement sets
64
77
  # def self.sets
65
78
  #
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 0
9
- - 3
10
- version: 0.0.3
8
+ - 1
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stephen Schor
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-11 00:00:00 -05:00
18
+ date: 2012-02-17 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -50,6 +50,20 @@ dependencies:
50
50
  version: 0.8.4
51
51
  type: :runtime
52
52
  version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: rmagick
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ type: :runtime
66
+ version_requirements: *id003
53
67
  description: A Command-Line tool for exploring your flickr account
54
68
  email:
55
69
  - beholdthepanda@gmail.com