curldown 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/curldown +31 -0
  2. metadata +5 -3
data/bin/curldown ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+ require 'curldown'
3
+ args = ARGV.dup
4
+ ARGV.clear
5
+ def set_options(args)
6
+ @options = {}
7
+ flags = [["-u","user"],["-r","repo"],["-b","branch"],["-f","file"]]
8
+ if args.inspect.include?("--url=")
9
+ args.each do |arg|
10
+ if arg.include?("--url=")
11
+ @options[:url] = arg[6..-1]
12
+ end
13
+ end
14
+ else
15
+ flags.each do |flag|
16
+ if args.include?(flag[0])
17
+ @options[flag[1].to_sym] = args[args.index(flag[0]) + 1]
18
+ end
19
+ end
20
+ end
21
+ end
22
+ if args.inspect.include?("--copy")
23
+ set_options(args)
24
+ IO.popen 'pbcopy', 'w' do |io|
25
+ io.print Curldown.new.get(@options)
26
+ end
27
+ puts "HTML has been copied to the clipboard"
28
+ else
29
+ set_options(args)
30
+ puts Curldown.new.get(@options)
31
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curldown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
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-07-07 00:00:00.000000000 Z
12
+ date: 2013-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: curb
@@ -77,11 +77,13 @@ dependencies:
77
77
  version: 0.5.1
78
78
  description: A simple tool to parse hosted markdown files into html
79
79
  email: ian@iankent.me
80
- executables: []
80
+ executables:
81
+ - curldown
81
82
  extensions: []
82
83
  extra_rdoc_files: []
83
84
  files:
84
85
  - lib/curldown.rb
86
+ - bin/curldown
85
87
  homepage: http://code.iankent.me/curldown
86
88
  licenses:
87
89
  - MIT