gisty 0.0.19 → 0.0.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.rdoc +4 -0
  2. data/Rakefile +2 -2
  3. data/bin/gisty +27 -22
  4. data/lib/gisty.rb +1 -1
  5. metadata +4 -4
data/README.rdoc CHANGED
@@ -33,6 +33,10 @@ example .zshrc
33
33
 
34
34
  export GISTY_SSL_CA="/your_ca_file_path/cert.pem"
35
35
 
36
+ if you do not want to verify, set GISTY_SSL_VERIFY.
37
+
38
+ export GISTY_SSL_VERIFY="NONE"
39
+
36
40
  == Synopsis
37
41
 
38
42
  gisty list show local list.
data/Rakefile CHANGED
@@ -97,8 +97,8 @@ task :gemspec do
97
97
  open("#{NAME}.gemspec", 'w') { |f| f.puts spec.to_ruby }
98
98
  end
99
99
 
100
- desc 'gem build'
101
- task :build_gem => [:gemspec] do
100
+ desc 'update gem'
101
+ task :update => [:gemspec] do
102
102
  sh "gem build #{NAME}.gemspec"
103
103
  end
104
104
 
data/bin/gisty CHANGED
@@ -4,35 +4,30 @@ require 'rubygems'
4
4
  require 'gisty'
5
5
 
6
6
  @cmds = {}
7
+ @help = <<-EOS
8
+ usage:
9
+ gisty commands
10
+ commands:
11
+ EOS
7
12
 
8
- def cmd name
13
+ def cmd name, args = '', description = ''
9
14
  @cmds[name.to_s] = Proc.new { |i| yield i }
15
+ h = " gisty #{name} #{args}"
16
+ @help << h.ljust(40) + description + "\n"
10
17
  end
11
18
 
12
- cmd :about do
19
+ cmd :about, '', 'show about gisty' do
13
20
  puts Gisty::AA
14
21
  puts
15
22
  puts 'version: ' + Gisty::VERSION
16
23
  puts 'url: ' + Gisty::GISTY_URL
17
24
  end
18
25
 
19
- cmd :help do
20
- puts <<-EOS
21
- usage:
22
- gisty commands
23
- commands:
24
- gisty list show local list.
25
- gisty post file1 file2 ... post new gist.
26
- gisty private_post file1 file2 ... post new private gist.
27
- gisty sync sync remote gist. (clone all remote gist)
28
- gisty sync_delete sync remote gist. delete local gist if remote gist was deleted.
29
- gisty pull_all pull all gist.
30
- gisty about show about gisty
31
- gisty help show help
32
- EOS
26
+ cmd :help, '', 'show help' do
27
+ puts @help
33
28
  end
34
29
 
35
- cmd :list do
30
+ cmd :list, '', 'show local list' do
36
31
  list = @g.list
37
32
  puts '- public gist -'
38
33
  list[:public].each do |i|
@@ -44,25 +39,25 @@ cmd :list do
44
39
  end
45
40
  end
46
41
 
47
- cmd :sync do
42
+ cmd :sync, '', 'sync remote gist (clone all remote gist)' do
48
43
  @g.sync
49
44
  puts '---'
50
45
  puts 'sync finished.'
51
46
  end
52
47
 
53
- cmd :sync_delete do
48
+ cmd :sync_delete, '', 'sync remote gist. delete local gist if remote gist was deleted' do
54
49
  @g.sync true
55
50
  puts '---'
56
51
  puts 'sync finished.'
57
52
  end
58
53
 
59
- cmd :pull_all do
54
+ cmd :pull_all, '', 'pull all gist' do
60
55
  @g.pull_all
61
56
  puts '---'
62
57
  puts 'pull_all finished.'
63
58
  end
64
59
 
65
- cmd :post do |fs|
60
+ cmd :post, 'file1 file2 ...', 'post new gist' do |fs|
66
61
  if fs.size > 0
67
62
  begin
68
63
  url = @g.create fs
@@ -78,7 +73,7 @@ cmd :post do |fs|
78
73
  end
79
74
  end
80
75
 
81
- cmd :private_post do |fs|
76
+ cmd :private_post, 'file1 file2 ...', 'post new private gist' do |fs|
82
77
  if fs.size > 0
83
78
  begin
84
79
  url = @g.create fs, :private => true
@@ -107,6 +102,16 @@ else
107
102
  exit
108
103
  end
109
104
 
105
+ # load ext commands
106
+ ext_path = File.join(ENV['GISTY_DIR'], 'commands', '*.rb')
107
+ Dir.glob(ext_path).each do |i|
108
+ begin
109
+ load i
110
+ rescue Exception => e
111
+ p [i, e]
112
+ end
113
+ end
114
+
110
115
  if ARGV.size == 0
111
116
  @cmds['help'].call []
112
117
  else
data/lib/gisty.rb CHANGED
@@ -7,7 +7,7 @@ require 'nokogiri'
7
7
  require 'net/https'
8
8
 
9
9
  class Gisty
10
- VERSION = '0.0.19'
10
+ VERSION = '0.0.20'
11
11
  GIST_URL = 'https://gist.github.com/'
12
12
  GISTY_URL = 'http://github.com/swdyh/gisty/tree/master'
13
13
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gisty
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 19
10
- version: 0.0.19
9
+ - 20
10
+ version: 0.0.20
11
11
  platform: ruby
12
12
  authors:
13
13
  - swdyh
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-01 00:00:00 +09:00
18
+ date: 2011-04-21 00:00:00 +09:00
19
19
  default_executable: gisty
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency