flickr_airlift 0.0.8 → 0.0.9

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/flickr_airlift.rb +6 -3
  2. metadata +4 -4
@@ -47,21 +47,24 @@ module FlickrAirlift
47
47
  end
48
48
  end
49
49
 
50
- def self.upload(relative_url)
50
+ def self.upload(relative_url = ".")
51
51
  establish_session("write")
52
52
 
53
- image_file_names = Dir.entries(".").find_all{ |file_name| UPLOADABLE_FORMATS.any?{ |extension| file_name.downcase.include?(extension)} }
53
+ image_file_names = Dir.entries(relative_url).find_all{ |file_name| UPLOADABLE_FORMATS.any?{ |extension| file_name.downcase.include?(extension)} }
54
54
  uploaded_ids = []
55
+
55
56
  puts "Uploading #{image_file_names.length} files:"
56
57
  sleep 1
58
+
57
59
  image_file_names.each_with_index do |file_name, index|
58
60
  puts " Uploading (#{index+1} of #{image_file_names.length}): #{file_name}"
59
61
  uploaded_ids << flickr.upload_photo(File.join(relative_url, file_name), :title => file_name.split(".").first)
60
62
  end
63
+
61
64
  puts "...DONE!"
62
65
  edit_url = "http://www.flickr.com/photos/upload/edit/?ids=#{uploaded_ids.join(',')}"
63
66
 
64
- system("which open") ? system("open '#{edit_url}'") : puts(" Go to #{edit_url} to edit your photos more")
67
+ Launchy.open(edit_url)
65
68
  end
66
69
 
67
70
  def self.establish_session(permission = "read")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickr_airlift
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
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: 2011-05-23 00:00:00 -04:00
18
+ date: 2011-05-24 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency