davetron5000-gliffy 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/gliffy +37 -17
- metadata +1 -1
data/bin/gliffy
CHANGED
@@ -15,6 +15,9 @@ default_value Etc.getpwuid.dir + '/.gliffyrc'
|
|
15
15
|
arg_name 'path to gliffy config file'
|
16
16
|
flag [:config]
|
17
17
|
|
18
|
+
desc 'Show debug info'
|
19
|
+
switch [:debug]
|
20
|
+
|
18
21
|
#desc 'Use gob-go instead of the real gliffy (devs only)'
|
19
22
|
#switch [:gobgotest]
|
20
23
|
|
@@ -70,10 +73,12 @@ command [:lsf,:lsfolders] do |c|
|
|
70
73
|
end
|
71
74
|
|
72
75
|
desc 'List diagram ids and names'
|
73
|
-
|
76
|
+
long_desc 'This shows you the diagrams available to you. By default this will be all diagrams in all folders to which you have access. If you specify a folder on the command line, you will see diagrams only in that folder'
|
77
|
+
arg_name 'Folder to list (omit for all folders)'
|
74
78
|
command [:ls,:list] do |c|
|
75
79
|
|
76
80
|
c.desc 'Show id, public?, versions, owner, update date, name'
|
81
|
+
c.long_desc 'This shows more information about the diagrams. The columsn shown are, in order: diagram id, "P" for public/"-" for not public, the number of versions of the diagram, the username of the diagram owner, the last updated date, and the diagram name'
|
77
82
|
c.switch :l
|
78
83
|
|
79
84
|
c.desc 'Sort by id'
|
@@ -122,11 +127,12 @@ command :edit do |c|
|
|
122
127
|
c.default_value 'http://www.gliffy.com'
|
123
128
|
c.flag [:u,:url]
|
124
129
|
|
125
|
-
c.desc 'Text on the "Return" button in Gliffy'
|
130
|
+
c.desc 'Text on the "Return" button in Gliffy Editor'
|
126
131
|
c.default_value 'Return'
|
127
132
|
c.flag [:t,:text]
|
128
133
|
|
129
|
-
c.desc 'Command to run to open URL in browser'
|
134
|
+
c.desc 'Command to run to open URL for editing in browser'
|
135
|
+
c.long_desc 'If defined, this command will be run with the URL for editing given to it. Hopefully, this will pop up Gliffy in your browser.'
|
130
136
|
c.default_value RUBY_PLATFORM =~ /^universal-darwin/ ? 'open' : nil
|
131
137
|
c.flag [:o,:openwith]
|
132
138
|
|
@@ -162,13 +168,14 @@ command [:view,:get] do |c|
|
|
162
168
|
c.flag [:s,:size]
|
163
169
|
|
164
170
|
c.desc 'Version'
|
165
|
-
c.arg_name 'version number (omit for latest)'
|
171
|
+
c.arg_name 'version number (omit for latest, "1" is the first version)'
|
166
172
|
c.flag [:v,:version]
|
167
173
|
|
168
174
|
c.desc 'Get the URL only'
|
169
175
|
c.switch [:u,:url]
|
170
176
|
|
171
177
|
c.desc 'Get the Public URL only (if possibe)'
|
178
|
+
c.long_desc 'This is not strictly documented by the gliffy API, but, for public documents, this URL is more usable, as it can be requested any number of times. The non-public URLs contain signature information that makes them one-time-use only.'
|
172
179
|
c.switch [:p,:publicurl]
|
173
180
|
|
174
181
|
c.action do |global_options,options,args|
|
@@ -207,19 +214,41 @@ command :new do |c|
|
|
207
214
|
c.flag [:f,:folder]
|
208
215
|
|
209
216
|
c.desc 'Id of a document to use as a template'
|
210
|
-
c.flag [:
|
217
|
+
c.flag [:m,:template]
|
218
|
+
|
219
|
+
c.desc 'URL to return to after editing is complete (for -e only)'
|
220
|
+
c.default_value 'http://www.gliffy.com'
|
221
|
+
c.flag [:u,:url]
|
222
|
+
|
223
|
+
c.desc 'Text on the "Return" button in Gliffy Editor (for -e only)'
|
224
|
+
c.default_value 'Return'
|
225
|
+
c.flag [:t,:text]
|
226
|
+
|
227
|
+
c.desc 'Command to run to open URL for editing in browser (for -e only)'
|
228
|
+
c.long_desc 'If -e is specified and this is defined, this command will be run with the URL for editing given to it. Hopefully, this will pop up Gliffy in your browser.'
|
229
|
+
c.default_value RUBY_PLATFORM =~ /^universal-darwin/ ? 'open' : nil
|
230
|
+
c.flag [:o,:openwith]
|
231
|
+
|
232
|
+
c.desc 'Edit the diagram right after using -o'
|
233
|
+
c.long_desc 'If you specified the -o option (or there is a system default ), this will open up your new diagram in Gliffy.'
|
234
|
+
c.switch [:e]
|
211
235
|
|
212
236
|
c.action do |global_options,options,args|
|
213
237
|
if args.length > 0
|
214
|
-
new_document = $handle.document_create(args.join(" "),options[:f],options[:
|
238
|
+
new_document = $handle.document_create(args.join(" "),options[:f],options[:m])
|
239
|
+
if options[:e]
|
240
|
+
GLI.commands[:edit].execute(global_options,options,[new_document.document_id])
|
241
|
+
else
|
215
242
|
puts "Created document #{new_document.document_id} - #{new_document.name}"
|
243
|
+
end
|
216
244
|
else
|
217
245
|
$stderr.puts "You must supply the diagram name"
|
218
246
|
end
|
219
247
|
end
|
220
248
|
end
|
221
249
|
|
222
|
-
desc '
|
250
|
+
desc 'Create your configuration file'
|
251
|
+
long_desc 'This will ask you a series of questions that will create your gliffy configuration file. This file will be used for subsequent requests of gliffy and will need to contain your OAuth keys as well as some other information.'
|
223
252
|
command :config do |c|
|
224
253
|
|
225
254
|
c.desc 'Force a recreation of your config file, even if it exists'
|
@@ -288,22 +317,13 @@ pre do |global,command,options,args|
|
|
288
317
|
$config)
|
289
318
|
end
|
290
319
|
token = $handle.update_token
|
320
|
+
$handle.logger.level = Logger::DEBUG if global[:debug]
|
291
321
|
write_config($config,global[:config])
|
292
322
|
end
|
293
323
|
true
|
294
324
|
end
|
295
325
|
end
|
296
326
|
|
297
|
-
post do |global,command,options,args|
|
298
|
-
# Post logic here
|
299
|
-
end
|
300
|
-
|
301
|
-
on_error do |exception|
|
302
|
-
# Error logic here
|
303
|
-
# return false to skip default error handling
|
304
|
-
true
|
305
|
-
end
|
306
|
-
|
307
327
|
def write_config(cred,config)
|
308
328
|
File.open(config,'w') do |out|
|
309
329
|
YAML.dump(cred,out)
|