gyazo 0.4.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of gyazo might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.gitignore +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/Makefile +19 -0
- data/README.md +57 -0
- data/Rakefile +8 -26
- data/bin/gyazo +3 -2
- data/gyazo.gemspec +29 -0
- data/lib/gyazo.rb +6 -123
- data/lib/gyazo/client.rb +81 -0
- data/lib/gyazo/error.rb +4 -0
- data/lib/gyazo/version.rb +3 -0
- data/test/test.png +0 -0
- data/test/test_gyazo.rb +21 -11
- data/test/test_helper.rb +5 -3
- metadata +66 -39
- data/.gemtest +0 -0
- data/History.txt +0 -4
- data/Manifest.txt +0 -12
- data/PostInstall.txt +0 -7
- data/README.rdoc +0 -42
- data/script/console +0 -10
- data/script/destroy +0 -14
- data/script/generate +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
SHA512:
|
3
|
-
metadata.gz: f99b4949768b5ba9f29cf39b5860190f97cbd47f383e5bba46005ee1c44a0682b2ed3d4464171127b1561264029aeb7d40b90021eaf54a449239f4c9031a6d9b
|
4
|
-
data.tar.gz: dfa38df9ab4c430e5b43801aeea9cc955d623bfa7e96563814bf6378266922cf7376bc0d531190c377bd16b0b2eeb772cff6484958ddfdbe9f6fa941860de8c3
|
5
2
|
SHA1:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad0060be9db7f626014c7d30193e256b9c714ee9
|
4
|
+
data.tar.gz: d29d9ae532e354117389fce9dbe728ff8851caf9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d9190285cc2003325353014fac914d99657492f3e715062355f4a9a7b62dc462f28d90000dfc261a5fd143a91aac55b97eb9b939415276cd3c6cbc1193ebee27
|
7
|
+
data.tar.gz: b7277aea5c3f1c3b0f853ad538589ff757554a1d6d7db926ee15e719751c8233048b4657362bb3cb5af6b660c4c0cbe3cdde3f86945670e0989f2098c7ee97d1
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012-2014 Toshiyuki Masui
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Makefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#
|
2
|
+
# バージョンを変えた場合はlib/gyazo/version.rbを変えること
|
3
|
+
#
|
4
|
+
|
5
|
+
localinstall:
|
6
|
+
rake install
|
7
|
+
gempush:
|
8
|
+
rake release
|
9
|
+
gitpush:
|
10
|
+
git push git@github.com:masui/gyazo-ruby.git
|
11
|
+
git push pitecan.com:/home/masui/git/gyazo-ruby.git
|
12
|
+
|
13
|
+
test: test_always
|
14
|
+
test_always:
|
15
|
+
bundle exec rake test
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
data/README.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
Gyazo
|
2
|
+
=====
|
3
|
+
Upload an image to http://gyazo.com
|
4
|
+
|
5
|
+
- http://github.com/masui/gyazo-ruby
|
6
|
+
- https://rubygems.org/gems/gyazo
|
7
|
+
|
8
|
+
|
9
|
+
Installation
|
10
|
+
------------
|
11
|
+
|
12
|
+
% gem install gyazo
|
13
|
+
|
14
|
+
|
15
|
+
Usage
|
16
|
+
-----
|
17
|
+
|
18
|
+
### Upload
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
require 'gyazo'
|
22
|
+
|
23
|
+
g = Gyazo::Client.new
|
24
|
+
g.upload 'my_image.png' #=> "http://gyazo.com/a1b2cdef345"
|
25
|
+
```
|
26
|
+
|
27
|
+
### List
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
g.list.each do |image|
|
31
|
+
image['image_id']
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
|
36
|
+
### Upload to http://your-private-gyazo.com
|
37
|
+
```ruby
|
38
|
+
g = Gyazo::Client.new
|
39
|
+
g.host = 'http://your-private-gyazo.com'
|
40
|
+
g.upload 'my_image.png'
|
41
|
+
```
|
42
|
+
|
43
|
+
Test
|
44
|
+
----
|
45
|
+
|
46
|
+
% gem install bundler
|
47
|
+
% bundle install
|
48
|
+
% bundle exec rake test
|
49
|
+
|
50
|
+
|
51
|
+
Contributing
|
52
|
+
------------
|
53
|
+
1. Fork it
|
54
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
55
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
56
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
57
|
+
5. Create new Pull Request
|
data/Rakefile
CHANGED
@@ -1,26 +1,8 @@
|
|
1
|
-
require
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
# Hoe.plugin :cucumberfeatures
|
10
|
-
|
11
|
-
# Generate all the Rake tasks
|
12
|
-
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
13
|
-
$hoe = Hoe.spec 'gyazo' do
|
14
|
-
self.developer 'Toshiyuki Masui', 'masui@pitecan.com'
|
15
|
-
self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
16
|
-
self.rubyforge_name = self.name # TODO this is default value
|
17
|
-
# self.extra_deps = [['activesupport','>= 2.0.2']]
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
require 'newgem/tasks'
|
22
|
-
Dir['tasks/**/*.rake'].each { |t| load t }
|
23
|
-
|
24
|
-
# TODO - want other tests/tasks run by default? Add them to the list
|
25
|
-
# remove_task :default
|
26
|
-
# task :default => [:spec, :features]
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rake/testtask"
|
3
|
+
|
4
|
+
Rake::TestTask.new do |t|
|
5
|
+
t.pattern = "test/test_*.rb"
|
6
|
+
end
|
7
|
+
|
8
|
+
task :default => :test
|
data/bin/gyazo
CHANGED
@@ -3,6 +3,7 @@ $:.unshift File.expand_path '../lib', File.dirname(__FILE__)
|
|
3
3
|
|
4
4
|
require 'rubygems'
|
5
5
|
require 'gyazo'
|
6
|
+
require 'launchy'
|
6
7
|
|
7
8
|
raw = ARGV.include? "-raw"
|
8
9
|
upload_files = ARGV.reject{|arg| arg =~ /^\-+raw$/ }
|
@@ -13,13 +14,13 @@ if upload_files.empty?
|
|
13
14
|
exit 1
|
14
15
|
end
|
15
16
|
|
16
|
-
g = Gyazo.new
|
17
|
+
g = Gyazo::Client.new
|
17
18
|
|
18
19
|
|
19
20
|
upload_files.each do |file|
|
20
21
|
next unless File.exists? file
|
21
22
|
url = g.upload file, :raw => raw
|
22
23
|
puts url
|
23
|
-
|
24
|
+
Launchy.open url
|
24
25
|
sleep 1
|
25
26
|
end
|
data/gyazo.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'gyazo/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "gyazo"
|
8
|
+
spec.version = Gyazo::VERSION
|
9
|
+
spec.authors = ["Toshiyuki Masui"]
|
10
|
+
spec.email = ["masui@pitecan.com"]
|
11
|
+
spec.description = %q{Upload an image to Gyazo.com}
|
12
|
+
spec.summary = spec.description
|
13
|
+
spec.homepage = "http://github.com/masui/gyazo-ruby"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/).reject{|i| i=="Gemfile.lock" }
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "minitest"
|
24
|
+
|
25
|
+
spec.add_dependency "json"
|
26
|
+
spec.add_dependency "httparty"
|
27
|
+
spec.add_dependency "httmultiparty"
|
28
|
+
spec.add_dependency "launchy"
|
29
|
+
end
|
data/lib/gyazo.rb
CHANGED
@@ -1,125 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
require 'gyazo/version'
|
2
|
+
require 'gyazo/error'
|
3
|
+
require 'gyazo/client'
|
4
4
|
|
5
|
-
require '
|
5
|
+
require 'httparty'
|
6
|
+
require 'httmultiparty'
|
6
7
|
require 'json'
|
7
|
-
|
8
|
-
class Gyazo
|
9
|
-
VERSION = '0.4.2'
|
10
|
-
|
11
|
-
def initialize(app = '/Applications/Gyazo.app',userid=nil)
|
12
|
-
@user = IO.popen("whoami", "r+").gets.chomp
|
13
|
-
@userid = userid
|
14
|
-
@program = app
|
15
|
-
@idfile = "/Users/#{@user}/Library/Gyazo/id"
|
16
|
-
@old_idfile = File.dirname(@program) + "/gyazo.app/Contents/Resources/id"
|
17
|
-
@id = ''
|
18
|
-
if File.exist?(@idfile) then
|
19
|
-
@id = File.read(@idfile).chomp
|
20
|
-
elsif File.exist?(@old_idfile) then
|
21
|
-
@id = File.read(@old_idfile).chomp
|
22
|
-
end
|
23
|
-
@host = 'gyazo.com'
|
24
|
-
end
|
25
|
-
|
26
|
-
attr_accessor :id
|
27
|
-
attr_accessor :userid
|
28
|
-
|
29
|
-
def info(gyazoid)
|
30
|
-
gyazoid =~ /[0-9a-f]{32}/
|
31
|
-
gyazoid = $&
|
32
|
-
cgi = "/api/image/get?image_id=#{gyazoid}"
|
33
|
-
header = {}
|
34
|
-
res = Net::HTTP.start(@host,80){|http|
|
35
|
-
http.get(cgi,header)
|
36
|
-
}
|
37
|
-
JSON.parse(res.read_body)
|
38
|
-
end
|
39
|
-
|
40
|
-
def list(page,count)
|
41
|
-
# 旧API
|
42
|
-
# cgi = "/api/image/list?userkey=#{@id}&page=#{page}&count=#{count}"
|
43
|
-
# 新API: @useridが指定されている場合はマシン共通のUserIDを利用する
|
44
|
-
cgi = (@userid ?
|
45
|
-
"/api/image/list?user_id=#{@userid}&page=#{page}&count=#{count}" :
|
46
|
-
"/api/image/list?device_id=#{@id}&page=#{page}&count=#{count}")
|
47
|
-
header = {}
|
48
|
-
res = Net::HTTP.start(@host,80){|http|
|
49
|
-
http.get(cgi,header)
|
50
|
-
}
|
51
|
-
JSON.parse(res.read_body)['images']
|
52
|
-
end
|
53
|
-
|
54
|
-
DEFAULT_UPLOAD_OPTS = {:time => nil, :raw => false}
|
55
|
-
def upload(imagefile, opts)
|
56
|
-
DEFAULT_UPLOAD_OPTS.each do |k,v|
|
57
|
-
opts[k] = v unless opts.include? k
|
58
|
-
end
|
59
|
-
|
60
|
-
if opts[:raw] then
|
61
|
-
imagedata = File.read(imagefile)
|
62
|
-
else
|
63
|
-
tmpfile = "/tmp/image_upload#{$$}.png"
|
64
|
-
if imagefile && File.exist?(imagefile) then
|
65
|
-
system "sips -s format png \"#{imagefile}\" --out \"#{tmpfile}\" > /dev/null"
|
66
|
-
end
|
67
|
-
imagedata = File.read(tmpfile)
|
68
|
-
File.delete(tmpfile)
|
69
|
-
end
|
70
|
-
|
71
|
-
boundary = '----BOUNDARYBOUNDARY----'
|
72
|
-
@cgi = '/upload.cgi'
|
73
|
-
@ua = 'Gyazo/1.0'
|
74
|
-
data = <<EOF
|
75
|
-
--#{boundary}\r
|
76
|
-
content-disposition: form-data; name="id"\r
|
77
|
-
\r
|
78
|
-
#{@id}\r
|
79
|
-
--#{boundary}\r
|
80
|
-
content-disposition: form-data; name="imagedata"; filename="gyazo.com"\r
|
81
|
-
\r
|
82
|
-
#{imagedata}\r
|
83
|
-
--#{boundary}--\r
|
84
|
-
EOF
|
85
|
-
|
86
|
-
if opts[:time].kind_of? Time then
|
87
|
-
@timestr = opts[:time].gmtime.strftime("%Y-%m-%d %H:%M:%S")
|
88
|
-
s = <<EOF
|
89
|
-
--#{boundary}\r
|
90
|
-
content-disposition: form-data; name="date"\r
|
91
|
-
\r
|
92
|
-
#{@timestr}\r
|
93
|
-
EOF
|
94
|
-
data = s + data
|
95
|
-
end
|
96
|
-
|
97
|
-
header ={
|
98
|
-
'Content-Length' => data.length.to_s,
|
99
|
-
'Content-type' => "multipart/form-data; boundary=#{boundary}",
|
100
|
-
'User-Agent' => @ua
|
101
|
-
}
|
102
|
-
res = Net::HTTP.start(@host,80){|http|
|
103
|
-
http.post(@cgi,data,header)
|
104
|
-
}
|
105
|
-
|
106
|
-
@url = res.read_body
|
107
|
-
|
108
|
-
# save id
|
109
|
-
newid = res['X-Gyazo-Id']
|
110
|
-
if newid and newid != "" then
|
111
|
-
if !File.exist?(File.dirname(@idfile)) then
|
112
|
-
Dir.mkdir(File.dirname(@idfile))
|
113
|
-
end
|
114
|
-
if File.exist?(@idfile) then
|
115
|
-
File.rename(@idfile, @idfile+Time.new.strftime("_%Y%m%d%H%M%S.bak"))
|
116
|
-
end
|
117
|
-
File.open(@idfile,"w").print(newid)
|
118
|
-
if File.exist?(@old_idfile) then
|
119
|
-
File.delete(@old_idfile)
|
120
|
-
end
|
121
|
-
end
|
122
|
-
@url
|
123
|
-
end
|
124
|
-
|
125
|
-
end
|
8
|
+
require 'kconv'
|
data/lib/gyazo/client.rb
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
module Gyazo
|
2
|
+
|
3
|
+
class Client
|
4
|
+
|
5
|
+
attr_accessor :id, :user_id, :user_agent, :host
|
6
|
+
|
7
|
+
def initialize(user_id=nil)
|
8
|
+
@user_id = user_id
|
9
|
+
@user = ENV['USER']
|
10
|
+
@idfile = "#{ENV['HOME']}/Library/Gyazo/id"
|
11
|
+
@id = nil
|
12
|
+
@id = File.read(@idfile).strip if File.exist? @idfile
|
13
|
+
@user_agent = "GyazoRubyGem/#{Gyazo::VERSION}"
|
14
|
+
@host = 'http://gyazo.com'
|
15
|
+
end
|
16
|
+
|
17
|
+
def info(image_id)
|
18
|
+
res = HTTParty.get "#{@host}/api/image/get", {
|
19
|
+
:query => {
|
20
|
+
:image_id => image_id
|
21
|
+
},
|
22
|
+
:header => {
|
23
|
+
'User-Agent' => @user_agent
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
raise Gyazz::Error, res.body unless res.code == 200
|
28
|
+
JSON.parse(res.body)
|
29
|
+
end
|
30
|
+
|
31
|
+
def list(page=1, count=100)
|
32
|
+
url = "#{@host}/api/image/list"
|
33
|
+
query = {:page => page, :count => count}
|
34
|
+
if @user_id
|
35
|
+
query[:user_id] = @user_id
|
36
|
+
else
|
37
|
+
query[:device_id] = @id
|
38
|
+
end
|
39
|
+
|
40
|
+
res = HTTParty.get "#{@host}/api/image/list", {
|
41
|
+
:query => query,
|
42
|
+
:header => {
|
43
|
+
'User-Agent' => @user_agent
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
raise Gyazz::Error, res.body unless res.code == 200
|
48
|
+
JSON.parse(res.body)['images']
|
49
|
+
end
|
50
|
+
|
51
|
+
DEFAULT_UPLOAD_OPTS = {:time => nil, :raw => false}
|
52
|
+
def upload(imagefile, opts={})
|
53
|
+
DEFAULT_UPLOAD_OPTS.each do |k,v|
|
54
|
+
opts[k] = v unless opts.include? k
|
55
|
+
end
|
56
|
+
|
57
|
+
unless opts[:raw]
|
58
|
+
tmpfile = "/tmp/gyazo_upload_#{Time.now.to_i}_#{Time.now.usec}.png"
|
59
|
+
if File.exist? imagefile
|
60
|
+
system "sips -s format png \"#{imagefile}\" --out \"#{tmpfile}\" > /dev/null"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
res = HTTMultiParty.post "#{@host}/upload.cgi", {
|
65
|
+
:query => {
|
66
|
+
:id => @id,
|
67
|
+
:imagedata => File.new(imagefile)
|
68
|
+
},
|
69
|
+
:header => {
|
70
|
+
'User-Agent' => @user_agent
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
File.delete(tmpfile) if tmpfile and File.exists? tmpfile
|
75
|
+
|
76
|
+
raise Gyazo::Error, res.body unless res.code == 200
|
77
|
+
res.body
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
data/lib/gyazo/error.rb
ADDED
data/test/test.png
ADDED
Binary file
|
data/test/test_gyazo.rb
CHANGED
@@ -1,22 +1,32 @@
|
|
1
|
-
require File.dirname(__FILE__)
|
1
|
+
require File.expand_path 'test_helper', File.dirname(__FILE__)
|
2
2
|
|
3
|
-
class TestGyazo < Test
|
3
|
+
class TestGyazo < MiniTest::Test
|
4
4
|
|
5
5
|
def setup
|
6
|
+
@gyazo = Gyazo::Client.new
|
7
|
+
@imagefile = File.expand_path 'test.png', File.dirname(__FILE__)
|
8
|
+
@image_id = "a2a2a8154340bd33e9cd5eeea1efd832"
|
6
9
|
end
|
7
10
|
|
8
11
|
def test_upload
|
9
|
-
|
10
|
-
|
11
|
-
url = g.upload(imagefile)
|
12
|
-
assert_equal(url,'http://gyazo.com/6bdded98323cba83530daae7fa7881f9')
|
13
|
-
# assert_equal(url,'http://gyazo.com/a2a2a8154340bd33e9cd5eeea1efd832')
|
12
|
+
url = @gyazo.upload @imagefile
|
13
|
+
assert_equal url, "#{@gyazo.host}/#{@image_id}"
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_id
|
17
|
-
|
18
|
-
assert
|
19
|
-
|
20
|
-
|
17
|
+
@gyazo = Gyazo::Client.new
|
18
|
+
assert @gyazo.id =~ /^[0-9a-f]+$/
|
19
|
+
@gyazo.id = '12345'
|
20
|
+
assert_equal @gyazo.id, '12345'
|
21
21
|
end
|
22
|
+
|
23
|
+
def test_list
|
24
|
+
assert_equal @gyazo.list.class, Array
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_info
|
28
|
+
info = @gyazo.info @image_id
|
29
|
+
assert_equal info.class, Hash
|
30
|
+
end
|
31
|
+
|
22
32
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gyazo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshiyuki Masui
|
@@ -9,91 +9,118 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2014-01-05 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: bundler
|
16
16
|
prerelease: false
|
17
17
|
requirement: &id001 !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: "
|
21
|
+
version: "1.3"
|
22
22
|
type: :development
|
23
23
|
version_requirements: *id001
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
|
-
name:
|
25
|
+
name: rake
|
26
26
|
prerelease: false
|
27
27
|
requirement: &id002 !ruby/object:Gem::Requirement
|
28
28
|
requirements:
|
29
|
-
-
|
29
|
+
- &id003
|
30
|
+
- ">="
|
30
31
|
- !ruby/object:Gem::Version
|
31
|
-
version:
|
32
|
+
version: "0"
|
32
33
|
type: :development
|
33
34
|
version_requirements: *id002
|
34
35
|
- !ruby/object:Gem::Dependency
|
35
|
-
name:
|
36
|
+
name: minitest
|
36
37
|
prerelease: false
|
37
|
-
requirement: &
|
38
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
38
39
|
requirements:
|
39
|
-
-
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: "3.7"
|
40
|
+
- *id003
|
42
41
|
type: :development
|
43
|
-
version_requirements: *
|
44
|
-
|
42
|
+
version_requirements: *id004
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: json
|
45
|
+
prerelease: false
|
46
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- *id003
|
49
|
+
type: :runtime
|
50
|
+
version_requirements: *id005
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: httparty
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- *id003
|
57
|
+
type: :runtime
|
58
|
+
version_requirements: *id006
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: httmultiparty
|
61
|
+
prerelease: false
|
62
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- *id003
|
65
|
+
type: :runtime
|
66
|
+
version_requirements: *id007
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: launchy
|
69
|
+
prerelease: false
|
70
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- *id003
|
73
|
+
type: :runtime
|
74
|
+
version_requirements: *id008
|
75
|
+
description: Upload an image to Gyazo.com
|
45
76
|
email:
|
46
77
|
- masui@pitecan.com
|
47
78
|
executables:
|
48
79
|
- gyazo
|
49
80
|
extensions: []
|
50
81
|
|
51
|
-
extra_rdoc_files:
|
52
|
-
|
53
|
-
- Manifest.txt
|
54
|
-
- PostInstall.txt
|
55
|
-
- README.rdoc
|
82
|
+
extra_rdoc_files: []
|
83
|
+
|
56
84
|
files:
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
85
|
+
- .gitignore
|
86
|
+
- Gemfile
|
87
|
+
- LICENSE.txt
|
88
|
+
- Makefile
|
89
|
+
- README.md
|
61
90
|
- Rakefile
|
91
|
+
- bin/gyazo
|
92
|
+
- gyazo.gemspec
|
62
93
|
- lib/gyazo.rb
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
94
|
+
- lib/gyazo/client.rb
|
95
|
+
- lib/gyazo/error.rb
|
96
|
+
- lib/gyazo/version.rb
|
97
|
+
- test/test.png
|
66
98
|
- test/test_gyazo.rb
|
67
99
|
- test/test_helper.rb
|
68
|
-
- bin/gyazo
|
69
|
-
- .gemtest
|
70
100
|
homepage: http://github.com/masui/gyazo-ruby
|
71
101
|
licenses:
|
72
102
|
- MIT
|
73
103
|
metadata: {}
|
74
104
|
|
75
|
-
post_install_message:
|
76
|
-
rdoc_options:
|
77
|
-
|
78
|
-
- README.rdoc
|
105
|
+
post_install_message:
|
106
|
+
rdoc_options: []
|
107
|
+
|
79
108
|
require_paths:
|
80
109
|
- lib
|
81
110
|
required_ruby_version: !ruby/object:Gem::Requirement
|
82
111
|
requirements:
|
83
|
-
-
|
84
|
-
- ">="
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: "0"
|
112
|
+
- *id003
|
87
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
114
|
requirements:
|
89
|
-
- *
|
115
|
+
- *id003
|
90
116
|
requirements: []
|
91
117
|
|
92
|
-
rubyforge_project:
|
118
|
+
rubyforge_project:
|
93
119
|
rubygems_version: 2.1.11
|
94
120
|
signing_key:
|
95
121
|
specification_version: 4
|
96
|
-
summary:
|
122
|
+
summary: Upload an image to Gyazo.com
|
97
123
|
test_files:
|
124
|
+
- test/test.png
|
98
125
|
- test/test_gyazo.rb
|
99
126
|
- test/test_helper.rb
|
data/.gemtest
DELETED
File without changes
|
data/History.txt
DELETED
data/Manifest.txt
DELETED
data/PostInstall.txt
DELETED
data/README.rdoc
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
= gyazo
|
2
|
-
|
3
|
-
* http://github.com/masui/gyazo-ruby
|
4
|
-
|
5
|
-
== REQUIREMENTS:
|
6
|
-
|
7
|
-
* Works only for Mac
|
8
|
-
|
9
|
-
== DESCRIPTION:
|
10
|
-
|
11
|
-
* Upload an image to Gyazo.com
|
12
|
-
|
13
|
-
== SYNOPSIS:
|
14
|
-
|
15
|
-
require 'gyazo'
|
16
|
-
g = Gyazo.new('/Applications/Gyazo.app')
|
17
|
-
url = g.upload('/Users/masui/junk.png')
|
18
|
-
|
19
|
-
== LICENSE:
|
20
|
-
|
21
|
-
(The MIT License)
|
22
|
-
|
23
|
-
Copyright (c) 2012 Toshiyuki Masui
|
24
|
-
|
25
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
26
|
-
a copy of this software and associated documentation files (the
|
27
|
-
'Software'), to deal in the Software without restriction, including
|
28
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
29
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
30
|
-
permit persons to whom the Software is furnished to do so, subject to
|
31
|
-
the following conditions:
|
32
|
-
|
33
|
-
The above copyright notice and this permission notice shall be
|
34
|
-
included in all copies or substantial portions of the Software.
|
35
|
-
|
36
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
37
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
38
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
39
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
40
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
41
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
42
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/script/console
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# File: script/console
|
3
|
-
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
-
|
5
|
-
libs = " -r irb/completion"
|
6
|
-
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
-
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
-
libs << " -r #{File.dirname(__FILE__) + '/../lib/gyazo.rb'}"
|
9
|
-
puts "Loading gyazo gem"
|
10
|
-
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/destroy'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'rubigen'
|
6
|
-
rescue LoadError
|
7
|
-
require 'rubygems'
|
8
|
-
require 'rubigen'
|
9
|
-
end
|
10
|
-
require 'rubigen/scripts/generate'
|
11
|
-
|
12
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
-
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
-
RubiGen::Scripts::Generate.new.run(ARGV)
|