jmcarbo-rimapub 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Manifest.txt +1 -0
  2. data/bin/rimapub +59 -0
  3. data/lib/rimapub.rb +1 -1
  4. metadata +6 -5
@@ -3,6 +3,7 @@ Manifest.txt
3
3
  PostInstall.txt
4
4
  README.rdoc
5
5
  Rakefile
6
+ bin/rimapub
6
7
  config/website.yml.sample
7
8
  lib/rimapub.rb
8
9
  lib/rimapub/rimapub.rb
@@ -0,0 +1,59 @@
1
+ #! /usr/bin/ruby
2
+ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
3
+
4
+ require 'rubygems'
5
+ require 'rimapub'
6
+ require 'rdoc/ri/ri_paths'
7
+ require 'getoptions'
8
+ require 'pp'
9
+
10
+ COMMAND_LIST = ['publish', 'setup' ]
11
+ opt = GetOptions.new(%w( help set=s command=s description=s images=@s x! tags=s Title=s Date=s))
12
+
13
+ if opt['help']
14
+ puts "Usage: rimapub -c <#{COMMAND_LIST.join(', ')}> -s <image set> -d <image description> -t <tags comma separated and quoted> -i <image list or glob> "
15
+ puts " -D <publish date YY-MM-DD> -T <image title>"
16
+ puts " rimapub -h"
17
+ exit 0
18
+ end
19
+
20
+ set = opt['set'] || "default"
21
+ command = opt['command'] || "publish"
22
+ description = opt['description'] || ""
23
+ images = opt['images'] || "*"
24
+ verbose = opt['x'] || false
25
+ tags = opt['tags'] || ""
26
+ title = opt['Title'] || ""
27
+ date = opt['Date'] || Time.now.strftime("%Y-%m-%d")
28
+
29
+
30
+ #begin
31
+ if COMMAND_LIST.include? command
32
+ puts "Executing command #{command}" if verbose
33
+ case command
34
+ when 'publish':
35
+
36
+ images.each do |f|
37
+ f = File.expand_path(f)
38
+
39
+ Dir.glob(f) do |f2|
40
+ if(!File.directory? f2)
41
+ if File.exists?(f2)
42
+ puts "Publishing #{f2} in set #{set} with title #{title}" if verbose
43
+ aPublisher = Rimapub::Rimapub.new(verbose)
44
+ aPublisher.publish(f2, set, title, description, tags)
45
+ else
46
+ puts "File #{f2} does not exist."
47
+ end
48
+ else
49
+ puts "Directory of images not supported"
50
+ end
51
+ end
52
+ end
53
+ else
54
+ puts "Unsupported command"
55
+ end
56
+ end
57
+ # rescue
58
+ # puts "An error has occured #{$!}"
59
+ # end
@@ -6,5 +6,5 @@ require 'rimapub/rimapub_service.rb'
6
6
  require 'rimapub/rimapub_set.rb'
7
7
 
8
8
  module Rimapub
9
- VERSION = '0.0.2'
9
+ VERSION = '0.0.3'
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jmcarbo-rimapub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - FIXME full name
@@ -9,8 +9,8 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-17 00:00:00 -08:00
13
- default_executable:
12
+ date: 2009-01-19 00:00:00 -08:00
13
+ default_executable: rimapub
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: newgem
@@ -33,8 +33,8 @@ dependencies:
33
33
  description: "* GEM package that allows publishing image files to several online sites at ones. Acts like Shozu. * Command line executable rimapub allows publishing images to onlines sites from the command line."
34
34
  email:
35
35
  - FIXME email
36
- executables: []
37
-
36
+ executables:
37
+ - rimapub
38
38
  extensions: []
39
39
 
40
40
  extra_rdoc_files:
@@ -49,6 +49,7 @@ files:
49
49
  - PostInstall.txt
50
50
  - README.rdoc
51
51
  - Rakefile
52
+ - bin/rimapub
52
53
  - config/website.yml.sample
53
54
  - lib/rimapub.rb
54
55
  - lib/rimapub/rimapub.rb