s3-gyazo 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b74fbddd0401fbffa6db7fc0c90cd554c0552fb5
4
+ data.tar.gz: 649548f483bcc58e15ace086eae3863af5eaad8c
5
+ SHA512:
6
+ metadata.gz: 056fa05fbc8ed9eeba8f635c5996ae591ed288ba896880074043f8e295742a878087321725cb193f4c83dd976eb6f2ba6a61a9b3216c0a5913254275d3a15830
7
+ data.tar.gz: 9928cc64560bb3fa0bb30e8a2803ee71d09c2aa1c69d37924a6996fc787b5ea2d454c3f4054129f0696eb9d644f86973a9a2be06b5d1580dc6667d349645d182
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.3
4
+ before_install: gem install bundler -v 1.10.6
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in s3-gyazo.gemspec
4
+ gemspec
@@ -0,0 +1,50 @@
1
+ # S3::Gyazo
2
+
3
+ s3-gazo
4
+
5
+ ## Installation
6
+
7
+ install it yourself as:
8
+
9
+ $ gem install s3-gyazo
10
+
11
+ ## Setup
12
+
13
+ this app use environment variables;
14
+
15
+ key|value
16
+ -----|-----
17
+ AWS_ACCESS_KEY_ID| my-access-key
18
+ AWS_SECRET_ACCESS_KEY| secret
19
+ S3_GAZO_REGION| s3 region
20
+ S3_GAZO_BUCKET| s3 bucket name
21
+ S3_GAZO_BASE_URL| base URL
22
+
23
+ ### Use [envchain](https://github.com/sorah/envchain) (strongly recommended)
24
+
25
+ ```
26
+ $ envchain --set aws AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
27
+ aws.AWS_ACCESS_KEY_ID: my-access-key
28
+ aws.AWS_SECRET_ACCESS_KEY: secret
29
+
30
+ $ envchain --set s3gazo S3_GAZO_BUCKET S3_GAZO_BASE_URL S3_GAZO_REGION
31
+ s3gazo.S3_GAZO_REGION: s3 region
32
+ s3gazo.S3_GAZO_BUCKET: s3 bucket name
33
+ s3gazo.S3_GAZO_BASE_URL: base URL
34
+ ```
35
+
36
+ ## Usage
37
+
38
+ ```
39
+ $ envchain s3gazo envchain aws s3-gyazo
40
+ ```
41
+
42
+ ## Development
43
+
44
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec s3-gyazo` to use the gem in this directory, ignoring other installed copies of this gem.
45
+
46
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
47
+
48
+ ## Contributing
49
+
50
+ Bug reports and pull requests are welcome on GitHub at https://github.com/yoshiori/s3-gyazo.
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "s3/gyazo"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "s3/gyazo/client"
4
+ S3::Gyazo::Client.run
@@ -0,0 +1,6 @@
1
+ require "s3/gyazo/version"
2
+
3
+ module S3
4
+ module Gyazo
5
+ end
6
+ end
@@ -0,0 +1,19 @@
1
+ require "aws-sdk-core"
2
+
3
+ class S3::Gyazo::Client
4
+ def self.run
5
+ Tempfile.create("") do |tmp|
6
+ break unless system "screencapture -x -i \"#{tmp.path}\""
7
+ filename = Time.now.strftime("%Y-%m-%d_%H-%M-%S.png")
8
+ s3 = Aws::S3::Client.new(region: ENV["S3_GAZO_REGION"])
9
+ File.open(tmp.path) do |file|
10
+ s3.put_object(
11
+ bucket: ENV["S3_GAZO_BUCKET"],
12
+ body: file,
13
+ key: filename,
14
+ )
15
+ end
16
+ system "open #{ENV['S3_GAZO_BASE_URL'] + filename}"
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,5 @@
1
+ module S3
2
+ module Gyazo
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 's3/gyazo/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "s3-gyazo"
8
+ spec.version = S3::Gyazo::VERSION
9
+ spec.authors = ["Yoshiori SHOJI"]
10
+ spec.email = ["yoshiori@gmail.com"]
11
+
12
+ spec.summary = "private gyazo command using s3."
13
+ spec.description = "private gyazo command using s3."
14
+ spec.homepage = "https://github.com/yoshiori/s3-gyazo"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "aws-sdk"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.10"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: s3-gyazo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Yoshiori SHOJI
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-11-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: private gyazo command using s3.
56
+ email:
57
+ - yoshiori@gmail.com
58
+ executables:
59
+ - s3-gyazo
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - ".travis.yml"
66
+ - Gemfile
67
+ - README.md
68
+ - Rakefile
69
+ - bin/console
70
+ - bin/setup
71
+ - exe/s3-gyazo
72
+ - lib/s3/gyazo.rb
73
+ - lib/s3/gyazo/client.rb
74
+ - lib/s3/gyazo/version.rb
75
+ - s3-gyazo.gemspec
76
+ homepage: https://github.com/yoshiori/s3-gyazo
77
+ licenses: []
78
+ metadata: {}
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 2.4.5.1
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: private gyazo command using s3.
99
+ test_files: []