File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,26 @@ respect to http://github.com/typester/net-github-upload-perl
35
35
36
36
# data upload
37
37
# you can define content_type => Amazon S3 Content-Type
38
+ time = Time.now.to_i
38
39
direct_link = gh.upload(
39
40
:repos => repos,
40
41
:data => 'test',
41
- :name => "test_#{Time.now.to_i}.txt",
42
+ :name => "test_#{time}.txt",
43
+ :content_type => 'text/plain',
44
+ :description => "test file2"
45
+ )
46
+
47
+ # replace file or data
48
+ # thx id:rngtng !
49
+ direct_link = gh.replace(
50
+ :repos => repos,
51
+ :file => 'test/test',
52
+ :description => "test file"
53
+ )
54
+ direct_link = gh.replace(
55
+ :repos => repos,
56
+ :data => 'test',
57
+ :name => "test_#{time}.txt",
42
58
:content_type => 'text/plain',
43
59
:description => "test file2"
44
60
)
You can’t perform that action at this time.
0 commit comments